diff --git a/.fern/metadata.json b/.fern/metadata.json index 289609fc..4ffc3676 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,29 +1,29 @@ { - "cliVersion": "5.59.0", - "generatorName": "fernapi/fern-typescript-node-sdk", - "generatorVersion": "3.75.0", - "generatorConfig": { - "allowExtraFields": true, - "allowCustomFetcher": true, - "enableInlineTypes": false, - "fetchSupport": "native", - "fileResponseType": "binary-response", - "formDataSupport": "Node18", - "includeApiReference": true, - "inlineFileProperties": true, - "inlinePathParameters": true, - "namespaceExport": "TrueFoundry", - "noSerdeLayer": false, - "omitUndefined": true, - "retainOriginalCasing": false, - "skipResponseValidation": true, - "streamType": "web", - "useDefaultRequestParameterValues": true - }, - "originGitCommit": "32fe60c676059f66eca28ed6042c72b38db2ff04", - "originGitCommitIsDirty": false, - "invokedBy": "ci", - "requestedVersion": "0.0.0", - "ciProvider": "github", - "sdkVersion": "0.0.0" -} \ No newline at end of file + "cliVersion": "5.89.4", + "generatorName": "fernapi/fern-typescript-node-sdk", + "generatorVersion": "3.86.0", + "generatorConfig": { + "allowExtraFields": true, + "allowCustomFetcher": true, + "enableInlineTypes": false, + "fetchSupport": "native", + "fileResponseType": "binary-response", + "formDataSupport": "Node18", + "includeApiReference": true, + "inlineFileProperties": true, + "inlinePathParameters": true, + "namespaceExport": "TrueFoundry", + "noSerdeLayer": false, + "omitUndefined": true, + "retainOriginalCasing": false, + "skipResponseValidation": true, + "streamType": "web", + "useDefaultRequestParameterValues": true + }, + "originGitCommit": "ee220d57a9ea7d75b0042756f2870909b45115ab", + "originGitCommitIsDirty": false, + "invokedBy": "ci", + "requestedVersion": "0.0.0", + "ciProvider": "github", + "sdkVersion": "0.0.0" +} diff --git a/README.md b/README.md index c601fad5..a3867379 100644 --- a/README.md +++ b/README.md @@ -50,25 +50,10 @@ Instantiate and use the client with the following: ```typescript import { TrueFoundryClient } from "truefoundry-sdk"; -const client = new TrueFoundryClient({ environment: "YOUR_BASE_URL", apiKey: "YOUR_API_KEY" }); +const client = new TrueFoundryClient({ baseUrl: "YOUR_BASE_URL", apiKey: "YOUR_API_KEY" }); const pageableResponse = await client.applications.list({ limit: 10, - offset: 0, - applicationId: "applicationId", - workspaceId: "workspaceId", - applicationName: "applicationName", - fqn: "fqn", - workspaceFqn: "workspaceFqn", - applicationType: "async-service", - nameSearchQuery: "nameSearchQuery", - environmentId: "environmentId", - clusterId: "clusterId", - applicationSetId: "applicationSetId", - paused: true, - deviceTypeFilter: "cpu", - lastDeployedBySubjects: "lastDeployedBySubjects", - lifecycleStage: "active", - isRecommendationPresentAndVisible: true + offset: 0 }); for await (const item of pageableResponse) { console.log(item); @@ -77,22 +62,7 @@ for await (const item of pageableResponse) { // Or you can manually iterate page-by-page let page = await client.applications.list({ limit: 10, - offset: 0, - applicationId: "applicationId", - workspaceId: "workspaceId", - applicationName: "applicationName", - fqn: "fqn", - workspaceFqn: "workspaceFqn", - applicationType: "async-service", - nameSearchQuery: "nameSearchQuery", - environmentId: "environmentId", - clusterId: "clusterId", - applicationSetId: "applicationSetId", - paused: true, - deviceTypeFilter: "cpu", - lastDeployedBySubjects: "lastDeployedBySubjects", - lifecycleStage: "active", - isRecommendationPresentAndVisible: true + offset: 0 }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -110,7 +80,7 @@ following namespace: ```typescript import { TrueFoundry } from "truefoundry-sdk"; -const request: TrueFoundry.InternalGetIdFromFqnRequest = { +const request: TrueFoundry.GetIdFromFqnInternalRequest = { ... }; ``` @@ -142,12 +112,11 @@ List endpoints are paginated. The SDK provides an iterator so that you can simpl ```typescript import { TrueFoundryClient } from "truefoundry-sdk"; -const client = new TrueFoundryClient({ environment: "YOUR_BASE_URL", apiKey: "YOUR_API_KEY" }); +const client = new TrueFoundryClient({ baseUrl: "YOUR_BASE_URL", apiKey: "YOUR_API_KEY" }); const pageableResponse = await client.users.list({ limit: 10, offset: 0, - query: "john@example.com", - showInvalidUsers: true + query: "john@example.com" }); for await (const item of pageableResponse) { console.log(item); @@ -157,8 +126,7 @@ for await (const item of pageableResponse) { let page = await client.users.list({ limit: 10, offset: 0, - query: "john@example.com", - showInvalidUsers: true + query: "john@example.com" }); while (page.hasNextPage()) { page = page.getNextPage(); diff --git a/package.json b/package.json index f3347094..110735de 100644 --- a/package.json +++ b/package.json @@ -66,6 +66,17 @@ }, "default": "./dist/cjs/api/resources/teams/exports.js" }, + "./gatewayBudgets": { + "import": { + "types": "./dist/esm/api/resources/gatewayBudgets/exports.d.mts", + "default": "./dist/esm/api/resources/gatewayBudgets/exports.mjs" + }, + "require": { + "types": "./dist/cjs/api/resources/gatewayBudgets/exports.d.ts", + "default": "./dist/cjs/api/resources/gatewayBudgets/exports.js" + }, + "default": "./dist/cjs/api/resources/gatewayBudgets/exports.js" + }, "./personalAccessTokens": { "import": { "types": "./dist/esm/api/resources/personalAccessTokens/exports.d.mts", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ea5ae6e9..cee962a3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -19,16 +19,16 @@ importers: version: 2.11.2(@types/node@20.19.43)(typescript@5.9.3) ts-loader: specifier: ^9.5.4 - version: 9.6.2(typescript@5.9.3)(webpack@5.108.3) + version: 9.6.2(typescript@5.9.3)(webpack@5.109.2) typescript: specifier: ~5.9.3 version: 5.9.3 vitest: specifier: ^4.1.1 - version: 4.1.9(@types/node@20.19.43)(msw@2.11.2(@types/node@20.19.43)(typescript@5.9.3))(vite@8.1.3(@types/node@20.19.43)(terser@5.48.0)) + version: 4.1.10(@types/node@20.19.43)(msw@2.11.2(@types/node@20.19.43)(typescript@5.9.3))(vite@8.2.0(@types/node@20.19.43)(terser@5.49.0)) webpack: specifier: ^5.105.4 - version: 5.108.3 + version: 5.109.2 packages: @@ -95,15 +95,6 @@ packages: '@bundled-es-modules/statuses@1.0.1': resolution: {integrity: sha512-yn7BklA5acgcBr+7w064fGV+SGIFySjCKpqjcWgBAIfrAkY+4GQTJJHQMeT3V/sgz23VTEVV8TtOmkvJAhFVfg==} - '@emnapi/core@1.11.1': - resolution: {integrity: sha512-RSvbQmHzdKzNsLYa/wHrbc3KN4sYLKAdPZxqiM2HATqv/SBk2/ENSHpvXGaLOMcsAyz0poEGqkmmKYG3OWiJEQ==} - - '@emnapi/runtime@1.11.1': - resolution: {integrity: sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==} - - '@emnapi/wasi-threads@1.2.2': - resolution: {integrity: sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA==} - '@inquirer/ansi@1.0.2': resolution: {integrity: sha512-S8qNSZiYzFd0wAcyG5AXCvUHC5Sr7xpZ9wZ2py9XR88jUz8wooStVx5M6dRzczbBWjic9NP7+rY0Xi7qqK/aMQ==} engines: {node: '>=18'} @@ -159,12 +150,6 @@ packages: resolution: {integrity: sha512-2+BzZbjRO7Ct61k8fMNHEtoKjeWI9pIlHFTqBwZ5icHpqszIgEZbjb1MW5Z0+bITTCTl3gk4PDBxs9tA/csXvA==} engines: {node: '>=18'} - '@napi-rs/wasm-runtime@1.1.6': - resolution: {integrity: sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg==} - peerDependencies: - '@emnapi/core': ^1.7.1 - '@emnapi/runtime': ^1.7.1 - '@open-draft/deferred-promise@2.2.0': resolution: {integrity: sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA==} @@ -174,100 +159,95 @@ packages: '@open-draft/until@2.1.0': resolution: {integrity: sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==} - '@oxc-project/types@0.138.0': - resolution: {integrity: sha512-1a7ZKmrRTCoN1XMZ4L0PyyqrMnrNlLyPuOkdSX2MZg7IiIGRUyurNhAm73ptDOraoBcIordsIGKNPKUzy3ZmfA==} + '@oxc-project/types@0.142.0': + resolution: {integrity: sha512-7W+2q5AKQVU36fkaryontrHn3YDt1RyUYXatw9i5H8ocYe2sPKSFB6eS8WNPeRKiN1qAWWZUPm7gwFzJGrccqQ==} - '@rolldown/binding-android-arm64@1.1.4': - resolution: {integrity: sha512-EZLpf/8y7GXkkra90ML47kzik/GMP3EMcE9bPyHmRfxLC6z9+aW5A8poCsoxjrT5GfEcNAAvWwUHjvP1pUQkfw==} + '@rolldown/binding-android-arm64@1.2.2': + resolution: {integrity: sha512-l7x215OGvo1s52JWmR8U/DAVzEDWBCIbTm28aeJV/WDTSHgcKXaZTuBT0hJMs5NggilfJTW3clZVvd24yfKJxA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [android] - '@rolldown/binding-darwin-arm64@1.1.4': - resolution: {integrity: sha512-aUi+HBvmYb7j8krl1+qJgkG8C17fO79gk3c+jPw4S8glRFc1DTija9S3EyaTSQUm5GJXYKDAsugBEhFHH2vYiQ==} + '@rolldown/binding-darwin-arm64@1.2.2': + resolution: {integrity: sha512-9u9Xv6c1AJZT0FfwH5vrMG5Jjcwhc1MlyrPu0XfTqkzsmqfks2M6W/o5XwAJgVVN/jHpqqngC1WevHKKTIUtIA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] - '@rolldown/binding-darwin-x64@1.1.4': - resolution: {integrity: sha512-F7hHC3gwY11+vByKPRWqwGbeXWVgKmL+pTGCinaEhdihzBV2aQ0fvZOch9cXYUOKuKKq429HeYXOqQLc7wFCEg==} + '@rolldown/binding-darwin-x64@1.2.2': + resolution: {integrity: sha512-9W1mbGZAfW3oqd85bhBkmpyHCCzL1TeG/zFFP3vg7b0rlly8cxOcre5nXwz+LHazCwac2MNWgPdPCHndABjpWQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] - '@rolldown/binding-freebsd-x64@1.1.4': - resolution: {integrity: sha512-sI5yw+7s92SK6odiEhD5lKCBlWcpjHS5qyqpVQbZAJ0fIzEUXrmbl3DH2ybR3PZogulNJF+COLtmA8hUfvkCCQ==} + '@rolldown/binding-freebsd-x64@1.2.2': + resolution: {integrity: sha512-0p1lhiCSCyaerFwtrdZQUx7NqGk6LQnaRKWX7tFQqwQgvX0rjM15cIkm3pax1UpEakK14C4mOxx/jSqCBdBRqQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [freebsd] - '@rolldown/binding-linux-arm-gnueabihf@1.1.4': - resolution: {integrity: sha512-mCi0OKgEieFircrtVYmQAFGszRtMnZ6fpZAXrxanXAu7lqZcsK1E1RAaZNG0uKAnxox3B1f4EyQNnoyMfN1vAA==} + '@rolldown/binding-linux-arm-gnueabihf@1.2.2': + resolution: {integrity: sha512-e+cOJXrJ2L3zx6YzqPg+f6Wbk3V1cKB8bOhbaYdVYN3DdquzNdRAmrbETz1qnt5yp/c7JNlNjmITiA2cVneQ7w==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] - '@rolldown/binding-linux-arm64-gnu@1.1.4': - resolution: {integrity: sha512-B9Ial3Kv5sh0SHnB1g/QWcUQCEvCF6QKGAl4zXypYj65mVI+B4AhFBwPtSN7pDrJeIx8Z7zdy4ntx+wQABom7w==} + '@rolldown/binding-linux-arm64-gnu@1.2.2': + resolution: {integrity: sha512-JsSMsj6sNat/MuhG5fnBD7QgbtpHKVe30x5/bAVirDHdhoQRXJkF6xc0Jqk8O4fiCUQAzMOoH9wZi3m60c8wtg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [glibc] - '@rolldown/binding-linux-arm64-musl@1.1.4': - resolution: {integrity: sha512-lZVym0PuHE1KZ22gmFTC15lAkrg9iTszR617oYRB/iPY1A56ywoJzVKOJBKaot5RiikCObmur6pogpse3gRcng==} + '@rolldown/binding-linux-arm64-musl@1.2.2': + resolution: {integrity: sha512-B5G/zJdHaoJn9vD50eGHWkiWfmq8Uhi3IiLPJTzmZTrAalk1bztUikSXo0qga18ibE0IXboyeMUnhPjhAJ45wQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [musl] - '@rolldown/binding-linux-ppc64-gnu@1.1.4': - resolution: {integrity: sha512-t2DNiLJWNTbnEHyUzTumldML6ET4/g16467LZoDDJ3tSxGvguL5/NyC2lCsNKuyRycg9XeDQF5SSv+TNOhQEXg==} + '@rolldown/binding-linux-ppc64-gnu@1.2.2': + resolution: {integrity: sha512-6mC/awzKka8W6EoekjegpfGkjz8jXWDX63pqu/HYVpyKtZfu65Jsh4QAH3Kej3CAv/c1oGX7psTmFEbr0mDxLA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] libc: [glibc] - '@rolldown/binding-linux-s390x-gnu@1.1.4': - resolution: {integrity: sha512-0WIRnL1Uw4BvTZRLQt+PVgo6ZKTJadlC2btP+/EOXv2f/DWbY0rEgl+y834mIVwP1FkTlWVTrGGJXf12lru7EQ==} + '@rolldown/binding-linux-s390x-gnu@1.2.2': + resolution: {integrity: sha512-412MX9fJLdA1IK28EZnc8jYv2HRTleOZgfLQumJ5zy7OeJLZlg/CETwFaXjNmGVxG51cFHpKLqb5LKvBC+HsHA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] libc: [glibc] - '@rolldown/binding-linux-x64-gnu@1.1.4': - resolution: {integrity: sha512-JWtGshGfX+oENAKonoNkqEJX+7hC8yfhi9GUyPX1VX4mdh1y5r+ZiJLR5XzAB0aoP6s/PcILsGjKq8O0mm24bw==} + '@rolldown/binding-linux-x64-gnu@1.2.2': + resolution: {integrity: sha512-Q/+HI/ToJafZ1iCqGgVQXUEkIjufHCTF0gBQ2a5o3cg7GJ2h0qyq3nvvSmU+bGda2/7ygXpTY4TM6gO9OhQ0ZA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [glibc] - '@rolldown/binding-linux-x64-musl@1.1.4': - resolution: {integrity: sha512-rT6yQcxUuXs4CnbofqwHRRV0iem349rLMYpTjkgQGLjrY4ado/eDzwPZPTCgTOlF6Nkp8NEv70yLMTn6qkWxsQ==} + '@rolldown/binding-linux-x64-musl@1.2.2': + resolution: {integrity: sha512-ZKp/w41n6wCvxzxQHtQSbuphfX3Y4cCvbjkKHusrLx4lh+JWLTU7StSltO/DKARISzbj368d+qUaCjI8K2wzXw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [musl] - '@rolldown/binding-openharmony-arm64@1.1.4': - resolution: {integrity: sha512-KXMGoboq5cyaCQjDA4GLuRiOwBQ0EyFnJoVViLeZ45/3rFItRODEr+NdsBcVpll40hhNArlm/speWGRvj08LzA==} + '@rolldown/binding-openharmony-arm64@1.2.2': + resolution: {integrity: sha512-pxE6xD4KS3eAROkKK5yrhB9/3+vhlhVGMvlQLbdpzrBGDbKrnzx3RLwPaHvasLo6jgaiBLn7e04Df9C4tYhjmA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [openharmony] - '@rolldown/binding-wasm32-wasi@1.1.4': - resolution: {integrity: sha512-5K83rb36oJiY7BCyE9zLZtGcPV4g5wvq+xwdO0XPIwDVZI8cyB/AUjkNXGb92/rnmezEkjMOpgY61rtwjQtFwg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [wasm32] - - '@rolldown/binding-win32-arm64-msvc@1.1.4': - resolution: {integrity: sha512-PnWBtw3TV5KOg69HQQDR0mnQuyCmSGR2pAB4DC1rPF808fgKeTUMj2EOEyKATpgiuxuR5APQmiDO7PDgEjTFSA==} + '@rolldown/binding-win32-arm64-msvc@1.2.2': + resolution: {integrity: sha512-4MqEue5re+xIZzAWsB8sj0P1kqZySWqIuN4t6QaIO/YA6SFwySOLruvWQFzfmqk8LBK2P30KCSJwf6mJCZZ5/A==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] - '@rolldown/binding-win32-x64-msvc@1.1.4': - resolution: {integrity: sha512-M1lpniBePobTfsa7Ks9a199e1akxsXn+GYBUKsEzv3YFzOm1HJAMNwKI3qr0Zq+mxwx9gOZoTdP1yXRYsZUocQ==} + '@rolldown/binding-win32-x64-msvc@1.2.2': + resolution: {integrity: sha512-NweNxxD0Nf9t8v7kodun45Ijp3EIwYY+uydPP6qBEYvfBqhIjN6dZMzlQja3tqX/aLs3F3Uz+AxDpKgRhpOZQg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] @@ -278,9 +258,6 @@ packages: '@standard-schema/spec@1.1.0': resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==} - '@tybys/wasm-util@0.10.3': - resolution: {integrity: sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==} - '@types/chai@5.2.3': resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} @@ -302,11 +279,11 @@ packages: '@types/statuses@2.0.6': resolution: {integrity: sha512-xMAgYwceFhRA2zY+XbEA7mxYbA093wdiW8Vu6gZPGWy9cmOyU9XesH1tNcEWsKFd5Vzrqx5T3D38PWx1FIIXkA==} - '@vitest/expect@4.1.9': - resolution: {integrity: sha512-vl/rYsUKcBr3SnQn166+XR5ZQcgMx3DQhFWdfli/cWpLnLUmbxZvyrJZotLFUryib+LtArYMSTJ5RbQ57ZqrlA==} + '@vitest/expect@4.1.10': + resolution: {integrity: sha512-YsCn+qAk1GWjQOWFEsEcL2gNQ0zmVmQu3T03qP6UyjhtmdtwtbuI+DASn/7iQB3HGTXkdBwGddzxPlmiql5vlA==} - '@vitest/mocker@4.1.9': - resolution: {integrity: sha512-EVkXzBjrPGM+cK8/ANWgBrkUCfJfb38/EfTSO8h7pWvKkyPkpWxvR7BkD2MyItMF62C97zAEoqdpUixwR/e+Rw==} + '@vitest/mocker@4.1.10': + resolution: {integrity: sha512-v0xaezt+DKEmKfaxg133ldzADrwLGd7Ze1MfQQTYfvs8OqZIwbxyxaYURivwV7sWy5fqn3rH5uOrSp07bp44Ow==} peerDependencies: msw: ^2.4.9 vite: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -316,20 +293,20 @@ packages: vite: optional: true - '@vitest/pretty-format@4.1.9': - resolution: {integrity: sha512-s0iufns3iIFitdgm+YR7g1whCAaGtXz459VS9/PqyKDEEFgYIhsHOQmXgIgDuYCt7DeQmiZT0Qe2OA2p4ZPu5A==} + '@vitest/pretty-format@4.1.10': + resolution: {integrity: sha512-W1HsjSH4MXQ9YfmmhLAoIYf1HRfekQCGngeIgcei6MP5QQGWUe0gkopdZQaVCFO+JDJMrAJGwa5pRpNpvy4P8Q==} - '@vitest/runner@4.1.9': - resolution: {integrity: sha512-KXLMDtc7oe70+3mJfGrPUWPesswH+3sTxAMAMl8DG7I8IUQT4XW718dY5ID3vPUcmlu27CcKfY4P3h3I29SLJg==} + '@vitest/runner@4.1.10': + resolution: {integrity: sha512-IKI6kpIH+LmpROplyLwBBaCfMgOZOMsygVa6BARD6ahA04VRuJSa6OaVG7kRvSEMD870Vd91rSSw0eegtWyLGg==} - '@vitest/snapshot@4.1.9': - resolution: {integrity: sha512-Jc7RKGNBo8Z28WYIm0Niej4xdSPByRf6mU58VpHQkd6Zh05rlnA+twjbK5HyeIGHxrzsc3mJgS43uM0CZKzaIA==} + '@vitest/snapshot@4.1.10': + resolution: {integrity: sha512-xRkfOT1qpTAi/Ti4Y1LtfRc3kEuqxGw59eN2jN9pRWMtS/XDevekhcFSqvQqjUNGksfjMJu3Y+oJ+4Ypn2OaJw==} - '@vitest/spy@4.1.9': - resolution: {integrity: sha512-fHpsS6mIi+PiEW+vcRVOMkX1oSaPKne3VOclSFICPcGOmfKgXPU5iAah+wcNcj2xPrCCmfq99IDGf+EojhhvhA==} + '@vitest/spy@4.1.10': + resolution: {integrity: sha512-PLf/Ugvoq5wO/b4rwYCR1h2PSIdXz7wnkQFMiUpLdtM7l6pqVFcQIBEHyT1+l+cj7mNwAfZHzqXqDyjvOuwbDw==} - '@vitest/utils@4.1.9': - resolution: {integrity: sha512-A51o8ymO5PpqlWNnBP9ZHPXDIpuMtTLlGSjN7la4US+LJzoUMyhwjA5QXlm39JexgwHKW4Xjs8Z2d3dLCXOeuA==} + '@vitest/utils@4.1.10': + resolution: {integrity: sha512-fy9am/HWxbaGt/Sawrp90vt6Y6jQwf1RX77cz3uwoJwJVMli/e1IEwRPnMNJ7vKfPTwo0diXifkpPvwH9v7nGA==} '@webassemblyjs/ast@1.14.1': resolution: {integrity: sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==} @@ -382,14 +359,8 @@ packages: '@xtuc/long@4.2.2': resolution: {integrity: sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==} - acorn-import-phases@1.0.4: - resolution: {integrity: sha512-wKmbr/DDiIXzEOiWrTTUcDm24kQ2vGfZQvM2fwg2vXqR5uW6aapr7ObPtj1th32b9u90/Pf4AItvdTh42fBmVQ==} - engines: {node: '>=10.13.0'} - peerDependencies: - acorn: ^8.14.0 - - acorn@8.17.0: - resolution: {integrity: sha512-xRQbDb9BnwDafYNn6Vwl839DYVjqXYb1XVGtWAZ1kcDc6iwAL4hg3B1dZlRiuENFeO2H53gFG3in621AdERVAg==} + acorn@8.18.0: + resolution: {integrity: sha512-lGq+9yr1/GuAWaVYIHRjvvySG5/4VfKIvC8EWxStPdcDh/Ka7FG3twP6v4d5BkravUilhIAsG4Qj83t02LWUPQ==} engines: {node: '>=0.4.0'} hasBin: true @@ -421,21 +392,21 @@ packages: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} - baseline-browser-mapping@2.10.41: - resolution: {integrity: sha512-WwS7MHhqGHHlaVsqRZnhvCEMS0owDX+SxRlve7JkuH7My1Ara3ZriTmCQupPfYjxMZ8I/tgxtJYr2t7taHaH4A==} + baseline-browser-mapping@2.11.12: + resolution: {integrity: sha512-r7WnVImvVCeFpf2DOXfy41aPWzeNg3H/A2X4dKmy1QL0MSyyk/e7z8ihJ3N6Nn2PsdhkVlqnEfnUE4a05P2aTA==} engines: {node: '>=6.0.0'} hasBin: true - browserslist@4.28.4: - resolution: {integrity: sha512-MTc8i/x9jBQd1iMw2CFGS+rwMa07eYjLR0CCTLDACl9xhxy+nIs3KeML/biicXtk9JrZ6dnnTatmc7ErPXIxqw==} + browserslist@4.28.7: + resolution: {integrity: sha512-JxV13hNrFxqjOc8alRbq9dK1MM79NEXYpma2B2J4wAtpWS5zIEIKqWPGCl7N4o7Uc7B7itylh7SuDujATRyyTw==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} - caniuse-lite@1.0.30001800: - resolution: {integrity: sha512-MMHtuAz9Ys840zAY5F4k6fV5GaivZ9sPk+nz0mY+GYVzRBnYkN0mpqkSR92oWRQ19yQWo4HvBV/FnC16AJX8MA==} + caniuse-lite@1.0.30001806: + resolution: {integrity: sha512-72Cuvd95zbSYPKq6Fhg8eDJRlzgWDf7/mtoZv6Qe/DYNCEBdNxoA3+rZAU2ZhGCpZlns3EssFavaZomckT5Uuw==} chai@6.2.2: resolution: {integrity: sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==} @@ -478,18 +449,18 @@ packages: resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} engines: {node: '>=8'} - electron-to-chromium@1.5.385: - resolution: {integrity: sha512-78sa/M08MNAYHQfjoWMvOlKQqZ0ElhSm/L5HNUc96VZ3b+KvDVnngFm8sYQy0XrhTRgAhggHr5abA7yTvRdo4Q==} + electron-to-chromium@1.5.399: + resolution: {integrity: sha512-lEcqhErbHjXRvd41rnWLpzbyU/IXfIYo7QwaFWmxGeLiLyY2TBCdHnWY88vB+p3ubnihRypDm66panXl7TylLA==} emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - enhanced-resolve@5.24.1: - resolution: {integrity: sha512-7DdUaTjmNwMcH2gLr1qycesKII3BK4RLy/mdAb7x10Lq7bR4aNKHt1BR1ZALSv0rPM/hF5wYF0PhGop/rJm8vw==} + enhanced-resolve@5.24.5: + resolution: {integrity: sha512-L1l8TNvomm6UVW5B253AGxQagSQr+vGwhMlrrfRS2qmhx46AMpMVJKQYLvWYbysTMY8VoicOvzHzoHMbyzB+4A==} engines: {node: '>=10.13.0'} - es-module-lexer@2.3.0: - resolution: {integrity: sha512-KLdwQm2NvGLDkQDCGvmiQrhkd0JbMzXthwQAUgWjQuQdBLFa3eiBP5arXZyA+f8x+x7OXgud6bq2rxjGtHV2tw==} + es-module-lexer@2.3.1: + resolution: {integrity: sha512-shc1dbU90Yl/xq1QrC7QRtfcwURZuVRfPhZbDoldJ1cn1gzDvBaBWlv0eFolj5+0znnPJz5TXLxsN77X/12KTA==} escalade@3.2.0: resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} @@ -525,8 +496,8 @@ packages: fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - fast-uri@3.1.3: - resolution: {integrity: sha512-i70LwGWUduXqzicKXWshooq+sWL1K3WUU5rKZNG/0i3a1OSoX3HqhH5WbWwTmqWfor4urUakGPiRQcleRZTwOg==} + fast-uri@3.1.5: + resolution: {integrity: sha512-gHwA1O9LDIcKunMKhObS/HimwtehO1nPUECKAu5TpKgaO19fcWEl4bliWe1jWxVFvIXztJjjQ4L8XQ1EU9f7Jw==} fdir@6.5.0: resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} @@ -574,84 +545,80 @@ packages: json-schema-traverse@1.0.0: resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} - lightningcss-android-arm64@1.32.0: - resolution: {integrity: sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==} + lightningcss-android-arm64@1.33.0: + resolution: {integrity: sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [android] - lightningcss-darwin-arm64@1.32.0: - resolution: {integrity: sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==} + lightningcss-darwin-arm64@1.33.0: + resolution: {integrity: sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [darwin] - lightningcss-darwin-x64@1.32.0: - resolution: {integrity: sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==} + lightningcss-darwin-x64@1.33.0: + resolution: {integrity: sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [darwin] - lightningcss-freebsd-x64@1.32.0: - resolution: {integrity: sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==} + lightningcss-freebsd-x64@1.33.0: + resolution: {integrity: sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [freebsd] - lightningcss-linux-arm-gnueabihf@1.32.0: - resolution: {integrity: sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==} + lightningcss-linux-arm-gnueabihf@1.33.0: + resolution: {integrity: sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==} engines: {node: '>= 12.0.0'} cpu: [arm] os: [linux] - lightningcss-linux-arm64-gnu@1.32.0: - resolution: {integrity: sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==} + lightningcss-linux-arm64-gnu@1.33.0: + resolution: {integrity: sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] libc: [glibc] - lightningcss-linux-arm64-musl@1.32.0: - resolution: {integrity: sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==} + lightningcss-linux-arm64-musl@1.33.0: + resolution: {integrity: sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] libc: [musl] - lightningcss-linux-x64-gnu@1.32.0: - resolution: {integrity: sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==} + lightningcss-linux-x64-gnu@1.33.0: + resolution: {integrity: sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] libc: [glibc] - lightningcss-linux-x64-musl@1.32.0: - resolution: {integrity: sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==} + lightningcss-linux-x64-musl@1.33.0: + resolution: {integrity: sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] libc: [musl] - lightningcss-win32-arm64-msvc@1.32.0: - resolution: {integrity: sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==} + lightningcss-win32-arm64-msvc@1.33.0: + resolution: {integrity: sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [win32] - lightningcss-win32-x64-msvc@1.32.0: - resolution: {integrity: sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==} + lightningcss-win32-x64-msvc@1.33.0: + resolution: {integrity: sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [win32] - lightningcss@1.32.0: - resolution: {integrity: sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==} + lightningcss@1.33.0: + resolution: {integrity: sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==} engines: {node: '>= 12.0.0'} - loader-runner@4.3.2: - resolution: {integrity: sha512-DFEqQ3ihfS9blba08cLfYf1NRAIEm+dDjic073DRDc3/JspI/8wYmtDsHwd3+4hwvdxSK7PGaElfTmm0awWJ4w==} - engines: {node: '>=6.11.5'} - magic-string@0.30.21: resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} @@ -719,20 +686,20 @@ packages: resolution: {integrity: sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==} engines: {node: ^18.17.0 || >=20.5.0} - nanoid@3.3.15: - resolution: {integrity: sha512-y7Wygv/7mEOvxTuEQDB8StXdMRBWf1kR/tlhAzBRUFkB2jfcLOAxO/SHmOO2zgz1pVgK29/kyupn059/bCHdjA==} + nanoid@3.3.17: + resolution: {integrity: sha512-xQLf0A3HOMlgHq0n247/LRuAOYmB7dXJ/DvAxGvsSBij45XtBSmQycu+F8ODbHwns/XyFZagyL1+J0Offw1E0g==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true neo-async@2.6.2: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} - node-releases@2.0.50: - resolution: {integrity: sha512-J6l92tKHX6w8Jy5nO1Vuc01NoIiRGi/d6qBKVxh+IQ8Cr3b6HbVNfKiF8ZpFKufTwpwxMmce2W3iQZ861ZRyTg==} + node-releases@2.0.51: + resolution: {integrity: sha512-wRNIrw4DmVLKQlbgOMdkMx27Wrpzes2hh5Jtbi2bjPd+4wJstWIqP5A+lscnqbm0xxmT5Bpg8Lec5ItEBwx6BQ==} engines: {node: '>=18'} - obug@2.1.3: - resolution: {integrity: sha512-9miFgM2OFba7hB+pRgvtV84pYTBaoTHohvmIgiRt6dRIzbwEOIaNaP+dIlGs2fNFoB0SeISs0Jz5WFVRid6Xyg==} + obug@2.1.4: + resolution: {integrity: sha512-4a+OsYv9UktOJKE+l1A4OufDgdRF9PifWj+tJnHURo/P+WOxpG4GzUFL9qCalmWauao6ogiG+QvnCovwPoyAWA==} engines: {node: '>=12.20.0'} outvariant@1.4.3: @@ -751,8 +718,8 @@ packages: resolution: {integrity: sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==} engines: {node: '>=12'} - postcss@8.5.16: - resolution: {integrity: sha512-vuwillviilfKZsg0VGj5R/YwwcHx4SLsIOI/7K6mQkWx+l5cUHTjj5g0AasTBcyXsbfTgrwsUNmVUb5xVwyPwg==} + postcss@8.5.25: + resolution: {integrity: sha512-DTPx3RWSSnWyzLxQnlH0rJP+EW5ekl16ZU4/psbIhA0e53kJfdgaN5vKM+xP7yJtXVu+nfdVFmlgFDEKAe4Pyw==} engines: {node: ^10 || ^12 || >=14} require-directory@2.1.1: @@ -766,8 +733,8 @@ packages: rettime@0.7.0: resolution: {integrity: sha512-LPRKoHnLKd/r3dVxcwO7vhCW+orkOGj9ViueosEBK6ie89CijnfRlhaDhHq/3Hxu4CkWQtxwlBG0mzTQY6uQjw==} - rolldown@1.1.4: - resolution: {integrity: sha512-IjZYiLxZwpnhwhdBH2ugdTGVSdhCQUmLxLoqyjiL0JxYjyRst+5a0P3xfrTxJ5F638j4Mvvw5FAX5XE6eHpXbA==} + rolldown@1.2.2: + resolution: {integrity: sha512-opwpo1tQBAcpSUJDt94B7hhLNGOKjCdE//XXjeLrnx9b83bjnw45tXdg1b09yEw/VLFBJGZpwRULMmOZo7ol+A==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true @@ -804,8 +771,8 @@ packages: resolution: {integrity: sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==} engines: {node: '>= 0.8'} - std-env@4.1.0: - resolution: {integrity: sha512-Rq7ybcX2RuC55r9oaPVEW7/xu3tj8u4GeBYHBWCychFtzMIr86A7e3PPEBPT37sHStKX3+TiX/Fr/ACmJLVlLQ==} + std-env@4.2.0: + resolution: {integrity: sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw==} strict-event-emitter@0.5.1: resolution: {integrity: sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ==} @@ -830,35 +797,35 @@ packages: resolution: {integrity: sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==} engines: {node: '>=6'} - terser@5.48.0: - resolution: {integrity: sha512-J/9An6vs9Us6wKRriSFXBWdRZapREHqFzdNUKk0pmu804EMR6dr6winwo7e5JDxN4xahxQsuysyYFwlwj4XN/Q==} + terser@5.49.0: + resolution: {integrity: sha512-SNiDnXyHSrxVcIOtVbULzcTmniUiwcV7Nwdyj1twVubeTmbjoa8p69KKDpfkdoOavuM4/GRm1+ykI8qqnavHoA==} engines: {node: '>=10'} hasBin: true tinybench@2.9.0: resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} - tinyexec@1.2.4: - resolution: {integrity: sha512-SHf/r48b7vOrjve9PxJo3MN5v5yuyjHvdUcrQffT3WXMUfnGmHDVbC4k3sHJaJTgZCwpUplIaAo5ANtMyp3YHg==} + tinyexec@1.3.0: + resolution: {integrity: sha512-QKAl9m8gWWGHV8jZcPeym6j+XULi6tOf1mT83WYJ4Lk2ytW/uwAWkrP0uFsdoYMdueVJ0qs26wZ+23xeB4ibNQ==} engines: {node: '>=18'} tinyglobby@0.2.17: resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==} engines: {node: '>=12.0.0'} - tinyrainbow@3.1.0: - resolution: {integrity: sha512-Bf+ILmBgretUrdJxzXM0SgXLZ3XfiaUuOj/IKQHuTXip+05Xn+uyEYdVg0kYDipTBcLrCVyUzAPz7QmArb0mmw==} + tinyrainbow@3.1.1: + resolution: {integrity: sha512-yau8yJdTt989Mm0Bd/236QnzEiPf2xLLTqUZRUJOo/3CB078LSwzei343DgtJVmfJKJE3TMINY1u42SQsP6mXw==} engines: {node: '>=14.0.0'} - tldts-core@7.4.6: - resolution: {integrity: sha512-TkQNGJIhlEphpHCjKodMTSe23egUZr/g+flI2qkLgiJ/maAzSgXypSLRTNH3nCmqgayEmtcJBiLcfODSAr1xoA==} + tldts-core@7.4.10: + resolution: {integrity: sha512-KnQjp53ZekKgm/r3l+u8kJGGzYgrWdP8+Mql7a4vijh2WE0IrZWspQj/TpTxDho/YxO+AnOZnIjQcCD+q6iJsw==} - tldts@7.4.6: - resolution: {integrity: sha512-rbP0Gyx8b3Ae9yO//CU2wbSnQNoQ66m1nJdSbSHmnwKwzkkz/u8mERYU8T2rmlmy+bJvRNn84yNCW8gYqox44Q==} + tldts@7.4.10: + resolution: {integrity: sha512-GgouD1B+sWwvkaEq8vXC15DjQitxbvs12oIXELpconwm+Tg3zfcEv4jgzq3vtKverDXsg3VI8aRgNL2Nra0Iog==} hasBin: true - tough-cookie@6.0.1: - resolution: {integrity: sha512-LktZQb3IeoUWB9lqR5EWTHgW/VTITCXg4D21M+lvybRVdylLrRMnqaIONLVb5mav8vM19m44HIcGq4qASeu2Qw==} + tough-cookie@6.0.2: + resolution: {integrity: sha512-exgYmnmL/sJpR3upZfXG5PoatXQii55xAiXGXzY+sROLZ/Y+SLcp9PgJNI9Vz37HpQ74WvDcLT8eqm+kV3FzrA==} engines: {node: '>=16'} ts-loader@9.6.2: @@ -872,9 +839,6 @@ packages: loader-utils: optional: true - tslib@2.8.1: - resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} - type-fest@4.41.0: resolution: {integrity: sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==} engines: {node: '>=16'} @@ -893,13 +857,13 @@ packages: peerDependencies: browserslist: '>= 4.21.0' - vite@8.1.3: - resolution: {integrity: sha512-Ds+gBRbj0lwRO2Y5hwnUBdxSwlAve9LeRyU4sNnAr0ewW0gWF0n5bgXgUzbgZ49MV9BVUAQUFYVcDUcilUExMA==} + vite@8.2.0: + resolution: {integrity: sha512-pn+CFpM0lwDeKwmOq1ZaBK/9sjorZcgqxki6MbY/jPEVd9vichIlmlD4HmQ5wdP5EgqQCFRaACBxMC7uEGc6lQ==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true peerDependencies: '@types/node': ^20.19.0 || >=22.12.0 - '@vitejs/devtools': ^0.3.0 + '@vitejs/devtools': ^0.4.0 esbuild: ^0.27.0 || ^0.28.0 jiti: '>=1.21.0' less: ^4.0.0 @@ -936,20 +900,20 @@ packages: yaml: optional: true - vitest@4.1.9: - resolution: {integrity: sha512-nE3/LEyc0z87uHYLZebqCUOaJr2hdtuPp7BQ4BosVFnfltxgAvMG08NyrSGlPpOUWvR27c5flSmYFTNr78L9GQ==} + vitest@4.1.10: + resolution: {integrity: sha512-R9jUTe5S4Qb0HCd4TNqpC7oGcrMssMRGXLW80ubjWsW9VH5GF8y1Y0SFLY9AbqSk6nt0PnOx4H4WNJYZ13GUPw==} engines: {node: ^20.0.0 || ^22.0.0 || >=24.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' '@opentelemetry/api': ^1.9.0 '@types/node': ^20.0.0 || ^22.0.0 || >=24.0.0 - '@vitest/browser-playwright': 4.1.9 - '@vitest/browser-preview': 4.1.9 - '@vitest/browser-webdriverio': 4.1.9 - '@vitest/coverage-istanbul': 4.1.9 - '@vitest/coverage-v8': 4.1.9 - '@vitest/ui': 4.1.9 + '@vitest/browser-playwright': 4.1.10 + '@vitest/browser-preview': 4.1.10 + '@vitest/browser-webdriverio': 4.1.10 + '@vitest/coverage-istanbul': 4.1.10 + '@vitest/coverage-v8': 4.1.10 + '@vitest/ui': 4.1.10 happy-dom: '*' jsdom: '*' vite: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -981,12 +945,12 @@ packages: resolution: {integrity: sha512-6i/00NBjP4yGPs+caKSyRfpTF/8Torsu0MOW3mMzIbhgISFder8i7xbqgHlLMwJrdiN8ndBV3UA1/AfzPSr+jg==} engines: {node: '>=10.13.0'} - webpack-sources@3.5.0: - resolution: {integrity: sha512-HPuy+uuoTCaaoEoI1LQ3JN9+vrPBvEesnnX1jADHy728cHSMlq4wUc4afYqahq2B1mhQVZxCXOkNTnXltr+2vQ==} + webpack-sources@3.5.1: + resolution: {integrity: sha512-jyuiGJdtvY434z5bUZrjz67v76/ePNvFZTp9Mdz29IlH4+GPsgyGjiv0fKI+M7BdkU6ADjulUcKAd3tUK3WlEw==} engines: {node: '>=10.13.0'} - webpack@5.108.3: - resolution: {integrity: sha512-hOpaCHmQVVY66IVTjofnH14IgSdmod2aquSGHGuYig/OIdWge01Hk2Wt988DZcwXumFUT4+FvJY5N+ikl8o/ww==} + webpack@5.109.2: + resolution: {integrity: sha512-U9/cvLzxObKNEZ9+TtdqrHM5/9z3lgl2c+c4BzbqGxFQvQvBAq87yql5A8pQ+rrMbS496MZJeF5enVBndIy2hw==} engines: {node: '>=10.13.0'} hasBin: true peerDependencies: @@ -1069,22 +1033,6 @@ snapshots: dependencies: statuses: 2.0.2 - '@emnapi/core@1.11.1': - dependencies: - '@emnapi/wasi-threads': 1.2.2 - tslib: 2.8.1 - optional: true - - '@emnapi/runtime@1.11.1': - dependencies: - tslib: 2.8.1 - optional: true - - '@emnapi/wasi-threads@1.2.2': - dependencies: - tslib: 2.8.1 - optional: true - '@inquirer/ansi@1.0.2': {} '@inquirer/confirm@5.1.21(@types/node@20.19.43)': @@ -1141,13 +1089,6 @@ snapshots: outvariant: 1.4.3 strict-event-emitter: 0.5.1 - '@napi-rs/wasm-runtime@1.1.6(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)': - dependencies: - '@emnapi/core': 1.11.1 - '@emnapi/runtime': 1.11.1 - '@tybys/wasm-util': 0.10.3 - optional: true - '@open-draft/deferred-promise@2.2.0': {} '@open-draft/logger@0.3.0': @@ -1157,66 +1098,54 @@ snapshots: '@open-draft/until@2.1.0': {} - '@oxc-project/types@0.138.0': {} + '@oxc-project/types@0.142.0': {} - '@rolldown/binding-android-arm64@1.1.4': + '@rolldown/binding-android-arm64@1.2.2': optional: true - '@rolldown/binding-darwin-arm64@1.1.4': + '@rolldown/binding-darwin-arm64@1.2.2': optional: true - '@rolldown/binding-darwin-x64@1.1.4': + '@rolldown/binding-darwin-x64@1.2.2': optional: true - '@rolldown/binding-freebsd-x64@1.1.4': + '@rolldown/binding-freebsd-x64@1.2.2': optional: true - '@rolldown/binding-linux-arm-gnueabihf@1.1.4': + '@rolldown/binding-linux-arm-gnueabihf@1.2.2': optional: true - '@rolldown/binding-linux-arm64-gnu@1.1.4': + '@rolldown/binding-linux-arm64-gnu@1.2.2': optional: true - '@rolldown/binding-linux-arm64-musl@1.1.4': + '@rolldown/binding-linux-arm64-musl@1.2.2': optional: true - '@rolldown/binding-linux-ppc64-gnu@1.1.4': + '@rolldown/binding-linux-ppc64-gnu@1.2.2': optional: true - '@rolldown/binding-linux-s390x-gnu@1.1.4': + '@rolldown/binding-linux-s390x-gnu@1.2.2': optional: true - '@rolldown/binding-linux-x64-gnu@1.1.4': + '@rolldown/binding-linux-x64-gnu@1.2.2': optional: true - '@rolldown/binding-linux-x64-musl@1.1.4': + '@rolldown/binding-linux-x64-musl@1.2.2': optional: true - '@rolldown/binding-openharmony-arm64@1.1.4': + '@rolldown/binding-openharmony-arm64@1.2.2': optional: true - '@rolldown/binding-wasm32-wasi@1.1.4': - dependencies: - '@emnapi/core': 1.11.1 - '@emnapi/runtime': 1.11.1 - '@napi-rs/wasm-runtime': 1.1.6(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1) + '@rolldown/binding-win32-arm64-msvc@1.2.2': optional: true - '@rolldown/binding-win32-arm64-msvc@1.1.4': - optional: true - - '@rolldown/binding-win32-x64-msvc@1.1.4': + '@rolldown/binding-win32-x64-msvc@1.2.2': optional: true '@rolldown/pluginutils@1.0.1': {} '@standard-schema/spec@1.1.0': {} - '@tybys/wasm-util@0.10.3': - dependencies: - tslib: 2.8.1 - optional: true - '@types/chai@5.2.3': dependencies: '@types/deep-eql': 4.0.2 @@ -1236,47 +1165,47 @@ snapshots: '@types/statuses@2.0.6': {} - '@vitest/expect@4.1.9': + '@vitest/expect@4.1.10': dependencies: '@standard-schema/spec': 1.1.0 '@types/chai': 5.2.3 - '@vitest/spy': 4.1.9 - '@vitest/utils': 4.1.9 + '@vitest/spy': 4.1.10 + '@vitest/utils': 4.1.10 chai: 6.2.2 - tinyrainbow: 3.1.0 + tinyrainbow: 3.1.1 - '@vitest/mocker@4.1.9(msw@2.11.2(@types/node@20.19.43)(typescript@5.9.3))(vite@8.1.3(@types/node@20.19.43)(terser@5.48.0))': + '@vitest/mocker@4.1.10(msw@2.11.2(@types/node@20.19.43)(typescript@5.9.3))(vite@8.2.0(@types/node@20.19.43)(terser@5.49.0))': dependencies: - '@vitest/spy': 4.1.9 + '@vitest/spy': 4.1.10 estree-walker: 3.0.3 magic-string: 0.30.21 optionalDependencies: msw: 2.11.2(@types/node@20.19.43)(typescript@5.9.3) - vite: 8.1.3(@types/node@20.19.43)(terser@5.48.0) + vite: 8.2.0(@types/node@20.19.43)(terser@5.49.0) - '@vitest/pretty-format@4.1.9': + '@vitest/pretty-format@4.1.10': dependencies: - tinyrainbow: 3.1.0 + tinyrainbow: 3.1.1 - '@vitest/runner@4.1.9': + '@vitest/runner@4.1.10': dependencies: - '@vitest/utils': 4.1.9 + '@vitest/utils': 4.1.10 pathe: 2.0.3 - '@vitest/snapshot@4.1.9': + '@vitest/snapshot@4.1.10': dependencies: - '@vitest/pretty-format': 4.1.9 - '@vitest/utils': 4.1.9 + '@vitest/pretty-format': 4.1.10 + '@vitest/utils': 4.1.10 magic-string: 0.30.21 pathe: 2.0.3 - '@vitest/spy@4.1.9': {} + '@vitest/spy@4.1.10': {} - '@vitest/utils@4.1.9': + '@vitest/utils@4.1.10': dependencies: - '@vitest/pretty-format': 4.1.9 + '@vitest/pretty-format': 4.1.10 convert-source-map: 2.0.0 - tinyrainbow: 3.1.0 + tinyrainbow: 3.1.1 '@webassemblyjs/ast@1.14.1': dependencies: @@ -1358,11 +1287,7 @@ snapshots: '@xtuc/long@4.2.2': {} - acorn-import-phases@1.0.4(acorn@8.17.0): - dependencies: - acorn: 8.17.0 - - acorn@8.17.0: {} + acorn@8.18.0: {} ajv-formats@2.1.1(ajv@8.20.0): optionalDependencies: @@ -1376,7 +1301,7 @@ snapshots: ajv@8.20.0: dependencies: fast-deep-equal: 3.1.3 - fast-uri: 3.1.3 + fast-uri: 3.1.5 json-schema-traverse: 1.0.0 require-from-string: 2.0.2 @@ -1388,19 +1313,19 @@ snapshots: assertion-error@2.0.1: {} - baseline-browser-mapping@2.10.41: {} + baseline-browser-mapping@2.11.12: {} - browserslist@4.28.4: + browserslist@4.28.7: dependencies: - baseline-browser-mapping: 2.10.41 - caniuse-lite: 1.0.30001800 - electron-to-chromium: 1.5.385 - node-releases: 2.0.50 - update-browserslist-db: 1.2.3(browserslist@4.28.4) + baseline-browser-mapping: 2.11.12 + caniuse-lite: 1.0.30001806 + electron-to-chromium: 1.5.399 + node-releases: 2.0.51 + update-browserslist-db: 1.2.3(browserslist@4.28.7) buffer-from@1.1.2: {} - caniuse-lite@1.0.30001800: {} + caniuse-lite@1.0.30001806: {} chai@6.2.2: {} @@ -1433,16 +1358,16 @@ snapshots: detect-libc@2.1.2: {} - electron-to-chromium@1.5.385: {} + electron-to-chromium@1.5.399: {} emoji-regex@8.0.0: {} - enhanced-resolve@5.24.1: + enhanced-resolve@5.24.5: dependencies: graceful-fs: 4.2.11 tapable: 2.3.3 - es-module-lexer@2.3.0: {} + es-module-lexer@2.3.1: {} escalade@3.2.0: {} @@ -1469,7 +1394,7 @@ snapshots: fast-deep-equal@3.1.3: {} - fast-uri@3.1.3: {} + fast-uri@3.1.5: {} fdir@6.5.0(picomatch@4.0.5): optionalDependencies: @@ -1500,56 +1425,54 @@ snapshots: json-schema-traverse@1.0.0: {} - lightningcss-android-arm64@1.32.0: + lightningcss-android-arm64@1.33.0: optional: true - lightningcss-darwin-arm64@1.32.0: + lightningcss-darwin-arm64@1.33.0: optional: true - lightningcss-darwin-x64@1.32.0: + lightningcss-darwin-x64@1.33.0: optional: true - lightningcss-freebsd-x64@1.32.0: + lightningcss-freebsd-x64@1.33.0: optional: true - lightningcss-linux-arm-gnueabihf@1.32.0: + lightningcss-linux-arm-gnueabihf@1.33.0: optional: true - lightningcss-linux-arm64-gnu@1.32.0: + lightningcss-linux-arm64-gnu@1.33.0: optional: true - lightningcss-linux-arm64-musl@1.32.0: + lightningcss-linux-arm64-musl@1.33.0: optional: true - lightningcss-linux-x64-gnu@1.32.0: + lightningcss-linux-x64-gnu@1.33.0: optional: true - lightningcss-linux-x64-musl@1.32.0: + lightningcss-linux-x64-musl@1.33.0: optional: true - lightningcss-win32-arm64-msvc@1.32.0: + lightningcss-win32-arm64-msvc@1.33.0: optional: true - lightningcss-win32-x64-msvc@1.32.0: + lightningcss-win32-x64-msvc@1.33.0: optional: true - lightningcss@1.32.0: + lightningcss@1.33.0: dependencies: detect-libc: 2.1.2 optionalDependencies: - lightningcss-android-arm64: 1.32.0 - lightningcss-darwin-arm64: 1.32.0 - lightningcss-darwin-x64: 1.32.0 - lightningcss-freebsd-x64: 1.32.0 - lightningcss-linux-arm-gnueabihf: 1.32.0 - lightningcss-linux-arm64-gnu: 1.32.0 - lightningcss-linux-arm64-musl: 1.32.0 - lightningcss-linux-x64-gnu: 1.32.0 - lightningcss-linux-x64-musl: 1.32.0 - lightningcss-win32-arm64-msvc: 1.32.0 - lightningcss-win32-x64-msvc: 1.32.0 - - loader-runner@4.3.2: {} + lightningcss-android-arm64: 1.33.0 + lightningcss-darwin-arm64: 1.33.0 + lightningcss-darwin-x64: 1.33.0 + lightningcss-freebsd-x64: 1.33.0 + lightningcss-linux-arm-gnueabihf: 1.33.0 + lightningcss-linux-arm64-gnu: 1.33.0 + lightningcss-linux-arm64-musl: 1.33.0 + lightningcss-linux-x64-gnu: 1.33.0 + lightningcss-linux-x64-musl: 1.33.0 + lightningcss-win32-arm64-msvc: 1.33.0 + lightningcss-win32-x64-msvc: 1.33.0 magic-string@0.30.21: dependencies: @@ -1559,13 +1482,13 @@ snapshots: mime-db@1.54.0: {} - minimizer-webpack-plugin@5.6.1(webpack@5.108.3): + minimizer-webpack-plugin@5.6.1(webpack@5.109.2): dependencies: '@jridgewell/trace-mapping': 0.3.31 jest-worker: 27.5.1 schema-utils: 4.3.3 - terser: 5.48.0 - webpack: 5.108.3 + terser: 5.49.0 + webpack: 5.109.2 msw@2.11.2(@types/node@20.19.43)(typescript@5.9.3): dependencies: @@ -1585,7 +1508,7 @@ snapshots: picocolors: 1.1.1 rettime: 0.7.0 strict-event-emitter: 0.5.1 - tough-cookie: 6.0.1 + tough-cookie: 6.0.2 type-fest: 4.41.0 yargs: 17.7.3 optionalDependencies: @@ -1595,13 +1518,13 @@ snapshots: mute-stream@2.0.0: {} - nanoid@3.3.15: {} + nanoid@3.3.17: {} neo-async@2.6.2: {} - node-releases@2.0.50: {} + node-releases@2.0.51: {} - obug@2.1.3: {} + obug@2.1.4: {} outvariant@1.4.3: {} @@ -1613,9 +1536,9 @@ snapshots: picomatch@4.0.5: {} - postcss@8.5.16: + postcss@8.5.25: dependencies: - nanoid: 3.3.15 + nanoid: 3.3.17 picocolors: 1.1.1 source-map-js: 1.2.1 @@ -1625,26 +1548,25 @@ snapshots: rettime@0.7.0: {} - rolldown@1.1.4: + rolldown@1.2.2: dependencies: - '@oxc-project/types': 0.138.0 + '@oxc-project/types': 0.142.0 '@rolldown/pluginutils': 1.0.1 optionalDependencies: - '@rolldown/binding-android-arm64': 1.1.4 - '@rolldown/binding-darwin-arm64': 1.1.4 - '@rolldown/binding-darwin-x64': 1.1.4 - '@rolldown/binding-freebsd-x64': 1.1.4 - '@rolldown/binding-linux-arm-gnueabihf': 1.1.4 - '@rolldown/binding-linux-arm64-gnu': 1.1.4 - '@rolldown/binding-linux-arm64-musl': 1.1.4 - '@rolldown/binding-linux-ppc64-gnu': 1.1.4 - '@rolldown/binding-linux-s390x-gnu': 1.1.4 - '@rolldown/binding-linux-x64-gnu': 1.1.4 - '@rolldown/binding-linux-x64-musl': 1.1.4 - '@rolldown/binding-openharmony-arm64': 1.1.4 - '@rolldown/binding-wasm32-wasi': 1.1.4 - '@rolldown/binding-win32-arm64-msvc': 1.1.4 - '@rolldown/binding-win32-x64-msvc': 1.1.4 + '@rolldown/binding-android-arm64': 1.2.2 + '@rolldown/binding-darwin-arm64': 1.2.2 + '@rolldown/binding-darwin-x64': 1.2.2 + '@rolldown/binding-freebsd-x64': 1.2.2 + '@rolldown/binding-linux-arm-gnueabihf': 1.2.2 + '@rolldown/binding-linux-arm64-gnu': 1.2.2 + '@rolldown/binding-linux-arm64-musl': 1.2.2 + '@rolldown/binding-linux-ppc64-gnu': 1.2.2 + '@rolldown/binding-linux-s390x-gnu': 1.2.2 + '@rolldown/binding-linux-x64-gnu': 1.2.2 + '@rolldown/binding-linux-x64-musl': 1.2.2 + '@rolldown/binding-openharmony-arm64': 1.2.2 + '@rolldown/binding-win32-arm64-msvc': 1.2.2 + '@rolldown/binding-win32-x64-msvc': 1.2.2 schema-utils@4.3.3: dependencies: @@ -1672,7 +1594,7 @@ snapshots: statuses@2.0.2: {} - std-env@4.1.0: {} + std-env@4.2.0: {} strict-event-emitter@0.5.1: {} @@ -1696,44 +1618,41 @@ snapshots: tapable@2.3.3: {} - terser@5.48.0: + terser@5.49.0: dependencies: '@jridgewell/source-map': 0.3.11 - acorn: 8.17.0 + acorn: 8.18.0 commander: 2.20.3 source-map-support: 0.5.21 tinybench@2.9.0: {} - tinyexec@1.2.4: {} + tinyexec@1.3.0: {} tinyglobby@0.2.17: dependencies: fdir: 6.5.0(picomatch@4.0.5) picomatch: 4.0.5 - tinyrainbow@3.1.0: {} + tinyrainbow@3.1.1: {} - tldts-core@7.4.6: {} + tldts-core@7.4.10: {} - tldts@7.4.6: + tldts@7.4.10: dependencies: - tldts-core: 7.4.6 + tldts-core: 7.4.10 - tough-cookie@6.0.1: + tough-cookie@6.0.2: dependencies: - tldts: 7.4.6 + tldts: 7.4.10 - ts-loader@9.6.2(typescript@5.9.3)(webpack@5.108.3): + ts-loader@9.6.2(typescript@5.9.3)(webpack@5.109.2): dependencies: chalk: 4.1.2 picomatch: 4.0.5 source-map: 0.7.6 typescript: 5.9.3 - webpack: 5.108.3 - - tslib@2.8.1: - optional: true + webpack: 5.109.2 type-fest@4.41.0: {} @@ -1741,45 +1660,45 @@ snapshots: undici-types@6.21.0: {} - update-browserslist-db@1.2.3(browserslist@4.28.4): + update-browserslist-db@1.2.3(browserslist@4.28.7): dependencies: - browserslist: 4.28.4 + browserslist: 4.28.7 escalade: 3.2.0 picocolors: 1.1.1 - vite@8.1.3(@types/node@20.19.43)(terser@5.48.0): + vite@8.2.0(@types/node@20.19.43)(terser@5.49.0): dependencies: - lightningcss: 1.32.0 + lightningcss: 1.33.0 picomatch: 4.0.5 - postcss: 8.5.16 - rolldown: 1.1.4 + postcss: 8.5.25 + rolldown: 1.2.2 tinyglobby: 0.2.17 optionalDependencies: '@types/node': 20.19.43 fsevents: 2.3.3 - terser: 5.48.0 - - vitest@4.1.9(@types/node@20.19.43)(msw@2.11.2(@types/node@20.19.43)(typescript@5.9.3))(vite@8.1.3(@types/node@20.19.43)(terser@5.48.0)): - dependencies: - '@vitest/expect': 4.1.9 - '@vitest/mocker': 4.1.9(msw@2.11.2(@types/node@20.19.43)(typescript@5.9.3))(vite@8.1.3(@types/node@20.19.43)(terser@5.48.0)) - '@vitest/pretty-format': 4.1.9 - '@vitest/runner': 4.1.9 - '@vitest/snapshot': 4.1.9 - '@vitest/spy': 4.1.9 - '@vitest/utils': 4.1.9 - es-module-lexer: 2.3.0 + terser: 5.49.0 + + vitest@4.1.10(@types/node@20.19.43)(msw@2.11.2(@types/node@20.19.43)(typescript@5.9.3))(vite@8.2.0(@types/node@20.19.43)(terser@5.49.0)): + dependencies: + '@vitest/expect': 4.1.10 + '@vitest/mocker': 4.1.10(msw@2.11.2(@types/node@20.19.43)(typescript@5.9.3))(vite@8.2.0(@types/node@20.19.43)(terser@5.49.0)) + '@vitest/pretty-format': 4.1.10 + '@vitest/runner': 4.1.10 + '@vitest/snapshot': 4.1.10 + '@vitest/spy': 4.1.10 + '@vitest/utils': 4.1.10 + es-module-lexer: 2.3.1 expect-type: 1.4.0 magic-string: 0.30.21 - obug: 2.1.3 + obug: 2.1.4 pathe: 2.0.3 picomatch: 4.0.5 - std-env: 4.1.0 + std-env: 4.2.0 tinybench: 2.9.0 - tinyexec: 1.2.4 + tinyexec: 1.3.0 tinyglobby: 0.2.17 - tinyrainbow: 3.1.0 - vite: 8.1.3(@types/node@20.19.43)(terser@5.48.0) + tinyrainbow: 3.1.1 + vite: 8.2.0(@types/node@20.19.43)(terser@5.49.0) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 20.19.43 @@ -1790,32 +1709,30 @@ snapshots: dependencies: graceful-fs: 4.2.11 - webpack-sources@3.5.0: {} + webpack-sources@3.5.1: {} - webpack@5.108.3: + webpack@5.109.2: dependencies: '@types/estree': 1.0.9 '@types/json-schema': 7.0.15 '@webassemblyjs/ast': 1.14.1 '@webassemblyjs/wasm-edit': 1.14.1 '@webassemblyjs/wasm-parser': 1.14.1 - acorn: 8.17.0 - acorn-import-phases: 1.0.4(acorn@8.17.0) - browserslist: 4.28.4 + acorn: 8.18.0 + browserslist: 4.28.7 chrome-trace-event: 1.0.4 - enhanced-resolve: 5.24.1 - es-module-lexer: 2.3.0 + enhanced-resolve: 5.24.5 + es-module-lexer: 2.3.1 eslint-scope: 5.1.1 events: 3.3.0 graceful-fs: 4.2.11 - loader-runner: 4.3.2 mime-db: 1.54.0 - minimizer-webpack-plugin: 5.6.1(webpack@5.108.3) + minimizer-webpack-plugin: 5.6.1(webpack@5.109.2) neo-async: 2.6.2 schema-utils: 4.3.3 tapable: 2.3.3 watchpack: 2.5.2 - webpack-sources: 3.5.0 + webpack-sources: 3.5.1 transitivePeerDependencies: - '@minify-html/node' - '@swc/core' diff --git a/reference.md b/reference.md index e2aa8ba5..67838ece 100644 --- a/reference.md +++ b/reference.md @@ -199,7 +199,7 @@ await client.internal.getIdFromFqn("type", {
-**request:** `TrueFoundry.InternalGetIdFromFqnRequest` +**request:** `TrueFoundry.GetIdFromFqnInternalRequest`
@@ -250,8 +250,7 @@ List users in the current tenant. const pageableResponse = await client.users.list({ limit: 10, offset: 0, - query: "john@example.com", - showInvalidUsers: true + query: "john@example.com" }); for await (const item of pageableResponse) { console.log(item); @@ -261,8 +260,7 @@ for await (const item of pageableResponse) { let page = await client.users.list({ limit: 10, offset: 0, - query: "john@example.com", - showInvalidUsers: true + query: "john@example.com" }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -285,7 +283,7 @@ const response = page.response;
-**request:** `TrueFoundry.UsersListRequest` +**request:** `TrueFoundry.ListUsersRequest`
@@ -526,9 +524,7 @@ Permanently delete a user by ID. The user must not be a collaborator on any reso
```typescript -await client.users.delete("jqfwg345gi25n5ju2yz5iz6m", { - tenantName: "tenantName" -}); +await client.users.delete("jqfwg345gi25n5ju2yz5iz6m"); ```
@@ -552,7 +548,7 @@ await client.users.delete("jqfwg345gi25n5ju2yz5iz6m", {
-**request:** `TrueFoundry.UsersDeleteRequest` +**request:** `TrueFoundry.DeleteUsersRequest`
@@ -1037,7 +1033,7 @@ await client.users.getTeams("jqfwg345gi25n5ju2yz5iz6m");
-List teams accessible to the current user. +List teams accessible to the current user. Set includeMembership=false to omit full member and manager lists and return cached membership summaries instead.
@@ -1054,9 +1050,7 @@ List teams accessible to the current user. ```typescript const pageableResponse = await client.teams.list({ limit: 10, - offset: 0, - role: "manager", - attributes: ["attributes"] + offset: 0 }); for await (const item of pageableResponse) { console.log(item); @@ -1065,9 +1059,7 @@ for await (const item of pageableResponse) { // Or you can manually iterate page-by-page let page = await client.teams.list({ limit: 10, - offset: 0, - role: "manager", - attributes: ["attributes"] + offset: 0 }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -1090,7 +1082,7 @@ const response = page.response;
-**request:** `TrueFoundry.TeamsListRequest` +**request:** `TrueFoundry.ListTeamsRequest`
@@ -1207,8 +1199,8 @@ List users who are members of a team. ```typescript const pageableResponse = await client.teams.listMembers("jqfwg345gi25n5ju2yz5iz6m", { - limit: 10, offset: 0, + limit: 10, filter: "{\"type\":\"AND\",\"children\":[{\"column\":\"email\",\"op\":\"STRING_CONTAINS\",\"value\":\"@example.com\"}]}" }); for await (const item of pageableResponse) { @@ -1217,8 +1209,8 @@ for await (const item of pageableResponse) { // Or you can manually iterate page-by-page let page = await client.teams.listMembers("jqfwg345gi25n5ju2yz5iz6m", { - limit: 10, offset: 0, + limit: 10, filter: "{\"type\":\"AND\",\"children\":[{\"column\":\"email\",\"op\":\"STRING_CONTAINS\",\"value\":\"@example.com\"}]}" }); while (page.hasNextPage()) { @@ -1250,7 +1242,7 @@ const response = page.response;
-**request:** `TrueFoundry.TeamsListMembersRequest` +**request:** `TrueFoundry.ListMembersTeamsRequest`
@@ -1298,8 +1290,8 @@ List users who hold the team-manager role on a team. ```typescript const pageableResponse = await client.teams.listManagers("jqfwg345gi25n5ju2yz5iz6m", { - limit: 10, offset: 0, + limit: 10, filter: "{\"type\":\"AND\",\"children\":[{\"column\":\"email\",\"op\":\"STRING_CONTAINS\",\"value\":\"@example.com\"}]}" }); for await (const item of pageableResponse) { @@ -1308,24 +1300,459 @@ for await (const item of pageableResponse) { // Or you can manually iterate page-by-page let page = await client.teams.listManagers("jqfwg345gi25n5ju2yz5iz6m", { - limit: 10, offset: 0, + limit: 10, filter: "{\"type\":\"AND\",\"children\":[{\"column\":\"email\",\"op\":\"STRING_CONTAINS\",\"value\":\"@example.com\"}]}" }); while (page.hasNextPage()) { page = page.getNextPage(); } -// You can also access the underlying response -const response = page.response; +// You can also access the underlying response +const response = page.response; + +``` + + + + + +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` — System-generated team ID. + +
+
+ +
+
+ +**request:** `TrueFoundry.ListManagersTeamsRequest` + +
+
+ +
+
+ +**requestOptions:** `TeamsClient.RequestOptions` + +
+
+
+
+ + + + + + +
client.teams.get(id) -> TrueFoundry.GetTeamResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get a single team by its ID. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.teams.get("jqfwg345gi25n5ju2yz5iz6m"); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` — System-generated team ID. + +
+
+ +
+
+ +**requestOptions:** `TeamsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.teams.delete(id) -> TrueFoundry.DeleteTeamResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Permanently delete the team with the given ID. This action is irreversible. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.teams.delete("jqfwg345gi25n5ju2yz5iz6m"); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` — System-generated team ID. + +
+
+ +
+
+ +**requestOptions:** `TeamsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.teams.getPermissions(id) -> TrueFoundry.GetTeamPermissionsResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get all role bindings associated with a team. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.teams.getPermissions("jqfwg345gi25n5ju2yz5iz6m"); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` — System-generated team ID. + +
+
+ +
+
+ +**requestOptions:** `TeamsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +## GatewayBudgets +
client.gatewayBudgets.list({ ...params }) -> TrueFoundry.ListBudgetsResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List the gateway budgets the caller can read within the tenant. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.gatewayBudgets.list(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `TrueFoundry.ListGatewayBudgetsRequest` + +
+
+ +
+
+ +**requestOptions:** `GatewayBudgetsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.gatewayBudgets.createOrUpdate({ ...params }) -> TrueFoundry.GatewayBudget +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates or updates a budget manifest for the tenant. Budgets are upserted by `manifest.name` (unique per tenant). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.gatewayBudgets.createOrUpdate({ + manifest: { + type: "tenant-budget-config", + name: "name", + limits: {}, + appliesTo: { + type: "aggregate" + }, + mode: "enforce" + } +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `TrueFoundry.CreateOrUpdateBudgetRequest` + +
+
+ +
+
+ +**requestOptions:** `GatewayBudgetsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.gatewayBudgets.getMyUsage() -> TrueFoundry.BudgetUsageResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns every per-user budget that currently applies to the caller, with current usage per period. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.gatewayBudgets.getMyUsage(); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**requestOptions:** `GatewayBudgetsClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.gatewayBudgets.simulate({ ...params }) -> TrueFoundry.BudgetUsageResponse +
+
-``` +#### 📝 Description + +
+
+ +
+
+ +Returns the budgets that would apply to a hypothetical user/team/model/metadata selection, with current usage.
-#### ⚙️ Parameters +#### 🔌 Usage
@@ -1333,15 +1760,24 @@ const response = page.response;
-**id:** `string` — System-generated team ID. - +```typescript +await client.gatewayBudgets.simulate(); + +```
+
+
+ +#### ⚙️ Parameters
-**request:** `TrueFoundry.TeamsListManagersRequest` +
+
+ +**request:** `TrueFoundry.SimulateBudgetRequest`
@@ -1349,7 +1785,7 @@ const response = page.response;
-**requestOptions:** `TeamsClient.RequestOptions` +**requestOptions:** `GatewayBudgetsClient.RequestOptions`
@@ -1361,7 +1797,7 @@ const response = page.response;
-
client.teams.get(id) -> TrueFoundry.GetTeamResponse +
client.gatewayBudgets.get(id) -> TrueFoundry.GatewayBudget
@@ -1373,7 +1809,7 @@ const response = page.response;
-Get a single team by its ID. +Returns a single budget by id.
@@ -1388,7 +1824,7 @@ Get a single team by its ID.
```typescript -await client.teams.get("jqfwg345gi25n5ju2yz5iz6m"); +await client.gatewayBudgets.get("id"); ```
@@ -1404,7 +1840,7 @@ await client.teams.get("jqfwg345gi25n5ju2yz5iz6m");
-**id:** `string` — System-generated team ID. +**id:** `string` — The budget id to retrieve or delete.
@@ -1412,7 +1848,7 @@ await client.teams.get("jqfwg345gi25n5ju2yz5iz6m");
-**requestOptions:** `TeamsClient.RequestOptions` +**requestOptions:** `GatewayBudgetsClient.RequestOptions`
@@ -1424,7 +1860,7 @@ await client.teams.get("jqfwg345gi25n5ju2yz5iz6m");
-
client.teams.delete(id) -> TrueFoundry.DeleteTeamResponse +
client.gatewayBudgets.delete(id) -> void
@@ -1436,7 +1872,7 @@ await client.teams.get("jqfwg345gi25n5ju2yz5iz6m");
-Permanently delete the team with the given ID. This action is irreversible. +Permanently deletes a budget manifest.
@@ -1451,7 +1887,7 @@ Permanently delete the team with the given ID. This action is irreversible.
```typescript -await client.teams.delete("jqfwg345gi25n5ju2yz5iz6m"); +await client.gatewayBudgets.delete("id"); ```
@@ -1467,7 +1903,7 @@ await client.teams.delete("jqfwg345gi25n5ju2yz5iz6m");
-**id:** `string` — System-generated team ID. +**id:** `string` — The budget id to retrieve or delete.
@@ -1475,7 +1911,7 @@ await client.teams.delete("jqfwg345gi25n5ju2yz5iz6m");
-**requestOptions:** `TeamsClient.RequestOptions` +**requestOptions:** `GatewayBudgetsClient.RequestOptions`
@@ -1487,7 +1923,7 @@ await client.teams.delete("jqfwg345gi25n5ju2yz5iz6m");
-
client.teams.getPermissions(id) -> TrueFoundry.GetTeamPermissionsResponse +
client.gatewayBudgets.getLeaderboard(id, { ...params }) -> TrueFoundry.BudgetUsageResponse
@@ -1499,7 +1935,7 @@ await client.teams.delete("jqfwg345gi25n5ju2yz5iz6m");
-Get all role bindings associated with a team. +Returns the top spenders for a budget in its applies_to dimension, for the configured period. Aggregate budgets return a single whole-budget entity (entity: null).
@@ -1514,7 +1950,9 @@ Get all role bindings associated with a team.
```typescript -await client.teams.getPermissions("jqfwg345gi25n5ju2yz5iz6m"); +await client.gatewayBudgets.getLeaderboard("id", { + limit: 50 +}); ```
@@ -1530,7 +1968,7 @@ await client.teams.getPermissions("jqfwg345gi25n5ju2yz5iz6m");
-**id:** `string` — System-generated team ID. +**id:** `string` — The budget id to retrieve or delete.
@@ -1538,7 +1976,15 @@ await client.teams.getPermissions("jqfwg345gi25n5ju2yz5iz6m");
-**requestOptions:** `TeamsClient.RequestOptions` +**request:** `TrueFoundry.GetLeaderboardGatewayBudgetsRequest` + +
+
+ +
+
+ +**requestOptions:** `GatewayBudgetsClient.RequestOptions`
@@ -1614,7 +2060,7 @@ const response = page.response;
-**request:** `TrueFoundry.PersonalAccessTokensListRequest` +**request:** `TrueFoundry.ListPersonalAccessTokensRequest`
@@ -1854,9 +2300,7 @@ Get an existing personal access token by name. If none exists, a new one is crea
```typescript -await client.personalAccessTokens.get("name", { - teamName: "teamName" -}); +await client.personalAccessTokens.get("name"); ```
@@ -1880,7 +2324,7 @@ await client.personalAccessTokens.get("name", {
-**request:** `TrueFoundry.PersonalAccessTokensGetRequest` +**request:** `TrueFoundry.GetPersonalAccessTokensRequest`
@@ -1932,8 +2376,6 @@ const pageableResponse = await client.virtualAccounts.list({ limit: 10, offset: 0, nameSearchQuery: "staging-bot", - ownedByTeams: ["ownedByTeams"], - isExpired: true, filter: "{\"type\":\"AND\",\"children\":[{\"column\":\"name\",\"op\":\"STRING_CONTAINS\",\"value\":\"bot\"}]}" }); for await (const item of pageableResponse) { @@ -1945,8 +2387,6 @@ let page = await client.virtualAccounts.list({ limit: 10, offset: 0, nameSearchQuery: "staging-bot", - ownedByTeams: ["ownedByTeams"], - isExpired: true, filter: "{\"type\":\"AND\",\"children\":[{\"column\":\"name\",\"op\":\"STRING_CONTAINS\",\"value\":\"bot\"}]}" }); while (page.hasNextPage()) { @@ -1970,7 +2410,7 @@ const response = page.response;
-**request:** `TrueFoundry.VirtualAccountsListRequest` +**request:** `TrueFoundry.ListVirtualAccountsRequest`
@@ -2489,8 +2929,7 @@ List clusters the caller can read. ```typescript const pageableResponse = await client.clusters.list({ limit: 10, - offset: 0, - attributes: ["attributes"] + offset: 0 }); for await (const item of pageableResponse) { console.log(item); @@ -2499,8 +2938,7 @@ for await (const item of pageableResponse) { // Or you can manually iterate page-by-page let page = await client.clusters.list({ limit: 10, - offset: 0, - attributes: ["attributes"] + offset: 0 }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -2523,7 +2961,7 @@ const response = page.response;
-**request:** `TrueFoundry.ClustersListRequest` +**request:** `TrueFoundry.ListClustersRequest`
@@ -2772,8 +3210,7 @@ List addons installed on the cluster. ```typescript await client.clusters.getAddons("id", { limit: 10, - offset: 0, - attributes: ["attributes"] + offset: 0 }); ``` @@ -2798,7 +3235,7 @@ await client.clusters.getAddons("id", {
-**request:** `TrueFoundry.ClustersGetAddonsRequest` +**request:** `TrueFoundry.GetAddonsClustersRequest`
@@ -2911,22 +3348,7 @@ List applications the caller can read. ```typescript const pageableResponse = await client.applications.list({ limit: 10, - offset: 0, - applicationId: "applicationId", - workspaceId: "workspaceId", - applicationName: "applicationName", - fqn: "fqn", - workspaceFqn: "workspaceFqn", - applicationType: "async-service", - nameSearchQuery: "nameSearchQuery", - environmentId: "environmentId", - clusterId: "clusterId", - applicationSetId: "applicationSetId", - paused: true, - deviceTypeFilter: "cpu", - lastDeployedBySubjects: "lastDeployedBySubjects", - lifecycleStage: "active", - isRecommendationPresentAndVisible: true + offset: 0 }); for await (const item of pageableResponse) { console.log(item); @@ -2935,22 +3357,7 @@ for await (const item of pageableResponse) { // Or you can manually iterate page-by-page let page = await client.applications.list({ limit: 10, - offset: 0, - applicationId: "applicationId", - workspaceId: "workspaceId", - applicationName: "applicationName", - fqn: "fqn", - workspaceFqn: "workspaceFqn", - applicationType: "async-service", - nameSearchQuery: "nameSearchQuery", - environmentId: "environmentId", - clusterId: "clusterId", - applicationSetId: "applicationSetId", - paused: true, - deviceTypeFilter: "cpu", - lastDeployedBySubjects: "lastDeployedBySubjects", - lifecycleStage: "active", - isRecommendationPresentAndVisible: true + offset: 0 }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -2973,7 +3380,7 @@ const response = page.response;
-**request:** `TrueFoundry.ApplicationsListRequest` +**request:** `TrueFoundry.ListApplicationsRequest`
@@ -3383,7 +3790,7 @@ await client.applications.scaleToOriginal("id");
-
client.applications.cancelDeployment(id, deploymentId) -> TrueFoundry.ApplicationsCancelDeploymentResponse +
client.applications.cancelDeployment(id, deploymentId) -> TrueFoundry.CancelDeploymentApplicationsResponse
@@ -3528,7 +3935,7 @@ const response = page.response;
-**request:** `TrueFoundry.ApplicationVersionsListRequest` +**request:** `TrueFoundry.ListApplicationVersionsRequest`
@@ -3649,13 +4056,7 @@ List Job Runs for provided Job Id. Filter the data based on parameters passed in ```typescript const pageableResponse = await client.jobs.listRuns("jobId", { limit: 10, - offset: 0, - searchPrefix: "searchPrefix", - sortBy: "startTime", - order: "asc", - triggeredBy: ["triggeredBy"], - status: ["CREATED"], - versionNumbers: [1.1] + offset: 0 }); for await (const item of pageableResponse) { console.log(item); @@ -3664,13 +4065,7 @@ for await (const item of pageableResponse) { // Or you can manually iterate page-by-page let page = await client.jobs.listRuns("jobId", { limit: 10, - offset: 0, - searchPrefix: "searchPrefix", - sortBy: "startTime", - order: "asc", - triggeredBy: ["triggeredBy"], - status: ["CREATED"], - versionNumbers: [1.1] + offset: 0 }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -3701,7 +4096,7 @@ const response = page.response;
-**request:** `TrueFoundry.JobsListRunsRequest` +**request:** `TrueFoundry.ListRunsJobsRequest`
@@ -3972,7 +4367,7 @@ await client.jobs.terminate({
-**request:** `TrueFoundry.JobsTerminateRequest` +**request:** `TrueFoundry.TerminateJobsRequest`
@@ -4023,11 +4418,7 @@ List workspaces the caller can read. const pageableResponse = await client.workspaces.list({ limit: 10, offset: 0, - clusterId: "jqfwg345gi25n5ju2yz5iz6m", - name: "name", - fqn: "fqn", - includeCluster: true, - attributes: ["attributes"] + clusterId: "jqfwg345gi25n5ju2yz5iz6m" }); for await (const item of pageableResponse) { console.log(item); @@ -4037,11 +4428,7 @@ for await (const item of pageableResponse) { let page = await client.workspaces.list({ limit: 10, offset: 0, - clusterId: "jqfwg345gi25n5ju2yz5iz6m", - name: "name", - fqn: "fqn", - includeCluster: true, - attributes: ["attributes"] + clusterId: "jqfwg345gi25n5ju2yz5iz6m" }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -4064,7 +4451,7 @@ const response = page.response;
-**request:** `TrueFoundry.WorkspacesListRequest` +**request:** `TrueFoundry.ListWorkspacesRequest`
@@ -4183,8 +4570,7 @@ Search workspaces using a structured filter expression. Return a paginated list const pageableResponse = await client.workspaces.search({ limit: 10, offset: 0, - filter: "[{\"type\":\"name\",\"operator\":\"STRING_CONTAINS\",\"value\":\"prod\"}]", - includeCluster: true + filter: "[{\"type\":\"name\",\"operator\":\"STRING_CONTAINS\",\"value\":\"prod\"}]" }); for await (const item of pageableResponse) { console.log(item); @@ -4194,8 +4580,7 @@ for await (const item of pageableResponse) { let page = await client.workspaces.search({ limit: 10, offset: 0, - filter: "[{\"type\":\"name\",\"operator\":\"STRING_CONTAINS\",\"value\":\"prod\"}]", - includeCluster: true + filter: "[{\"type\":\"name\",\"operator\":\"STRING_CONTAINS\",\"value\":\"prod\"}]" }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -4218,7 +4603,7 @@ const response = page.response;
-**request:** `TrueFoundry.WorkspacesSearchRequest` +**request:** `TrueFoundry.SearchWorkspacesRequest`
@@ -4426,7 +4811,7 @@ const response = page.response;
-**request:** `TrueFoundry.EnvironmentsListRequest` +**request:** `TrueFoundry.ListEnvironmentsRequest`
@@ -4809,9 +5194,7 @@ Delete the secret and all its versions permanently.
```typescript -await client.secrets.delete("id", { - forceDelete: true -}); +await client.secrets.delete("id"); ```
@@ -4835,7 +5218,7 @@ await client.secrets.delete("id", {
-**request:** `TrueFoundry.SecretsDeleteRequest` +**request:** `TrueFoundry.DeleteSecretsRequest`
@@ -4885,10 +5268,7 @@ List secret groups the caller has access to, along with associated secrets for e ```typescript const pageableResponse = await client.secretGroups.list({ limit: 10, - offset: 0, - fqn: "fqn", - search: "search", - attributes: ["attributes"] + offset: 0 }); for await (const item of pageableResponse) { console.log(item); @@ -4897,10 +5277,7 @@ for await (const item of pageableResponse) { // Or you can manually iterate page-by-page let page = await client.secretGroups.list({ limit: 10, - offset: 0, - fqn: "fqn", - search: "search", - attributes: ["attributes"] + offset: 0 }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -4923,7 +5300,7 @@ const response = page.response;
-**request:** `TrueFoundry.SecretGroupsListRequest` +**request:** `TrueFoundry.ListSecretGroupsRequest`
@@ -5251,9 +5628,7 @@ Delete the secret group and all its associated secrets and secret versions perma
```typescript -await client.secretGroups.delete("id", { - forceDelete: true -}); +await client.secretGroups.delete("id"); ```
@@ -5277,7 +5652,7 @@ await client.secretGroups.delete("id", {
-**request:** `TrueFoundry.SecretGroupsDeleteRequest` +**request:** `TrueFoundry.DeleteSecretGroupsRequest`
@@ -5325,14 +5700,7 @@ Get events for an application, filtered by pod names, job run, or time range.
```typescript -await client.events.get({ - startTs: "startTs", - endTs: "endTs", - applicationId: "applicationId", - applicationFqn: "applicationFqn", - podNames: ["podNames"], - jobRunName: "jobRunName" -}); +await client.events.get(); ```
@@ -5348,7 +5716,7 @@ await client.events.get({
-**request:** `TrueFoundry.EventsGetRequest` +**request:** `TrueFoundry.GetEventsRequest`
@@ -5396,13 +5764,7 @@ Get alerts for a given application or cluster filtered by start and end timestam
```typescript -await client.alerts.list({ - startTs: "startTs", - endTs: "endTs", - clusterId: "clusterId", - applicationId: "applicationId", - alertStatus: "firing" -}); +await client.alerts.list(); ```
@@ -5418,7 +5780,7 @@ await client.alerts.list({
-**request:** `TrueFoundry.AlertsListRequest` +**request:** `TrueFoundry.ListAlertsRequest`
@@ -5468,11 +5830,7 @@ List all Agents for a tenant. ```typescript const pageableResponse = await client.agents.list({ limit: 10, - offset: 0, - name: "name", - namePrefix: "namePrefix", - type: "remote-agent", - attributes: ["attributes"] + offset: 0 }); for await (const item of pageableResponse) { console.log(item); @@ -5481,11 +5839,7 @@ for await (const item of pageableResponse) { // Or you can manually iterate page-by-page let page = await client.agents.list({ limit: 10, - offset: 0, - name: "name", - namePrefix: "namePrefix", - type: "remote-agent", - attributes: ["attributes"] + offset: 0 }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -5508,7 +5862,7 @@ const response = page.response;
-**request:** `TrueFoundry.AgentsListRequest` +**request:** `TrueFoundry.ListAgentsRequest`
@@ -5726,6 +6080,69 @@ await client.agents.delete("jqfwg345gi25n5ju2yz5iz6m");
+ + +
+ +
client.agents.getToken(id) -> TrueFoundry.GetAgentIdentityTokenResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns the TrueFoundry-backed token for the agent's linked identity, generating one on demand if none exists yet (or the stored one has expired). Only valid for agents whose identity is TrueFoundry-backed. Requires manage access on the agent since the token authenticates as it. 404s if the agent has no linked identity. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.agents.getToken("jqfwg345gi25n5ju2yz5iz6m"); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `string` — System-generated agent ID. + +
+
+ +
+
+ +**requestOptions:** `AgentsClient.RequestOptions` + +
+
+
+
+ +
@@ -5760,8 +6177,7 @@ List Agent Versions for the provided agent id ```typescript const pageableResponse = await client.agentVersions.list({ limit: 10, - offset: 0, - id: "id" + offset: 0 }); for await (const item of pageableResponse) { console.log(item); @@ -5770,8 +6186,7 @@ for await (const item of pageableResponse) { // Or you can manually iterate page-by-page let page = await client.agentVersions.list({ limit: 10, - offset: 0, - id: "id" + offset: 0 }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -5794,7 +6209,7 @@ const response = page.response;
-**request:** `TrueFoundry.AgentVersionsListRequest` +**request:** `TrueFoundry.ListAgentVersionsRequest`
@@ -5970,11 +6385,7 @@ List prompts with optional filtering by FQN, ML Repo, or name. ```typescript const pageableResponse = await client.prompts.list({ limit: 10, - offset: 0, - fqn: "fqn", - mlRepoId: "ml_repo_id", - name: "name", - includeEmptyPrompts: true + offset: 0 }); for await (const item of pageableResponse) { console.log(item); @@ -5983,11 +6394,7 @@ for await (const item of pageableResponse) { // Or you can manually iterate page-by-page let page = await client.prompts.list({ limit: 10, - offset: 0, - fqn: "fqn", - mlRepoId: "ml_repo_id", - name: "name", - includeEmptyPrompts: true + offset: 0 }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -6010,7 +6417,7 @@ const response = page.response;
-**request:** `TrueFoundry.PromptsListRequest` +**request:** `TrueFoundry.ListPromptsRequest`
@@ -6134,13 +6541,7 @@ List prompt versions with optional filtering by tag, FQN, prompt ID, ML Repo, na ```typescript const pageableResponse = await client.promptVersions.list({ limit: 10, - offset: 0, - tag: "tag", - fqn: "fqn", - promptId: "prompt_id", - mlRepoId: "ml_repo_id", - name: "name", - version: 1 + offset: 0 }); for await (const item of pageableResponse) { console.log(item); @@ -6149,13 +6550,7 @@ for await (const item of pageableResponse) { // Or you can manually iterate page-by-page let page = await client.promptVersions.list({ limit: 10, - offset: 0, - tag: "tag", - fqn: "fqn", - promptId: "prompt_id", - mlRepoId: "ml_repo_id", - name: "name", - version: 1 + offset: 0 }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -6178,7 +6573,7 @@ const response = page.response;
-**request:** `TrueFoundry.PromptVersionsListRequest` +**request:** `TrueFoundry.ListPromptVersionsRequest`
@@ -6546,12 +6941,7 @@ List artifacts with optional filtering by FQN, ML Repo, name, or run ID. ```typescript const pageableResponse = await client.artifacts.list({ limit: 10, - offset: 0, - fqn: "fqn", - mlRepoId: "ml_repo_id", - name: "name", - runId: "run_id", - includeEmptyArtifacts: true + offset: 0 }); for await (const item of pageableResponse) { console.log(item); @@ -6560,12 +6950,7 @@ for await (const item of pageableResponse) { // Or you can manually iterate page-by-page let page = await client.artifacts.list({ limit: 10, - offset: 0, - fqn: "fqn", - mlRepoId: "ml_repo_id", - name: "name", - runId: "run_id", - includeEmptyArtifacts: true + offset: 0 }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -6588,7 +6973,7 @@ const response = page.response;
-**request:** `TrueFoundry.ArtifactsListRequest` +**request:** `TrueFoundry.ListArtifactsRequest`
@@ -6712,16 +7097,7 @@ List artifact versions with optional filtering by tag, FQN, artifact ID, ML Repo ```typescript const pageableResponse = await client.artifactVersions.list({ limit: 10, - offset: 0, - tag: "tag", - fqn: "fqn", - artifactId: "artifact_id", - mlRepoId: "ml_repo_id", - name: "name", - version: 1, - runIds: ["run_ids"], - runSteps: [1.1], - includeInternalMetadata: true + offset: 0 }); for await (const item of pageableResponse) { console.log(item); @@ -6730,16 +7106,7 @@ for await (const item of pageableResponse) { // Or you can manually iterate page-by-page let page = await client.artifactVersions.list({ limit: 10, - offset: 0, - tag: "tag", - fqn: "fqn", - artifactId: "artifact_id", - mlRepoId: "ml_repo_id", - name: "name", - version: 1, - runIds: ["run_ids"], - runSteps: [1.1], - includeInternalMetadata: true + offset: 0 }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -6762,7 +7129,7 @@ const response = page.response;
-**request:** `TrueFoundry.ArtifactVersionsListRequest` +**request:** `TrueFoundry.ListArtifactVersionsRequest`
@@ -7482,9 +7849,7 @@ List ML Repos with optional filtering by name. ```typescript const pageableResponse = await client.mlRepos.list({ limit: 10, - offset: 0, - name: "name", - attributes: ["attributes"] + offset: 0 }); for await (const item of pageableResponse) { console.log(item); @@ -7493,9 +7858,7 @@ for await (const item of pageableResponse) { // Or you can manually iterate page-by-page let page = await client.mlRepos.list({ limit: 10, - offset: 0, - name: "name", - attributes: ["attributes"] + offset: 0 }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -7518,7 +7881,7 @@ const response = page.response;
-**request:** `TrueFoundry.MlReposListRequest` +**request:** `TrueFoundry.ListMlReposRequest`
@@ -7641,10 +8004,7 @@ List data directories with optional filtering by FQN, ML Repo, or name. ```typescript const pageableResponse = await client.dataDirectories.list({ limit: 10, - offset: 0, - fqn: "fqn", - mlRepoId: "ml_repo_id", - name: "name" + offset: 0 }); for await (const item of pageableResponse) { console.log(item); @@ -7653,10 +8013,7 @@ for await (const item of pageableResponse) { // Or you can manually iterate page-by-page let page = await client.dataDirectories.list({ limit: 10, - offset: 0, - fqn: "fqn", - mlRepoId: "ml_repo_id", - name: "name" + offset: 0 }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -7679,7 +8036,7 @@ const response = page.response;
-**request:** `TrueFoundry.DataDirectoriesListRequest` +**request:** `TrueFoundry.ListDataDirectoriesRequest`
@@ -8143,9 +8500,7 @@ Delete a data directory, optionally including its contents.
```typescript -await client.dataDirectories.delete("id", { - deleteContents: true -}); +await client.dataDirectories.delete("id"); ```
@@ -8169,7 +8524,7 @@ await client.dataDirectories.delete("id", {
-**request:** `TrueFoundry.DataDirectoriesDeleteRequest` +**request:** `TrueFoundry.DeleteDataDirectoriesRequest`
@@ -8581,7 +8936,7 @@ await client.runs.getMetricHistory("id", {
-**request:** `TrueFoundry.RunsGetMetricHistoryRequest` +**request:** `TrueFoundry.GetMetricHistoryRunsRequest`
@@ -9195,12 +9550,7 @@ List models with optional filtering by FQN, ML Repo, name, or run ID. ```typescript const pageableResponse = await client.models.list({ limit: 10, - offset: 0, - fqn: "fqn", - mlRepoId: "ml_repo_id", - name: "name", - runId: "run_id", - includeEmptyModels: true + offset: 0 }); for await (const item of pageableResponse) { console.log(item); @@ -9209,12 +9559,7 @@ for await (const item of pageableResponse) { // Or you can manually iterate page-by-page let page = await client.models.list({ limit: 10, - offset: 0, - fqn: "fqn", - mlRepoId: "ml_repo_id", - name: "name", - runId: "run_id", - includeEmptyModels: true + offset: 0 }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -9237,7 +9582,7 @@ const response = page.response;
-**request:** `TrueFoundry.ModelsListRequest` +**request:** `TrueFoundry.ListModelsRequest`
@@ -9361,16 +9706,7 @@ List model versions with optional filtering by tag, FQN, model ID, ML Repo, name ```typescript const pageableResponse = await client.modelVersions.list({ limit: 10, - offset: 0, - tag: "tag", - fqn: "fqn", - modelId: "model_id", - mlRepoId: "ml_repo_id", - name: "name", - version: 1, - runIds: ["run_ids"], - runSteps: [1.1], - includeInternalMetadata: true + offset: 0 }); for await (const item of pageableResponse) { console.log(item); @@ -9379,16 +9715,7 @@ for await (const item of pageableResponse) { // Or you can manually iterate page-by-page let page = await client.modelVersions.list({ limit: 10, - offset: 0, - tag: "tag", - fqn: "fqn", - modelId: "model_id", - mlRepoId: "ml_repo_id", - name: "name", - version: 1, - runIds: ["run_ids"], - runSteps: [1.1], - includeInternalMetadata: true + offset: 0 }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -9411,7 +9738,7 @@ const response = page.response;
-**request:** `TrueFoundry.ModelVersionsListRequest` +**request:** `TrueFoundry.ListModelVersionsRequest`
@@ -9654,21 +9981,7 @@ Get runtime logs (stdout/stderr) emitted by the pods of a deployed application. await client.logs.get({ startTs: "1779262323000000000", endTs: "1779348723000000000", - limit: 1, - direction: "asc", - numLogsToIgnore: 1, - applicationId: "applicationId", - applicationFqn: "applicationFqn", - deploymentId: "deploymentId", - jobRunName: "jobRunName", - podName: "podName", - containerName: "containerName", - podNames: ["podNames"], - podNamesRegex: "podNamesRegex", - searchFilters: "[{\"string\":\"error\",\"type\":\"substring\",\"operator\":\"equal\"}]", - searchString: "searchString", - searchType: "regex", - searchOperator: "equal" + searchFilters: "[{\"string\":\"error\",\"type\":\"substring\",\"operator\":\"equal\"}]" }); ``` @@ -9685,7 +9998,7 @@ await client.logs.get({
-**request:** `TrueFoundry.LogsGetRequest` +**request:** `TrueFoundry.GetLogsRequest`
@@ -9861,11 +10174,7 @@ List agent skills with optional filtering by FQN, ML Repo, or name. ```typescript const pageableResponse = await client.agentSkills.list({ limit: 10, - offset: 0, - fqn: "fqn", - mlRepoId: "ml_repo_id", - name: "name", - includeEmptyAgentSkills: true + offset: 0 }); for await (const item of pageableResponse) { console.log(item); @@ -9874,11 +10183,7 @@ for await (const item of pageableResponse) { // Or you can manually iterate page-by-page let page = await client.agentSkills.list({ limit: 10, - offset: 0, - fqn: "fqn", - mlRepoId: "ml_repo_id", - name: "name", - includeEmptyAgentSkills: true + offset: 0 }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -9901,7 +10206,7 @@ const response = page.response;
-**request:** `TrueFoundry.AgentSkillsListRequest` +**request:** `TrueFoundry.ListAgentSkillsRequest`
@@ -10027,12 +10332,7 @@ List agent skill versions with optional filtering by FQN, agent skill ID, ML Rep ```typescript const pageableResponse = await client.agentSkillVersions.list({ limit: 10, - offset: 0, - fqn: "fqn", - agentSkillId: "agent_skill_id", - mlRepoId: "ml_repo_id", - name: "name", - version: 1 + offset: 0 }); for await (const item of pageableResponse) { console.log(item); @@ -10041,12 +10341,7 @@ for await (const item of pageableResponse) { // Or you can manually iterate page-by-page let page = await client.agentSkillVersions.list({ limit: 10, - offset: 0, - fqn: "fqn", - agentSkillId: "agent_skill_id", - mlRepoId: "ml_repo_id", - name: "name", - version: 1 + offset: 0 }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -10069,7 +10364,7 @@ const response = page.response;
-**request:** `TrueFoundry.AgentSkillVersionsListRequest` +**request:** `TrueFoundry.ListAgentSkillVersionsRequest`
@@ -10381,7 +10676,7 @@ await client.internal.aiGateway.getGatewayConfig("gateway-rate-limiting-config")
-**type:** `TrueFoundry.AiGatewayGetGatewayConfigRequestType` — The type of gateway configuration to retrieve or delete. +**type:** `TrueFoundry.GetGatewayConfigAiGatewayRequestType` — The type of gateway configuration to retrieve or delete.
@@ -10759,10 +11054,7 @@ Generate deployment endpoint based on the provided query parameters. await client.internal.deployments.getSuggestedEndpoint({ applicationType: "async-service", applicationName: "applicationName", - workspaceId: "workspaceId", - baseDomain: "baseDomain", - port: "port", - preferWildcard: true + workspaceId: "workspaceId" }); ``` @@ -10779,7 +11071,7 @@ await client.internal.deployments.getSuggestedEndpoint({
-**request:** `TrueFoundry.internal.DeploymentsGetSuggestedEndpointRequest` +**request:** `TrueFoundry.internal.GetSuggestedEndpointDeploymentsRequest`
@@ -10827,9 +11119,7 @@ Promote an application rollout for canary and blue-green.
```typescript -await client.internal.applications.promoteRollout("id", { - full: true -}); +await client.internal.applications.promoteRollout("id"); ```
@@ -10853,7 +11143,7 @@ await client.internal.applications.promoteRollout("id", {
-**request:** `TrueFoundry.internal.ApplicationsPromoteRolloutRequest` +**request:** `TrueFoundry.internal.PromoteRolloutApplicationsRequest`
@@ -10900,9 +11190,7 @@ Get the pod template hash to deployment version map for a specific application.
```typescript -await client.internal.applications.getPodTemplateHashToDeploymentVersion("id", { - podTemplateHashes: "podTemplateHashes" -}); +await client.internal.applications.getPodTemplateHashToDeploymentVersion("id"); ```
@@ -10926,7 +11214,7 @@ await client.internal.applications.getPodTemplateHashToDeploymentVersion("id", {
-**request:** `TrueFoundry.internal.ApplicationsGetPodTemplateHashToDeploymentVersionRequest` +**request:** `TrueFoundry.internal.GetPodTemplateHashToDeploymentVersionApplicationsRequest`
@@ -10976,8 +11264,6 @@ List metric charts available for an application. ```typescript await client.internal.metrics.getCharts("workspaceId", { applicationId: "applicationId", - startTs: "startTs", - endTs: "endTs", filterEntity: "application", filterQuery: "{\"pod\":\"my-app-abc123-xyz\"}" }); @@ -11004,7 +11290,7 @@ await client.internal.metrics.getCharts("workspaceId", {
-**request:** `TrueFoundry.internal.MetricsGetChartsRequest` +**request:** `TrueFoundry.internal.GetChartsMetricsRequest`
@@ -11157,18 +11443,7 @@ List artifact versions with internal metadata, optionally including model versio ```typescript const pageableResponse = await client.internal.artifactVersions.list({ limit: 10, - offset: 0, - tag: "tag", - fqn: "fqn", - artifactId: "artifact_id", - mlRepoId: "ml_repo_id", - name: "name", - version: 1, - runIds: ["run_ids"], - runSteps: [1.1], - includeInternalMetadata: true, - includeModelVersions: true, - artifactTypes: ["artifact_types"] + offset: 0 }); for await (const item of pageableResponse) { console.log(item); @@ -11177,18 +11452,7 @@ for await (const item of pageableResponse) { // Or you can manually iterate page-by-page let page = await client.internal.artifactVersions.list({ limit: 10, - offset: 0, - tag: "tag", - fqn: "fqn", - artifactId: "artifact_id", - mlRepoId: "ml_repo_id", - name: "name", - version: 1, - runIds: ["run_ids"], - runSteps: [1.1], - includeInternalMetadata: true, - includeModelVersions: true, - artifactTypes: ["artifact_types"] + offset: 0 }); while (page.hasNextPage()) { page = page.getNextPage(); @@ -11211,7 +11475,7 @@ const response = page.response;
-**request:** `TrueFoundry.internal.ArtifactVersionsListRequest` +**request:** `TrueFoundry.internal.ListArtifactVersionsRequest`
@@ -11326,10 +11590,7 @@ Get docker registry credentials for building and pushing an image.
```typescript -await client.internal.dockerRegistries.getCredentials({ - fqn: "fqn", - clusterId: "clusterId" -}); +await client.internal.dockerRegistries.getCredentials(); ```
@@ -11345,7 +11606,7 @@ await client.internal.dockerRegistries.getCredentials({
-**request:** `TrueFoundry.internal.DockerRegistriesGetCredentialsRequest` +**request:** `TrueFoundry.internal.GetCredentialsDockerRegistriesRequest`
@@ -11366,7 +11627,7 @@ await client.internal.dockerRegistries.getCredentials({
## Internal Workflows -
client.internal.workflows.executeWorkflow(applicationId, { ...params }) -> TrueFoundry.WorkflowsExecuteWorkflowResponse +
client.internal.workflows.executeWorkflow(applicationId, { ...params }) -> TrueFoundry.ExecuteWorkflowWorkflowsResponse
@@ -11468,10 +11729,7 @@ Get logs emitted by the image build and deploy pipeline for a specific build of await client.internal.buildLogs.get("pipelineRunName", { startTs: "1635467890123456789", endTs: "1635467891123456789", - limit: "limit", - direction: "direction", - filterQuery: "{\"matchString\":\"error\",\"type\":\"substring\",\"operator\":\"equal\"}", - numLogsToIgnore: 1.1 + filterQuery: "{\"matchString\":\"error\",\"type\":\"substring\",\"operator\":\"equal\"}" }); ``` @@ -11496,7 +11754,7 @@ await client.internal.buildLogs.get("pipelineRunName", {
-**request:** `TrueFoundry.internal.BuildLogsGetRequest` +**request:** `TrueFoundry.internal.GetBuildLogsRequest`
diff --git a/scripts/rename-to-esm-files.js b/scripts/rename-to-esm-files.js index dc1df1cb..0a03de13 100644 --- a/scripts/rename-to-esm-files.js +++ b/scripts/rename-to-esm-files.js @@ -1,6 +1,7 @@ #!/usr/bin/env node const fs = require("fs").promises; +const fsSync = require("fs"); const path = require("path"); const extensionMap = { @@ -44,8 +45,32 @@ async function updateFiles(files) { console.log(`Updated imports in ${updatedFiles.length} files.`); } +const KNOWN_EXTENSIONS = new Set([".js", ".mjs", ".cjs", ".jsx", ".json", ".ts", ".mts", ".cts", ".tsx", ".node"]); + +function hasFileExtension(importPath) { + const basename = path.basename(importPath); + const dotIndex = basename.lastIndexOf("."); + if (dotIndex <= 0) { + return false; + } + return KNOWN_EXTENSIONS.has(basename.slice(dotIndex).toLowerCase()); +} + +function resolveExtensionlessImport(dir, importPath) { + const resolvedPath = path.resolve(dir, importPath); + if (fsSync.existsSync(`${resolvedPath}.js`)) { + return `${importPath}.mjs`; + } + const indexPath = path.join(resolvedPath, "index.js"); + if (fsSync.existsSync(indexPath)) { + return `${importPath}/index.mjs`; + } + return null; +} + async function updateFileContents(file) { const content = await fs.readFile(file, "utf8"); + const dir = path.dirname(file); let newContent = content; // Update each extension type defined in the map @@ -62,6 +87,46 @@ async function updateFileContents(file) { newContent = newContent.replace(dynamicRegex, `$1("$2${newExt}")`); } + // Handle extensionless relative imports (e.g. from "./oauth" or from "../utils"). + // These violate the ESM spec and break Node's ESM loader and Turbopack. + const staticExtensionless = /(import|export)(.+from\s+['"])(\.\.?\/[^'"]+?)(['"])/g; + const staticReplacements = []; + let match; + while ((match = staticExtensionless.exec(newContent)) !== null) { + const importPath = match[3]; + if (hasFileExtension(importPath)) continue; + const resolved = resolveExtensionlessImport(dir, importPath); + if (resolved != null) { + staticReplacements.push({ + start: match.index, + end: match.index + match[0].length, + replacement: `${match[1]}${match[2]}${resolved}${match[4]}`, + }); + } + } + for (const { start, end, replacement } of staticReplacements.reverse()) { + newContent = newContent.slice(0, start) + replacement + newContent.slice(end); + } + + // Handle extensionless dynamic imports + const dynamicExtensionless = /(yield\s+import|await\s+import|import)\s*\(\s*['"](\.\.?\/[^'"]+?)['"]\s*\)/g; + const dynamicReplacements = []; + while ((match = dynamicExtensionless.exec(newContent)) !== null) { + const importPath = match[2]; + if (hasFileExtension(importPath)) continue; + const resolved = resolveExtensionlessImport(dir, importPath); + if (resolved != null) { + dynamicReplacements.push({ + start: match.index, + end: match.index + match[0].length, + replacement: `${match[1]}("${resolved}")`, + }); + } + } + for (const { start, end, replacement } of dynamicReplacements.reverse()) { + newContent = newContent.slice(0, start) + replacement + newContent.slice(end); + } + if (content !== newContent) { await fs.writeFile(file, newContent, "utf8"); return true; diff --git a/src/BaseClient.ts b/src/BaseClient.ts index 0eebfaa9..eb96d1a8 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -1,15 +1,14 @@ // This file was auto-generated by Fern from our API Definition. import { BearerAuthProvider } from "./auth/BearerAuthProvider.js"; -import * as core from "./core/index.js"; -import type { AuthProvider } from "./core/auth/index.js"; import { mergeHeaders } from "./core/headers.js"; +import * as core from "./core/index.js"; export type AuthOption = | false | core.AuthProvider["getAuthRequest"] | core.AuthProvider - | (BearerAuthProvider.AuthOptions); + | BearerAuthProvider.AuthOptions; export type BaseClientOptions = { environment: core.Supplier; @@ -41,6 +40,8 @@ export interface BaseRequestOptions { abortSignal?: AbortSignal; /** Additional query string parameters to include in the request. */ queryParams?: Record; + /** A dictionary containing additional parameters to spread into the request's body. */ + additionalBodyParameters?: Record; /** Additional headers to include in the request. */ headers?: Record | null | undefined>; /** Options for SSE stream reconnection behavior. Has no effect on non-resumable endpoints. */ @@ -50,18 +51,26 @@ export interface BaseRequestOptions { export type NormalizedClientOptions = T & { logging: core.logging.Logger; authProvider?: core.AuthProvider; -} +}; -export type NormalizedClientOptionsWithAuth = NormalizedClientOptions & { - authProvider: core.AuthProvider; -} +export type NormalizedClientOptionsWithAuth = + NormalizedClientOptions & { + authProvider: core.AuthProvider; + }; export function normalizeClientOptions( - options: T + options: T, ): NormalizedClientOptions { const headers = mergeHeaders( - { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "truefoundry-sdk", "X-Fern-SDK-Version": "0.0.0", "User-Agent": "truefoundry-sdk/0.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, - options?.headers + { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "truefoundry-sdk", + "X-Fern-SDK-Version": "0.0.0", + "User-Agent": "truefoundry-sdk/0.0.0", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + options?.headers, ); return { @@ -72,7 +81,7 @@ export function normalizeClientOptions( - options: T + options: T, ): NormalizedClientOptionsWithAuth { const normalized = normalizeClientOptions(options) as NormalizedClientOptionsWithAuth; @@ -98,10 +107,10 @@ export function normalizeClientOptionsWithAuth( - options: NormalizedClientOptions + options: NormalizedClientOptions, ): NormalizedClientOptionsWithAuth { return { ...options, - authProvider: new core.NoOpAuthProvider() + authProvider: new core.NoOpAuthProvider(), }; } diff --git a/src/Client.ts b/src/Client.ts index 9063e9fe..f1fb7a6c 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -1,9 +1,9 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "./api/index.js"; -import { AgentsClient } from "./api/resources/agents/client/Client.js"; +import type * as TrueFoundry from "./api/index.js"; import { AgentSkillsClient } from "./api/resources/agentSkills/client/Client.js"; import { AgentSkillVersionsClient } from "./api/resources/agentSkillVersions/client/Client.js"; +import { AgentsClient } from "./api/resources/agents/client/Client.js"; import { AgentVersionsClient } from "./api/resources/agentVersions/client/Client.js"; import { AlertsClient } from "./api/resources/alerts/client/Client.js"; import { ApplicationsClient } from "./api/resources/applications/client/Client.js"; @@ -14,6 +14,7 @@ import { ClustersClient } from "./api/resources/clusters/client/Client.js"; import { DataDirectoriesClient } from "./api/resources/dataDirectories/client/Client.js"; import { EnvironmentsClient } from "./api/resources/environments/client/Client.js"; import { EventsClient } from "./api/resources/events/client/Client.js"; +import { GatewayBudgetsClient } from "./api/resources/gatewayBudgets/client/Client.js"; import { InternalClient } from "./api/resources/internal/client/Client.js"; import { JobsClient } from "./api/resources/jobs/client/Client.js"; import { LogsClient } from "./api/resources/logs/client/Client.js"; @@ -32,9 +33,10 @@ import { UsersClient } from "./api/resources/users/client/Client.js"; import { VirtualAccountsClient } from "./api/resources/virtualAccounts/client/Client.js"; import { WorkspacesClient } from "./api/resources/workspaces/client/Client.js"; import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "./BaseClient.js"; -import * as core from "./core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "./BaseClient.js"; import { mergeHeaders } from "./core/headers.js"; +import * as core from "./core/index.js"; +import { mergeAdditionalBodyParameters } from "./core/requestBody.js"; import { handleNonStatusCodeError } from "./errors/handleNonStatusCodeError.js"; import * as errors from "./errors/index.js"; import * as serializers from "./serialization/index.js"; @@ -42,8 +44,7 @@ import * as serializers from "./serialization/index.js"; export declare namespace TrueFoundryClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class TrueFoundryClient { @@ -51,6 +52,7 @@ export class TrueFoundryClient { protected _internal: InternalClient | undefined; protected _users: UsersClient | undefined; protected _teams: TeamsClient | undefined; + protected _gatewayBudgets: GatewayBudgetsClient | undefined; protected _personalAccessTokens: PersonalAccessTokensClient | undefined; protected _virtualAccounts: VirtualAccountsClient | undefined; protected _clusters: ClustersClient | undefined; @@ -80,10 +82,7 @@ export class TrueFoundryClient { protected _traces: TracesClient | undefined; constructor(options: TrueFoundryClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } public get internal(): InternalClient { @@ -98,6 +97,10 @@ export class TrueFoundryClient { return (this._teams ??= new TeamsClient(this._options)); } + public get gatewayBudgets(): GatewayBudgetsClient { + return (this._gatewayBudgets ??= new GatewayBudgetsClient(this._options)); + } + public get personalAccessTokens(): PersonalAccessTokensClient { return (this._personalAccessTokens ??= new PersonalAccessTokensClient(this._options)); } @@ -212,6 +215,9 @@ export class TrueFoundryClient { * @param {TrueFoundry.TrueFoundryApplyRequest} request * @param {TrueFoundryClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.apply({ * manifest: { @@ -225,36 +231,67 @@ export class TrueFoundryClient { * } * }) */ - public apply(request: TrueFoundry.TrueFoundryApplyRequest, requestOptions?: TrueFoundryClient.RequestOptions): core.HttpResponsePromise { + public apply( + request: TrueFoundry.TrueFoundryApplyRequest, + requestOptions?: TrueFoundryClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__apply(request, requestOptions)); } - private async __apply(request: TrueFoundry.TrueFoundryApplyRequest, requestOptions?: TrueFoundryClient.RequestOptions): Promise> { + private async __apply( + request: TrueFoundry.TrueFoundryApplyRequest, + requestOptions?: TrueFoundryClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/apply"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/apply", + ), method: "PUT", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.TrueFoundryApplyRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.TrueFoundryApplyRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.TrueFoundryApplyResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.TrueFoundryApplyResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } @@ -267,6 +304,9 @@ export class TrueFoundryClient { * @param {TrueFoundry.TrueFoundryDeleteRequest} request * @param {TrueFoundryClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.delete({ * manifest: { @@ -280,36 +320,67 @@ export class TrueFoundryClient { * } * }) */ - public delete(request: TrueFoundry.TrueFoundryDeleteRequest, requestOptions?: TrueFoundryClient.RequestOptions): core.HttpResponsePromise { + public delete( + request: TrueFoundry.TrueFoundryDeleteRequest, + requestOptions?: TrueFoundryClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions)); } - private async __delete(request: TrueFoundry.TrueFoundryDeleteRequest, requestOptions?: TrueFoundryClient.RequestOptions): Promise> { + private async __delete( + request: TrueFoundry.TrueFoundryDeleteRequest, + requestOptions?: TrueFoundryClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/delete"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/delete", + ), method: "POST", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.TrueFoundryDeleteRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.TrueFoundryDeleteRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.TrueFoundryDeleteResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.TrueFoundryDeleteResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } @@ -326,16 +397,24 @@ export class TrueFoundryClient { * @param {core.PassthroughRequest.RequestOptions} requestOptions - Per-request overrides (timeout, retries, headers, abort signal). * @returns {Promise} A standard Response object. */ - public async fetch(input: Request | string | URL, init?: RequestInit, requestOptions?: core.PassthroughRequest.RequestOptions): Promise { - - return core.makePassthroughRequest(input, init, { - baseUrl: this._options.baseUrl ?? this._options.environment, - headers: this._options.headers, - timeoutInSeconds: this._options.timeoutInSeconds, - maxRetries: this._options.maxRetries, - fetch: this._options.fetch, - logging: this._options.logging, - getAuthHeaders: async () => (await this._options.authProvider.getAuthRequest()).headers, - }, requestOptions); + public async fetch( + input: Request | string | URL, + init?: RequestInit, + requestOptions?: core.PassthroughRequest.RequestOptions, + ): Promise { + return core.makePassthroughRequest( + input, + init, + { + baseUrl: this._options.baseUrl ?? this._options.environment, + headers: this._options.headers, + timeoutInSeconds: this._options.timeoutInSeconds, + maxRetries: this._options.maxRetries, + fetch: this._options.fetch, + logging: this._options.logging, + getAuthHeaders: async () => (await this._options.authProvider.getAuthRequest()).headers, + }, + requestOptions, + ); } } diff --git a/src/api/client/requests/TrueFoundryApplyRequest.ts b/src/api/client/requests/TrueFoundryApplyRequest.ts index a129ffb7..d055043a 100644 --- a/src/api/client/requests/TrueFoundryApplyRequest.ts +++ b/src/api/client/requests/TrueFoundryApplyRequest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../index.js"; +import type * as TrueFoundry from "../../index.js"; /** * @example @@ -20,5 +20,5 @@ export interface TrueFoundryApplyRequest { /** Manifest of the resource to be created or updated */ manifest: TrueFoundry.TrueFoundryApplyRequestManifest; /** Dry run the apply operation without actually applying */ - dryRun?: boolean; + dryRun?: boolean | null; } diff --git a/src/api/client/requests/TrueFoundryDeleteRequest.ts b/src/api/client/requests/TrueFoundryDeleteRequest.ts index e445f7b9..929350c4 100644 --- a/src/api/client/requests/TrueFoundryDeleteRequest.ts +++ b/src/api/client/requests/TrueFoundryDeleteRequest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../index.js"; +import type * as TrueFoundry from "../../index.js"; /** * @example diff --git a/src/api/errors/BadRequestError.ts b/src/api/errors/BadRequestError.ts index 999d5575..8ed981ac 100644 --- a/src/api/errors/BadRequestError.ts +++ b/src/api/errors/BadRequestError.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as core from "../../core/index.js"; +import type * as core from "../../core/index.js"; import * as errors from "../../errors/index.js"; export class BadRequestError extends errors.TrueFoundryError { @@ -9,7 +9,7 @@ export class BadRequestError extends errors.TrueFoundryError { message: "BadRequestError", statusCode: 400, body: body, - rawResponse: rawResponse + rawResponse: rawResponse, }); Object.setPrototypeOf(this, new.target.prototype); if (Error.captureStackTrace) { diff --git a/src/api/errors/ConflictError.ts b/src/api/errors/ConflictError.ts index 16af9569..f872e1cb 100644 --- a/src/api/errors/ConflictError.ts +++ b/src/api/errors/ConflictError.ts @@ -1,16 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as core from "../../core/index.js"; +import type * as core from "../../core/index.js"; import * as errors from "../../errors/index.js"; -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export class ConflictError extends errors.TrueFoundryError { + public declare readonly body: TrueFoundry.HttpError; + constructor(body: TrueFoundry.HttpError, rawResponse?: core.RawResponse) { super({ message: "ConflictError", statusCode: 409, body: body, - rawResponse: rawResponse + rawResponse: rawResponse, }); Object.setPrototypeOf(this, new.target.prototype); if (Error.captureStackTrace) { diff --git a/src/api/errors/ExpectationFailedError.ts b/src/api/errors/ExpectationFailedError.ts index 3d852795..4d6d546c 100644 --- a/src/api/errors/ExpectationFailedError.ts +++ b/src/api/errors/ExpectationFailedError.ts @@ -1,16 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as core from "../../core/index.js"; +import type * as core from "../../core/index.js"; import * as errors from "../../errors/index.js"; -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export class ExpectationFailedError extends errors.TrueFoundryError { + public declare readonly body: TrueFoundry.HttpError; + constructor(body: TrueFoundry.HttpError, rawResponse?: core.RawResponse) { super({ message: "ExpectationFailedError", statusCode: 417, body: body, - rawResponse: rawResponse + rawResponse: rawResponse, }); Object.setPrototypeOf(this, new.target.prototype); if (Error.captureStackTrace) { diff --git a/src/api/errors/FailedDependencyError.ts b/src/api/errors/FailedDependencyError.ts index bfc68dfd..87a81e33 100644 --- a/src/api/errors/FailedDependencyError.ts +++ b/src/api/errors/FailedDependencyError.ts @@ -1,16 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as core from "../../core/index.js"; +import type * as core from "../../core/index.js"; import * as errors from "../../errors/index.js"; -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export class FailedDependencyError extends errors.TrueFoundryError { + public declare readonly body: TrueFoundry.HttpError; + constructor(body: TrueFoundry.HttpError, rawResponse?: core.RawResponse) { super({ message: "FailedDependencyError", statusCode: 424, body: body, - rawResponse: rawResponse + rawResponse: rawResponse, }); Object.setPrototypeOf(this, new.target.prototype); if (Error.captureStackTrace) { diff --git a/src/api/errors/ForbiddenError.ts b/src/api/errors/ForbiddenError.ts index 10fef13b..7a7c9057 100644 --- a/src/api/errors/ForbiddenError.ts +++ b/src/api/errors/ForbiddenError.ts @@ -1,16 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as core from "../../core/index.js"; +import type * as core from "../../core/index.js"; import * as errors from "../../errors/index.js"; -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export class ForbiddenError extends errors.TrueFoundryError { + public declare readonly body: TrueFoundry.HttpError; + constructor(body: TrueFoundry.HttpError, rawResponse?: core.RawResponse) { super({ message: "ForbiddenError", statusCode: 403, body: body, - rawResponse: rawResponse + rawResponse: rawResponse, }); Object.setPrototypeOf(this, new.target.prototype); if (Error.captureStackTrace) { diff --git a/src/api/errors/InternalServerError.ts b/src/api/errors/InternalServerError.ts index 28db1f5e..49f8d445 100644 --- a/src/api/errors/InternalServerError.ts +++ b/src/api/errors/InternalServerError.ts @@ -1,16 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as core from "../../core/index.js"; +import type * as core from "../../core/index.js"; import * as errors from "../../errors/index.js"; -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export class InternalServerError extends errors.TrueFoundryError { + public declare readonly body: TrueFoundry.HttpError; + constructor(body: TrueFoundry.HttpError, rawResponse?: core.RawResponse) { super({ message: "InternalServerError", statusCode: 500, body: body, - rawResponse: rawResponse + rawResponse: rawResponse, }); Object.setPrototypeOf(this, new.target.prototype); if (Error.captureStackTrace) { diff --git a/src/api/errors/MethodNotAllowedError.ts b/src/api/errors/MethodNotAllowedError.ts index 34a30149..4a5b7f6f 100644 --- a/src/api/errors/MethodNotAllowedError.ts +++ b/src/api/errors/MethodNotAllowedError.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as core from "../../core/index.js"; +import type * as core from "../../core/index.js"; import * as errors from "../../errors/index.js"; export class MethodNotAllowedError extends errors.TrueFoundryError { @@ -9,7 +9,7 @@ export class MethodNotAllowedError extends errors.TrueFoundryError { message: "MethodNotAllowedError", statusCode: 405, body: body, - rawResponse: rawResponse + rawResponse: rawResponse, }); Object.setPrototypeOf(this, new.target.prototype); if (Error.captureStackTrace) { diff --git a/src/api/errors/NotFoundError.ts b/src/api/errors/NotFoundError.ts index 05d07d66..8895d114 100644 --- a/src/api/errors/NotFoundError.ts +++ b/src/api/errors/NotFoundError.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as core from "../../core/index.js"; +import type * as core from "../../core/index.js"; import * as errors from "../../errors/index.js"; export class NotFoundError extends errors.TrueFoundryError { @@ -9,7 +9,7 @@ export class NotFoundError extends errors.TrueFoundryError { message: "NotFoundError", statusCode: 404, body: body, - rawResponse: rawResponse + rawResponse: rawResponse, }); Object.setPrototypeOf(this, new.target.prototype); if (Error.captureStackTrace) { diff --git a/src/api/errors/NotImplementedError.ts b/src/api/errors/NotImplementedError.ts index bacfad89..07837eb5 100644 --- a/src/api/errors/NotImplementedError.ts +++ b/src/api/errors/NotImplementedError.ts @@ -1,16 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as core from "../../core/index.js"; +import type * as core from "../../core/index.js"; import * as errors from "../../errors/index.js"; -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export class NotImplementedError extends errors.TrueFoundryError { + public declare readonly body: TrueFoundry.HttpError; + constructor(body: TrueFoundry.HttpError, rawResponse?: core.RawResponse) { super({ message: "NotImplementedError", statusCode: 501, body: body, - rawResponse: rawResponse + rawResponse: rawResponse, }); Object.setPrototypeOf(this, new.target.prototype); if (Error.captureStackTrace) { diff --git a/src/api/errors/UnauthorizedError.ts b/src/api/errors/UnauthorizedError.ts index a161ae26..47d87e09 100644 --- a/src/api/errors/UnauthorizedError.ts +++ b/src/api/errors/UnauthorizedError.ts @@ -1,16 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as core from "../../core/index.js"; +import type * as core from "../../core/index.js"; import * as errors from "../../errors/index.js"; -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export class UnauthorizedError extends errors.TrueFoundryError { + public declare readonly body: TrueFoundry.HttpError; + constructor(body: TrueFoundry.HttpError, rawResponse?: core.RawResponse) { super({ message: "UnauthorizedError", statusCode: 401, body: body, - rawResponse: rawResponse + rawResponse: rawResponse, }); Object.setPrototypeOf(this, new.target.prototype); if (Error.captureStackTrace) { diff --git a/src/api/errors/UnprocessableEntityError.ts b/src/api/errors/UnprocessableEntityError.ts index 71394f65..d753fb42 100644 --- a/src/api/errors/UnprocessableEntityError.ts +++ b/src/api/errors/UnprocessableEntityError.ts @@ -1,16 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as core from "../../core/index.js"; +import type * as core from "../../core/index.js"; import * as errors from "../../errors/index.js"; -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export class UnprocessableEntityError extends errors.TrueFoundryError { + public declare readonly body: TrueFoundry.HttpError; + constructor(body: TrueFoundry.HttpError, rawResponse?: core.RawResponse) { super({ message: "UnprocessableEntityError", statusCode: 422, body: body, - rawResponse: rawResponse + rawResponse: rawResponse, }); Object.setPrototypeOf(this, new.target.prototype); if (Error.captureStackTrace) { diff --git a/src/api/resources/agentSkillVersions/client/Client.ts b/src/api/resources/agentSkillVersions/client/Client.ts index eb0376ad..5cfae452 100644 --- a/src/api/resources/agentSkillVersions/client/Client.ts +++ b/src/api/resources/agentSkillVersions/client/Client.ts @@ -1,9 +1,9 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; -import * as core from "../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; @@ -12,73 +12,114 @@ import * as TrueFoundry from "../../../index.js"; export declare namespace AgentSkillVersionsClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class AgentSkillVersionsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: AgentSkillVersionsClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** * List agent skill versions with optional filtering by FQN, agent skill ID, ML Repo, name, or version. * - * @param {TrueFoundry.AgentSkillVersionsListRequest} request + * @param {TrueFoundry.ListAgentSkillVersionsRequest} request * @param {AgentSkillVersionsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.agentSkillVersions.list({ * limit: 10, - * offset: 0, - * fqn: "fqn", - * agentSkillId: "agent_skill_id", - * mlRepoId: "ml_repo_id", - * name: "name", - * version: 1 + * offset: 0 * }) */ - public async list(request: TrueFoundry.AgentSkillVersionsListRequest = {}, requestOptions?: AgentSkillVersionsClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.AgentSkillVersionsListRequest): Promise> => { const { limit = 100, offset = 0, fqn, agentSkillId, mlRepoId, name, version } = request; const _queryParams: Record = { - limit, - offset, - fqn, - agent_skill_id: agentSkillId, - ml_repo_id: mlRepoId, - name, - version - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/agent-skill-versions"), - method: "GET", - headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.ListAgentSkillVersionsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/agent-skill-versions"); }); + public async list( + request: TrueFoundry.ListAgentSkillVersionsRequest = {}, + requestOptions?: AgentSkillVersionsClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.ListAgentSkillVersionsRequest, + ): Promise> => { + const { limit = 100, offset = 0, fqn, agentSkillId, mlRepoId, name, version } = request; + const _queryParams: Record = { + limit, + offset, + fqn, + agent_skill_id: agentSkillId, + ml_repo_id: mlRepoId, + name, + version, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/agent-skill-versions", + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ListAgentSkillVersionsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/agent-skill-versions", + ); + }, + ); let _offset = request?.offset != null ? request?.offset : 0; const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => (response?.data ?? []).length > 0 && (request?.limit == null || (response?.data ?? []).length >= request?.limit), - getItems: response => response?.data ?? [], - loadPage: response => { _offset += response?.data != null ? response.data.length : 1; return list(core.setObjectProperty(request, "offset", _offset)); } + hasNextPage: (response) => + (response?.data ?? []).length > 0 && + (request?.limit == null || (response?.data ?? []).length >= request?.limit), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + _offset += response?.data != null ? response.data.length : 1; + return list(core.setObjectProperty(request, "offset", _offset)); + }, }); } @@ -89,19 +130,35 @@ export class AgentSkillVersionsClient { * @param {AgentSkillVersionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.agentSkillVersions.get("agent_skill_version_id") */ - public get(agent_skill_version_id: string, requestOptions?: AgentSkillVersionsClient.RequestOptions): core.HttpResponsePromise { + public get( + agent_skill_version_id: string, + requestOptions?: AgentSkillVersionsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(agent_skill_version_id, requestOptions)); } - private async __get(agent_skill_version_id: string, requestOptions?: AgentSkillVersionsClient.RequestOptions): Promise> { + private async __get( + agent_skill_version_id: string, + requestOptions?: AgentSkillVersionsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/agent-skill-versions/${core.url.encodePathParam(agent_skill_version_id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/agent-skill-versions/${core.url.encodePathParam(agent_skill_version_id)}`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -109,24 +166,40 @@ export class AgentSkillVersionsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetAgentSkillVersionResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetAgentSkillVersionResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/agent-skill-versions/{agent_skill_version_id}"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/agent-skill-versions/{agent_skill_version_id}", + ); } /** @@ -136,19 +209,35 @@ export class AgentSkillVersionsClient { * @param {AgentSkillVersionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.agentSkillVersions.delete("agent_skill_version_id") */ - public delete(agent_skill_version_id: string, requestOptions?: AgentSkillVersionsClient.RequestOptions): core.HttpResponsePromise { + public delete( + agent_skill_version_id: string, + requestOptions?: AgentSkillVersionsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(agent_skill_version_id, requestOptions)); } - private async __delete(agent_skill_version_id: string, requestOptions?: AgentSkillVersionsClient.RequestOptions): Promise> { + private async __delete( + agent_skill_version_id: string, + requestOptions?: AgentSkillVersionsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/agent-skill-versions/${core.url.encodePathParam(agent_skill_version_id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/agent-skill-versions/${core.url.encodePathParam(agent_skill_version_id)}`, + ), method: "DELETE", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -156,23 +245,39 @@ export class AgentSkillVersionsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.EmptyResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.EmptyResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/api/svc/v1/agent-skill-versions/{agent_skill_version_id}"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/api/svc/v1/agent-skill-versions/{agent_skill_version_id}", + ); } } diff --git a/src/api/resources/agentSkillVersions/client/requests/AgentSkillVersionsListRequest.ts b/src/api/resources/agentSkillVersions/client/requests/ListAgentSkillVersionsRequest.ts similarity index 59% rename from src/api/resources/agentSkillVersions/client/requests/AgentSkillVersionsListRequest.ts rename to src/api/resources/agentSkillVersions/client/requests/ListAgentSkillVersionsRequest.ts index 2d8b9cbd..bac176f6 100644 --- a/src/api/resources/agentSkillVersions/client/requests/AgentSkillVersionsListRequest.ts +++ b/src/api/resources/agentSkillVersions/client/requests/ListAgentSkillVersionsRequest.ts @@ -4,27 +4,22 @@ * @example * { * limit: 10, - * offset: 0, - * fqn: "fqn", - * agentSkillId: "agent_skill_id", - * mlRepoId: "ml_repo_id", - * name: "name", - * version: 1 + * offset: 0 * } */ -export interface AgentSkillVersionsListRequest { +export interface ListAgentSkillVersionsRequest { /** Number of items per page */ - limit?: number; + limit?: number | null; /** Number of items to skip */ - offset?: number; + offset?: number | null; /** Fully Qualified Name uniquely identifying the agent skill version. */ - fqn?: string; + fqn?: string | null; /** Identifier of the agent skill whose versions are being listed. */ - agentSkillId?: string; + agentSkillId?: string | null; /** Identifier of the ML Repo to filter agent skill versions by. */ - mlRepoId?: string; + mlRepoId?: string | null; /** Name of the agent skill to filter versions by. */ - name?: string; + name?: string | null; /** Version number (positive integer) to filter by. */ - version?: number; + version?: number | null; } diff --git a/src/api/resources/agentSkillVersions/client/requests/index.ts b/src/api/resources/agentSkillVersions/client/requests/index.ts index 16123636..36fd70be 100644 --- a/src/api/resources/agentSkillVersions/client/requests/index.ts +++ b/src/api/resources/agentSkillVersions/client/requests/index.ts @@ -1 +1 @@ -export type { AgentSkillVersionsListRequest } from "./AgentSkillVersionsListRequest.js"; +export type { ListAgentSkillVersionsRequest } from "./ListAgentSkillVersionsRequest.js"; diff --git a/src/api/resources/agentSkills/client/Client.ts b/src/api/resources/agentSkills/client/Client.ts index 00d731f3..22a375a1 100644 --- a/src/api/resources/agentSkills/client/Client.ts +++ b/src/api/resources/agentSkills/client/Client.ts @@ -1,9 +1,10 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; -import * as core from "../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; @@ -12,18 +13,14 @@ import * as TrueFoundry from "../../../index.js"; export declare namespace AgentSkillsClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class AgentSkillsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: AgentSkillsClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** @@ -33,19 +30,35 @@ export class AgentSkillsClient { * @param {AgentSkillsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.agentSkills.get("agent_skill_id") */ - public get(agent_skill_id: string, requestOptions?: AgentSkillsClient.RequestOptions): core.HttpResponsePromise { + public get( + agent_skill_id: string, + requestOptions?: AgentSkillsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(agent_skill_id, requestOptions)); } - private async __get(agent_skill_id: string, requestOptions?: AgentSkillsClient.RequestOptions): Promise> { + private async __get( + agent_skill_id: string, + requestOptions?: AgentSkillsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/agent-skills/${core.url.encodePathParam(agent_skill_id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/agent-skills/${core.url.encodePathParam(agent_skill_id)}`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -53,24 +66,40 @@ export class AgentSkillsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetAgentSkillResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetAgentSkillResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/agent-skills/{agent_skill_id}"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/agent-skills/{agent_skill_id}", + ); } /** @@ -80,19 +109,35 @@ export class AgentSkillsClient { * @param {AgentSkillsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.agentSkills.delete("agent_skill_id") */ - public delete(agent_skill_id: string, requestOptions?: AgentSkillsClient.RequestOptions): core.HttpResponsePromise { + public delete( + agent_skill_id: string, + requestOptions?: AgentSkillsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(agent_skill_id, requestOptions)); } - private async __delete(agent_skill_id: string, requestOptions?: AgentSkillsClient.RequestOptions): Promise> { + private async __delete( + agent_skill_id: string, + requestOptions?: AgentSkillsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/agent-skills/${core.url.encodePathParam(agent_skill_id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/agent-skills/${core.url.encodePathParam(agent_skill_id)}`, + ), method: "DELETE", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -100,77 +145,139 @@ export class AgentSkillsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.EmptyResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.EmptyResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/api/svc/v1/agent-skills/{agent_skill_id}"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/api/svc/v1/agent-skills/{agent_skill_id}", + ); } /** * List agent skills with optional filtering by FQN, ML Repo, or name. * - * @param {TrueFoundry.AgentSkillsListRequest} request + * @param {TrueFoundry.ListAgentSkillsRequest} request * @param {AgentSkillsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.agentSkills.list({ * limit: 10, - * offset: 0, - * fqn: "fqn", - * mlRepoId: "ml_repo_id", - * name: "name", - * includeEmptyAgentSkills: true + * offset: 0 * }) */ - public async list(request: TrueFoundry.AgentSkillsListRequest = {}, requestOptions?: AgentSkillsClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.AgentSkillsListRequest): Promise> => { const { limit = 100, offset = 0, fqn, mlRepoId, name, includeEmptyAgentSkills = true } = request; const _queryParams: Record = { - limit, - offset, - fqn, - ml_repo_id: mlRepoId, - name, - include_empty_agent_skills: includeEmptyAgentSkills - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/agent-skills"), - method: "GET", - headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.ListAgentSkillsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/agent-skills"); }); + public async list( + request: TrueFoundry.ListAgentSkillsRequest = {}, + requestOptions?: AgentSkillsClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.ListAgentSkillsRequest, + ): Promise> => { + const { limit = 100, offset = 0, fqn, mlRepoId, name, includeEmptyAgentSkills = true } = request; + const _queryParams: Record = { + limit, + offset, + fqn, + ml_repo_id: mlRepoId, + name, + include_empty_agent_skills: includeEmptyAgentSkills, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/agent-skills", + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ListAgentSkillsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/agent-skills", + ); + }, + ); let _offset = request?.offset != null ? request?.offset : 0; const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => (response?.data ?? []).length > 0 && (request?.limit == null || (response?.data ?? []).length >= request?.limit), - getItems: response => response?.data ?? [], - loadPage: response => { _offset += response?.data != null ? response.data.length : 1; return list(core.setObjectProperty(request, "offset", _offset)); } + hasNextPage: (response) => + (response?.data ?? []).length > 0 && + (request?.limit == null || (response?.data ?? []).length >= request?.limit), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + _offset += response?.data != null ? response.data.length : 1; + return list(core.setObjectProperty(request, "offset", _offset)); + }, }); } @@ -180,6 +287,9 @@ export class AgentSkillsClient { * @param {TrueFoundry.ApplyAgentSkillRequest} request * @param {AgentSkillsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.agentSkills.createOrUpdate({ * manifest: { @@ -196,39 +306,75 @@ export class AgentSkillsClient { * } * }) */ - public createOrUpdate(request: TrueFoundry.ApplyAgentSkillRequest, requestOptions?: AgentSkillsClient.RequestOptions): core.HttpResponsePromise { + public createOrUpdate( + request: TrueFoundry.ApplyAgentSkillRequest, + requestOptions?: AgentSkillsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__createOrUpdate(request, requestOptions)); } - private async __createOrUpdate(request: TrueFoundry.ApplyAgentSkillRequest, requestOptions?: AgentSkillsClient.RequestOptions): Promise> { + private async __createOrUpdate( + request: TrueFoundry.ApplyAgentSkillRequest, + requestOptions?: AgentSkillsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/agent-skill-versions"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/agent-skill-versions", + ), method: "PUT", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.ApplyAgentSkillRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.ApplyAgentSkillRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetAgentSkillVersionResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetAgentSkillVersionResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/api/svc/v1/agent-skill-versions"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PUT", + "/api/svc/v1/agent-skill-versions", + ); } } diff --git a/src/api/resources/agentSkills/client/requests/ApplyAgentSkillRequest.ts b/src/api/resources/agentSkills/client/requests/ApplyAgentSkillRequest.ts index bf37e3ff..15df1c73 100644 --- a/src/api/resources/agentSkills/client/requests/ApplyAgentSkillRequest.ts +++ b/src/api/resources/agentSkills/client/requests/ApplyAgentSkillRequest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../index.js"; +import type * as TrueFoundry from "../../../../index.js"; /** * @example diff --git a/src/api/resources/agentSkills/client/requests/AgentSkillsListRequest.ts b/src/api/resources/agentSkills/client/requests/ListAgentSkillsRequest.ts similarity index 57% rename from src/api/resources/agentSkills/client/requests/AgentSkillsListRequest.ts rename to src/api/resources/agentSkills/client/requests/ListAgentSkillsRequest.ts index 013ba2f8..720f6e89 100644 --- a/src/api/resources/agentSkills/client/requests/AgentSkillsListRequest.ts +++ b/src/api/resources/agentSkills/client/requests/ListAgentSkillsRequest.ts @@ -4,24 +4,20 @@ * @example * { * limit: 10, - * offset: 0, - * fqn: "fqn", - * mlRepoId: "ml_repo_id", - * name: "name", - * includeEmptyAgentSkills: true + * offset: 0 * } */ -export interface AgentSkillsListRequest { +export interface ListAgentSkillsRequest { /** Number of items per page */ - limit?: number; + limit?: number | null; /** Number of items to skip */ - offset?: number; + offset?: number | null; /** Fully Qualified Name uniquely identifying the agent skill. */ - fqn?: string; + fqn?: string | null; /** Identifier of the ML Repo to filter agent skills by. */ - mlRepoId?: string; + mlRepoId?: string | null; /** Name of the agent skill to filter by. */ - name?: string; + name?: string | null; /** Whether to include agent skills that have no versions. */ - includeEmptyAgentSkills?: boolean; + includeEmptyAgentSkills?: boolean | null; } diff --git a/src/api/resources/agentSkills/client/requests/index.ts b/src/api/resources/agentSkills/client/requests/index.ts index b43f146a..b57c8645 100644 --- a/src/api/resources/agentSkills/client/requests/index.ts +++ b/src/api/resources/agentSkills/client/requests/index.ts @@ -1,2 +1,2 @@ -export type { AgentSkillsListRequest } from "./AgentSkillsListRequest.js"; export type { ApplyAgentSkillRequest } from "./ApplyAgentSkillRequest.js"; +export type { ListAgentSkillsRequest } from "./ListAgentSkillsRequest.js"; diff --git a/src/api/resources/agentVersions/client/Client.ts b/src/api/resources/agentVersions/client/Client.ts index 5011ecc1..3e119322 100644 --- a/src/api/resources/agentVersions/client/Client.ts +++ b/src/api/resources/agentVersions/client/Client.ts @@ -1,76 +1,121 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; -import * as core from "../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; -import * as TrueFoundry from "../../../index.js"; +import type * as TrueFoundry from "../../../index.js"; export declare namespace AgentVersionsClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class AgentVersionsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: AgentVersionsClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** * List Agent Versions for the provided agent id * - * @param {TrueFoundry.AgentVersionsListRequest} request + * @param {TrueFoundry.ListAgentVersionsRequest} request * @param {AgentVersionsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.agentVersions.list({ * limit: 10, - * offset: 0, - * id: "id" + * offset: 0 * }) */ - public async list(request: TrueFoundry.AgentVersionsListRequest = {}, requestOptions?: AgentVersionsClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.AgentVersionsListRequest): Promise> => { const { limit = 100, offset = 0, id } = request; const _queryParams: Record = { - limit, - offset, - id - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/agent-versions"), - method: "GET", - headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.ListAgentVersionsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/agent-versions"); }); + public async list( + request: TrueFoundry.ListAgentVersionsRequest = {}, + requestOptions?: AgentVersionsClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.ListAgentVersionsRequest, + ): Promise> => { + const { limit = 100, offset = 0, id } = request; + const _queryParams: Record = { + limit, + offset, + id, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/agent-versions", + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ListAgentVersionsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/agent-versions", + ); + }, + ); let _offset = request?.offset != null ? request?.offset : 0; const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => (response?.data ?? []).length > 0 && (request?.limit == null || (response?.data ?? []).length >= request?.limit), - getItems: response => response?.data ?? [], - loadPage: response => { _offset += response?.data != null ? response.data.length : 1; return list(core.setObjectProperty(request, "offset", _offset)); } + hasNextPage: (response) => + (response?.data ?? []).length > 0 && + (request?.limit == null || (response?.data ?? []).length >= request?.limit), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + _offset += response?.data != null ? response.data.length : 1; + return list(core.setObjectProperty(request, "offset", _offset)); + }, }); } } diff --git a/src/api/resources/agentVersions/client/requests/AgentVersionsListRequest.ts b/src/api/resources/agentVersions/client/requests/ListAgentVersionsRequest.ts similarity index 60% rename from src/api/resources/agentVersions/client/requests/AgentVersionsListRequest.ts rename to src/api/resources/agentVersions/client/requests/ListAgentVersionsRequest.ts index 027498f5..ddd7e989 100644 --- a/src/api/resources/agentVersions/client/requests/AgentVersionsListRequest.ts +++ b/src/api/resources/agentVersions/client/requests/ListAgentVersionsRequest.ts @@ -4,15 +4,14 @@ * @example * { * limit: 10, - * offset: 0, - * id: "id" + * offset: 0 * } */ -export interface AgentVersionsListRequest { +export interface ListAgentVersionsRequest { /** Number of items per page */ - limit?: number; + limit?: number | null; /** Number of items to skip */ - offset?: number; + offset?: number | null; /** Agent Id */ - id?: string; + id?: string | null; } diff --git a/src/api/resources/agentVersions/client/requests/index.ts b/src/api/resources/agentVersions/client/requests/index.ts index 434dc607..f8e9b868 100644 --- a/src/api/resources/agentVersions/client/requests/index.ts +++ b/src/api/resources/agentVersions/client/requests/index.ts @@ -1 +1 @@ -export type { AgentVersionsListRequest } from "./AgentVersionsListRequest.js"; +export type { ListAgentVersionsRequest } from "./ListAgentVersionsRequest.js"; diff --git a/src/api/resources/agents/client/Client.ts b/src/api/resources/agents/client/Client.ts index 5ddd65fc..b9f591b8 100644 --- a/src/api/resources/agents/client/Client.ts +++ b/src/api/resources/agents/client/Client.ts @@ -1,9 +1,11 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; -import * as core from "../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import { toJson } from "../../../../core/json.js"; +import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; @@ -12,76 +14,131 @@ import * as TrueFoundry from "../../../index.js"; export declare namespace AgentsClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class AgentsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: AgentsClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** * List all Agents for a tenant. * - * @param {TrueFoundry.AgentsListRequest} request + * @param {TrueFoundry.ListAgentsRequest} request * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.UnauthorizedError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.agents.list({ * limit: 10, - * offset: 0, - * name: "name", - * namePrefix: "namePrefix", - * type: "remote-agent", - * attributes: ["attributes"] + * offset: 0 * }) */ - public async list(request: TrueFoundry.AgentsListRequest = {}, requestOptions?: AgentsClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.AgentsListRequest): Promise> => { const { limit = 100, offset = 0, name, namePrefix, "type": type_, attributes } = request; const _queryParams: Record = { - limit, - offset, - name, - namePrefix, - type: type_ != null ? serializers.AgentsListRequestType.jsonOrThrow(type_, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }) : undefined, - attributes - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/agents"), - method: "GET", - headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.ListAgentsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: throw new TrueFoundry.UnauthorizedError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse + public async list( + request: TrueFoundry.ListAgentsRequest = {}, + requestOptions?: AgentsClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.ListAgentsRequest, + ): Promise> => { + const { limit = 100, offset = 0, name, namePrefix, type: type_, attributes } = request; + const _queryParams: Record = { + limit, + offset, + name, + namePrefix, + type: + type_ !== undefined + ? serializers.ListAgentsRequestType.jsonOrThrow(type_, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }) + : undefined, + attributes: attributes !== undefined ? toJson(attributes) : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/agents", + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, }); - } - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/agents"); }); + if (_response.ok) { + return { + data: serializers.ListAgentsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new TrueFoundry.UnauthorizedError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/agents"); + }, + ); let _offset = request?.offset != null ? request?.offset : 0; const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => (response?.data ?? []).length > 0 && (request?.limit == null || (response?.data ?? []).length >= request?.limit), - getItems: response => response?.data ?? [], - loadPage: response => { _offset += response?.data != null ? response.data.length : 1; return list(core.setObjectProperty(request, "offset", _offset)); } + hasNextPage: (response) => + (response?.data ?? []).length > 0 && + (request?.limit == null || (response?.data ?? []).length >= request?.limit), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + _offset += response?.data != null ? response.data.length : 1; + return list(core.setObjectProperty(request, "offset", _offset)); + }, }); } @@ -96,6 +153,8 @@ export class AgentsClient { * @throws {@link TrueFoundry.ForbiddenError} * @throws {@link TrueFoundry.NotFoundError} * @throws {@link TrueFoundry.InternalServerError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.agents.createOrUpdate({ @@ -113,43 +172,107 @@ export class AgentsClient { * } * }) */ - public createOrUpdate(request: TrueFoundry.CreateOrUpdateAgentRequest, requestOptions?: AgentsClient.RequestOptions): core.HttpResponsePromise { + public createOrUpdate( + request: TrueFoundry.CreateOrUpdateAgentRequest, + requestOptions?: AgentsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__createOrUpdate(request, requestOptions)); } - private async __createOrUpdate(request: TrueFoundry.CreateOrUpdateAgentRequest, requestOptions?: AgentsClient.RequestOptions): Promise> { + private async __createOrUpdate( + request: TrueFoundry.CreateOrUpdateAgentRequest, + requestOptions?: AgentsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/agents"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/agents", + ), method: "PUT", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.CreateOrUpdateAgentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.CreateOrUpdateAgentRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetAgentVersionResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetAgentVersionResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 400: throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); - case 401: throw new TrueFoundry.UnauthorizedError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - case 500: throw new TrueFoundry.InternalServerError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 400: + throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new TrueFoundry.UnauthorizedError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + case 500: + throw new TrueFoundry.InternalServerError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -164,19 +287,35 @@ export class AgentsClient { * * @throws {@link TrueFoundry.UnauthorizedError} * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.agents.get("jqfwg345gi25n5ju2yz5iz6m") */ - public get(id: string, requestOptions?: AgentsClient.RequestOptions): core.HttpResponsePromise { + public get( + id: string, + requestOptions?: AgentsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions)); } - private async __get(id: string, requestOptions?: AgentsClient.RequestOptions): Promise> { + private async __get( + id: string, + requestOptions?: AgentsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/agents/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/agents/${core.url.encodePathParam(id)}`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -184,21 +323,42 @@ export class AgentsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetAgentResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetAgentResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 401: throw new TrueFoundry.UnauthorizedError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 401: + throw new TrueFoundry.UnauthorizedError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -215,6 +375,8 @@ export class AgentsClient { * @throws {@link TrueFoundry.ForbiddenError} * @throws {@link TrueFoundry.NotFoundError} * @throws {@link TrueFoundry.InternalServerError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.agents.delete("jqfwg345gi25n5ju2yz5iz6m") @@ -223,11 +385,22 @@ export class AgentsClient { return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions)); } - private async __delete(id: string, requestOptions?: AgentsClient.RequestOptions): Promise> { + private async __delete( + id: string, + requestOptions?: AgentsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/agents/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/agents/${core.url.encodePathParam(id)}`, + ), method: "DELETE", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -235,7 +408,7 @@ export class AgentsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { return { data: undefined, rawResponse: _response.rawResponse }; @@ -243,18 +416,160 @@ export class AgentsClient { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 401: throw new TrueFoundry.UnauthorizedError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - case 500: throw new TrueFoundry.InternalServerError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 401: + throw new TrueFoundry.UnauthorizedError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + case 500: + throw new TrueFoundry.InternalServerError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/api/svc/v1/agents/{id}"); } + + /** + * Returns the TrueFoundry-backed token for the agent's linked identity, generating one on demand if none exists yet (or the stored one has expired). Only valid for agents whose identity is TrueFoundry-backed. Requires manage access on the agent since the token authenticates as it. 404s if the agent has no linked identity. + * + * @param {string} id - System-generated agent ID. + * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link TrueFoundry.UnauthorizedError} + * @throws {@link TrueFoundry.ForbiddenError} + * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link TrueFoundry.UnprocessableEntityError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * + * @example + * await client.agents.getToken("jqfwg345gi25n5ju2yz5iz6m") + */ + public getToken( + id: string, + requestOptions?: AgentsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getToken(id, requestOptions)); + } + + private async __getToken( + id: string, + requestOptions?: AgentsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/agents/${core.url.encodePathParam(id)}/token`, + ), + method: "GET", + headers: _headers, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.GetAgentIdentityTokenResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new TrueFoundry.UnauthorizedError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + case 422: + throw new TrueFoundry.UnprocessableEntityError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/agents/{id}/token"); + } } diff --git a/src/api/resources/agents/client/requests/CreateOrUpdateAgentRequest.ts b/src/api/resources/agents/client/requests/CreateOrUpdateAgentRequest.ts index c4eedc0e..e815c611 100644 --- a/src/api/resources/agents/client/requests/CreateOrUpdateAgentRequest.ts +++ b/src/api/resources/agents/client/requests/CreateOrUpdateAgentRequest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../index.js"; +import type * as TrueFoundry from "../../../../index.js"; /** * @example @@ -23,5 +23,5 @@ export interface CreateOrUpdateAgentRequest { /** Agent Manifest */ manifest: TrueFoundry.AgentManifest; /** Validate the manifest and collaborators without persisting or syncing to the gateway store */ - dryRun?: boolean; + dryRun?: boolean | null; } diff --git a/src/api/resources/agents/client/requests/AgentsListRequest.ts b/src/api/resources/agents/client/requests/ListAgentsRequest.ts similarity index 64% rename from src/api/resources/agents/client/requests/AgentsListRequest.ts rename to src/api/resources/agents/client/requests/ListAgentsRequest.ts index 964f6a53..f6ec1e6f 100644 --- a/src/api/resources/agents/client/requests/AgentsListRequest.ts +++ b/src/api/resources/agents/client/requests/ListAgentsRequest.ts @@ -1,29 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../index.js"; +import type * as TrueFoundry from "../../../../index.js"; /** * @example * { * limit: 10, - * offset: 0, - * name: "name", - * namePrefix: "namePrefix", - * type: "remote-agent", - * attributes: ["attributes"] + * offset: 0 * } */ -export interface AgentsListRequest { +export interface ListAgentsRequest { /** Number of items per page */ - limit?: number; + limit?: number | null; /** Number of items to skip */ - offset?: number; + offset?: number | null; /** Agent Name */ - name?: string; + name?: string | null; /** When set, only agents whose name starts with this string (case-sensitive). Ignored when `name` is also provided. */ - namePrefix?: string; + namePrefix?: string | null; /** Filter by latest manifest discriminator (`remote-agent`, `truefoundry-agent`, or `agent`). NOTE: `agent` is a legacy type and will be removed in the future. */ - type?: TrueFoundry.AgentsListRequestType; + type?: TrueFoundry.ListAgentsRequestType | null; /** Comma-separated list of attributes to return (e.g. id,name). When provided, only the specified fields are fetched. `id` is always included. */ - attributes?: string | string[]; + attributes?: string[] | null; } diff --git a/src/api/resources/agents/client/requests/index.ts b/src/api/resources/agents/client/requests/index.ts index 6f0e31a0..97d7b333 100644 --- a/src/api/resources/agents/client/requests/index.ts +++ b/src/api/resources/agents/client/requests/index.ts @@ -1,2 +1,2 @@ -export type { AgentsListRequest } from "./AgentsListRequest.js"; export type { CreateOrUpdateAgentRequest } from "./CreateOrUpdateAgentRequest.js"; +export type { ListAgentsRequest } from "./ListAgentsRequest.js"; diff --git a/src/api/resources/agents/types/AgentsListRequestType.ts b/src/api/resources/agents/types/AgentsListRequestType.ts deleted file mode 100644 index 12f69458..00000000 --- a/src/api/resources/agents/types/AgentsListRequestType.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const AgentsListRequestType = { - RemoteAgent: "remote-agent", - TruefoundryAgent: "truefoundry-agent", - Agent: "agent" - } as const; -export type AgentsListRequestType = typeof AgentsListRequestType[keyof typeof AgentsListRequestType]; diff --git a/src/api/resources/agents/types/ListAgentsRequestType.ts b/src/api/resources/agents/types/ListAgentsRequestType.ts new file mode 100644 index 00000000..c53de885 --- /dev/null +++ b/src/api/resources/agents/types/ListAgentsRequestType.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const ListAgentsRequestType = { + RemoteAgent: "remote-agent", + TruefoundryAgent: "truefoundry-agent", + Agent: "agent", +} as const; +export type ListAgentsRequestType = (typeof ListAgentsRequestType)[keyof typeof ListAgentsRequestType]; diff --git a/src/api/resources/agents/types/index.ts b/src/api/resources/agents/types/index.ts index f9cb644c..51e547e5 100644 --- a/src/api/resources/agents/types/index.ts +++ b/src/api/resources/agents/types/index.ts @@ -1 +1 @@ -export * from "./AgentsListRequestType.js"; +export * from "./ListAgentsRequestType.js"; diff --git a/src/api/resources/alerts/client/Client.ts b/src/api/resources/alerts/client/Client.ts index 8f12a56f..17f05a3e 100644 --- a/src/api/resources/alerts/client/Client.ts +++ b/src/api/resources/alerts/client/Client.ts @@ -1,9 +1,9 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; -import * as core from "../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; @@ -12,77 +12,116 @@ import * as TrueFoundry from "../../../index.js"; export declare namespace AlertsClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class AlertsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: AlertsClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** * Get alerts for a given application or cluster filtered by start and end timestamp * - * @param {TrueFoundry.AlertsListRequest} request + * @param {TrueFoundry.ListAlertsRequest} request * @param {AlertsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.BadRequestError} * @throws {@link TrueFoundry.ForbiddenError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example - * await client.alerts.list({ - * startTs: "startTs", - * endTs: "endTs", - * clusterId: "clusterId", - * applicationId: "applicationId", - * alertStatus: "firing" - * }) + * await client.alerts.list() */ - public list(request: TrueFoundry.AlertsListRequest = {}, requestOptions?: AlertsClient.RequestOptions): core.HttpResponsePromise { + public list( + request: TrueFoundry.ListAlertsRequest = {}, + requestOptions?: AlertsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); } - private async __list(request: TrueFoundry.AlertsListRequest = {}, requestOptions?: AlertsClient.RequestOptions): Promise> { + private async __list( + request: TrueFoundry.ListAlertsRequest = {}, + requestOptions?: AlertsClient.RequestOptions, + ): Promise> { const { startTs, endTs, clusterId, applicationId, alertStatus } = request; const _queryParams: Record = { startTs, endTs, clusterId, applicationId, - alertStatus: alertStatus != null ? serializers.AlertStatus.jsonOrThrow(alertStatus, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }) : undefined + alertStatus: + alertStatus != null + ? serializers.AlertStatus.jsonOrThrow(alertStatus, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }) + : undefined, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/alerts"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/alerts", + ), method: "GET", headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetAlertsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetAlertsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 400: throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 400: + throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } diff --git a/src/api/resources/alerts/client/requests/AlertsListRequest.ts b/src/api/resources/alerts/client/requests/ListAlertsRequest.ts similarity index 54% rename from src/api/resources/alerts/client/requests/AlertsListRequest.ts rename to src/api/resources/alerts/client/requests/ListAlertsRequest.ts index dfdf0346..92d65e26 100644 --- a/src/api/resources/alerts/client/requests/AlertsListRequest.ts +++ b/src/api/resources/alerts/client/requests/ListAlertsRequest.ts @@ -1,26 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../index.js"; +import type * as TrueFoundry from "../../../../index.js"; /** * @example - * { - * startTs: "startTs", - * endTs: "endTs", - * clusterId: "clusterId", - * applicationId: "applicationId", - * alertStatus: "firing" - * } + * {} */ -export interface AlertsListRequest { +export interface ListAlertsRequest { /** Start timestamp for filtering alerts (ISO 8601 format, UTC). Must be before endTs. */ - startTs?: string; + startTs?: string | null; /** End timestamp for filtering alerts (ISO 8601 format, UTC). Must be after startTs. */ - endTs?: string; + endTs?: string | null; /** Unique identifier of the cluster. */ - clusterId?: string; + clusterId?: string | null; /** Unique identifier of the application. */ - applicationId?: string; + applicationId?: string | null; /** Filter by alert status. */ alertStatus?: TrueFoundry.AlertStatus; } diff --git a/src/api/resources/alerts/client/requests/index.ts b/src/api/resources/alerts/client/requests/index.ts index 209e870f..b1cc6cb5 100644 --- a/src/api/resources/alerts/client/requests/index.ts +++ b/src/api/resources/alerts/client/requests/index.ts @@ -1 +1 @@ -export type { AlertsListRequest } from "./AlertsListRequest.js"; +export type { ListAlertsRequest } from "./ListAlertsRequest.js"; diff --git a/src/api/resources/applicationVersions/client/Client.ts b/src/api/resources/applicationVersions/client/Client.ts index b8dd1da1..44d06aef 100644 --- a/src/api/resources/applicationVersions/client/Client.ts +++ b/src/api/resources/applicationVersions/client/Client.ts @@ -1,9 +1,9 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; -import * as core from "../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; @@ -12,29 +12,27 @@ import * as TrueFoundry from "../../../index.js"; export declare namespace ApplicationVersionsClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class ApplicationVersionsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: ApplicationVersionsClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** * List deployments for a given application. Each deployment is a new version of the application. * * @param {string} id - Unique identifier of the application - * @param {TrueFoundry.ApplicationVersionsListRequest} request + * @param {TrueFoundry.ListApplicationVersionsRequest} request * @param {ApplicationVersionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.ForbiddenError} * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.applicationVersions.list("id", { @@ -44,43 +42,103 @@ export class ApplicationVersionsClient { * deploymentId: "deployment123" * }) */ - public async list(id: string, request: TrueFoundry.ApplicationVersionsListRequest = {}, requestOptions?: ApplicationVersionsClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.ApplicationVersionsListRequest): Promise> => { const { limit = 100, offset = 0, version, deploymentId } = request; const _queryParams: Record = { - limit, - offset, - version, - deploymentId - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/apps/${core.url.encodePathParam(id)}/deployments`), - method: "GET", - headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.ListApplicationDeploymentsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse + public async list( + id: string, + request: TrueFoundry.ListApplicationVersionsRequest = {}, + requestOptions?: ApplicationVersionsClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.ListApplicationVersionsRequest, + ): Promise> => { + const { limit = 100, offset = 0, version, deploymentId } = request; + const _queryParams: Record = { + limit, + offset, + version, + deploymentId, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/apps/${core.url.encodePathParam(id)}/deployments`, + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, }); - } - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/apps/{id}/deployments"); }); + if (_response.ok) { + return { + data: serializers.ListApplicationDeploymentsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/apps/{id}/deployments", + ); + }, + ); let _offset = request?.offset != null ? request?.offset : 0; const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => (response?.data ?? []).length > 0 && (request?.limit == null || (response?.data ?? []).length >= request?.limit), - getItems: response => response?.data ?? [], - loadPage: response => { _offset += response?.data != null ? response.data.length : 1; return list(core.setObjectProperty(request, "offset", _offset)); } + hasNextPage: (response) => + (response?.data ?? []).length > 0 && + (request?.limit == null || (response?.data ?? []).length >= request?.limit), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + _offset += response?.data != null ? response.data.length : 1; + return list(core.setObjectProperty(request, "offset", _offset)); + }, }); } @@ -93,19 +151,37 @@ export class ApplicationVersionsClient { * * @throws {@link TrueFoundry.ForbiddenError} * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.applicationVersions.get("id", "deploymentId") */ - public get(id: string, deploymentId: string, requestOptions?: ApplicationVersionsClient.RequestOptions): core.HttpResponsePromise { + public get( + id: string, + deploymentId: string, + requestOptions?: ApplicationVersionsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(id, deploymentId, requestOptions)); } - private async __get(id: string, deploymentId: string, requestOptions?: ApplicationVersionsClient.RequestOptions): Promise> { + private async __get( + id: string, + deploymentId: string, + requestOptions?: ApplicationVersionsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/apps/${core.url.encodePathParam(id)}/deployments/${core.url.encodePathParam(deploymentId)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/apps/${core.url.encodePathParam(id)}/deployments/${core.url.encodePathParam(deploymentId)}`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -113,24 +189,50 @@ export class ApplicationVersionsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetApplicationDeploymentResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetApplicationDeploymentResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/apps/{id}/deployments/{deploymentId}"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/apps/{id}/deployments/{deploymentId}", + ); } } diff --git a/src/api/resources/applicationVersions/client/requests/ApplicationVersionsListRequest.ts b/src/api/resources/applicationVersions/client/requests/ListApplicationVersionsRequest.ts similarity index 68% rename from src/api/resources/applicationVersions/client/requests/ApplicationVersionsListRequest.ts rename to src/api/resources/applicationVersions/client/requests/ListApplicationVersionsRequest.ts index 64efddc7..61a8d0f6 100644 --- a/src/api/resources/applicationVersions/client/requests/ApplicationVersionsListRequest.ts +++ b/src/api/resources/applicationVersions/client/requests/ListApplicationVersionsRequest.ts @@ -9,13 +9,13 @@ * deploymentId: "deployment123" * } */ -export interface ApplicationVersionsListRequest { +export interface ListApplicationVersionsRequest { /** Number of items per page */ - limit?: number; + limit?: number | null; /** Number of items to skip */ - offset?: number; + offset?: number | null; /** Deployment version to filter by */ - version?: string; + version?: string | null; /** Deployment ID to filter by */ - deploymentId?: string; + deploymentId?: string | null; } diff --git a/src/api/resources/applicationVersions/client/requests/index.ts b/src/api/resources/applicationVersions/client/requests/index.ts index e498217f..436acc71 100644 --- a/src/api/resources/applicationVersions/client/requests/index.ts +++ b/src/api/resources/applicationVersions/client/requests/index.ts @@ -1 +1 @@ -export type { ApplicationVersionsListRequest } from "./ApplicationVersionsListRequest.js"; +export type { ListApplicationVersionsRequest } from "./ListApplicationVersionsRequest.js"; diff --git a/src/api/resources/applications/client/Client.ts b/src/api/resources/applications/client/Client.ts index 389787a3..b1f9ca84 100644 --- a/src/api/resources/applications/client/Client.ts +++ b/src/api/resources/applications/client/Client.ts @@ -1,9 +1,10 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; -import * as core from "../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; @@ -12,98 +13,167 @@ import * as TrueFoundry from "../../../index.js"; export declare namespace ApplicationsClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class ApplicationsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: ApplicationsClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** * List applications the caller can read. * - * @param {TrueFoundry.ApplicationsListRequest} request + * @param {TrueFoundry.ListApplicationsRequest} request * @param {ApplicationsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.BadRequestError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.applications.list({ * limit: 10, - * offset: 0, - * applicationId: "applicationId", - * workspaceId: "workspaceId", - * applicationName: "applicationName", - * fqn: "fqn", - * workspaceFqn: "workspaceFqn", - * applicationType: "async-service", - * nameSearchQuery: "nameSearchQuery", - * environmentId: "environmentId", - * clusterId: "clusterId", - * applicationSetId: "applicationSetId", - * paused: true, - * deviceTypeFilter: "cpu", - * lastDeployedBySubjects: "lastDeployedBySubjects", - * lifecycleStage: "active", - * isRecommendationPresentAndVisible: true + * offset: 0 * }) */ - public async list(request: TrueFoundry.ApplicationsListRequest = {}, requestOptions?: ApplicationsClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.ApplicationsListRequest): Promise> => { const { limit = 100, offset = 0, applicationId, workspaceId, applicationName, fqn, workspaceFqn, applicationType, nameSearchQuery, environmentId, clusterId, applicationSetId, paused, deviceTypeFilter, lastDeployedBySubjects, lifecycleStage, isRecommendationPresentAndVisible } = request; const _queryParams: Record = { - limit, - offset, - applicationId, - workspaceId, - applicationName, - fqn, - workspaceFqn, - applicationType: applicationType != null ? serializers.ApplicationType.jsonOrThrow(applicationType, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }) : undefined, - nameSearchQuery, - environmentId, - clusterId, - applicationSetId, - paused, - deviceTypeFilter: deviceTypeFilter != null ? serializers.ApplicationsListRequestDeviceTypeFilter.jsonOrThrow(deviceTypeFilter, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }) : undefined, - lastDeployedBySubjects, - lifecycleStage: lifecycleStage != null ? serializers.ApplicationsListRequestLifecycleStage.jsonOrThrow(lifecycleStage, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }) : undefined, - isRecommendationPresentAndVisible - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/apps"), - method: "GET", - headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.ListApplicationsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse + public async list( + request: TrueFoundry.ListApplicationsRequest = {}, + requestOptions?: ApplicationsClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.ListApplicationsRequest, + ): Promise> => { + const { + limit = 100, + offset = 0, + applicationId, + workspaceId, + applicationName, + fqn, + workspaceFqn, + applicationType, + nameSearchQuery, + environmentId, + clusterId, + applicationSetId, + paused, + deviceTypeFilter, + lastDeployedBySubjects, + lifecycleStage, + isRecommendationPresentAndVisible, + } = request; + const _queryParams: Record = { + limit, + offset, + applicationId, + workspaceId, + applicationName, + fqn, + workspaceFqn, + applicationType: + applicationType != null + ? serializers.ApplicationType.jsonOrThrow(applicationType, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }) + : undefined, + nameSearchQuery, + environmentId, + clusterId, + applicationSetId, + paused, + deviceTypeFilter: + deviceTypeFilter !== undefined + ? serializers.ListApplicationsRequestDeviceTypeFilter.jsonOrThrow(deviceTypeFilter, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }) + : undefined, + lastDeployedBySubjects, + lifecycleStage: + lifecycleStage !== undefined + ? serializers.ListApplicationsRequestLifecycleStage.jsonOrThrow(lifecycleStage, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }) + : undefined, + isRecommendationPresentAndVisible, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/apps", + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, }); - } - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/apps"); }); + if (_response.ok) { + return { + data: serializers.ListApplicationsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/apps"); + }, + ); let _offset = request?.offset != null ? request?.offset : 0; const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => (response?.data ?? []).length > 0 && (request?.limit == null || (response?.data ?? []).length >= request?.limit), - getItems: response => response?.data ?? [], - loadPage: response => { _offset += response?.data != null ? response.data.length : 1; return list(core.setObjectProperty(request, "offset", _offset)); } + hasNextPage: (response) => + (response?.data ?? []).length > 0 && + (request?.limit == null || (response?.data ?? []).length >= request?.limit), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + _offset += response?.data != null ? response.data.length : 1; + return list(core.setObjectProperty(request, "offset", _offset)); + }, }); } @@ -117,6 +187,8 @@ export class ApplicationsClient { * @throws {@link TrueFoundry.ForbiddenError} * @throws {@link TrueFoundry.NotFoundError} * @throws {@link TrueFoundry.ConflictError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.applications.createOrUpdate({ @@ -125,42 +197,96 @@ export class ApplicationsClient { * } * }) */ - public createOrUpdate(request: TrueFoundry.CreateDeploymentRequest, requestOptions?: ApplicationsClient.RequestOptions): core.HttpResponsePromise { + public createOrUpdate( + request: TrueFoundry.CreateDeploymentRequest, + requestOptions?: ApplicationsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__createOrUpdate(request, requestOptions)); } - private async __createOrUpdate(request: TrueFoundry.CreateDeploymentRequest, requestOptions?: ApplicationsClient.RequestOptions): Promise> { + private async __createOrUpdate( + request: TrueFoundry.CreateDeploymentRequest, + requestOptions?: ApplicationsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/apps"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/apps", + ), method: "PUT", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.CreateDeploymentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.CreateDeploymentRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetApplicationDeploymentResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetApplicationDeploymentResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 400: throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - case 409: throw new TrueFoundry.ConflictError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 400: + throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + case 409: + throw new TrueFoundry.ConflictError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -175,19 +301,35 @@ export class ApplicationsClient { * * @throws {@link TrueFoundry.ForbiddenError} * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.applications.get("id") */ - public get(id: string, requestOptions?: ApplicationsClient.RequestOptions): core.HttpResponsePromise { + public get( + id: string, + requestOptions?: ApplicationsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions)); } - private async __get(id: string, requestOptions?: ApplicationsClient.RequestOptions): Promise> { + private async __get( + id: string, + requestOptions?: ApplicationsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/apps/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/apps/${core.url.encodePathParam(id)}`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -195,21 +337,42 @@ export class ApplicationsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetApplicationResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetApplicationResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -224,19 +387,35 @@ export class ApplicationsClient { * * @throws {@link TrueFoundry.ForbiddenError} * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.applications.delete("id") */ - public delete(id: string, requestOptions?: ApplicationsClient.RequestOptions): core.HttpResponsePromise { + public delete( + id: string, + requestOptions?: ApplicationsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions)); } - private async __delete(id: string, requestOptions?: ApplicationsClient.RequestOptions): Promise> { + private async __delete( + id: string, + requestOptions?: ApplicationsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/apps/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/apps/${core.url.encodePathParam(id)}`, + ), method: "DELETE", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -244,21 +423,42 @@ export class ApplicationsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.DeleteApplicationResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.DeleteApplicationResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -274,19 +474,37 @@ export class ApplicationsClient { * * @throws {@link TrueFoundry.ForbiddenError} * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.applications.redeploy("id", "deploymentId") */ - public redeploy(id: string, deploymentId: string, requestOptions?: ApplicationsClient.RequestOptions): core.HttpResponsePromise { + public redeploy( + id: string, + deploymentId: string, + requestOptions?: ApplicationsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__redeploy(id, deploymentId, requestOptions)); } - private async __redeploy(id: string, deploymentId: string, requestOptions?: ApplicationsClient.RequestOptions): Promise> { + private async __redeploy( + id: string, + deploymentId: string, + requestOptions?: ApplicationsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/apps/${core.url.encodePathParam(id)}/deployments/${core.url.encodePathParam(deploymentId)}/redeploy`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/apps/${core.url.encodePathParam(id)}/deployments/${core.url.encodePathParam(deploymentId)}/redeploy`, + ), method: "POST", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -294,25 +512,51 @@ export class ApplicationsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetApplicationDeploymentResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetApplicationDeploymentResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/svc/v1/apps/{id}/deployments/{deploymentId}/redeploy"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/api/svc/v1/apps/{id}/deployments/{deploymentId}/redeploy", + ); } /** @@ -325,6 +569,8 @@ export class ApplicationsClient { * @throws {@link TrueFoundry.NotFoundError} * @throws {@link TrueFoundry.MethodNotAllowedError} * @throws {@link TrueFoundry.NotImplementedError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.applications.scaleToZero("id") @@ -333,11 +579,22 @@ export class ApplicationsClient { return core.HttpResponsePromise.fromPromise(this.__scaleToZero(id, requestOptions)); } - private async __scaleToZero(id: string, requestOptions?: ApplicationsClient.RequestOptions): Promise> { + private async __scaleToZero( + id: string, + requestOptions?: ApplicationsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/apps/${core.url.encodePathParam(id)}/scale-to-zero`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/apps/${core.url.encodePathParam(id)}/scale-to-zero`, + ), method: "PATCH", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -345,7 +602,7 @@ export class ApplicationsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { return { data: undefined, rawResponse: _response.rawResponse }; @@ -353,19 +610,47 @@ export class ApplicationsClient { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - case 405: throw new TrueFoundry.MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 501: throw new TrueFoundry.NotImplementedError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + case 405: + throw new TrueFoundry.MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 501: + throw new TrueFoundry.NotImplementedError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/api/svc/v1/apps/{id}/scale-to-zero"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PATCH", + "/api/svc/v1/apps/{id}/scale-to-zero", + ); } /** @@ -377,19 +662,35 @@ export class ApplicationsClient { * @throws {@link TrueFoundry.ForbiddenError} * @throws {@link TrueFoundry.NotFoundError} * @throws {@link TrueFoundry.NotImplementedError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.applications.scaleToOriginal("id") */ - public scaleToOriginal(id: string, requestOptions?: ApplicationsClient.RequestOptions): core.HttpResponsePromise { + public scaleToOriginal( + id: string, + requestOptions?: ApplicationsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__scaleToOriginal(id, requestOptions)); } - private async __scaleToOriginal(id: string, requestOptions?: ApplicationsClient.RequestOptions): Promise> { + private async __scaleToOriginal( + id: string, + requestOptions?: ApplicationsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/apps/${core.url.encodePathParam(id)}/scale-to-original`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/apps/${core.url.encodePathParam(id)}/scale-to-original`, + ), method: "PATCH", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -397,26 +698,62 @@ export class ApplicationsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.Deployment.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.Deployment.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - case 501: throw new TrueFoundry.NotImplementedError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + case 501: + throw new TrueFoundry.NotImplementedError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/api/svc/v1/apps/{id}/scale-to-original"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PATCH", + "/api/svc/v1/apps/{id}/scale-to-original", + ); } /** @@ -429,19 +766,37 @@ export class ApplicationsClient { * @throws {@link TrueFoundry.ForbiddenError} * @throws {@link TrueFoundry.NotFoundError} * @throws {@link TrueFoundry.ConflictError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.applications.cancelDeployment("id", "deploymentId") */ - public cancelDeployment(id: string, deploymentId: string, requestOptions?: ApplicationsClient.RequestOptions): core.HttpResponsePromise { + public cancelDeployment( + id: string, + deploymentId: string, + requestOptions?: ApplicationsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__cancelDeployment(id, deploymentId, requestOptions)); } - private async __cancelDeployment(id: string, deploymentId: string, requestOptions?: ApplicationsClient.RequestOptions): Promise> { + private async __cancelDeployment( + id: string, + deploymentId: string, + requestOptions?: ApplicationsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/apps/${core.url.encodePathParam(id)}/deployments/${core.url.encodePathParam(deploymentId)}/cancel`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/apps/${core.url.encodePathParam(id)}/deployments/${core.url.encodePathParam(deploymentId)}/cancel`, + ), method: "POST", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -449,25 +804,61 @@ export class ApplicationsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.ApplicationsCancelDeploymentResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.CancelDeploymentApplicationsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - case 409: throw new TrueFoundry.ConflictError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + case 409: + throw new TrueFoundry.ConflictError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/svc/v1/apps/{id}/deployments/{deploymentId}/cancel"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/api/svc/v1/apps/{id}/deployments/{deploymentId}/cancel", + ); } } diff --git a/src/api/resources/applications/client/requests/CreateDeploymentRequest.ts b/src/api/resources/applications/client/requests/CreateDeploymentRequest.ts index 0fe710a6..274d0772 100644 --- a/src/api/resources/applications/client/requests/CreateDeploymentRequest.ts +++ b/src/api/resources/applications/client/requests/CreateDeploymentRequest.ts @@ -12,17 +12,17 @@ export interface CreateDeploymentRequest { /** Manifest of application */ manifest: Record; /** Dry run */ - dryRun?: boolean; + dryRun?: boolean | null; /** Cancels any ongoing deployments */ - forceDeploy?: boolean; + forceDeploy?: boolean | null; /** Trigger on deploy */ - triggerOnDeploy?: boolean; + triggerOnDeploy?: boolean | null; /** workspace id of the workspace */ - workspaceId?: string; + workspaceId?: string | null; /** Id of the application */ - applicationId?: string; + applicationId?: string | null; /** Name of application */ - name?: string; + name?: string | null; /** Application Set Id */ - applicationSetId?: string; + applicationSetId?: string | null; } diff --git a/src/api/resources/applications/client/requests/ApplicationsListRequest.ts b/src/api/resources/applications/client/requests/ListApplicationsRequest.ts similarity index 50% rename from src/api/resources/applications/client/requests/ApplicationsListRequest.ts rename to src/api/resources/applications/client/requests/ListApplicationsRequest.ts index 3d7a848e..03a7f6c7 100644 --- a/src/api/resources/applications/client/requests/ApplicationsListRequest.ts +++ b/src/api/resources/applications/client/requests/ListApplicationsRequest.ts @@ -1,62 +1,47 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../index.js"; +import type * as TrueFoundry from "../../../../index.js"; /** * @example * { * limit: 10, - * offset: 0, - * applicationId: "applicationId", - * workspaceId: "workspaceId", - * applicationName: "applicationName", - * fqn: "fqn", - * workspaceFqn: "workspaceFqn", - * applicationType: "async-service", - * nameSearchQuery: "nameSearchQuery", - * environmentId: "environmentId", - * clusterId: "clusterId", - * applicationSetId: "applicationSetId", - * paused: true, - * deviceTypeFilter: "cpu", - * lastDeployedBySubjects: "lastDeployedBySubjects", - * lifecycleStage: "active", - * isRecommendationPresentAndVisible: true + * offset: 0 * } */ -export interface ApplicationsListRequest { +export interface ListApplicationsRequest { /** Number of items per page */ - limit?: number; + limit?: number | null; /** Number of items to skip */ - offset?: number; + offset?: number | null; /** Unique identifier of the application to filter by */ - applicationId?: string; + applicationId?: string | null; /** Workspace IDs to filter by (comma-separated) */ - workspaceId?: string; + workspaceId?: string | null; /** Exact application name to filter by. Takes precedence over nameSearchQuery if both are provided. */ - applicationName?: string; + applicationName?: string | null; /** FQN of the application to filter by. */ - fqn?: string; + fqn?: string | null; /** FQN of the workspace to filter by. */ - workspaceFqn?: string; + workspaceFqn?: string | null; /** Application type to filter by (comma-separated). */ applicationType?: TrueFoundry.ApplicationType; /** Substring search query for application name. Ignored if applicationName is also provided. */ - nameSearchQuery?: string; + nameSearchQuery?: string | null; /** Environment IDs to filter by (comma-separated) */ - environmentId?: string; + environmentId?: string | null; /** Cluster IDs to filter by (comma-separated) */ - clusterId?: string; + clusterId?: string | null; /** Application set ID to filter by */ - applicationSetId?: string; + applicationSetId?: string | null; /** Filter by explicit pause state (true = paused, false = not paused). Does not account for autoshutdown. */ - paused?: boolean; + paused?: boolean | null; /** Device type to filter by (comma-separated). */ - deviceTypeFilter?: TrueFoundry.ApplicationsListRequestDeviceTypeFilter; + deviceTypeFilter?: TrueFoundry.ListApplicationsRequestDeviceTypeFilter | null; /** Subject slugs of last deployers to filter by (comma-separated). Email for users (e.g. user@example.com), name for virtual accounts. */ - lastDeployedBySubjects?: string; + lastDeployedBySubjects?: string | null; /** Application lifecycle stage to filter by */ - lifecycleStage?: TrueFoundry.ApplicationsListRequestLifecycleStage; + lifecycleStage?: TrueFoundry.ListApplicationsRequestLifecycleStage | null; /** Whether the application has visible recommendations */ - isRecommendationPresentAndVisible?: boolean; + isRecommendationPresentAndVisible?: boolean | null; } diff --git a/src/api/resources/applications/client/requests/index.ts b/src/api/resources/applications/client/requests/index.ts index b50ad798..f3ffc597 100644 --- a/src/api/resources/applications/client/requests/index.ts +++ b/src/api/resources/applications/client/requests/index.ts @@ -1,2 +1,2 @@ -export type { ApplicationsListRequest } from "./ApplicationsListRequest.js"; export type { CreateDeploymentRequest } from "./CreateDeploymentRequest.js"; +export type { ListApplicationsRequest } from "./ListApplicationsRequest.js"; diff --git a/src/api/resources/applications/types/ApplicationsListRequestDeviceTypeFilter.ts b/src/api/resources/applications/types/ApplicationsListRequestDeviceTypeFilter.ts deleted file mode 100644 index c5e4f368..00000000 --- a/src/api/resources/applications/types/ApplicationsListRequestDeviceTypeFilter.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const ApplicationsListRequestDeviceTypeFilter = { - Cpu: "cpu", - NvidiaGpu: "nvidia_gpu", - AwsInferentia: "aws_inferentia", - NvidiaMigGpu: "nvidia_mig_gpu", - NvidiaTimeslicingGpu: "nvidia_timeslicing_gpu", - GcpTpu: "gcp_tpu" - } as const; -export type ApplicationsListRequestDeviceTypeFilter = typeof ApplicationsListRequestDeviceTypeFilter[keyof typeof ApplicationsListRequestDeviceTypeFilter]; diff --git a/src/api/resources/applications/types/ApplicationsListRequestLifecycleStage.ts b/src/api/resources/applications/types/ApplicationsListRequestLifecycleStage.ts deleted file mode 100644 index 86f64ac2..00000000 --- a/src/api/resources/applications/types/ApplicationsListRequestLifecycleStage.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const ApplicationsListRequestLifecycleStage = { - Active: "active", - Deleting: "deleting", - DeletionFailed: "deletion_failed" - } as const; -export type ApplicationsListRequestLifecycleStage = typeof ApplicationsListRequestLifecycleStage[keyof typeof ApplicationsListRequestLifecycleStage]; diff --git a/src/api/resources/applications/types/ApplicationsCancelDeploymentResponse.ts b/src/api/resources/applications/types/CancelDeploymentApplicationsResponse.ts similarity index 68% rename from src/api/resources/applications/types/ApplicationsCancelDeploymentResponse.ts rename to src/api/resources/applications/types/CancelDeploymentApplicationsResponse.ts index c6c7b04a..099e5554 100644 --- a/src/api/resources/applications/types/ApplicationsCancelDeploymentResponse.ts +++ b/src/api/resources/applications/types/CancelDeploymentApplicationsResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -export interface ApplicationsCancelDeploymentResponse { +export interface CancelDeploymentApplicationsResponse { /** Deployment cancelled */ message?: string; } diff --git a/src/api/resources/applications/types/ListApplicationsRequestDeviceTypeFilter.ts b/src/api/resources/applications/types/ListApplicationsRequestDeviceTypeFilter.ts new file mode 100644 index 00000000..64d01a7e --- /dev/null +++ b/src/api/resources/applications/types/ListApplicationsRequestDeviceTypeFilter.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +export const ListApplicationsRequestDeviceTypeFilter = { + Cpu: "cpu", + NvidiaGpu: "nvidia_gpu", + AwsInferentia: "aws_inferentia", + NvidiaMigGpu: "nvidia_mig_gpu", + NvidiaTimeslicingGpu: "nvidia_timeslicing_gpu", + GcpTpu: "gcp_tpu", +} as const; +export type ListApplicationsRequestDeviceTypeFilter = + (typeof ListApplicationsRequestDeviceTypeFilter)[keyof typeof ListApplicationsRequestDeviceTypeFilter]; diff --git a/src/api/resources/applications/types/ListApplicationsRequestLifecycleStage.ts b/src/api/resources/applications/types/ListApplicationsRequestLifecycleStage.ts new file mode 100644 index 00000000..b0915c85 --- /dev/null +++ b/src/api/resources/applications/types/ListApplicationsRequestLifecycleStage.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +export const ListApplicationsRequestLifecycleStage = { + Active: "active", + Deleting: "deleting", + DeletionFailed: "deletion_failed", +} as const; +export type ListApplicationsRequestLifecycleStage = + (typeof ListApplicationsRequestLifecycleStage)[keyof typeof ListApplicationsRequestLifecycleStage]; diff --git a/src/api/resources/applications/types/index.ts b/src/api/resources/applications/types/index.ts index 758fdc1f..041c901a 100644 --- a/src/api/resources/applications/types/index.ts +++ b/src/api/resources/applications/types/index.ts @@ -1,3 +1,3 @@ -export * from "./ApplicationsCancelDeploymentResponse.js"; -export * from "./ApplicationsListRequestDeviceTypeFilter.js"; -export * from "./ApplicationsListRequestLifecycleStage.js"; +export * from "./CancelDeploymentApplicationsResponse.js"; +export * from "./ListApplicationsRequestDeviceTypeFilter.js"; +export * from "./ListApplicationsRequestLifecycleStage.js"; diff --git a/src/api/resources/artifactVersions/client/Client.ts b/src/api/resources/artifactVersions/client/Client.ts index 74e746f8..632a4d59 100644 --- a/src/api/resources/artifactVersions/client/Client.ts +++ b/src/api/resources/artifactVersions/client/Client.ts @@ -1,9 +1,11 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; -import * as core from "../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import { toJson } from "../../../../core/json.js"; +import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; @@ -12,81 +14,130 @@ import * as TrueFoundry from "../../../index.js"; export declare namespace ArtifactVersionsClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class ArtifactVersionsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: ArtifactVersionsClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** * List artifact versions with optional filtering by tag, FQN, artifact ID, ML Repo, name, version, run IDs, or run steps. * - * @param {TrueFoundry.ArtifactVersionsListRequest} request + * @param {TrueFoundry.ListArtifactVersionsRequest} request * @param {ArtifactVersionsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.artifactVersions.list({ * limit: 10, - * offset: 0, - * tag: "tag", - * fqn: "fqn", - * artifactId: "artifact_id", - * mlRepoId: "ml_repo_id", - * name: "name", - * version: 1, - * runIds: ["run_ids"], - * runSteps: [1.1], - * includeInternalMetadata: true + * offset: 0 * }) */ - public async list(request: TrueFoundry.ArtifactVersionsListRequest = {}, requestOptions?: ArtifactVersionsClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.ArtifactVersionsListRequest): Promise> => { const { limit = 100, offset = 0, tag, fqn, artifactId, mlRepoId, name, version, runIds, runSteps, includeInternalMetadata = false } = request; const _queryParams: Record = { - limit, - offset, - tag, - fqn, - artifact_id: artifactId, - ml_repo_id: mlRepoId, - name, - version, - run_ids: runIds, - run_steps: runSteps, - include_internal_metadata: includeInternalMetadata - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/artifact-versions"), - method: "GET", - headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.ListArtifactVersionsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/artifact-versions"); }); + public async list( + request: TrueFoundry.ListArtifactVersionsRequest = {}, + requestOptions?: ArtifactVersionsClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.ListArtifactVersionsRequest, + ): Promise> => { + const { + limit = 100, + offset = 0, + tag, + fqn, + artifactId, + mlRepoId, + name, + version, + runIds, + runSteps, + includeInternalMetadata = false, + } = request; + const _queryParams: Record = { + limit, + offset, + tag, + fqn, + artifact_id: artifactId, + ml_repo_id: mlRepoId, + name, + version, + run_ids: runIds !== undefined ? toJson(runIds) : undefined, + run_steps: runSteps !== undefined ? toJson(runSteps) : undefined, + include_internal_metadata: includeInternalMetadata, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/artifact-versions", + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ListArtifactVersionsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/artifact-versions", + ); + }, + ); let _offset = request?.offset != null ? request?.offset : 0; const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => (response?.data ?? []).length > 0 && (request?.limit == null || (response?.data ?? []).length >= request?.limit), - getItems: response => response?.data ?? [], - loadPage: response => { _offset += response?.data != null ? response.data.length : 1; return list(core.setObjectProperty(request, "offset", _offset)); } + hasNextPage: (response) => + (response?.data ?? []).length > 0 && + (request?.limit == null || (response?.data ?? []).length >= request?.limit), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + _offset += response?.data != null ? response.data.length : 1; + return list(core.setObjectProperty(request, "offset", _offset)); + }, }); } @@ -96,46 +147,85 @@ export class ArtifactVersionsClient { * @param {TrueFoundry.ApplyArtifactVersionTagsRequest} request * @param {ArtifactVersionsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.artifactVersions.applyTags({ * artifactVersionId: "artifact_version_id", * tags: ["tags"] * }) */ - public applyTags(request: TrueFoundry.ApplyArtifactVersionTagsRequest, requestOptions?: ArtifactVersionsClient.RequestOptions): core.HttpResponsePromise { + public applyTags( + request: TrueFoundry.ApplyArtifactVersionTagsRequest, + requestOptions?: ArtifactVersionsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__applyTags(request, requestOptions)); } - private async __applyTags(request: TrueFoundry.ApplyArtifactVersionTagsRequest, requestOptions?: ArtifactVersionsClient.RequestOptions): Promise> { + private async __applyTags( + request: TrueFoundry.ApplyArtifactVersionTagsRequest, + requestOptions?: ArtifactVersionsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/artifact-versions/tags"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/artifact-versions/tags", + ), method: "PUT", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.ApplyArtifactVersionTagsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.ApplyArtifactVersionTagsRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.EmptyResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.EmptyResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/api/svc/v1/artifact-versions/tags"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PUT", + "/api/svc/v1/artifact-versions/tags", + ); } /** @@ -144,6 +234,9 @@ export class ArtifactVersionsClient { * @param {TrueFoundry.GetSignedUrLsRequest} request * @param {ArtifactVersionsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.artifactVersions.getSignedUrls({ * id: "id", @@ -151,40 +244,76 @@ export class ArtifactVersionsClient { * operation: "READ" * }) */ - public getSignedUrls(request: TrueFoundry.GetSignedUrLsRequest, requestOptions?: ArtifactVersionsClient.RequestOptions): core.HttpResponsePromise { + public getSignedUrls( + request: TrueFoundry.GetSignedUrLsRequest, + requestOptions?: ArtifactVersionsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__getSignedUrls(request, requestOptions)); } - private async __getSignedUrls(request: TrueFoundry.GetSignedUrLsRequest, requestOptions?: ArtifactVersionsClient.RequestOptions): Promise> { + private async __getSignedUrls( + request: TrueFoundry.GetSignedUrLsRequest, + requestOptions?: ArtifactVersionsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/artifact-versions/signed-urls"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/artifact-versions/signed-urls", + ), method: "POST", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.GetSignedUrLsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.GetSignedUrLsRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetSignedUrLsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetSignedUrLsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/svc/v1/artifact-versions/signed-urls"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/api/svc/v1/artifact-versions/signed-urls", + ); } /** @@ -193,6 +322,9 @@ export class ArtifactVersionsClient { * @param {TrueFoundry.CreateMultiPartUploadRequest} request * @param {ArtifactVersionsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.artifactVersions.createMultiPartUpload({ * id: "id", @@ -200,40 +332,76 @@ export class ArtifactVersionsClient { * numParts: 1.1 * }) */ - public createMultiPartUpload(request: TrueFoundry.CreateMultiPartUploadRequest, requestOptions?: ArtifactVersionsClient.RequestOptions): core.HttpResponsePromise { + public createMultiPartUpload( + request: TrueFoundry.CreateMultiPartUploadRequest, + requestOptions?: ArtifactVersionsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__createMultiPartUpload(request, requestOptions)); } - private async __createMultiPartUpload(request: TrueFoundry.CreateMultiPartUploadRequest, requestOptions?: ArtifactVersionsClient.RequestOptions): Promise> { + private async __createMultiPartUpload( + request: TrueFoundry.CreateMultiPartUploadRequest, + requestOptions?: ArtifactVersionsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/artifact-versions/signed-urls/multipart"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/artifact-versions/signed-urls/multipart", + ), method: "POST", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.CreateMultiPartUploadRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.CreateMultiPartUploadRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.MultiPartUploadResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.MultiPartUploadResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/svc/v1/artifact-versions/signed-urls/multipart"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/api/svc/v1/artifact-versions/signed-urls/multipart", + ); } /** @@ -242,41 +410,92 @@ export class ArtifactVersionsClient { * @param {TrueFoundry.ListFilesRequest} request * @param {ArtifactVersionsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.artifactVersions.listFiles({ * id: "id" * }) */ - public async listFiles(request: TrueFoundry.ListFilesRequest, requestOptions?: ArtifactVersionsClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.ListFilesRequest): Promise> => { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/artifact-versions/files"), - method: "POST", - headers: _headers, - contentType: "application/json", - queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), - requestType: "json", - body: serializers.ListFilesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.ListFilesResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/svc/v1/artifact-versions/files"); }); + public async listFiles( + request: TrueFoundry.ListFilesRequest, + requestOptions?: ArtifactVersionsClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.ListFilesRequest, + ): Promise> => { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/artifact-versions/files", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + requestType: "json", + body: mergeAdditionalBodyParameters( + serializers.ListFilesRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ListFilesResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/api/svc/v1/artifact-versions/files", + ); + }, + ); const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => response?.pagination.nextPageToken != null && !(typeof response?.pagination.nextPageToken === "string" && response?.pagination.nextPageToken === ""), - getItems: response => response?.data ?? [], - loadPage: response => { return list(core.setObjectProperty(request, "pageToken", response?.pagination.nextPageToken)); } + hasNextPage: (response) => + response?.pagination.nextPageToken != null && + !(typeof response?.pagination.nextPageToken === "string" && response?.pagination.nextPageToken === ""), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + return list(core.setObjectProperty(request, "pageToken", response?.pagination.nextPageToken)); + }, }); } @@ -286,6 +505,9 @@ export class ArtifactVersionsClient { * @param {TrueFoundry.StageArtifactRequest} request * @param {ArtifactVersionsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.artifactVersions.stage({ * manifest: { @@ -300,40 +522,76 @@ export class ArtifactVersionsClient { * } * }) */ - public stage(request: TrueFoundry.StageArtifactRequest, requestOptions?: ArtifactVersionsClient.RequestOptions): core.HttpResponsePromise { + public stage( + request: TrueFoundry.StageArtifactRequest, + requestOptions?: ArtifactVersionsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__stage(request, requestOptions)); } - private async __stage(request: TrueFoundry.StageArtifactRequest, requestOptions?: ArtifactVersionsClient.RequestOptions): Promise> { + private async __stage( + request: TrueFoundry.StageArtifactRequest, + requestOptions?: ArtifactVersionsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/artifact-versions/stage"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/artifact-versions/stage", + ), method: "POST", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.StageArtifactRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.StageArtifactRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.StageArtifactResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.StageArtifactResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/svc/v1/artifact-versions/stage"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/api/svc/v1/artifact-versions/stage", + ); } /** @@ -342,45 +600,84 @@ export class ArtifactVersionsClient { * @param {TrueFoundry.MarkStageArtifactFailureRequest} request * @param {ArtifactVersionsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.artifactVersions.markStageFailure({ * id: "id" * }) */ - public markStageFailure(request: TrueFoundry.MarkStageArtifactFailureRequest, requestOptions?: ArtifactVersionsClient.RequestOptions): core.HttpResponsePromise { + public markStageFailure( + request: TrueFoundry.MarkStageArtifactFailureRequest, + requestOptions?: ArtifactVersionsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__markStageFailure(request, requestOptions)); } - private async __markStageFailure(request: TrueFoundry.MarkStageArtifactFailureRequest, requestOptions?: ArtifactVersionsClient.RequestOptions): Promise> { + private async __markStageFailure( + request: TrueFoundry.MarkStageArtifactFailureRequest, + requestOptions?: ArtifactVersionsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/artifact-versions/mark-stage-failure"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/artifact-versions/mark-stage-failure", + ), method: "POST", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.MarkStageArtifactFailureRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.MarkStageArtifactFailureRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.EmptyResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.EmptyResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/svc/v1/artifact-versions/mark-stage-failure"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/api/svc/v1/artifact-versions/mark-stage-failure", + ); } /** @@ -390,19 +687,35 @@ export class ArtifactVersionsClient { * @param {ArtifactVersionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.artifactVersions.get("id") */ - public get(id: string, requestOptions?: ArtifactVersionsClient.RequestOptions): core.HttpResponsePromise { + public get( + id: string, + requestOptions?: ArtifactVersionsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions)); } - private async __get(id: string, requestOptions?: ArtifactVersionsClient.RequestOptions): Promise> { + private async __get( + id: string, + requestOptions?: ArtifactVersionsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/artifact-versions/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/artifact-versions/${core.url.encodePathParam(id)}`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -410,24 +723,40 @@ export class ArtifactVersionsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetArtifactVersionResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetArtifactVersionResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/artifact-versions/{id}"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/artifact-versions/{id}", + ); } /** @@ -437,19 +766,35 @@ export class ArtifactVersionsClient { * @param {ArtifactVersionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.artifactVersions.delete("id") */ - public delete(id: string, requestOptions?: ArtifactVersionsClient.RequestOptions): core.HttpResponsePromise { + public delete( + id: string, + requestOptions?: ArtifactVersionsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions)); } - private async __delete(id: string, requestOptions?: ArtifactVersionsClient.RequestOptions): Promise> { + private async __delete( + id: string, + requestOptions?: ArtifactVersionsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/artifact-versions/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/artifact-versions/${core.url.encodePathParam(id)}`, + ), method: "DELETE", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -457,23 +802,39 @@ export class ArtifactVersionsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.EmptyResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.EmptyResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/api/svc/v1/artifact-versions/{id}"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/api/svc/v1/artifact-versions/{id}", + ); } } diff --git a/src/api/resources/artifactVersions/client/requests/ArtifactVersionsListRequest.ts b/src/api/resources/artifactVersions/client/requests/ListArtifactVersionsRequest.ts similarity index 57% rename from src/api/resources/artifactVersions/client/requests/ArtifactVersionsListRequest.ts rename to src/api/resources/artifactVersions/client/requests/ListArtifactVersionsRequest.ts index e368596e..bbb91255 100644 --- a/src/api/resources/artifactVersions/client/requests/ArtifactVersionsListRequest.ts +++ b/src/api/resources/artifactVersions/client/requests/ListArtifactVersionsRequest.ts @@ -4,39 +4,30 @@ * @example * { * limit: 10, - * offset: 0, - * tag: "tag", - * fqn: "fqn", - * artifactId: "artifact_id", - * mlRepoId: "ml_repo_id", - * name: "name", - * version: 1, - * runIds: ["run_ids"], - * runSteps: [1.1], - * includeInternalMetadata: true + * offset: 0 * } */ -export interface ArtifactVersionsListRequest { +export interface ListArtifactVersionsRequest { /** Number of items per page */ - limit?: number; + limit?: number | null; /** Number of items to skip */ - offset?: number; + offset?: number | null; /** Tag to filter artifact versions by. */ - tag?: string; + tag?: string | null; /** Fully Qualified Name uniquely identifying the artifact version. */ - fqn?: string; + fqn?: string | null; /** Identifier of the artifact whose versions to list. */ - artifactId?: string; + artifactId?: string | null; /** Identifier of the ML Repo the artifact versions belong to. */ - mlRepoId?: string; + mlRepoId?: string | null; /** Name of the artifact version. */ - name?: string; + name?: string | null; /** Version number (positive integer) to filter by. */ - version?: number; + version?: number | null; /** Run IDs to filter artifact versions by. */ - runIds?: string | string[]; + runIds?: string[] | null; /** Run steps to filter artifact versions by. */ - runSteps?: number | number[]; + runSteps?: number[] | null; /** Whether to include internal metadata in the response. */ includeInternalMetadata?: boolean; } diff --git a/src/api/resources/artifactVersions/client/requests/StageArtifactRequest.ts b/src/api/resources/artifactVersions/client/requests/StageArtifactRequest.ts index ace00e4f..50b4a759 100644 --- a/src/api/resources/artifactVersions/client/requests/StageArtifactRequest.ts +++ b/src/api/resources/artifactVersions/client/requests/StageArtifactRequest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../index.js"; +import type * as TrueFoundry from "../../../../index.js"; /** * @example diff --git a/src/api/resources/artifactVersions/client/requests/index.ts b/src/api/resources/artifactVersions/client/requests/index.ts index e2b88a1e..50fa4f44 100644 --- a/src/api/resources/artifactVersions/client/requests/index.ts +++ b/src/api/resources/artifactVersions/client/requests/index.ts @@ -1,4 +1,4 @@ export type { ApplyArtifactVersionTagsRequest } from "./ApplyArtifactVersionTagsRequest.js"; -export type { ArtifactVersionsListRequest } from "./ArtifactVersionsListRequest.js"; +export type { ListArtifactVersionsRequest } from "./ListArtifactVersionsRequest.js"; export type { MarkStageArtifactFailureRequest } from "./MarkStageArtifactFailureRequest.js"; export type { StageArtifactRequest } from "./StageArtifactRequest.js"; diff --git a/src/api/resources/artifactVersions/types/StageArtifactRequestManifest.ts b/src/api/resources/artifactVersions/types/StageArtifactRequestManifest.ts index 1d358034..3f54429d 100644 --- a/src/api/resources/artifactVersions/types/StageArtifactRequestManifest.ts +++ b/src/api/resources/artifactVersions/types/StageArtifactRequestManifest.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../index.js"; +import type * as TrueFoundry from "../../../index.js"; /** * Manifest containing metadata for the artifact to be staged (model or generic artifact) */ -export type StageArtifactRequestManifest = +export type StageArtifactRequestManifest = | TrueFoundry.ArtifactManifest | TrueFoundry.ModelManifest | TrueFoundry.AgentSkillManifest; diff --git a/src/api/resources/artifacts/client/Client.ts b/src/api/resources/artifacts/client/Client.ts index 2c8bbfc8..ab2cfcc1 100644 --- a/src/api/resources/artifacts/client/Client.ts +++ b/src/api/resources/artifacts/client/Client.ts @@ -1,9 +1,10 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; -import * as core from "../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; @@ -12,18 +13,14 @@ import * as TrueFoundry from "../../../index.js"; export declare namespace ArtifactsClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class ArtifactsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: ArtifactsClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** @@ -33,19 +30,35 @@ export class ArtifactsClient { * @param {ArtifactsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.artifacts.get("jqfwg345gi25n5ju2yz5iz6m") */ - public get(id: string, requestOptions?: ArtifactsClient.RequestOptions): core.HttpResponsePromise { + public get( + id: string, + requestOptions?: ArtifactsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions)); } - private async __get(id: string, requestOptions?: ArtifactsClient.RequestOptions): Promise> { + private async __get( + id: string, + requestOptions?: ArtifactsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/artifacts/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/artifacts/${core.url.encodePathParam(id)}`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -53,20 +66,31 @@ export class ArtifactsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetArtifactResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetArtifactResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -80,19 +104,35 @@ export class ArtifactsClient { * @param {ArtifactsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.artifacts.delete("jqfwg345gi25n5ju2yz5iz6m") */ - public delete(id: string, requestOptions?: ArtifactsClient.RequestOptions): core.HttpResponsePromise { + public delete( + id: string, + requestOptions?: ArtifactsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions)); } - private async __delete(id: string, requestOptions?: ArtifactsClient.RequestOptions): Promise> { + private async __delete( + id: string, + requestOptions?: ArtifactsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/artifacts/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/artifacts/${core.url.encodePathParam(id)}`, + ), method: "DELETE", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -100,20 +140,31 @@ export class ArtifactsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.EmptyResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.EmptyResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -123,56 +174,96 @@ export class ArtifactsClient { /** * List artifacts with optional filtering by FQN, ML Repo, name, or run ID. * - * @param {TrueFoundry.ArtifactsListRequest} request + * @param {TrueFoundry.ListArtifactsRequest} request * @param {ArtifactsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.artifacts.list({ * limit: 10, - * offset: 0, - * fqn: "fqn", - * mlRepoId: "ml_repo_id", - * name: "name", - * runId: "run_id", - * includeEmptyArtifacts: true + * offset: 0 * }) */ - public async list(request: TrueFoundry.ArtifactsListRequest = {}, requestOptions?: ArtifactsClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.ArtifactsListRequest): Promise> => { const { limit = 100, offset = 0, fqn, mlRepoId, name, runId, includeEmptyArtifacts = true } = request; const _queryParams: Record = { - limit, - offset, - fqn, - ml_repo_id: mlRepoId, - name, - run_id: runId, - include_empty_artifacts: includeEmptyArtifacts - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/artifacts"), - method: "GET", - headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.ListArtifactsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/artifacts"); }); + public async list( + request: TrueFoundry.ListArtifactsRequest = {}, + requestOptions?: ArtifactsClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.ListArtifactsRequest, + ): Promise> => { + const { limit = 100, offset = 0, fqn, mlRepoId, name, runId, includeEmptyArtifacts = true } = request; + const _queryParams: Record = { + limit, + offset, + fqn, + ml_repo_id: mlRepoId, + name, + run_id: runId, + include_empty_artifacts: includeEmptyArtifacts, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/artifacts", + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ListArtifactsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/artifacts"); + }, + ); let _offset = request?.offset != null ? request?.offset : 0; const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => (response?.data ?? []).length > 0 && (request?.limit == null || (response?.data ?? []).length >= request?.limit), - getItems: response => response?.data ?? [], - loadPage: response => { _offset += response?.data != null ? response.data.length : 1; return list(core.setObjectProperty(request, "offset", _offset)); } + hasNextPage: (response) => + (response?.data ?? []).length > 0 && + (request?.limit == null || (response?.data ?? []).length >= request?.limit), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + _offset += response?.data != null ? response.data.length : 1; + return list(core.setObjectProperty(request, "offset", _offset)); + }, }); } @@ -182,6 +273,9 @@ export class ArtifactsClient { * @param {TrueFoundry.ApplyArtifactRequest} request * @param {ArtifactsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.artifacts.createOrUpdate({ * manifest: { @@ -196,36 +290,67 @@ export class ArtifactsClient { * } * }) */ - public createOrUpdate(request: TrueFoundry.ApplyArtifactRequest, requestOptions?: ArtifactsClient.RequestOptions): core.HttpResponsePromise { + public createOrUpdate( + request: TrueFoundry.ApplyArtifactRequest, + requestOptions?: ArtifactsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__createOrUpdate(request, requestOptions)); } - private async __createOrUpdate(request: TrueFoundry.ApplyArtifactRequest, requestOptions?: ArtifactsClient.RequestOptions): Promise> { + private async __createOrUpdate( + request: TrueFoundry.ApplyArtifactRequest, + requestOptions?: ArtifactsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/artifact-versions"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/artifact-versions", + ), method: "PUT", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.ApplyArtifactRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.ApplyArtifactRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetArtifactVersionResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetArtifactVersionResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } diff --git a/src/api/resources/artifacts/client/requests/ApplyArtifactRequest.ts b/src/api/resources/artifacts/client/requests/ApplyArtifactRequest.ts index 34c741ab..8e831794 100644 --- a/src/api/resources/artifacts/client/requests/ApplyArtifactRequest.ts +++ b/src/api/resources/artifacts/client/requests/ApplyArtifactRequest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../index.js"; +import type * as TrueFoundry from "../../../../index.js"; /** * @example diff --git a/src/api/resources/artifacts/client/requests/ArtifactsListRequest.ts b/src/api/resources/artifacts/client/requests/ListArtifactsRequest.ts similarity index 56% rename from src/api/resources/artifacts/client/requests/ArtifactsListRequest.ts rename to src/api/resources/artifacts/client/requests/ListArtifactsRequest.ts index 6278a533..287df77a 100644 --- a/src/api/resources/artifacts/client/requests/ArtifactsListRequest.ts +++ b/src/api/resources/artifacts/client/requests/ListArtifactsRequest.ts @@ -4,27 +4,22 @@ * @example * { * limit: 10, - * offset: 0, - * fqn: "fqn", - * mlRepoId: "ml_repo_id", - * name: "name", - * runId: "run_id", - * includeEmptyArtifacts: true + * offset: 0 * } */ -export interface ArtifactsListRequest { +export interface ListArtifactsRequest { /** Number of items per page */ - limit?: number; + limit?: number | null; /** Number of items to skip */ - offset?: number; + offset?: number | null; /** Human-readable Fully Qualified Name of the artifact. */ - fqn?: string; + fqn?: string | null; /** Identifier of the ML Repo to filter artifacts by. */ - mlRepoId?: string; + mlRepoId?: string | null; /** Name of the artifact to filter by. */ - name?: string; + name?: string | null; /** Identifier of the run to filter artifacts by. */ - runId?: string; + runId?: string | null; /** Whether to include artifacts that have no versions. */ - includeEmptyArtifacts?: boolean; + includeEmptyArtifacts?: boolean | null; } diff --git a/src/api/resources/artifacts/client/requests/index.ts b/src/api/resources/artifacts/client/requests/index.ts index 0a61745d..93d8a2e4 100644 --- a/src/api/resources/artifacts/client/requests/index.ts +++ b/src/api/resources/artifacts/client/requests/index.ts @@ -1,2 +1,2 @@ export type { ApplyArtifactRequest } from "./ApplyArtifactRequest.js"; -export type { ArtifactsListRequest } from "./ArtifactsListRequest.js"; +export type { ListArtifactsRequest } from "./ListArtifactsRequest.js"; diff --git a/src/api/resources/clusters/client/Client.ts b/src/api/resources/clusters/client/Client.ts index 9502d522..a0b535d0 100644 --- a/src/api/resources/clusters/client/Client.ts +++ b/src/api/resources/clusters/client/Client.ts @@ -1,9 +1,11 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; -import * as core from "../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import { toJson } from "../../../../core/json.js"; +import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; @@ -12,70 +14,120 @@ import * as TrueFoundry from "../../../index.js"; export declare namespace ClustersClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class ClustersClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: ClustersClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** * List clusters the caller can read. * - * @param {TrueFoundry.ClustersListRequest} request + * @param {TrueFoundry.ListClustersRequest} request * @param {ClustersClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.UnauthorizedError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.clusters.list({ * limit: 10, - * offset: 0, - * attributes: ["attributes"] + * offset: 0 * }) */ - public async list(request: TrueFoundry.ClustersListRequest = {}, requestOptions?: ClustersClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.ClustersListRequest): Promise> => { const { limit = 100, offset = 0, attributes } = request; const _queryParams: Record = { - limit, - offset, - attributes - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/clusters"), - method: "GET", - headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.ListClustersResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 401: throw new TrueFoundry.UnauthorizedError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse + public async list( + request: TrueFoundry.ListClustersRequest = {}, + requestOptions?: ClustersClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.ListClustersRequest, + ): Promise> => { + const { limit = 100, offset = 0, attributes } = request; + const _queryParams: Record = { + limit, + offset, + attributes: attributes !== undefined ? toJson(attributes) : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/clusters", + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, }); - } - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/clusters"); }); + if (_response.ok) { + return { + data: serializers.ListClustersResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new TrueFoundry.UnauthorizedError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/clusters"); + }, + ); let _offset = request?.offset != null ? request?.offset : 0; const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => (response?.data ?? []).length > 0 && (request?.limit == null || (response?.data ?? []).length >= request?.limit), - getItems: response => response?.data ?? [], - loadPage: response => { _offset += response?.data != null ? response.data.length : 1; return list(core.setObjectProperty(request, "offset", _offset)); } + hasNextPage: (response) => + (response?.data ?? []).length > 0 && + (request?.limit == null || (response?.data ?? []).length >= request?.limit), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + _offset += response?.data != null ? response.data.length : 1; + return list(core.setObjectProperty(request, "offset", _offset)); + }, }); } @@ -88,6 +140,8 @@ export class ClustersClient { * @throws {@link TrueFoundry.UnauthorizedError} * @throws {@link TrueFoundry.ConflictError} * @throws {@link TrueFoundry.UnprocessableEntityError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.clusters.createOrUpdate({ @@ -103,41 +157,103 @@ export class ClustersClient { * } * }) */ - public createOrUpdate(request: TrueFoundry.CreateOrUpdateClusterRequest, requestOptions?: ClustersClient.RequestOptions): core.HttpResponsePromise { + public createOrUpdate( + request: TrueFoundry.CreateOrUpdateClusterRequest, + requestOptions?: ClustersClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__createOrUpdate(request, requestOptions)); } - private async __createOrUpdate(request: TrueFoundry.CreateOrUpdateClusterRequest, requestOptions?: ClustersClient.RequestOptions): Promise> { + private async __createOrUpdate( + request: TrueFoundry.CreateOrUpdateClusterRequest, + requestOptions?: ClustersClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/clusters"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/clusters", + ), method: "PUT", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.CreateOrUpdateClusterRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.CreateOrUpdateClusterRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetClusterResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetClusterResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 401: throw new TrueFoundry.UnauthorizedError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 409: throw new TrueFoundry.ConflictError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 422: throw new TrueFoundry.UnprocessableEntityError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 401: + throw new TrueFoundry.UnauthorizedError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 409: + throw new TrueFoundry.ConflictError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 422: + throw new TrueFoundry.UnprocessableEntityError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -152,19 +268,35 @@ export class ClustersClient { * * @throws {@link TrueFoundry.UnauthorizedError} * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.clusters.get("id") */ - public get(id: string, requestOptions?: ClustersClient.RequestOptions): core.HttpResponsePromise { + public get( + id: string, + requestOptions?: ClustersClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions)); } - private async __get(id: string, requestOptions?: ClustersClient.RequestOptions): Promise> { + private async __get( + id: string, + requestOptions?: ClustersClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/clusters/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/clusters/${core.url.encodePathParam(id)}`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -172,21 +304,42 @@ export class ClustersClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetClusterResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetClusterResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 401: throw new TrueFoundry.UnauthorizedError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 401: + throw new TrueFoundry.UnauthorizedError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -201,19 +354,35 @@ export class ClustersClient { * * @throws {@link TrueFoundry.UnauthorizedError} * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.clusters.delete("id") */ - public delete(id: string, requestOptions?: ClustersClient.RequestOptions): core.HttpResponsePromise { + public delete( + id: string, + requestOptions?: ClustersClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions)); } - private async __delete(id: string, requestOptions?: ClustersClient.RequestOptions): Promise> { + private async __delete( + id: string, + requestOptions?: ClustersClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/clusters/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/clusters/${core.url.encodePathParam(id)}`, + ), method: "DELETE", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -221,21 +390,42 @@ export class ClustersClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.DeleteClusterResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.DeleteClusterResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 401: throw new TrueFoundry.UnauthorizedError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 401: + throw new TrueFoundry.UnauthorizedError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -246,60 +436,107 @@ export class ClustersClient { * List addons installed on the cluster. * * @param {string} id - Unique identifier of the cluster. - * @param {TrueFoundry.ClustersGetAddonsRequest} request + * @param {TrueFoundry.GetAddonsClustersRequest} request * @param {ClustersClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.UnauthorizedError} * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.clusters.getAddons("id", { * limit: 10, - * offset: 0, - * attributes: ["attributes"] + * offset: 0 * }) */ - public getAddons(id: string, request: TrueFoundry.ClustersGetAddonsRequest = {}, requestOptions?: ClustersClient.RequestOptions): core.HttpResponsePromise { + public getAddons( + id: string, + request: TrueFoundry.GetAddonsClustersRequest = {}, + requestOptions?: ClustersClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__getAddons(id, request, requestOptions)); } - private async __getAddons(id: string, request: TrueFoundry.ClustersGetAddonsRequest = {}, requestOptions?: ClustersClient.RequestOptions): Promise> { + private async __getAddons( + id: string, + request: TrueFoundry.GetAddonsClustersRequest = {}, + requestOptions?: ClustersClient.RequestOptions, + ): Promise> { const { limit = 100, offset = 0, attributes } = request; const _queryParams: Record = { limit, offset, - attributes + attributes: attributes !== undefined ? toJson(attributes) : undefined, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/clusters/${core.url.encodePathParam(id)}/get-addons`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/clusters/${core.url.encodePathParam(id)}/get-addons`, + ), method: "GET", headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.ListClusterAddonsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.ListClusterAddonsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 401: throw new TrueFoundry.UnauthorizedError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 401: + throw new TrueFoundry.UnauthorizedError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/clusters/{id}/get-addons"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/clusters/{id}/get-addons", + ); } /** @@ -309,19 +546,35 @@ export class ClustersClient { * @param {ClustersClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.UnauthorizedError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.clusters.isConnected("id") */ - public isConnected(id: string, requestOptions?: ClustersClient.RequestOptions): core.HttpResponsePromise { + public isConnected( + id: string, + requestOptions?: ClustersClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__isConnected(id, requestOptions)); } - private async __isConnected(id: string, requestOptions?: ClustersClient.RequestOptions): Promise> { + private async __isConnected( + id: string, + requestOptions?: ClustersClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/clusters/${core.url.encodePathParam(id)}/is-connected`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/clusters/${core.url.encodePathParam(id)}/is-connected`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -329,23 +582,48 @@ export class ClustersClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.IsClusterConnectedResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.IsClusterConnectedResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 401: throw new TrueFoundry.UnauthorizedError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 401: + throw new TrueFoundry.UnauthorizedError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/clusters/{id}/is-connected"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/clusters/{id}/is-connected", + ); } } diff --git a/src/api/resources/clusters/client/requests/CreateOrUpdateClusterRequest.ts b/src/api/resources/clusters/client/requests/CreateOrUpdateClusterRequest.ts index 5a26ee57..9b854697 100644 --- a/src/api/resources/clusters/client/requests/CreateOrUpdateClusterRequest.ts +++ b/src/api/resources/clusters/client/requests/CreateOrUpdateClusterRequest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../index.js"; +import type * as TrueFoundry from "../../../../index.js"; /** * @example @@ -21,5 +21,5 @@ export interface CreateOrUpdateClusterRequest { /** Full cluster manifest. */ manifest: TrueFoundry.ClusterManifest; /** When true, validates the request without persisting changes. */ - dryRun?: boolean; + dryRun?: boolean | null; } diff --git a/src/api/resources/clusters/client/requests/ClustersListRequest.ts b/src/api/resources/clusters/client/requests/GetAddonsClustersRequest.ts similarity index 66% rename from src/api/resources/clusters/client/requests/ClustersListRequest.ts rename to src/api/resources/clusters/client/requests/GetAddonsClustersRequest.ts index ab4af632..ec7aeae9 100644 --- a/src/api/resources/clusters/client/requests/ClustersListRequest.ts +++ b/src/api/resources/clusters/client/requests/GetAddonsClustersRequest.ts @@ -4,15 +4,14 @@ * @example * { * limit: 10, - * offset: 0, - * attributes: ["attributes"] + * offset: 0 * } */ -export interface ClustersListRequest { +export interface GetAddonsClustersRequest { /** Number of items per page */ - limit?: number; + limit?: number | null; /** Number of items to skip */ - offset?: number; + offset?: number | null; /** Comma-separated list of attributes to return (e.g. id,name). When provided, only the specified fields are fetched. `id` is always included. */ - attributes?: string | string[]; + attributes?: string[] | null; } diff --git a/src/api/resources/clusters/client/requests/ClustersGetAddonsRequest.ts b/src/api/resources/clusters/client/requests/ListClustersRequest.ts similarity index 65% rename from src/api/resources/clusters/client/requests/ClustersGetAddonsRequest.ts rename to src/api/resources/clusters/client/requests/ListClustersRequest.ts index e39d522a..e1de8bb3 100644 --- a/src/api/resources/clusters/client/requests/ClustersGetAddonsRequest.ts +++ b/src/api/resources/clusters/client/requests/ListClustersRequest.ts @@ -4,15 +4,14 @@ * @example * { * limit: 10, - * offset: 0, - * attributes: ["attributes"] + * offset: 0 * } */ -export interface ClustersGetAddonsRequest { +export interface ListClustersRequest { /** Number of items per page */ - limit?: number; + limit?: number | null; /** Number of items to skip */ - offset?: number; + offset?: number | null; /** Comma-separated list of attributes to return (e.g. id,name). When provided, only the specified fields are fetched. `id` is always included. */ - attributes?: string | string[]; + attributes?: string[] | null; } diff --git a/src/api/resources/clusters/client/requests/index.ts b/src/api/resources/clusters/client/requests/index.ts index 6d6817fd..c3b0beda 100644 --- a/src/api/resources/clusters/client/requests/index.ts +++ b/src/api/resources/clusters/client/requests/index.ts @@ -1,3 +1,3 @@ -export type { ClustersGetAddonsRequest } from "./ClustersGetAddonsRequest.js"; -export type { ClustersListRequest } from "./ClustersListRequest.js"; export type { CreateOrUpdateClusterRequest } from "./CreateOrUpdateClusterRequest.js"; +export type { GetAddonsClustersRequest } from "./GetAddonsClustersRequest.js"; +export type { ListClustersRequest } from "./ListClustersRequest.js"; diff --git a/src/api/resources/dataDirectories/client/Client.ts b/src/api/resources/dataDirectories/client/Client.ts index 932aa29d..84329306 100644 --- a/src/api/resources/dataDirectories/client/Client.ts +++ b/src/api/resources/dataDirectories/client/Client.ts @@ -1,9 +1,10 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; -import * as core from "../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; @@ -12,69 +13,112 @@ import * as TrueFoundry from "../../../index.js"; export declare namespace DataDirectoriesClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class DataDirectoriesClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: DataDirectoriesClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** * List data directories with optional filtering by FQN, ML Repo, or name. * - * @param {TrueFoundry.DataDirectoriesListRequest} request + * @param {TrueFoundry.ListDataDirectoriesRequest} request * @param {DataDirectoriesClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.dataDirectories.list({ * limit: 10, - * offset: 0, - * fqn: "fqn", - * mlRepoId: "ml_repo_id", - * name: "name" + * offset: 0 * }) */ - public async list(request: TrueFoundry.DataDirectoriesListRequest = {}, requestOptions?: DataDirectoriesClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.DataDirectoriesListRequest): Promise> => { const { limit = 100, offset = 0, fqn, mlRepoId, name } = request; const _queryParams: Record = { - limit, - offset, - fqn, - ml_repo_id: mlRepoId, - name - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/data-directories"), - method: "GET", - headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.ListDataDirectoriesResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/data-directories"); }); + public async list( + request: TrueFoundry.ListDataDirectoriesRequest = {}, + requestOptions?: DataDirectoriesClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.ListDataDirectoriesRequest, + ): Promise> => { + const { limit = 100, offset = 0, fqn, mlRepoId, name } = request; + const _queryParams: Record = { + limit, + offset, + fqn, + ml_repo_id: mlRepoId, + name, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/data-directories", + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ListDataDirectoriesResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/data-directories", + ); + }, + ); let _offset = request?.offset != null ? request?.offset : 0; const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => (response?.data ?? []).length > 0 && (request?.limit == null || (response?.data ?? []).length >= request?.limit), - getItems: response => response?.data ?? [], - loadPage: response => { _offset += response?.data != null ? response.data.length : 1; return list(core.setObjectProperty(request, "offset", _offset)); } + hasNextPage: (response) => + (response?.data ?? []).length > 0 && + (request?.limit == null || (response?.data ?? []).length >= request?.limit), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + _offset += response?.data != null ? response.data.length : 1; + return list(core.setObjectProperty(request, "offset", _offset)); + }, }); } @@ -84,6 +128,9 @@ export class DataDirectoriesClient { * @param {TrueFoundry.ApplyDataDirectoryRequest} request * @param {DataDirectoriesClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.dataDirectories.createOrUpdate({ * manifest: { @@ -99,36 +146,67 @@ export class DataDirectoriesClient { * } * }) */ - public createOrUpdate(request: TrueFoundry.ApplyDataDirectoryRequest, requestOptions?: DataDirectoriesClient.RequestOptions): core.HttpResponsePromise { + public createOrUpdate( + request: TrueFoundry.ApplyDataDirectoryRequest, + requestOptions?: DataDirectoriesClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__createOrUpdate(request, requestOptions)); } - private async __createOrUpdate(request: TrueFoundry.ApplyDataDirectoryRequest, requestOptions?: DataDirectoriesClient.RequestOptions): Promise> { + private async __createOrUpdate( + request: TrueFoundry.ApplyDataDirectoryRequest, + requestOptions?: DataDirectoriesClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/data-directories"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/data-directories", + ), method: "PUT", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.ApplyDataDirectoryRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.ApplyDataDirectoryRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetDataDirectoryResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetDataDirectoryResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } @@ -141,41 +219,92 @@ export class DataDirectoriesClient { * @param {TrueFoundry.ListFilesRequest} request * @param {DataDirectoriesClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.dataDirectories.listFiles({ * id: "id" * }) */ - public async listFiles(request: TrueFoundry.ListFilesRequest, requestOptions?: DataDirectoriesClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.ListFilesRequest): Promise> => { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/data-directories/files"), - method: "POST", - headers: _headers, - contentType: "application/json", - queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), - requestType: "json", - body: serializers.ListFilesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.ListFilesResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/svc/v1/data-directories/files"); }); + public async listFiles( + request: TrueFoundry.ListFilesRequest, + requestOptions?: DataDirectoriesClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.ListFilesRequest, + ): Promise> => { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/data-directories/files", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + requestType: "json", + body: mergeAdditionalBodyParameters( + serializers.ListFilesRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ListFilesResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/api/svc/v1/data-directories/files", + ); + }, + ); const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => response?.pagination.nextPageToken != null && !(typeof response?.pagination.nextPageToken === "string" && response?.pagination.nextPageToken === ""), - getItems: response => response?.data ?? [], - loadPage: response => { return list(core.setObjectProperty(request, "pageToken", response?.pagination.nextPageToken)); } + hasNextPage: (response) => + response?.pagination.nextPageToken != null && + !(typeof response?.pagination.nextPageToken === "string" && response?.pagination.nextPageToken === ""), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + return list(core.setObjectProperty(request, "pageToken", response?.pagination.nextPageToken)); + }, }); } @@ -185,46 +314,85 @@ export class DataDirectoriesClient { * @param {TrueFoundry.DeleteFilesRequest} request * @param {DataDirectoriesClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.dataDirectories.deleteFiles({ * id: "id", * paths: ["paths"] * }) */ - public deleteFiles(request: TrueFoundry.DeleteFilesRequest, requestOptions?: DataDirectoriesClient.RequestOptions): core.HttpResponsePromise { + public deleteFiles( + request: TrueFoundry.DeleteFilesRequest, + requestOptions?: DataDirectoriesClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__deleteFiles(request, requestOptions)); } - private async __deleteFiles(request: TrueFoundry.DeleteFilesRequest, requestOptions?: DataDirectoriesClient.RequestOptions): Promise> { + private async __deleteFiles( + request: TrueFoundry.DeleteFilesRequest, + requestOptions?: DataDirectoriesClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/data-directories/files"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/data-directories/files", + ), method: "DELETE", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.DeleteFilesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.DeleteFilesRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.EmptyResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.EmptyResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/api/svc/v1/data-directories/files"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/api/svc/v1/data-directories/files", + ); } /** @@ -233,6 +401,9 @@ export class DataDirectoriesClient { * @param {TrueFoundry.CreateMultiPartUploadRequest} request * @param {DataDirectoriesClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.dataDirectories.createMultipartUpload({ * id: "id", @@ -240,40 +411,76 @@ export class DataDirectoriesClient { * numParts: 1.1 * }) */ - public createMultipartUpload(request: TrueFoundry.CreateMultiPartUploadRequest, requestOptions?: DataDirectoriesClient.RequestOptions): core.HttpResponsePromise { + public createMultipartUpload( + request: TrueFoundry.CreateMultiPartUploadRequest, + requestOptions?: DataDirectoriesClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__createMultipartUpload(request, requestOptions)); } - private async __createMultipartUpload(request: TrueFoundry.CreateMultiPartUploadRequest, requestOptions?: DataDirectoriesClient.RequestOptions): Promise> { + private async __createMultipartUpload( + request: TrueFoundry.CreateMultiPartUploadRequest, + requestOptions?: DataDirectoriesClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/data-directories/signed-urls/multipart"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/data-directories/signed-urls/multipart", + ), method: "POST", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.CreateMultiPartUploadRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.CreateMultiPartUploadRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.MultiPartUploadResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.MultiPartUploadResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/svc/v1/data-directories/signed-urls/multipart"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/api/svc/v1/data-directories/signed-urls/multipart", + ); } /** @@ -282,6 +489,9 @@ export class DataDirectoriesClient { * @param {TrueFoundry.GetSignedUrLsRequest} request * @param {DataDirectoriesClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.dataDirectories.getSignedUrls({ * id: "id", @@ -289,40 +499,76 @@ export class DataDirectoriesClient { * operation: "READ" * }) */ - public getSignedUrls(request: TrueFoundry.GetSignedUrLsRequest, requestOptions?: DataDirectoriesClient.RequestOptions): core.HttpResponsePromise { + public getSignedUrls( + request: TrueFoundry.GetSignedUrLsRequest, + requestOptions?: DataDirectoriesClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__getSignedUrls(request, requestOptions)); } - private async __getSignedUrls(request: TrueFoundry.GetSignedUrLsRequest, requestOptions?: DataDirectoriesClient.RequestOptions): Promise> { + private async __getSignedUrls( + request: TrueFoundry.GetSignedUrLsRequest, + requestOptions?: DataDirectoriesClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/data-directories/signed-urls"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/data-directories/signed-urls", + ), method: "POST", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.GetSignedUrLsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.GetSignedUrLsRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetSignedUrLsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetSignedUrLsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/svc/v1/data-directories/signed-urls"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/api/svc/v1/data-directories/signed-urls", + ); } /** @@ -332,19 +578,35 @@ export class DataDirectoriesClient { * @param {DataDirectoriesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.dataDirectories.get("id") */ - public get(id: string, requestOptions?: DataDirectoriesClient.RequestOptions): core.HttpResponsePromise { + public get( + id: string, + requestOptions?: DataDirectoriesClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions)); } - private async __get(id: string, requestOptions?: DataDirectoriesClient.RequestOptions): Promise> { + private async __get( + id: string, + requestOptions?: DataDirectoriesClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/data-directories/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/data-directories/${core.url.encodePathParam(id)}`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -352,77 +614,129 @@ export class DataDirectoriesClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetDataDirectoryResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetDataDirectoryResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/data-directories/{id}"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/data-directories/{id}", + ); } /** * Delete a data directory, optionally including its contents. * * @param {string} id - Data directory ID - * @param {TrueFoundry.DataDirectoriesDeleteRequest} request + * @param {TrueFoundry.DeleteDataDirectoriesRequest} request * @param {DataDirectoriesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example - * await client.dataDirectories.delete("id", { - * deleteContents: true - * }) + * await client.dataDirectories.delete("id") */ - public delete(id: string, request: TrueFoundry.DataDirectoriesDeleteRequest = {}, requestOptions?: DataDirectoriesClient.RequestOptions): core.HttpResponsePromise { + public delete( + id: string, + request: TrueFoundry.DeleteDataDirectoriesRequest = {}, + requestOptions?: DataDirectoriesClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(id, request, requestOptions)); } - private async __delete(id: string, request: TrueFoundry.DataDirectoriesDeleteRequest = {}, requestOptions?: DataDirectoriesClient.RequestOptions): Promise> { + private async __delete( + id: string, + request: TrueFoundry.DeleteDataDirectoriesRequest = {}, + requestOptions?: DataDirectoriesClient.RequestOptions, + ): Promise> { const { deleteContents = false } = request; const _queryParams: Record = { - delete_contents: deleteContents + delete_contents: deleteContents, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/data-directories/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/data-directories/${core.url.encodePathParam(id)}`, + ), method: "DELETE", headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.EmptyResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.EmptyResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/api/svc/v1/data-directories/{id}"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/api/svc/v1/data-directories/{id}", + ); } } diff --git a/src/api/resources/dataDirectories/client/requests/ApplyDataDirectoryRequest.ts b/src/api/resources/dataDirectories/client/requests/ApplyDataDirectoryRequest.ts index b79ff5b2..7f00f49b 100644 --- a/src/api/resources/dataDirectories/client/requests/ApplyDataDirectoryRequest.ts +++ b/src/api/resources/dataDirectories/client/requests/ApplyDataDirectoryRequest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../index.js"; +import type * as TrueFoundry from "../../../../index.js"; /** * @example diff --git a/src/api/resources/dataDirectories/client/requests/DataDirectoriesDeleteRequest.ts b/src/api/resources/dataDirectories/client/requests/DeleteDataDirectoriesRequest.ts similarity index 67% rename from src/api/resources/dataDirectories/client/requests/DataDirectoriesDeleteRequest.ts rename to src/api/resources/dataDirectories/client/requests/DeleteDataDirectoriesRequest.ts index 5ae939be..039b6451 100644 --- a/src/api/resources/dataDirectories/client/requests/DataDirectoriesDeleteRequest.ts +++ b/src/api/resources/dataDirectories/client/requests/DeleteDataDirectoriesRequest.ts @@ -2,11 +2,9 @@ /** * @example - * { - * deleteContents: true - * } + * {} */ -export interface DataDirectoriesDeleteRequest { +export interface DeleteDataDirectoriesRequest { /** When true, also delete the contents (files) stored under the data directory. */ deleteContents?: boolean; } diff --git a/src/api/resources/dataDirectories/client/requests/DataDirectoriesListRequest.ts b/src/api/resources/dataDirectories/client/requests/ListDataDirectoriesRequest.ts similarity index 57% rename from src/api/resources/dataDirectories/client/requests/DataDirectoriesListRequest.ts rename to src/api/resources/dataDirectories/client/requests/ListDataDirectoriesRequest.ts index 2df45a79..5bda2f33 100644 --- a/src/api/resources/dataDirectories/client/requests/DataDirectoriesListRequest.ts +++ b/src/api/resources/dataDirectories/client/requests/ListDataDirectoriesRequest.ts @@ -4,21 +4,18 @@ * @example * { * limit: 10, - * offset: 0, - * fqn: "fqn", - * mlRepoId: "ml_repo_id", - * name: "name" + * offset: 0 * } */ -export interface DataDirectoriesListRequest { +export interface ListDataDirectoriesRequest { /** Number of items per page */ - limit?: number; + limit?: number | null; /** Number of items to skip */ - offset?: number; + offset?: number | null; /** Fully qualified name to filter by */ - fqn?: string; + fqn?: string | null; /** ID of the ML Repo to filter by */ - mlRepoId?: string; + mlRepoId?: string | null; /** Name of the data directory to filter by */ - name?: string; + name?: string | null; } diff --git a/src/api/resources/dataDirectories/client/requests/index.ts b/src/api/resources/dataDirectories/client/requests/index.ts index 541b4679..8b3121dd 100644 --- a/src/api/resources/dataDirectories/client/requests/index.ts +++ b/src/api/resources/dataDirectories/client/requests/index.ts @@ -1,4 +1,4 @@ export type { ApplyDataDirectoryRequest } from "./ApplyDataDirectoryRequest.js"; -export type { DataDirectoriesDeleteRequest } from "./DataDirectoriesDeleteRequest.js"; -export type { DataDirectoriesListRequest } from "./DataDirectoriesListRequest.js"; +export type { DeleteDataDirectoriesRequest } from "./DeleteDataDirectoriesRequest.js"; export type { DeleteFilesRequest } from "./DeleteFilesRequest.js"; +export type { ListDataDirectoriesRequest } from "./ListDataDirectoriesRequest.js"; diff --git a/src/api/resources/environments/client/Client.ts b/src/api/resources/environments/client/Client.ts index aa07abfb..b5f743c6 100644 --- a/src/api/resources/environments/client/Client.ts +++ b/src/api/resources/environments/client/Client.ts @@ -1,9 +1,10 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; -import * as core from "../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; @@ -12,63 +13,109 @@ import * as TrueFoundry from "../../../index.js"; export declare namespace EnvironmentsClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class EnvironmentsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: EnvironmentsClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** * List environments the caller can read within the tenant. * - * @param {TrueFoundry.EnvironmentsListRequest} request + * @param {TrueFoundry.ListEnvironmentsRequest} request * @param {EnvironmentsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.environments.list({ * limit: 10, * offset: 0 * }) */ - public async list(request: TrueFoundry.EnvironmentsListRequest = {}, requestOptions?: EnvironmentsClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.EnvironmentsListRequest): Promise> => { const { limit = 100, offset = 0 } = request; const _queryParams: Record = { - limit, - offset - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/environments"), - method: "GET", - headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.ListEnvironmentsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/environments"); }); + public async list( + request: TrueFoundry.ListEnvironmentsRequest = {}, + requestOptions?: EnvironmentsClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.ListEnvironmentsRequest, + ): Promise> => { + const { limit = 100, offset = 0 } = request; + const _queryParams: Record = { + limit, + offset, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/environments", + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ListEnvironmentsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/environments", + ); + }, + ); let _offset = request?.offset != null ? request?.offset : 0; const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => (response?.data ?? []).length > 0 && (request?.limit == null || (response?.data ?? []).length >= request?.limit), - getItems: response => response?.data ?? [], - loadPage: response => { _offset += response?.data != null ? response.data.length : 1; return list(core.setObjectProperty(request, "offset", _offset)); } + hasNextPage: (response) => + (response?.data ?? []).length > 0 && + (request?.limit == null || (response?.data ?? []).length >= request?.limit), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + _offset += response?.data != null ? response.data.length : 1; + return list(core.setObjectProperty(request, "offset", _offset)); + }, }); } @@ -79,6 +126,8 @@ export class EnvironmentsClient { * @param {EnvironmentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.UnprocessableEntityError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.environments.createOrUpdate({ @@ -91,39 +140,81 @@ export class EnvironmentsClient { * } * }) */ - public createOrUpdate(request: TrueFoundry.CreateOrUpdateEnvironmentRequest, requestOptions?: EnvironmentsClient.RequestOptions): core.HttpResponsePromise { + public createOrUpdate( + request: TrueFoundry.CreateOrUpdateEnvironmentRequest, + requestOptions?: EnvironmentsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__createOrUpdate(request, requestOptions)); } - private async __createOrUpdate(request: TrueFoundry.CreateOrUpdateEnvironmentRequest, requestOptions?: EnvironmentsClient.RequestOptions): Promise> { + private async __createOrUpdate( + request: TrueFoundry.CreateOrUpdateEnvironmentRequest, + requestOptions?: EnvironmentsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/environments"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/environments", + ), method: "PUT", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.CreateOrUpdateEnvironmentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.CreateOrUpdateEnvironmentRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetEnvironmentResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetEnvironmentResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 422: throw new TrueFoundry.UnprocessableEntityError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 422: + throw new TrueFoundry.UnprocessableEntityError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -136,18 +227,35 @@ export class EnvironmentsClient { * @param {string} id - System-generated environment ID. * @param {EnvironmentsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.environments.get("jqfwg345gi25n5ju2yz5iz6m") */ - public get(id: string, requestOptions?: EnvironmentsClient.RequestOptions): core.HttpResponsePromise { + public get( + id: string, + requestOptions?: EnvironmentsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions)); } - private async __get(id: string, requestOptions?: EnvironmentsClient.RequestOptions): Promise> { + private async __get( + id: string, + requestOptions?: EnvironmentsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/environments/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/environments/${core.url.encodePathParam(id)}`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -155,17 +263,26 @@ export class EnvironmentsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetEnvironmentResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetEnvironmentResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } @@ -180,6 +297,8 @@ export class EnvironmentsClient { * * @throws {@link TrueFoundry.NotFoundError} * @throws {@link TrueFoundry.ConflictError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.environments.delete("jqfwg345gi25n5ju2yz5iz6m") @@ -188,11 +307,22 @@ export class EnvironmentsClient { return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions)); } - private async __delete(id: string, requestOptions?: EnvironmentsClient.RequestOptions): Promise> { + private async __delete( + id: string, + requestOptions?: EnvironmentsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/environments/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/environments/${core.url.encodePathParam(id)}`, + ), method: "DELETE", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -200,24 +330,50 @@ export class EnvironmentsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.environments.delete.Response.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.environments.delete.Response.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - case 409: throw new TrueFoundry.ConflictError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + case 409: + throw new TrueFoundry.ConflictError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/api/svc/v1/environments/{id}"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/api/svc/v1/environments/{id}", + ); } } diff --git a/src/api/resources/environments/client/requests/CreateOrUpdateEnvironmentRequest.ts b/src/api/resources/environments/client/requests/CreateOrUpdateEnvironmentRequest.ts index 743017da..08507612 100644 --- a/src/api/resources/environments/client/requests/CreateOrUpdateEnvironmentRequest.ts +++ b/src/api/resources/environments/client/requests/CreateOrUpdateEnvironmentRequest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../index.js"; +import type * as TrueFoundry from "../../../../index.js"; /** * @example @@ -18,5 +18,5 @@ export interface CreateOrUpdateEnvironmentRequest { /** Environment manifest. The environment is matched by `name` for upsert. */ manifest: TrueFoundry.EnvironmentManifest; /** When true, validates the manifest without persisting changes. */ - dryRun?: boolean; + dryRun?: boolean | null; } diff --git a/src/api/resources/environments/client/requests/EnvironmentsListRequest.ts b/src/api/resources/environments/client/requests/ListEnvironmentsRequest.ts similarity index 69% rename from src/api/resources/environments/client/requests/EnvironmentsListRequest.ts rename to src/api/resources/environments/client/requests/ListEnvironmentsRequest.ts index 1f25e2e6..416331ad 100644 --- a/src/api/resources/environments/client/requests/EnvironmentsListRequest.ts +++ b/src/api/resources/environments/client/requests/ListEnvironmentsRequest.ts @@ -7,9 +7,9 @@ * offset: 0 * } */ -export interface EnvironmentsListRequest { +export interface ListEnvironmentsRequest { /** Number of items per page */ - limit?: number; + limit?: number | null; /** Number of items to skip */ - offset?: number; + offset?: number | null; } diff --git a/src/api/resources/environments/client/requests/index.ts b/src/api/resources/environments/client/requests/index.ts index da27885f..e6dd8134 100644 --- a/src/api/resources/environments/client/requests/index.ts +++ b/src/api/resources/environments/client/requests/index.ts @@ -1,2 +1,2 @@ export type { CreateOrUpdateEnvironmentRequest } from "./CreateOrUpdateEnvironmentRequest.js"; -export type { EnvironmentsListRequest } from "./EnvironmentsListRequest.js"; +export type { ListEnvironmentsRequest } from "./ListEnvironmentsRequest.js"; diff --git a/src/api/resources/events/client/Client.ts b/src/api/resources/events/client/Client.ts index e9e7186c..4e4579de 100644 --- a/src/api/resources/events/client/Client.ts +++ b/src/api/resources/events/client/Client.ts @@ -1,9 +1,10 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; -import * as core from "../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import { toJson } from "../../../../core/json.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; @@ -12,81 +13,112 @@ import * as TrueFoundry from "../../../index.js"; export declare namespace EventsClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class EventsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: EventsClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** * Get events for an application, filtered by pod names, job run, or time range. * - * @param {TrueFoundry.EventsGetRequest} request + * @param {TrueFoundry.GetEventsRequest} request * @param {EventsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.BadRequestError} * @throws {@link TrueFoundry.ForbiddenError} * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example - * await client.events.get({ - * startTs: "startTs", - * endTs: "endTs", - * applicationId: "applicationId", - * applicationFqn: "applicationFqn", - * podNames: ["podNames"], - * jobRunName: "jobRunName" - * }) + * await client.events.get() */ - public get(request: TrueFoundry.EventsGetRequest = {}, requestOptions?: EventsClient.RequestOptions): core.HttpResponsePromise { + public get( + request: TrueFoundry.GetEventsRequest = {}, + requestOptions?: EventsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } - private async __get(request: TrueFoundry.EventsGetRequest = {}, requestOptions?: EventsClient.RequestOptions): Promise> { + private async __get( + request: TrueFoundry.GetEventsRequest = {}, + requestOptions?: EventsClient.RequestOptions, + ): Promise> { const { startTs, endTs, applicationId, applicationFqn, podNames, jobRunName } = request; const _queryParams: Record = { startTs, endTs, applicationId, applicationFqn, - podNames, - jobRunName + podNames: podNames !== undefined ? toJson(podNames) : undefined, + jobRunName, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/events"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/events", + ), method: "GET", headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetEventsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetEventsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 400: throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 400: + throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } diff --git a/src/api/resources/events/client/requests/EventsGetRequest.ts b/src/api/resources/events/client/requests/GetEventsRequest.ts similarity index 64% rename from src/api/resources/events/client/requests/EventsGetRequest.ts rename to src/api/resources/events/client/requests/GetEventsRequest.ts index 8216e8bb..42a62e87 100644 --- a/src/api/resources/events/client/requests/EventsGetRequest.ts +++ b/src/api/resources/events/client/requests/GetEventsRequest.ts @@ -2,26 +2,19 @@ /** * @example - * { - * startTs: "startTs", - * endTs: "endTs", - * applicationId: "applicationId", - * applicationFqn: "applicationFqn", - * podNames: ["podNames"], - * jobRunName: "jobRunName" - * } + * {} */ -export interface EventsGetRequest { +export interface GetEventsRequest { /** Start timestamp for filtering events (ISO 8601 format, UTC). Defaults to 24 hours before endTs. Must be less than or equal to endTs. */ - startTs?: string; + startTs?: string | null; /** End timestamp for filtering events (ISO 8601 format, UTC). Defaults to current time. Must be greater than or equal to startTs. */ - endTs?: string; + endTs?: string | null; /** Unique identifier of the application. Either applicationId or applicationFqn must be provided. */ - applicationId?: string; + applicationId?: string | null; /** Fully qualified name of the application. Either applicationId or applicationFqn must be provided. */ - applicationFqn?: string; + applicationFqn?: string | null; /** List of Kubernetes pod names to filter events. Cannot be provided together with jobRunName. */ - podNames?: string | string[]; + podNames?: string[] | null; /** Name of the TrueFoundry job run. Cannot be provided together with podNames. */ - jobRunName?: string; + jobRunName?: string | null; } diff --git a/src/api/resources/events/client/requests/index.ts b/src/api/resources/events/client/requests/index.ts index 4167b9e9..c3d59ca2 100644 --- a/src/api/resources/events/client/requests/index.ts +++ b/src/api/resources/events/client/requests/index.ts @@ -1 +1 @@ -export type { EventsGetRequest } from "./EventsGetRequest.js"; +export type { GetEventsRequest } from "./GetEventsRequest.js"; diff --git a/src/api/resources/gatewayBudgets/client/Client.ts b/src/api/resources/gatewayBudgets/client/Client.ts new file mode 100644 index 00000000..c73b1ef3 --- /dev/null +++ b/src/api/resources/gatewayBudgets/client/Client.ts @@ -0,0 +1,607 @@ +// This file was auto-generated by Fern from our API Definition. + +import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; +import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.js"; +import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; +import * as errors from "../../../../errors/index.js"; +import * as serializers from "../../../../serialization/index.js"; +import * as TrueFoundry from "../../../index.js"; + +export declare namespace GatewayBudgetsClient { + export type Options = BaseClientOptions; + + export interface RequestOptions extends BaseRequestOptions {} +} + +export class GatewayBudgetsClient { + protected readonly _options: NormalizedClientOptionsWithAuth; + + constructor(options: GatewayBudgetsClient.Options) { + this._options = normalizeClientOptionsWithAuth(options); + } + + /** + * List the gateway budgets the caller can read within the tenant. + * + * @param {TrueFoundry.ListGatewayBudgetsRequest} request + * @param {GatewayBudgetsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * + * @example + * await client.gatewayBudgets.list() + */ + public list( + request: TrueFoundry.ListGatewayBudgetsRequest = {}, + requestOptions?: GatewayBudgetsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); + } + + private async __list( + request: TrueFoundry.ListGatewayBudgetsRequest = {}, + requestOptions?: GatewayBudgetsClient.RequestOptions, + ): Promise> { + const { type: type_, teamName } = request; + const _queryParams: Record = { + type: + type_ != null + ? serializers.ListGatewayBudgetsRequestType.jsonOrThrow(type_, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }) + : undefined, + team_name: teamName, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/llm-gateway/budgets", + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ListBudgetsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/llm-gateway/budgets", + ); + } + + /** + * Creates or updates a budget manifest for the tenant. Budgets are upserted by `manifest.name` (unique per tenant). + * + * @param {TrueFoundry.CreateOrUpdateBudgetRequest} request + * @param {GatewayBudgetsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link TrueFoundry.BadRequestError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * + * @example + * await client.gatewayBudgets.createOrUpdate({ + * manifest: { + * type: "tenant-budget-config", + * name: "name", + * limits: {}, + * appliesTo: { + * type: "aggregate" + * }, + * mode: "enforce" + * } + * }) + */ + public createOrUpdate( + request: TrueFoundry.CreateOrUpdateBudgetRequest, + requestOptions?: GatewayBudgetsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__createOrUpdate(request, requestOptions)); + } + + private async __createOrUpdate( + request: TrueFoundry.CreateOrUpdateBudgetRequest, + requestOptions?: GatewayBudgetsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/llm-gateway/budgets", + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + requestType: "json", + body: mergeAdditionalBodyParameters( + serializers.CreateOrUpdateBudgetRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.GatewayBudget.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PUT", + "/api/svc/v1/llm-gateway/budgets", + ); + } + + /** + * Returns every per-user budget that currently applies to the caller, with current usage per period. + * + * @param {GatewayBudgetsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * + * @example + * await client.gatewayBudgets.getMyUsage() + */ + public getMyUsage( + requestOptions?: GatewayBudgetsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getMyUsage(requestOptions)); + } + + private async __getMyUsage( + requestOptions?: GatewayBudgetsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/llm-gateway/budgets/my-usage", + ), + method: "GET", + headers: _headers, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.BudgetUsageResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/llm-gateway/budgets/my-usage", + ); + } + + /** + * Returns the budgets that would apply to a hypothetical user/team/model/metadata selection, with current usage. + * + * @param {TrueFoundry.SimulateBudgetRequest} request + * @param {GatewayBudgetsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * + * @example + * await client.gatewayBudgets.simulate() + */ + public simulate( + request: TrueFoundry.SimulateBudgetRequest = {}, + requestOptions?: GatewayBudgetsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__simulate(request, requestOptions)); + } + + private async __simulate( + request: TrueFoundry.SimulateBudgetRequest = {}, + requestOptions?: GatewayBudgetsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/llm-gateway/budgets/simulate", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + requestType: "json", + body: mergeAdditionalBodyParameters( + serializers.SimulateBudgetRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.BudgetUsageResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/api/svc/v1/llm-gateway/budgets/simulate", + ); + } + + /** + * Returns a single budget by id. + * + * @param {string} id - The budget id to retrieve or delete. + * @param {GatewayBudgetsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * + * @example + * await client.gatewayBudgets.get("id") + */ + public get( + id: string, + requestOptions?: GatewayBudgetsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions)); + } + + private async __get( + id: string, + requestOptions?: GatewayBudgetsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/llm-gateway/budgets/${core.url.encodePathParam(id)}`, + ), + method: "GET", + headers: _headers, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.GatewayBudget.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/llm-gateway/budgets/{id}", + ); + } + + /** + * Permanently deletes a budget manifest. + * + * @param {string} id - The budget id to retrieve or delete. + * @param {GatewayBudgetsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * + * @example + * await client.gatewayBudgets.delete("id") + */ + public delete(id: string, requestOptions?: GatewayBudgetsClient.RequestOptions): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions)); + } + + private async __delete( + id: string, + requestOptions?: GatewayBudgetsClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/llm-gateway/budgets/${core.url.encodePathParam(id)}`, + ), + method: "DELETE", + headers: _headers, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/api/svc/v1/llm-gateway/budgets/{id}", + ); + } + + /** + * Returns the top spenders for a budget in its applies_to dimension, for the configured period. Aggregate budgets return a single whole-budget entity (entity: null). + * + * @param {string} id - The budget id to retrieve or delete. + * @param {TrueFoundry.GetLeaderboardGatewayBudgetsRequest} request + * @param {GatewayBudgetsClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * + * @example + * await client.gatewayBudgets.getLeaderboard("id", { + * limit: 50 + * }) + */ + public getLeaderboard( + id: string, + request: TrueFoundry.GetLeaderboardGatewayBudgetsRequest = {}, + requestOptions?: GatewayBudgetsClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__getLeaderboard(id, request, requestOptions)); + } + + private async __getLeaderboard( + id: string, + request: TrueFoundry.GetLeaderboardGatewayBudgetsRequest = {}, + requestOptions?: GatewayBudgetsClient.RequestOptions, + ): Promise> { + const { limit } = request; + const _queryParams: Record = { + limit, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/llm-gateway/budgets/${core.url.encodePathParam(id)}/leaderboard`, + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.BudgetUsageResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/llm-gateway/budgets/{id}/leaderboard", + ); + } +} diff --git a/src/api/resources/gatewayBudgets/client/index.ts b/src/api/resources/gatewayBudgets/client/index.ts new file mode 100644 index 00000000..195f9aa8 --- /dev/null +++ b/src/api/resources/gatewayBudgets/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/api/resources/gatewayBudgets/client/requests/CreateOrUpdateBudgetRequest.ts b/src/api/resources/gatewayBudgets/client/requests/CreateOrUpdateBudgetRequest.ts new file mode 100644 index 00000000..d78e0897 --- /dev/null +++ b/src/api/resources/gatewayBudgets/client/requests/CreateOrUpdateBudgetRequest.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../../../index.js"; + +/** + * @example + * { + * manifest: { + * type: "tenant-budget-config", + * name: "name", + * limits: {}, + * appliesTo: { + * type: "aggregate" + * }, + * mode: "enforce" + * } + * } + */ +export interface CreateOrUpdateBudgetRequest { + /** The budget manifest. Must match either the TenantBudgetConfig or TeamBudgetConfig schema. */ + manifest: TrueFoundry.CreateOrUpdateBudgetRequestManifest; + /** When `true`, validates the manifest without persisting changes. */ + dryRun?: boolean | null; +} diff --git a/src/api/resources/gatewayBudgets/client/requests/GetLeaderboardGatewayBudgetsRequest.ts b/src/api/resources/gatewayBudgets/client/requests/GetLeaderboardGatewayBudgetsRequest.ts new file mode 100644 index 00000000..2a6982c6 --- /dev/null +++ b/src/api/resources/gatewayBudgets/client/requests/GetLeaderboardGatewayBudgetsRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * { + * limit: 50 + * } + */ +export interface GetLeaderboardGatewayBudgetsRequest { + /** Maximum number of entries to return. Defaults to 500 and is capped at 500. */ + limit?: number; +} diff --git a/src/api/resources/gatewayBudgets/client/requests/ListGatewayBudgetsRequest.ts b/src/api/resources/gatewayBudgets/client/requests/ListGatewayBudgetsRequest.ts new file mode 100644 index 00000000..e3715c16 --- /dev/null +++ b/src/api/resources/gatewayBudgets/client/requests/ListGatewayBudgetsRequest.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../../../index.js"; + +/** + * @example + * {} + */ +export interface ListGatewayBudgetsRequest { + /** Filter by budget type. */ + type?: TrueFoundry.ListGatewayBudgetsRequestType; + /** Human-readable name of the team owning the budget. Only matches team budgets. */ + teamName?: string; +} diff --git a/src/api/resources/gatewayBudgets/client/requests/SimulateBudgetRequest.ts b/src/api/resources/gatewayBudgets/client/requests/SimulateBudgetRequest.ts new file mode 100644 index 00000000..6d7df3ef --- /dev/null +++ b/src/api/resources/gatewayBudgets/client/requests/SimulateBudgetRequest.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface SimulateBudgetRequest { + /** User email to simulate as. */ + user?: string; + /** Virtual account slug to simulate as. Use this instead of `user` for virtual-account budgets. */ + virtualAccount?: string; + /** Single team to simulate membership of. Use `teams` to pass multiple teams. */ + team?: string; + /** All teams the simulated user belongs to. Merged with `team` when both are provided. */ + teams?: string[]; + /** Model to simulate. */ + model?: string; + /** Request metadata key/value pairs to simulate. */ + metadata?: Record; +} diff --git a/src/api/resources/gatewayBudgets/client/requests/index.ts b/src/api/resources/gatewayBudgets/client/requests/index.ts new file mode 100644 index 00000000..d2713a36 --- /dev/null +++ b/src/api/resources/gatewayBudgets/client/requests/index.ts @@ -0,0 +1,4 @@ +export type { CreateOrUpdateBudgetRequest } from "./CreateOrUpdateBudgetRequest.js"; +export type { GetLeaderboardGatewayBudgetsRequest } from "./GetLeaderboardGatewayBudgetsRequest.js"; +export type { ListGatewayBudgetsRequest } from "./ListGatewayBudgetsRequest.js"; +export type { SimulateBudgetRequest } from "./SimulateBudgetRequest.js"; diff --git a/src/api/resources/gatewayBudgets/exports.ts b/src/api/resources/gatewayBudgets/exports.ts new file mode 100644 index 00000000..857ae411 --- /dev/null +++ b/src/api/resources/gatewayBudgets/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { GatewayBudgetsClient } from "./client/Client.js"; +export * from "./client/index.js"; diff --git a/src/api/resources/gatewayBudgets/index.ts b/src/api/resources/gatewayBudgets/index.ts new file mode 100644 index 00000000..d9adb1af --- /dev/null +++ b/src/api/resources/gatewayBudgets/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/gatewayBudgets/types/CreateOrUpdateBudgetRequestManifest.ts b/src/api/resources/gatewayBudgets/types/CreateOrUpdateBudgetRequestManifest.ts new file mode 100644 index 00000000..7a051742 --- /dev/null +++ b/src/api/resources/gatewayBudgets/types/CreateOrUpdateBudgetRequestManifest.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../../index.js"; + +/** + * The budget manifest. Must match either the TenantBudgetConfig or TeamBudgetConfig schema. + */ +export type CreateOrUpdateBudgetRequestManifest = TrueFoundry.TenantBudgetConfig | TrueFoundry.TeamBudgetConfig; diff --git a/src/api/resources/gatewayBudgets/types/ListGatewayBudgetsRequestType.ts b/src/api/resources/gatewayBudgets/types/ListGatewayBudgetsRequestType.ts new file mode 100644 index 00000000..d78d03fc --- /dev/null +++ b/src/api/resources/gatewayBudgets/types/ListGatewayBudgetsRequestType.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const ListGatewayBudgetsRequestType = { + TenantBudgetConfig: "tenant-budget-config", + TeamBudgetConfig: "team-budget-config", +} as const; +export type ListGatewayBudgetsRequestType = + (typeof ListGatewayBudgetsRequestType)[keyof typeof ListGatewayBudgetsRequestType]; diff --git a/src/api/resources/gatewayBudgets/types/index.ts b/src/api/resources/gatewayBudgets/types/index.ts new file mode 100644 index 00000000..36be3385 --- /dev/null +++ b/src/api/resources/gatewayBudgets/types/index.ts @@ -0,0 +1,2 @@ +export * from "./CreateOrUpdateBudgetRequestManifest.js"; +export * from "./ListGatewayBudgetsRequestType.js"; diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts index 1219e69b..2e777505 100644 --- a/src/api/resources/index.ts +++ b/src/api/resources/index.ts @@ -1,66 +1,70 @@ -export * as agents from "./agents/index.js"; -export * from "./agents/client/requests/index.js"; -export * from "./agents/types/index.js"; -export * as agentSkills from "./agentSkills/index.js"; export * from "./agentSkills/client/requests/index.js"; -export * as agentSkillVersions from "./agentSkillVersions/index.js"; +export * as agentSkills from "./agentSkills/index.js"; export * from "./agentSkillVersions/client/requests/index.js"; -export * as agentVersions from "./agentVersions/index.js"; +export * as agentSkillVersions from "./agentSkillVersions/index.js"; +export * from "./agents/client/requests/index.js"; +export * as agents from "./agents/index.js"; +export * from "./agents/types/index.js"; export * from "./agentVersions/client/requests/index.js"; -export * as alerts from "./alerts/index.js"; +export * as agentVersions from "./agentVersions/index.js"; export * from "./alerts/client/requests/index.js"; -export * as applications from "./applications/index.js"; +export * as alerts from "./alerts/index.js"; export * from "./applications/client/requests/index.js"; +export * as applications from "./applications/index.js"; export * from "./applications/types/index.js"; -export * as applicationVersions from "./applicationVersions/index.js"; export * from "./applicationVersions/client/requests/index.js"; -export * as artifacts from "./artifacts/index.js"; +export * as applicationVersions from "./applicationVersions/index.js"; export * from "./artifacts/client/requests/index.js"; -export * as artifactVersions from "./artifactVersions/index.js"; +export * as artifacts from "./artifacts/index.js"; export * from "./artifactVersions/client/requests/index.js"; +export * as artifactVersions from "./artifactVersions/index.js"; export * from "./artifactVersions/types/index.js"; -export * as clusters from "./clusters/index.js"; export * from "./clusters/client/requests/index.js"; -export * as dataDirectories from "./dataDirectories/index.js"; +export * as clusters from "./clusters/index.js"; export * from "./dataDirectories/client/requests/index.js"; -export * as environments from "./environments/index.js"; +export * as dataDirectories from "./dataDirectories/index.js"; export * from "./environments/client/requests/index.js"; -export * as events from "./events/index.js"; +export * as environments from "./environments/index.js"; export * from "./events/client/requests/index.js"; -export * as internal from "./internal/index.js"; +export * as events from "./events/index.js"; +export * from "./gatewayBudgets/client/requests/index.js"; +export * as gatewayBudgets from "./gatewayBudgets/index.js"; +export * from "./gatewayBudgets/types/index.js"; export * from "./internal/client/requests/index.js"; -export * as jobs from "./jobs/index.js"; +export * as internal from "./internal/index.js"; export * from "./jobs/client/requests/index.js"; +export * as jobs from "./jobs/index.js"; export * from "./jobs/types/index.js"; -export * as logs from "./logs/index.js"; export * from "./logs/client/requests/index.js"; -export * as mlRepos from "./mlRepos/index.js"; +export * as logs from "./logs/index.js"; export * from "./mlRepos/client/requests/index.js"; -export * as models from "./models/index.js"; +export * as mlRepos from "./mlRepos/index.js"; export * from "./models/client/requests/index.js"; -export * as modelVersions from "./modelVersions/index.js"; +export * as models from "./models/index.js"; export * from "./modelVersions/client/requests/index.js"; -export * as personalAccessTokens from "./personalAccessTokens/index.js"; +export * as modelVersions from "./modelVersions/index.js"; export * from "./personalAccessTokens/client/requests/index.js"; +export * as personalAccessTokens from "./personalAccessTokens/index.js"; export * from "./personalAccessTokens/types/index.js"; -export * as prompts from "./prompts/index.js"; export * from "./prompts/client/requests/index.js"; -export * as promptVersions from "./promptVersions/index.js"; +export * as prompts from "./prompts/index.js"; export * from "./promptVersions/client/requests/index.js"; -export * as runs from "./runs/index.js"; +export * as promptVersions from "./promptVersions/index.js"; export * from "./runs/client/requests/index.js"; -export * as secretGroups from "./secretGroups/index.js"; +export * as runs from "./runs/index.js"; export * from "./secretGroups/client/requests/index.js"; -export * as secrets from "./secrets/index.js"; +export * as secretGroups from "./secretGroups/index.js"; export * from "./secrets/client/requests/index.js"; -export * as teams from "./teams/index.js"; +export * as secrets from "./secrets/index.js"; export * from "./teams/client/requests/index.js"; -export * as traces from "./traces/index.js"; +export * as teams from "./teams/index.js"; export * from "./traces/client/requests/index.js"; +export * as traces from "./traces/index.js"; export * from "./traces/types/index.js"; -export * as users from "./users/index.js"; export * from "./users/client/requests/index.js"; -export * as virtualAccounts from "./virtualAccounts/index.js"; +export * as users from "./users/index.js"; +export * from "./users/types/index.js"; export * from "./virtualAccounts/client/requests/index.js"; -export * as workspaces from "./workspaces/index.js"; +export * as virtualAccounts from "./virtualAccounts/index.js"; export * from "./workspaces/client/requests/index.js"; +export * as workspaces from "./workspaces/index.js"; diff --git a/src/api/resources/internal/client/Client.ts b/src/api/resources/internal/client/Client.ts index 7111ed23..b17e82d0 100644 --- a/src/api/resources/internal/client/Client.ts +++ b/src/api/resources/internal/client/Client.ts @@ -1,9 +1,9 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; -import * as core from "../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; @@ -23,8 +23,7 @@ import { WorkflowsClient } from "../resources/workflows/client/Client.js"; export declare namespace InternalClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class InternalClient { @@ -42,10 +41,7 @@ export class InternalClient { protected _buildLogs: BuildLogsClient | undefined; constructor(options: InternalClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } public get users(): UsersClient { @@ -96,52 +92,86 @@ export class InternalClient { * Get IDs associated with the FQN for various entity types, such as deployment, application, workspace, or cluster. * * @param {string} type - Entity Type - * @param {TrueFoundry.InternalGetIdFromFqnRequest} request + * @param {TrueFoundry.GetIdFromFqnInternalRequest} request * @param {InternalClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.BadRequestError} * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.internal.getIdFromFqn("type", { * fqn: "fqn" * }) */ - public getIdFromFqn(type: string, request: TrueFoundry.InternalGetIdFromFqnRequest, requestOptions?: InternalClient.RequestOptions): core.HttpResponsePromise> { + public getIdFromFqn( + type: string, + request: TrueFoundry.GetIdFromFqnInternalRequest, + requestOptions?: InternalClient.RequestOptions, + ): core.HttpResponsePromise> { return core.HttpResponsePromise.fromPromise(this.__getIdFromFqn(type, request, requestOptions)); } - private async __getIdFromFqn(type: string, request: TrueFoundry.InternalGetIdFromFqnRequest, requestOptions?: InternalClient.RequestOptions): Promise>> { + private async __getIdFromFqn( + type: string, + request: TrueFoundry.GetIdFromFqnInternalRequest, + requestOptions?: InternalClient.RequestOptions, + ): Promise>> { const { fqn } = request; const _queryParams: Record = { - fqn + fqn, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/fqn/${core.url.encodePathParam(type)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/fqn/${core.url.encodePathParam(type)}`, + ), method: "GET", headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.internal.getIdFromFqn.Response.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.internal.getIdFromFqn.Response.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 400: throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 400: + throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } diff --git a/src/api/resources/internal/client/requests/InternalGetIdFromFqnRequest.ts b/src/api/resources/internal/client/requests/GetIdFromFqnInternalRequest.ts similarity index 78% rename from src/api/resources/internal/client/requests/InternalGetIdFromFqnRequest.ts rename to src/api/resources/internal/client/requests/GetIdFromFqnInternalRequest.ts index 083f7fce..132aa1e7 100644 --- a/src/api/resources/internal/client/requests/InternalGetIdFromFqnRequest.ts +++ b/src/api/resources/internal/client/requests/GetIdFromFqnInternalRequest.ts @@ -6,7 +6,7 @@ * fqn: "fqn" * } */ -export interface InternalGetIdFromFqnRequest { +export interface GetIdFromFqnInternalRequest { /** Entity FQN */ fqn: string; } diff --git a/src/api/resources/internal/client/requests/index.ts b/src/api/resources/internal/client/requests/index.ts index 8f36be2d..f5c03190 100644 --- a/src/api/resources/internal/client/requests/index.ts +++ b/src/api/resources/internal/client/requests/index.ts @@ -1 +1 @@ -export type { InternalGetIdFromFqnRequest } from "./InternalGetIdFromFqnRequest.js"; +export type { GetIdFromFqnInternalRequest } from "./GetIdFromFqnInternalRequest.js"; diff --git a/src/api/resources/internal/resources/aiGateway/client/Client.ts b/src/api/resources/internal/resources/aiGateway/client/Client.ts index 47c38157..474156fd 100644 --- a/src/api/resources/internal/resources/aiGateway/client/Client.ts +++ b/src/api/resources/internal/resources/aiGateway/client/Client.ts @@ -1,9 +1,9 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import * as core from "../../../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; import { mergeHeaders } from "../../../../../../core/headers.js"; +import * as core from "../../../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../../../errors/index.js"; import * as serializers from "../../../../../../serialization/index.js"; @@ -12,38 +12,51 @@ import * as TrueFoundry from "../../../../../index.js"; export declare namespace AiGatewayClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class AiGatewayClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: AiGatewayClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** * Get the AI Gateway configuration for the given type. * - * @param {TrueFoundry.internal.AiGatewayGetGatewayConfigRequestType} type - The type of gateway configuration to retrieve or delete. + * @param {TrueFoundry.internal.GetGatewayConfigAiGatewayRequestType} type - The type of gateway configuration to retrieve or delete. * @param {AiGatewayClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.internal.aiGateway.getGatewayConfig("gateway-rate-limiting-config") */ - public getGatewayConfig(type: TrueFoundry.internal.AiGatewayGetGatewayConfigRequestType, requestOptions?: AiGatewayClient.RequestOptions): core.HttpResponsePromise { + public getGatewayConfig( + type: TrueFoundry.internal.GetGatewayConfigAiGatewayRequestType, + requestOptions?: AiGatewayClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__getGatewayConfig(type, requestOptions)); } - private async __getGatewayConfig(type: TrueFoundry.internal.AiGatewayGetGatewayConfigRequestType, requestOptions?: AiGatewayClient.RequestOptions): Promise> { + private async __getGatewayConfig( + type: TrueFoundry.internal.GetGatewayConfigAiGatewayRequestType, + requestOptions?: AiGatewayClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/llm-gateway/config/${core.url.encodePathParam(serializers.internal.AiGatewayGetGatewayConfigRequestType.jsonOrThrow(type, { omitUndefined: true }))}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/llm-gateway/config/${core.url.encodePathParam(serializers.internal.GetGatewayConfigAiGatewayRequestType.jsonOrThrow(type, { omitUndefined: true }))}`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -51,21 +64,35 @@ export class AiGatewayClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GatewayConfiguration.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GatewayConfiguration.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/llm-gateway/config/{type}"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/llm-gateway/config/{type}", + ); } /** @@ -74,6 +101,8 @@ export class AiGatewayClient { * @param {AiGatewayClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.BadRequestError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.internal.aiGateway.getBudgetUsage() @@ -82,11 +111,21 @@ export class AiGatewayClient { return core.HttpResponsePromise.fromPromise(this.__getBudgetUsage(requestOptions)); } - private async __getBudgetUsage(requestOptions?: AiGatewayClient.RequestOptions): Promise> { + private async __getBudgetUsage( + requestOptions?: AiGatewayClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/llm-gateway/config/budget/usage"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/llm-gateway/config/budget/usage", + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -94,7 +133,7 @@ export class AiGatewayClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { return { data: undefined, rawResponse: _response.rawResponse }; @@ -102,15 +141,22 @@ export class AiGatewayClient { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 400: throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 400: + throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/llm-gateway/config/budget/usage"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/llm-gateway/config/budget/usage", + ); } } diff --git a/src/api/resources/internal/resources/aiGateway/types/AiGatewayGetGatewayConfigRequestType.ts b/src/api/resources/internal/resources/aiGateway/types/AiGatewayGetGatewayConfigRequestType.ts deleted file mode 100644 index 566cf605..00000000 --- a/src/api/resources/internal/resources/aiGateway/types/AiGatewayGetGatewayConfigRequestType.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const AiGatewayGetGatewayConfigRequestType = { - GatewayRateLimitingConfig: "gateway-rate-limiting-config", - GatewayFallbackConfig: "gateway-fallback-config", - GatewayLoadBalancingConfig: "gateway-load-balancing-config", - GatewayGuardrailsConfig: "gateway-guardrails-config", - GatewayBudgetConfig: "gateway-budget-config", - TenantBudgetConfig: "tenant-budget-config", - TeamBudgetConfig: "team-budget-config", - GatewayOtelConfig: "gateway-otel-config", - GatewayGlobalSettings: "gateway-global-settings", - GatewayDataAccessConfig: "gateway-data-access-config", - GatewayDataRoutingConfig: "gateway-data-routing-config" - } as const; -export type AiGatewayGetGatewayConfigRequestType = typeof AiGatewayGetGatewayConfigRequestType[keyof typeof AiGatewayGetGatewayConfigRequestType]; diff --git a/src/api/resources/internal/resources/aiGateway/types/GetGatewayConfigAiGatewayRequestType.ts b/src/api/resources/internal/resources/aiGateway/types/GetGatewayConfigAiGatewayRequestType.ts new file mode 100644 index 00000000..60758c49 --- /dev/null +++ b/src/api/resources/internal/resources/aiGateway/types/GetGatewayConfigAiGatewayRequestType.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetGatewayConfigAiGatewayRequestType = { + GatewayRateLimitingConfig: "gateway-rate-limiting-config", + GatewayFallbackConfig: "gateway-fallback-config", + GatewayLoadBalancingConfig: "gateway-load-balancing-config", + GatewayGuardrailsConfig: "gateway-guardrails-config", + GatewayBudgetConfig: "gateway-budget-config", + TenantBudgetConfig: "tenant-budget-config", + TeamBudgetConfig: "team-budget-config", + GatewayOtelConfig: "gateway-otel-config", + GatewayGlobalSettings: "gateway-global-settings", + GatewayDataAccessConfig: "gateway-data-access-config", + GatewayDataRoutingConfig: "gateway-data-routing-config", + GatewayLoggingConfig: "gateway-logging-config", +} as const; +export type GetGatewayConfigAiGatewayRequestType = + (typeof GetGatewayConfigAiGatewayRequestType)[keyof typeof GetGatewayConfigAiGatewayRequestType]; diff --git a/src/api/resources/internal/resources/aiGateway/types/index.ts b/src/api/resources/internal/resources/aiGateway/types/index.ts index 96bb6258..0ddbb570 100644 --- a/src/api/resources/internal/resources/aiGateway/types/index.ts +++ b/src/api/resources/internal/resources/aiGateway/types/index.ts @@ -1 +1 @@ -export * from "./AiGatewayGetGatewayConfigRequestType.js"; +export * from "./GetGatewayConfigAiGatewayRequestType.js"; diff --git a/src/api/resources/internal/resources/applications/client/Client.ts b/src/api/resources/internal/resources/applications/client/Client.ts index ed29c11e..429a0913 100644 --- a/src/api/resources/internal/resources/applications/client/Client.ts +++ b/src/api/resources/internal/resources/applications/client/Client.ts @@ -1,9 +1,9 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import * as core from "../../../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; import { mergeHeaders } from "../../../../../../core/headers.js"; +import * as core from "../../../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../../../errors/index.js"; import * as serializers from "../../../../../../serialization/index.js"; @@ -12,56 +12,72 @@ import * as TrueFoundry from "../../../../../index.js"; export declare namespace ApplicationsClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class ApplicationsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: ApplicationsClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** * Promote an application rollout for canary and blue-green. * * @param {string} id - Unique identifier of the application - * @param {TrueFoundry.internal.ApplicationsPromoteRolloutRequest} request + * @param {TrueFoundry.internal.PromoteRolloutApplicationsRequest} request * @param {ApplicationsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} * @throws {@link TrueFoundry.MethodNotAllowedError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example - * await client.internal.applications.promoteRollout("id", { - * full: true - * }) + * await client.internal.applications.promoteRollout("id") */ - public promoteRollout(id: string, request: TrueFoundry.internal.ApplicationsPromoteRolloutRequest = {}, requestOptions?: ApplicationsClient.RequestOptions): core.HttpResponsePromise { + public promoteRollout( + id: string, + request: TrueFoundry.internal.PromoteRolloutApplicationsRequest = {}, + requestOptions?: ApplicationsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__promoteRollout(id, request, requestOptions)); } - private async __promoteRollout(id: string, request: TrueFoundry.internal.ApplicationsPromoteRolloutRequest = {}, requestOptions?: ApplicationsClient.RequestOptions): Promise> { + private async __promoteRollout( + id: string, + request: TrueFoundry.internal.PromoteRolloutApplicationsRequest = {}, + requestOptions?: ApplicationsClient.RequestOptions, + ): Promise> { const { full = false } = request; const _queryParams: Record = { - full + full, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/x/apps/${core.url.encodePathParam(id)}/rollout/promote`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/x/apps/${core.url.encodePathParam(id)}/rollout/promote`, + ), method: "POST", headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { return { data: undefined, rawResponse: _response.rawResponse }; @@ -69,70 +85,119 @@ export class ApplicationsClient { if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - case 405: throw new TrueFoundry.MethodNotAllowedError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + case 405: + throw new TrueFoundry.MethodNotAllowedError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/svc/v1/x/apps/{id}/rollout/promote"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/api/svc/v1/x/apps/{id}/rollout/promote", + ); } /** * Get the pod template hash to deployment version map for a specific application. * * @param {string} id - Unique identifier of the application - * @param {TrueFoundry.internal.ApplicationsGetPodTemplateHashToDeploymentVersionRequest} request + * @param {TrueFoundry.internal.GetPodTemplateHashToDeploymentVersionApplicationsRequest} request * @param {ApplicationsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.BadRequestError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example - * await client.internal.applications.getPodTemplateHashToDeploymentVersion("id", { - * podTemplateHashes: "podTemplateHashes" - * }) + * await client.internal.applications.getPodTemplateHashToDeploymentVersion("id") */ - public getPodTemplateHashToDeploymentVersion(id: string, request: TrueFoundry.internal.ApplicationsGetPodTemplateHashToDeploymentVersionRequest = {}, requestOptions?: ApplicationsClient.RequestOptions): core.HttpResponsePromise> { - return core.HttpResponsePromise.fromPromise(this.__getPodTemplateHashToDeploymentVersion(id, request, requestOptions)); + public getPodTemplateHashToDeploymentVersion( + id: string, + request: TrueFoundry.internal.GetPodTemplateHashToDeploymentVersionApplicationsRequest = {}, + requestOptions?: ApplicationsClient.RequestOptions, + ): core.HttpResponsePromise> { + return core.HttpResponsePromise.fromPromise( + this.__getPodTemplateHashToDeploymentVersion(id, request, requestOptions), + ); } - private async __getPodTemplateHashToDeploymentVersion(id: string, request: TrueFoundry.internal.ApplicationsGetPodTemplateHashToDeploymentVersionRequest = {}, requestOptions?: ApplicationsClient.RequestOptions): Promise>> { + private async __getPodTemplateHashToDeploymentVersion( + id: string, + request: TrueFoundry.internal.GetPodTemplateHashToDeploymentVersionApplicationsRequest = {}, + requestOptions?: ApplicationsClient.RequestOptions, + ): Promise>> { const { podTemplateHashes } = request; const _queryParams: Record = { - podTemplateHashes + podTemplateHashes, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/x/apps/${core.url.encodePathParam(id)}/pod-template-hash-deployment-version-map`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/x/apps/${core.url.encodePathParam(id)}/pod-template-hash-deployment-version-map`, + ), method: "GET", headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.internal.applications.getPodTemplateHashToDeploymentVersion.Response.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.internal.applications.getPodTemplateHashToDeploymentVersion.Response.parseOrThrow( + _response.body, + { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }, + ), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 400: throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 400: + throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/x/apps/{id}/pod-template-hash-deployment-version-map"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/x/apps/{id}/pod-template-hash-deployment-version-map", + ); } } diff --git a/src/api/resources/internal/resources/applications/client/requests/ApplicationsGetPodTemplateHashToDeploymentVersionRequest.ts b/src/api/resources/internal/resources/applications/client/requests/ApplicationsGetPodTemplateHashToDeploymentVersionRequest.ts deleted file mode 100644 index c10e5814..00000000 --- a/src/api/resources/internal/resources/applications/client/requests/ApplicationsGetPodTemplateHashToDeploymentVersionRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * podTemplateHashes: "podTemplateHashes" - * } - */ -export interface ApplicationsGetPodTemplateHashToDeploymentVersionRequest { - /** Pod template hashes to filter by (comma-separated) */ - podTemplateHashes?: string; -} diff --git a/src/api/resources/internal/resources/applications/client/requests/GetPodTemplateHashToDeploymentVersionApplicationsRequest.ts b/src/api/resources/internal/resources/applications/client/requests/GetPodTemplateHashToDeploymentVersionApplicationsRequest.ts new file mode 100644 index 00000000..4ce974c8 --- /dev/null +++ b/src/api/resources/internal/resources/applications/client/requests/GetPodTemplateHashToDeploymentVersionApplicationsRequest.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface GetPodTemplateHashToDeploymentVersionApplicationsRequest { + /** Pod template hashes to filter by (comma-separated) */ + podTemplateHashes?: string | null; +} diff --git a/src/api/resources/internal/resources/applications/client/requests/ApplicationsPromoteRolloutRequest.ts b/src/api/resources/internal/resources/applications/client/requests/PromoteRolloutApplicationsRequest.ts similarity index 56% rename from src/api/resources/internal/resources/applications/client/requests/ApplicationsPromoteRolloutRequest.ts rename to src/api/resources/internal/resources/applications/client/requests/PromoteRolloutApplicationsRequest.ts index 2901a7a2..edcef25c 100644 --- a/src/api/resources/internal/resources/applications/client/requests/ApplicationsPromoteRolloutRequest.ts +++ b/src/api/resources/internal/resources/applications/client/requests/PromoteRolloutApplicationsRequest.ts @@ -2,11 +2,9 @@ /** * @example - * { - * full: true - * } + * {} */ -export interface ApplicationsPromoteRolloutRequest { +export interface PromoteRolloutApplicationsRequest { /** Whether to promote the rollout to full traffic */ - full?: boolean; + full?: boolean | null; } diff --git a/src/api/resources/internal/resources/applications/client/requests/index.ts b/src/api/resources/internal/resources/applications/client/requests/index.ts index 8b6e6ade..80286356 100644 --- a/src/api/resources/internal/resources/applications/client/requests/index.ts +++ b/src/api/resources/internal/resources/applications/client/requests/index.ts @@ -1,2 +1,2 @@ -export type { ApplicationsGetPodTemplateHashToDeploymentVersionRequest } from "./ApplicationsGetPodTemplateHashToDeploymentVersionRequest.js"; -export type { ApplicationsPromoteRolloutRequest } from "./ApplicationsPromoteRolloutRequest.js"; +export type { GetPodTemplateHashToDeploymentVersionApplicationsRequest } from "./GetPodTemplateHashToDeploymentVersionApplicationsRequest.js"; +export type { PromoteRolloutApplicationsRequest } from "./PromoteRolloutApplicationsRequest.js"; diff --git a/src/api/resources/internal/resources/artifactVersions/client/Client.ts b/src/api/resources/internal/resources/artifactVersions/client/Client.ts index 1d53d5d2..b89d1171 100644 --- a/src/api/resources/internal/resources/artifactVersions/client/Client.ts +++ b/src/api/resources/internal/resources/artifactVersions/client/Client.ts @@ -1,96 +1,154 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import * as core from "../../../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; import { mergeHeaders } from "../../../../../../core/headers.js"; +import * as core from "../../../../../../core/index.js"; +import { toJson } from "../../../../../../core/json.js"; import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../../../errors/index.js"; import * as serializers from "../../../../../../serialization/index.js"; -import * as TrueFoundry from "../../../../../index.js"; +import type * as TrueFoundry from "../../../../../index.js"; export declare namespace ArtifactVersionsClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class ArtifactVersionsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: ArtifactVersionsClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** * List artifact versions with internal metadata, optionally including model versions. * - * @param {TrueFoundry.internal.ArtifactVersionsListRequest} request + * @param {TrueFoundry.internal.ListArtifactVersionsRequest} request * @param {ArtifactVersionsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.internal.artifactVersions.list({ * limit: 10, - * offset: 0, - * tag: "tag", - * fqn: "fqn", - * artifactId: "artifact_id", - * mlRepoId: "ml_repo_id", - * name: "name", - * version: 1, - * runIds: ["run_ids"], - * runSteps: [1.1], - * includeInternalMetadata: true, - * includeModelVersions: true, - * artifactTypes: ["artifact_types"] + * offset: 0 * }) */ - public async list(request: TrueFoundry.internal.ArtifactVersionsListRequest = {}, requestOptions?: ArtifactVersionsClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.internal.ArtifactVersionsListRequest): Promise> => { const { limit = 100, offset = 0, tag, fqn, artifactId, mlRepoId, name, version, runIds, runSteps, includeInternalMetadata = false, includeModelVersions = false, artifactTypes } = request; const _queryParams: Record = { - limit, - offset, - tag, - fqn, - artifact_id: artifactId, - ml_repo_id: mlRepoId, - name, - version, - run_ids: runIds, - run_steps: runSteps, - include_internal_metadata: includeInternalMetadata, - include_model_versions: includeModelVersions, - artifact_types: artifactTypes - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/x/artifact-versions"), - method: "GET", - headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.InternalListArtifactVersionsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/x/artifact-versions"); }); + public async list( + request: TrueFoundry.internal.ListArtifactVersionsRequest = {}, + requestOptions?: ArtifactVersionsClient.RequestOptions, + ): Promise< + core.Page< + TrueFoundry.InternalListArtifactVersionsResponseDataItem, + TrueFoundry.InternalListArtifactVersionsResponse + > + > { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.internal.ListArtifactVersionsRequest, + ): Promise> => { + const { + limit = 100, + offset = 0, + tag, + fqn, + artifactId, + mlRepoId, + name, + version, + runIds, + runSteps, + includeInternalMetadata = false, + includeModelVersions = false, + artifactTypes, + } = request; + const _queryParams: Record = { + limit, + offset, + tag, + fqn, + artifact_id: artifactId, + ml_repo_id: mlRepoId, + name, + version, + run_ids: runIds !== undefined ? toJson(runIds) : undefined, + run_steps: runSteps !== undefined ? toJson(runSteps) : undefined, + include_internal_metadata: includeInternalMetadata, + include_model_versions: includeModelVersions, + artifact_types: artifactTypes, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/x/artifact-versions", + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.InternalListArtifactVersionsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/x/artifact-versions", + ); + }, + ); let _offset = request?.offset != null ? request?.offset : 0; const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Page< + TrueFoundry.InternalListArtifactVersionsResponseDataItem, + TrueFoundry.InternalListArtifactVersionsResponse + >({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => (response?.data ?? []).length > 0 && (request?.limit == null || (response?.data ?? []).length >= request?.limit), - getItems: response => response?.data ?? [], - loadPage: response => { _offset += response?.data != null ? response.data.length : 1; return list(core.setObjectProperty(request, "offset", _offset)); } + hasNextPage: (response) => + (response?.data ?? []).length > 0 && + (request?.limit == null || (response?.data ?? []).length >= request?.limit), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + _offset += response?.data != null ? response.data.length : 1; + return list(core.setObjectProperty(request, "offset", _offset)); + }, }); } } diff --git a/src/api/resources/internal/resources/artifactVersions/client/requests/ArtifactVersionsListRequest.ts b/src/api/resources/internal/resources/artifactVersions/client/requests/ListArtifactVersionsRequest.ts similarity index 58% rename from src/api/resources/internal/resources/artifactVersions/client/requests/ArtifactVersionsListRequest.ts rename to src/api/resources/internal/resources/artifactVersions/client/requests/ListArtifactVersionsRequest.ts index 4337e5db..ef35a451 100644 --- a/src/api/resources/internal/resources/artifactVersions/client/requests/ArtifactVersionsListRequest.ts +++ b/src/api/resources/internal/resources/artifactVersions/client/requests/ListArtifactVersionsRequest.ts @@ -1,46 +1,35 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../../index.js"; +import type * as TrueFoundry from "../../../../../../index.js"; /** * @example * { * limit: 10, - * offset: 0, - * tag: "tag", - * fqn: "fqn", - * artifactId: "artifact_id", - * mlRepoId: "ml_repo_id", - * name: "name", - * version: 1, - * runIds: ["run_ids"], - * runSteps: [1.1], - * includeInternalMetadata: true, - * includeModelVersions: true, - * artifactTypes: ["artifact_types"] + * offset: 0 * } */ -export interface ArtifactVersionsListRequest { +export interface ListArtifactVersionsRequest { /** Number of items per page */ - limit?: number; + limit?: number | null; /** Number of items to skip */ - offset?: number; + offset?: number | null; /** Tag to filter artifact versions by. */ - tag?: string; + tag?: string | null; /** Fully Qualified Name uniquely identifying the artifact version. */ - fqn?: string; + fqn?: string | null; /** Identifier of the artifact whose versions to list. */ - artifactId?: string; + artifactId?: string | null; /** Identifier of the ML Repo the artifact versions belong to. */ - mlRepoId?: string; + mlRepoId?: string | null; /** Name of the artifact version. */ - name?: string; + name?: string | null; /** Version number (positive integer) to filter by. */ - version?: number; + version?: number | null; /** Run IDs to filter artifact versions by. */ - runIds?: string | string[]; + runIds?: string[] | null; /** Run steps to filter artifact versions by. */ - runSteps?: number | number[]; + runSteps?: number[] | null; /** Whether to include internal metadata in the response. */ includeInternalMetadata?: boolean; /** Whether to include model versions in the response. */ diff --git a/src/api/resources/internal/resources/artifactVersions/client/requests/index.ts b/src/api/resources/internal/resources/artifactVersions/client/requests/index.ts index ef487058..22951bea 100644 --- a/src/api/resources/internal/resources/artifactVersions/client/requests/index.ts +++ b/src/api/resources/internal/resources/artifactVersions/client/requests/index.ts @@ -1 +1 @@ -export type { ArtifactVersionsListRequest } from "./ArtifactVersionsListRequest.js"; +export type { ListArtifactVersionsRequest } from "./ListArtifactVersionsRequest.js"; diff --git a/src/api/resources/internal/resources/buildLogs/client/Client.ts b/src/api/resources/internal/resources/buildLogs/client/Client.ts index 2d1082e8..1a1d5a97 100644 --- a/src/api/resources/internal/resources/buildLogs/client/Client.ts +++ b/src/api/resources/internal/resources/buildLogs/client/Client.ts @@ -1,9 +1,9 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import * as core from "../../../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; import { mergeHeaders } from "../../../../../../core/headers.js"; +import * as core from "../../../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../../../errors/index.js"; import * as serializers from "../../../../../../serialization/index.js"; @@ -12,44 +12,47 @@ import * as TrueFoundry from "../../../../../index.js"; export declare namespace BuildLogsClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class BuildLogsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: BuildLogsClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** * Get logs emitted by the image build and deploy pipeline for a specific build of an application. * * @param {string} pipelineRunName - PipelineRun Name - * @param {TrueFoundry.internal.BuildLogsGetRequest} request + * @param {TrueFoundry.internal.GetBuildLogsRequest} request * @param {BuildLogsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.BadRequestError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.internal.buildLogs.get("pipelineRunName", { * startTs: "1635467890123456789", * endTs: "1635467891123456789", - * limit: "limit", - * direction: "direction", - * filterQuery: "{\"matchString\":\"error\",\"type\":\"substring\",\"operator\":\"equal\"}", - * numLogsToIgnore: 1.1 + * filterQuery: "{\"matchString\":\"error\",\"type\":\"substring\",\"operator\":\"equal\"}" * }) */ - public get(pipelineRunName: string, request: TrueFoundry.internal.BuildLogsGetRequest = {}, requestOptions?: BuildLogsClient.RequestOptions): core.HttpResponsePromise { + public get( + pipelineRunName: string, + request: TrueFoundry.internal.GetBuildLogsRequest = {}, + requestOptions?: BuildLogsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(pipelineRunName, request, requestOptions)); } - private async __get(pipelineRunName: string, request: TrueFoundry.internal.BuildLogsGetRequest = {}, requestOptions?: BuildLogsClient.RequestOptions): Promise> { + private async __get( + pipelineRunName: string, + request: TrueFoundry.internal.GetBuildLogsRequest = {}, + requestOptions?: BuildLogsClient.RequestOptions, + ): Promise> { const { startTs, endTs, limit, direction, filterQuery, numLogsToIgnore } = request; const _queryParams: Record = { startTs, @@ -57,36 +60,64 @@ export class BuildLogsClient { limit, direction, filterQuery, - numLogsToIgnore + numLogsToIgnore, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/x/build-logs/${core.url.encodePathParam(pipelineRunName)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/x/build-logs/${core.url.encodePathParam(pipelineRunName)}`, + ), method: "GET", headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.LogsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.LogsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 400: throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 400: + throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/x/build-logs/{pipelineRunName}"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/x/build-logs/{pipelineRunName}", + ); } } diff --git a/src/api/resources/internal/resources/buildLogs/client/requests/BuildLogsGetRequest.ts b/src/api/resources/internal/resources/buildLogs/client/requests/GetBuildLogsRequest.ts similarity index 70% rename from src/api/resources/internal/resources/buildLogs/client/requests/BuildLogsGetRequest.ts rename to src/api/resources/internal/resources/buildLogs/client/requests/GetBuildLogsRequest.ts index f32c7859..98e989e3 100644 --- a/src/api/resources/internal/resources/buildLogs/client/requests/BuildLogsGetRequest.ts +++ b/src/api/resources/internal/resources/buildLogs/client/requests/GetBuildLogsRequest.ts @@ -5,23 +5,20 @@ * { * startTs: "1635467890123456789", * endTs: "1635467891123456789", - * limit: "limit", - * direction: "direction", - * filterQuery: "{\"matchString\":\"error\",\"type\":\"substring\",\"operator\":\"equal\"}", - * numLogsToIgnore: 1.1 + * filterQuery: "{\"matchString\":\"error\",\"type\":\"substring\",\"operator\":\"equal\"}" * } */ -export interface BuildLogsGetRequest { +export interface GetBuildLogsRequest { /** Start timestamp for querying logs, in nanoseconds from the Unix epoch. */ - startTs?: string; + startTs?: string | null; /** End timestamp for querying logs, in nanoseconds from the Unix epoch. */ - endTs?: string; + endTs?: string | null; /** Max number of log lines to fetch */ - limit?: string; + limit?: string | null; /** Direction of sorting logs. Can be `asc` or `desc` */ - direction?: string; + direction?: string | null; /** JSON-encoded filter object with shape `{ matchString, type, operator }`. `type` is `regex` or `substring`; `operator` is `equal` or `not_equal`. */ - filterQuery?: string; + filterQuery?: string | null; /** Number of logs corresponding to the starting timestamp to be ignored. */ - numLogsToIgnore?: number; + numLogsToIgnore?: number | null; } diff --git a/src/api/resources/internal/resources/buildLogs/client/requests/index.ts b/src/api/resources/internal/resources/buildLogs/client/requests/index.ts index c8edaf5e..a101cd7c 100644 --- a/src/api/resources/internal/resources/buildLogs/client/requests/index.ts +++ b/src/api/resources/internal/resources/buildLogs/client/requests/index.ts @@ -1 +1 @@ -export type { BuildLogsGetRequest } from "./BuildLogsGetRequest.js"; +export type { GetBuildLogsRequest } from "./GetBuildLogsRequest.js"; diff --git a/src/api/resources/internal/resources/clusters/client/Client.ts b/src/api/resources/internal/resources/clusters/client/Client.ts index 0c44b184..53962803 100644 --- a/src/api/resources/internal/resources/clusters/client/Client.ts +++ b/src/api/resources/internal/resources/clusters/client/Client.ts @@ -1,9 +1,9 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import * as core from "../../../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; import { mergeHeaders } from "../../../../../../core/headers.js"; +import * as core from "../../../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../../../errors/index.js"; import * as serializers from "../../../../../../serialization/index.js"; @@ -12,18 +12,14 @@ import * as TrueFoundry from "../../../../../index.js"; export declare namespace ClustersClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class ClustersClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: ClustersClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** @@ -33,19 +29,35 @@ export class ClustersClient { * @param {ClustersClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.UnauthorizedError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.internal.clusters.getAutoprovisioningState("id") */ - public getAutoprovisioningState(id: string, requestOptions?: ClustersClient.RequestOptions): core.HttpResponsePromise { + public getAutoprovisioningState( + id: string, + requestOptions?: ClustersClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__getAutoprovisioningState(id, requestOptions)); } - private async __getAutoprovisioningState(id: string, requestOptions?: ClustersClient.RequestOptions): Promise> { + private async __getAutoprovisioningState( + id: string, + requestOptions?: ClustersClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/x/clusters/${core.url.encodePathParam(id)}/autoprovisioning-state`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/x/clusters/${core.url.encodePathParam(id)}/autoprovisioning-state`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -53,23 +65,48 @@ export class ClustersClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetAutoProvisioningStateResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetAutoProvisioningStateResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 401: throw new TrueFoundry.UnauthorizedError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 401: + throw new TrueFoundry.UnauthorizedError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/x/clusters/{id}/autoprovisioning-state"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/x/clusters/{id}/autoprovisioning-state", + ); } } diff --git a/src/api/resources/internal/resources/deployments/client/Client.ts b/src/api/resources/internal/resources/deployments/client/Client.ts index 5a158039..3fcda3e1 100644 --- a/src/api/resources/internal/resources/deployments/client/Client.ts +++ b/src/api/resources/internal/resources/deployments/client/Client.ts @@ -1,9 +1,10 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import * as core from "../../../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; import { mergeHeaders } from "../../../../../../core/headers.js"; +import * as core from "../../../../../../core/index.js"; +import { mergeAdditionalBodyParameters } from "../../../../../../core/requestBody.js"; import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../../../errors/index.js"; import * as serializers from "../../../../../../serialization/index.js"; @@ -12,18 +13,14 @@ import * as TrueFoundry from "../../../../../index.js"; export declare namespace DeploymentsClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class DeploymentsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: DeploymentsClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** @@ -34,19 +31,37 @@ export class DeploymentsClient { * @param {DeploymentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.internal.deployments.getDeploymentStatuses("id", "deploymentId") */ - public getDeploymentStatuses(id: string, deploymentId: string, requestOptions?: DeploymentsClient.RequestOptions): core.HttpResponsePromise { + public getDeploymentStatuses( + id: string, + deploymentId: string, + requestOptions?: DeploymentsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__getDeploymentStatuses(id, deploymentId, requestOptions)); } - private async __getDeploymentStatuses(id: string, deploymentId: string, requestOptions?: DeploymentsClient.RequestOptions): Promise> { + private async __getDeploymentStatuses( + id: string, + deploymentId: string, + requestOptions?: DeploymentsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/x/apps/${core.url.encodePathParam(id)}/deployments/${core.url.encodePathParam(deploymentId)}/statuses`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/x/apps/${core.url.encodePathParam(id)}/deployments/${core.url.encodePathParam(deploymentId)}/statuses`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -54,24 +69,40 @@ export class DeploymentsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.internal.deployments.getDeploymentStatuses.Response.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.internal.deployments.getDeploymentStatuses.Response.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/x/apps/{id}/deployments/{deploymentId}/statuses"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/x/apps/{id}/deployments/{deploymentId}/statuses", + ); } /** @@ -82,19 +113,37 @@ export class DeploymentsClient { * @param {DeploymentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.internal.deployments.getBuilds("id", "deploymentId") */ - public getBuilds(id: string, deploymentId: string, requestOptions?: DeploymentsClient.RequestOptions): core.HttpResponsePromise { + public getBuilds( + id: string, + deploymentId: string, + requestOptions?: DeploymentsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__getBuilds(id, deploymentId, requestOptions)); } - private async __getBuilds(id: string, deploymentId: string, requestOptions?: DeploymentsClient.RequestOptions): Promise> { + private async __getBuilds( + id: string, + deploymentId: string, + requestOptions?: DeploymentsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/x/apps/${core.url.encodePathParam(id)}/deployments/${core.url.encodePathParam(deploymentId)}/builds`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/x/apps/${core.url.encodePathParam(id)}/deployments/${core.url.encodePathParam(deploymentId)}/builds`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -102,24 +151,40 @@ export class DeploymentsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.internal.deployments.getBuilds.Response.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.internal.deployments.getBuilds.Response.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/x/apps/{id}/deployments/{deploymentId}/builds"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/x/apps/{id}/deployments/{deploymentId}/builds", + ); } /** @@ -128,108 +193,185 @@ export class DeploymentsClient { * @param {TrueFoundry.internal.GenerateCodeUploadPresignedUrlRequest} request * @param {DeploymentsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.internal.deployments.getCodeUploadUrl({ * serviceName: "serviceName", * workspaceFqn: "workspaceFqn" * }) */ - public getCodeUploadUrl(request: TrueFoundry.internal.GenerateCodeUploadPresignedUrlRequest, requestOptions?: DeploymentsClient.RequestOptions): core.HttpResponsePromise { + public getCodeUploadUrl( + request: TrueFoundry.internal.GenerateCodeUploadPresignedUrlRequest, + requestOptions?: DeploymentsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__getCodeUploadUrl(request, requestOptions)); } - private async __getCodeUploadUrl(request: TrueFoundry.internal.GenerateCodeUploadPresignedUrlRequest, requestOptions?: DeploymentsClient.RequestOptions): Promise> { + private async __getCodeUploadUrl( + request: TrueFoundry.internal.GenerateCodeUploadPresignedUrlRequest, + requestOptions?: DeploymentsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/deployment/code-upload-url"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/deployment/code-upload-url", + ), method: "POST", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.internal.GenerateCodeUploadPresignedUrlRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.internal.GenerateCodeUploadPresignedUrlRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.PresignedUrlObject.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.PresignedUrlObject.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/svc/v1/deployment/code-upload-url"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/api/svc/v1/deployment/code-upload-url", + ); } /** * Generate deployment endpoint based on the provided query parameters. * - * @param {TrueFoundry.internal.DeploymentsGetSuggestedEndpointRequest} request + * @param {TrueFoundry.internal.GetSuggestedEndpointDeploymentsRequest} request * @param {DeploymentsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.BadRequestError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.internal.deployments.getSuggestedEndpoint({ * applicationType: "async-service", * applicationName: "applicationName", - * workspaceId: "workspaceId", - * baseDomain: "baseDomain", - * port: "port", - * preferWildcard: true + * workspaceId: "workspaceId" * }) */ - public getSuggestedEndpoint(request: TrueFoundry.internal.DeploymentsGetSuggestedEndpointRequest, requestOptions?: DeploymentsClient.RequestOptions): core.HttpResponsePromise { + public getSuggestedEndpoint( + request: TrueFoundry.internal.GetSuggestedEndpointDeploymentsRequest, + requestOptions?: DeploymentsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__getSuggestedEndpoint(request, requestOptions)); } - private async __getSuggestedEndpoint(request: TrueFoundry.internal.DeploymentsGetSuggestedEndpointRequest, requestOptions?: DeploymentsClient.RequestOptions): Promise> { + private async __getSuggestedEndpoint( + request: TrueFoundry.internal.GetSuggestedEndpointDeploymentsRequest, + requestOptions?: DeploymentsClient.RequestOptions, + ): Promise> { const { applicationType, applicationName, workspaceId, baseDomain, port, preferWildcard = false } = request; const _queryParams: Record = { - applicationType: serializers.ApplicationType.jsonOrThrow(applicationType, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + applicationType: serializers.ApplicationType.jsonOrThrow(applicationType, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), applicationName, workspaceId, baseDomain, port, - preferWildcard + preferWildcard, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/deployment/deployment-endpoint"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/deployment/deployment-endpoint", + ), method: "GET", headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetSuggestedDeploymentEndpointResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetSuggestedDeploymentEndpointResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 400: throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 400: + throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/deployment/deployment-endpoint"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/deployment/deployment-endpoint", + ); } } diff --git a/src/api/resources/internal/resources/deployments/client/requests/DeploymentsGetSuggestedEndpointRequest.ts b/src/api/resources/internal/resources/deployments/client/requests/GetSuggestedEndpointDeploymentsRequest.ts similarity index 58% rename from src/api/resources/internal/resources/deployments/client/requests/DeploymentsGetSuggestedEndpointRequest.ts rename to src/api/resources/internal/resources/deployments/client/requests/GetSuggestedEndpointDeploymentsRequest.ts index b4d007bd..16b5718e 100644 --- a/src/api/resources/internal/resources/deployments/client/requests/DeploymentsGetSuggestedEndpointRequest.ts +++ b/src/api/resources/internal/resources/deployments/client/requests/GetSuggestedEndpointDeploymentsRequest.ts @@ -1,19 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../../index.js"; +import type * as TrueFoundry from "../../../../../../index.js"; /** * @example * { * applicationType: "async-service", * applicationName: "applicationName", - * workspaceId: "workspaceId", - * baseDomain: "baseDomain", - * port: "port", - * preferWildcard: true + * workspaceId: "workspaceId" * } */ -export interface DeploymentsGetSuggestedEndpointRequest { +export interface GetSuggestedEndpointDeploymentsRequest { /** Application Type */ applicationType: TrueFoundry.ApplicationType; /** Application name */ @@ -21,9 +18,9 @@ export interface DeploymentsGetSuggestedEndpointRequest { /** Workspace id */ workspaceId: string; /** Base domain */ - baseDomain?: string; + baseDomain?: string | null; /** Port */ - port?: string; + port?: string | null; /** Prefer wildcard */ - preferWildcard?: boolean; + preferWildcard?: boolean | null; } diff --git a/src/api/resources/internal/resources/deployments/client/requests/index.ts b/src/api/resources/internal/resources/deployments/client/requests/index.ts index 5795ecdb..d66ccc5d 100644 --- a/src/api/resources/internal/resources/deployments/client/requests/index.ts +++ b/src/api/resources/internal/resources/deployments/client/requests/index.ts @@ -1,2 +1,2 @@ -export type { DeploymentsGetSuggestedEndpointRequest } from "./DeploymentsGetSuggestedEndpointRequest.js"; export type { GenerateCodeUploadPresignedUrlRequest } from "./GenerateCodeUploadPresignedUrlRequest.js"; +export type { GetSuggestedEndpointDeploymentsRequest } from "./GetSuggestedEndpointDeploymentsRequest.js"; diff --git a/src/api/resources/internal/resources/dockerRegistries/client/Client.ts b/src/api/resources/internal/resources/dockerRegistries/client/Client.ts index 1b288d66..9923bdf3 100644 --- a/src/api/resources/internal/resources/dockerRegistries/client/Client.ts +++ b/src/api/resources/internal/resources/dockerRegistries/client/Client.ts @@ -1,9 +1,10 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import * as core from "../../../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; import { mergeHeaders } from "../../../../../../core/headers.js"; +import * as core from "../../../../../../core/index.js"; +import { mergeAdditionalBodyParameters } from "../../../../../../core/requestBody.js"; import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../../../errors/index.js"; import * as serializers from "../../../../../../serialization/index.js"; @@ -12,18 +13,14 @@ import * as TrueFoundry from "../../../../../index.js"; export declare namespace DockerRegistriesClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class DockerRegistriesClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: DockerRegistriesClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** @@ -33,6 +30,8 @@ export class DockerRegistriesClient { * @param {DockerRegistriesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.internal.dockerRegistries.createRepository({ @@ -41,92 +40,162 @@ export class DockerRegistriesClient { * workspaceFqn: "workspaceFqn" * }) */ - public createRepository(request: TrueFoundry.internal.CreateDockerRepositoryRequest, requestOptions?: DockerRegistriesClient.RequestOptions): core.HttpResponsePromise { + public createRepository( + request: TrueFoundry.internal.CreateDockerRepositoryRequest, + requestOptions?: DockerRegistriesClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__createRepository(request, requestOptions)); } - private async __createRepository(request: TrueFoundry.internal.CreateDockerRepositoryRequest, requestOptions?: DockerRegistriesClient.RequestOptions): Promise> { + private async __createRepository( + request: TrueFoundry.internal.CreateDockerRepositoryRequest, + requestOptions?: DockerRegistriesClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/docker-registry/create-repo"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/docker-registry/create-repo", + ), method: "POST", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.internal.CreateDockerRepositoryRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.internal.CreateDockerRepositoryRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.CreateDockerRepositoryResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.CreateDockerRepositoryResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/svc/v1/docker-registry/create-repo"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/api/svc/v1/docker-registry/create-repo", + ); } /** * Get docker registry credentials for building and pushing an image. * - * @param {TrueFoundry.internal.DockerRegistriesGetCredentialsRequest} request + * @param {TrueFoundry.internal.GetCredentialsDockerRegistriesRequest} request * @param {DockerRegistriesClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example - * await client.internal.dockerRegistries.getCredentials({ - * fqn: "fqn", - * clusterId: "clusterId" - * }) + * await client.internal.dockerRegistries.getCredentials() */ - public getCredentials(request: TrueFoundry.internal.DockerRegistriesGetCredentialsRequest = {}, requestOptions?: DockerRegistriesClient.RequestOptions): core.HttpResponsePromise { + public getCredentials( + request: TrueFoundry.internal.GetCredentialsDockerRegistriesRequest = {}, + requestOptions?: DockerRegistriesClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__getCredentials(request, requestOptions)); } - private async __getCredentials(request: TrueFoundry.internal.DockerRegistriesGetCredentialsRequest = {}, requestOptions?: DockerRegistriesClient.RequestOptions): Promise> { + private async __getCredentials( + request: TrueFoundry.internal.GetCredentialsDockerRegistriesRequest = {}, + requestOptions?: DockerRegistriesClient.RequestOptions, + ): Promise> { const { fqn, clusterId } = request; const _queryParams: Record = { fqn, - clusterId + clusterId, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/docker-registry/creds"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/docker-registry/creds", + ), method: "GET", headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetDockerRegistryCredentialsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetDockerRegistryCredentialsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/docker-registry/creds"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/docker-registry/creds", + ); } } diff --git a/src/api/resources/internal/resources/dockerRegistries/client/requests/DockerRegistriesGetCredentialsRequest.ts b/src/api/resources/internal/resources/dockerRegistries/client/requests/GetCredentialsDockerRegistriesRequest.ts similarity index 54% rename from src/api/resources/internal/resources/dockerRegistries/client/requests/DockerRegistriesGetCredentialsRequest.ts rename to src/api/resources/internal/resources/dockerRegistries/client/requests/GetCredentialsDockerRegistriesRequest.ts index 0f65d279..a3c7dac5 100644 --- a/src/api/resources/internal/resources/dockerRegistries/client/requests/DockerRegistriesGetCredentialsRequest.ts +++ b/src/api/resources/internal/resources/dockerRegistries/client/requests/GetCredentialsDockerRegistriesRequest.ts @@ -2,14 +2,11 @@ /** * @example - * { - * fqn: "fqn", - * clusterId: "clusterId" - * } + * {} */ -export interface DockerRegistriesGetCredentialsRequest { +export interface GetCredentialsDockerRegistriesRequest { /** Docker registry FQN */ - fqn?: string; + fqn?: string | null; /** Cluster Id if provided will fetch the default docker registry for the cluster */ - clusterId?: string; + clusterId?: string | null; } diff --git a/src/api/resources/internal/resources/dockerRegistries/client/requests/index.ts b/src/api/resources/internal/resources/dockerRegistries/client/requests/index.ts index 91e56d3d..7110b3f9 100644 --- a/src/api/resources/internal/resources/dockerRegistries/client/requests/index.ts +++ b/src/api/resources/internal/resources/dockerRegistries/client/requests/index.ts @@ -1,2 +1,2 @@ export type { CreateDockerRepositoryRequest } from "./CreateDockerRepositoryRequest.js"; -export type { DockerRegistriesGetCredentialsRequest } from "./DockerRegistriesGetCredentialsRequest.js"; +export type { GetCredentialsDockerRegistriesRequest } from "./GetCredentialsDockerRegistriesRequest.js"; diff --git a/src/api/resources/internal/resources/index.ts b/src/api/resources/internal/resources/index.ts index f3b73dbb..0e9a9e5f 100644 --- a/src/api/resources/internal/resources/index.ts +++ b/src/api/resources/internal/resources/index.ts @@ -1,22 +1,22 @@ export * as aiGateway from "./aiGateway/index.js"; export * from "./aiGateway/types/index.js"; -export * as applications from "./applications/index.js"; export * from "./applications/client/requests/index.js"; -export * as artifactVersions from "./artifactVersions/index.js"; +export * as applications from "./applications/index.js"; export * from "./artifactVersions/client/requests/index.js"; -export * as buildLogs from "./buildLogs/index.js"; +export * as artifactVersions from "./artifactVersions/index.js"; export * from "./buildLogs/client/requests/index.js"; +export * as buildLogs from "./buildLogs/index.js"; export * as clusters from "./clusters/index.js"; -export * as deployments from "./deployments/index.js"; export * from "./deployments/client/requests/index.js"; -export * as dockerRegistries from "./dockerRegistries/index.js"; +export * as deployments from "./deployments/index.js"; export * from "./dockerRegistries/client/requests/index.js"; -export * as metrics from "./metrics/index.js"; +export * as dockerRegistries from "./dockerRegistries/index.js"; export * from "./metrics/client/requests/index.js"; +export * as metrics from "./metrics/index.js"; export * from "./metrics/types/index.js"; export * as users from "./users/index.js"; -export * as vcs from "./vcs/index.js"; export * from "./vcs/client/requests/index.js"; -export * as workflows from "./workflows/index.js"; +export * as vcs from "./vcs/index.js"; export * from "./workflows/client/requests/index.js"; +export * as workflows from "./workflows/index.js"; export * from "./workflows/types/index.js"; diff --git a/src/api/resources/internal/resources/metrics/client/Client.ts b/src/api/resources/internal/resources/metrics/client/Client.ts index fc60188b..a4fd5392 100644 --- a/src/api/resources/internal/resources/metrics/client/Client.ts +++ b/src/api/resources/internal/resources/metrics/client/Client.ts @@ -1,9 +1,9 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import * as core from "../../../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; import { mergeHeaders } from "../../../../../../core/headers.js"; +import * as core from "../../../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../../../errors/index.js"; import * as serializers from "../../../../../../serialization/index.js"; @@ -12,83 +12,122 @@ import * as TrueFoundry from "../../../../../index.js"; export declare namespace MetricsClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class MetricsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: MetricsClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** * List metric charts available for an application. * * @param {string} workspaceId - * @param {TrueFoundry.internal.MetricsGetChartsRequest} request + * @param {TrueFoundry.internal.GetChartsMetricsRequest} request * @param {MetricsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.BadRequestError} * @throws {@link TrueFoundry.NotFoundError} * @throws {@link TrueFoundry.MethodNotAllowedError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.internal.metrics.getCharts("workspaceId", { * applicationId: "applicationId", - * startTs: "startTs", - * endTs: "endTs", * filterEntity: "application", * filterQuery: "{\"pod\":\"my-app-abc123-xyz\"}" * }) */ - public getCharts(workspaceId: string, request: TrueFoundry.internal.MetricsGetChartsRequest, requestOptions?: MetricsClient.RequestOptions): core.HttpResponsePromise { + public getCharts( + workspaceId: string, + request: TrueFoundry.internal.GetChartsMetricsRequest, + requestOptions?: MetricsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__getCharts(workspaceId, request, requestOptions)); } - private async __getCharts(workspaceId: string, request: TrueFoundry.internal.MetricsGetChartsRequest, requestOptions?: MetricsClient.RequestOptions): Promise> { + private async __getCharts( + workspaceId: string, + request: TrueFoundry.internal.GetChartsMetricsRequest, + requestOptions?: MetricsClient.RequestOptions, + ): Promise> { const { applicationId, startTs, endTs, filterEntity, filterQuery } = request; const _queryParams: Record = { applicationId, startTs, endTs, - filterEntity: serializers.internal.MetricsGetChartsRequestFilterEntity.jsonOrThrow(filterEntity, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), - filterQuery + filterEntity: serializers.internal.GetChartsMetricsRequestFilterEntity.jsonOrThrow(filterEntity, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + filterQuery, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/metrics/${core.url.encodePathParam(workspaceId)}/charts`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/metrics/${core.url.encodePathParam(workspaceId)}/charts`, + ), method: "GET", headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetChartsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetChartsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 400: throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - case 405: throw new TrueFoundry.MethodNotAllowedError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 400: + throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + case 405: + throw new TrueFoundry.MethodNotAllowedError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/metrics/{workspaceId}/charts"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/metrics/{workspaceId}/charts", + ); } } diff --git a/src/api/resources/internal/resources/metrics/client/requests/MetricsGetChartsRequest.ts b/src/api/resources/internal/resources/metrics/client/requests/GetChartsMetricsRequest.ts similarity index 68% rename from src/api/resources/internal/resources/metrics/client/requests/MetricsGetChartsRequest.ts rename to src/api/resources/internal/resources/metrics/client/requests/GetChartsMetricsRequest.ts index 787fb60a..58b59bf1 100644 --- a/src/api/resources/internal/resources/metrics/client/requests/MetricsGetChartsRequest.ts +++ b/src/api/resources/internal/resources/metrics/client/requests/GetChartsMetricsRequest.ts @@ -1,26 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../../index.js"; +import type * as TrueFoundry from "../../../../../../index.js"; /** * @example * { * applicationId: "applicationId", - * startTs: "startTs", - * endTs: "endTs", * filterEntity: "application", * filterQuery: "{\"pod\":\"my-app-abc123-xyz\"}" * } */ -export interface MetricsGetChartsRequest { +export interface GetChartsMetricsRequest { /** Unique identifier of the application. */ applicationId: string; /** Start timestamp in milliseconds since epoch. Defaults to the application's last deployment creation time. */ - startTs?: string; + startTs?: string | null; /** End timestamp in milliseconds since epoch. Defaults to the current time. */ - endTs?: string; + endTs?: string | null; /** Scope of the chart bundle to return. */ - filterEntity: TrueFoundry.internal.MetricsGetChartsRequestFilterEntity; + filterEntity: TrueFoundry.internal.GetChartsMetricsRequestFilterEntity; /** JSON-encoded filter required by certain scopes. */ - filterQuery?: string; + filterQuery?: string | null; } diff --git a/src/api/resources/internal/resources/metrics/client/requests/index.ts b/src/api/resources/internal/resources/metrics/client/requests/index.ts index f0799260..9792ac17 100644 --- a/src/api/resources/internal/resources/metrics/client/requests/index.ts +++ b/src/api/resources/internal/resources/metrics/client/requests/index.ts @@ -1 +1 @@ -export type { MetricsGetChartsRequest } from "./MetricsGetChartsRequest.js"; +export type { GetChartsMetricsRequest } from "./GetChartsMetricsRequest.js"; diff --git a/src/api/resources/internal/resources/metrics/types/GetChartsMetricsRequestFilterEntity.ts b/src/api/resources/internal/resources/metrics/types/GetChartsMetricsRequestFilterEntity.ts new file mode 100644 index 00000000..2a647144 --- /dev/null +++ b/src/api/resources/internal/resources/metrics/types/GetChartsMetricsRequestFilterEntity.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetChartsMetricsRequestFilterEntity = { + Application: "application", + Pod: "pod", + JobRun: "job-run", + Event: "event", + Cluster: "cluster", +} as const; +export type GetChartsMetricsRequestFilterEntity = + (typeof GetChartsMetricsRequestFilterEntity)[keyof typeof GetChartsMetricsRequestFilterEntity]; diff --git a/src/api/resources/internal/resources/metrics/types/MetricsGetChartsRequestFilterEntity.ts b/src/api/resources/internal/resources/metrics/types/MetricsGetChartsRequestFilterEntity.ts deleted file mode 100644 index a12cba63..00000000 --- a/src/api/resources/internal/resources/metrics/types/MetricsGetChartsRequestFilterEntity.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const MetricsGetChartsRequestFilterEntity = { - Application: "application", - Pod: "pod", - JobRun: "job-run", - Event: "event", - Cluster: "cluster" - } as const; -export type MetricsGetChartsRequestFilterEntity = typeof MetricsGetChartsRequestFilterEntity[keyof typeof MetricsGetChartsRequestFilterEntity]; diff --git a/src/api/resources/internal/resources/metrics/types/index.ts b/src/api/resources/internal/resources/metrics/types/index.ts index ef539cc0..59abb756 100644 --- a/src/api/resources/internal/resources/metrics/types/index.ts +++ b/src/api/resources/internal/resources/metrics/types/index.ts @@ -1 +1 @@ -export * from "./MetricsGetChartsRequestFilterEntity.js"; +export * from "./GetChartsMetricsRequestFilterEntity.js"; diff --git a/src/api/resources/internal/resources/users/client/Client.ts b/src/api/resources/internal/resources/users/client/Client.ts index 32a055f2..f05814ee 100644 --- a/src/api/resources/internal/resources/users/client/Client.ts +++ b/src/api/resources/internal/resources/users/client/Client.ts @@ -1,29 +1,25 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import * as core from "../../../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; import { mergeHeaders } from "../../../../../../core/headers.js"; +import * as core from "../../../../../../core/index.js"; import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../../../errors/index.js"; import * as serializers from "../../../../../../serialization/index.js"; -import * as TrueFoundry from "../../../../../index.js"; +import type * as TrueFoundry from "../../../../../index.js"; export declare namespace UsersClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class UsersClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: UsersClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** @@ -31,6 +27,9 @@ export class UsersClient { * * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.internal.users.getInfo() */ @@ -38,11 +37,21 @@ export class UsersClient { return core.HttpResponsePromise.fromPromise(this.__getInfo(requestOptions)); } - private async __getInfo(requestOptions?: UsersClient.RequestOptions): Promise> { + private async __getInfo( + requestOptions?: UsersClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/x/users/info"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/x/users/info", + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -50,17 +59,26 @@ export class UsersClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.Session.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.Session.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } diff --git a/src/api/resources/internal/resources/vcs/client/Client.ts b/src/api/resources/internal/resources/vcs/client/Client.ts index d79c5878..18f70ae7 100644 --- a/src/api/resources/internal/resources/vcs/client/Client.ts +++ b/src/api/resources/internal/resources/vcs/client/Client.ts @@ -1,118 +1,193 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import * as core from "../../../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; import { mergeHeaders } from "../../../../../../core/headers.js"; +import * as core from "../../../../../../core/index.js"; +import { mergeAdditionalBodyParameters } from "../../../../../../core/requestBody.js"; import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../../../errors/index.js"; import * as serializers from "../../../../../../serialization/index.js"; -import * as TrueFoundry from "../../../../../index.js"; +import type * as TrueFoundry from "../../../../../index.js"; export declare namespace VcsClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class VcsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: VcsClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** * @param {TrueFoundry.internal.GitRepositoryExistsRequest} request * @param {VcsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.internal.vcs.getRepositoryDetails({ * repoUrl: "repoURL" * }) */ - public getRepositoryDetails(request: TrueFoundry.internal.GitRepositoryExistsRequest, requestOptions?: VcsClient.RequestOptions): core.HttpResponsePromise { + public getRepositoryDetails( + request: TrueFoundry.internal.GitRepositoryExistsRequest, + requestOptions?: VcsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__getRepositoryDetails(request, requestOptions)); } - private async __getRepositoryDetails(request: TrueFoundry.internal.GitRepositoryExistsRequest, requestOptions?: VcsClient.RequestOptions): Promise> { + private async __getRepositoryDetails( + request: TrueFoundry.internal.GitRepositoryExistsRequest, + requestOptions?: VcsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/vcs/repository/details"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/vcs/repository/details", + ), method: "POST", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.internal.GitRepositoryExistsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.internal.GitRepositoryExistsRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GitRepositoryExistsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GitRepositoryExistsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/svc/v1/vcs/repository/details"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/api/svc/v1/vcs/repository/details", + ); } /** * @param {TrueFoundry.internal.GetAuthenticatedVcsurlRequest} request * @param {VcsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.internal.vcs.getAuthenticatedUrl({ * repoUrl: "repoURL" * }) */ - public getAuthenticatedUrl(request: TrueFoundry.internal.GetAuthenticatedVcsurlRequest, requestOptions?: VcsClient.RequestOptions): core.HttpResponsePromise { + public getAuthenticatedUrl( + request: TrueFoundry.internal.GetAuthenticatedVcsurlRequest, + requestOptions?: VcsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__getAuthenticatedUrl(request, requestOptions)); } - private async __getAuthenticatedUrl(request: TrueFoundry.internal.GetAuthenticatedVcsurlRequest, requestOptions?: VcsClient.RequestOptions): Promise> { + private async __getAuthenticatedUrl( + request: TrueFoundry.internal.GetAuthenticatedVcsurlRequest, + requestOptions?: VcsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/vcs/repository/authenticated-url"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/vcs/repository/authenticated-url", + ), method: "POST", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.internal.GetAuthenticatedVcsurlRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.internal.GetAuthenticatedVcsurlRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetAuthenticatedVcsurlResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetAuthenticatedVcsurlResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/svc/v1/vcs/repository/authenticated-url"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/api/svc/v1/vcs/repository/authenticated-url", + ); } } diff --git a/src/api/resources/internal/resources/vcs/client/requests/GitRepositoryExistsRequest.ts b/src/api/resources/internal/resources/vcs/client/requests/GitRepositoryExistsRequest.ts index 3edc7b81..68be541a 100644 --- a/src/api/resources/internal/resources/vcs/client/requests/GitRepositoryExistsRequest.ts +++ b/src/api/resources/internal/resources/vcs/client/requests/GitRepositoryExistsRequest.ts @@ -10,5 +10,5 @@ export interface GitRepositoryExistsRequest { /** The URL of the repository */ repoUrl: string; /** The integration id of the repository */ - id?: string; + id?: string | null; } diff --git a/src/api/resources/internal/resources/workflows/client/Client.ts b/src/api/resources/internal/resources/workflows/client/Client.ts index 4cbc52bf..f3777f13 100644 --- a/src/api/resources/internal/resources/workflows/client/Client.ts +++ b/src/api/resources/internal/resources/workflows/client/Client.ts @@ -1,9 +1,10 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js"; -import * as core from "../../../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.js"; import { mergeHeaders } from "../../../../../../core/headers.js"; +import * as core from "../../../../../../core/index.js"; +import { mergeAdditionalBodyParameters } from "../../../../../../core/requestBody.js"; import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../../../errors/index.js"; import * as serializers from "../../../../../../serialization/index.js"; @@ -12,18 +13,14 @@ import * as TrueFoundry from "../../../../../index.js"; export declare namespace WorkflowsClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class WorkflowsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: WorkflowsClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** @@ -35,47 +32,90 @@ export class WorkflowsClient { * * @throws {@link TrueFoundry.BadRequestError} * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.internal.workflows.executeWorkflow("applicationId") */ - public executeWorkflow(applicationId: string, request: TrueFoundry.internal.ExecuteWorkflowRequest = {}, requestOptions?: WorkflowsClient.RequestOptions): core.HttpResponsePromise { + public executeWorkflow( + applicationId: string, + request: TrueFoundry.internal.ExecuteWorkflowRequest = {}, + requestOptions?: WorkflowsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__executeWorkflow(applicationId, request, requestOptions)); } - private async __executeWorkflow(applicationId: string, request: TrueFoundry.internal.ExecuteWorkflowRequest = {}, requestOptions?: WorkflowsClient.RequestOptions): Promise> { + private async __executeWorkflow( + applicationId: string, + request: TrueFoundry.internal.ExecuteWorkflowRequest = {}, + requestOptions?: WorkflowsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/workflow/${core.url.encodePathParam(applicationId)}/executions`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/workflow/${core.url.encodePathParam(applicationId)}/executions`, + ), method: "POST", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.internal.ExecuteWorkflowRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.internal.ExecuteWorkflowRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.internal.WorkflowsExecuteWorkflowResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.internal.ExecuteWorkflowWorkflowsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 400: throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 400: + throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/svc/v1/workflow/{applicationId}/executions"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/api/svc/v1/workflow/{applicationId}/executions", + ); } } diff --git a/src/api/resources/internal/resources/workflows/client/requests/ExecuteWorkflowRequest.ts b/src/api/resources/internal/resources/workflows/client/requests/ExecuteWorkflowRequest.ts index 3efc4b53..af4b39f6 100644 --- a/src/api/resources/internal/resources/workflows/client/requests/ExecuteWorkflowRequest.ts +++ b/src/api/resources/internal/resources/workflows/client/requests/ExecuteWorkflowRequest.ts @@ -6,7 +6,7 @@ */ export interface ExecuteWorkflowRequest { /** Workflow inputs */ - inputs?: Record; + inputs?: Record | null; /** Workflow inputs literal map */ - inputsLiteralMap?: Record; + inputsLiteralMap?: Record | null; } diff --git a/src/api/resources/internal/resources/workflows/types/WorkflowsExecuteWorkflowResponse.ts b/src/api/resources/internal/resources/workflows/types/ExecuteWorkflowWorkflowsResponse.ts similarity index 71% rename from src/api/resources/internal/resources/workflows/types/WorkflowsExecuteWorkflowResponse.ts rename to src/api/resources/internal/resources/workflows/types/ExecuteWorkflowWorkflowsResponse.ts index 270af8d4..a193697e 100644 --- a/src/api/resources/internal/resources/workflows/types/WorkflowsExecuteWorkflowResponse.ts +++ b/src/api/resources/internal/resources/workflows/types/ExecuteWorkflowWorkflowsResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -export interface WorkflowsExecuteWorkflowResponse { +export interface ExecuteWorkflowWorkflowsResponse { /** The name of the execution */ executionName?: string; } diff --git a/src/api/resources/internal/resources/workflows/types/index.ts b/src/api/resources/internal/resources/workflows/types/index.ts index 41105159..b22e14d6 100644 --- a/src/api/resources/internal/resources/workflows/types/index.ts +++ b/src/api/resources/internal/resources/workflows/types/index.ts @@ -1 +1 @@ -export * from "./WorkflowsExecuteWorkflowResponse.js"; +export * from "./ExecuteWorkflowWorkflowsResponse.js"; diff --git a/src/api/resources/jobs/client/Client.ts b/src/api/resources/jobs/client/Client.ts index 027c80a6..334c8bc1 100644 --- a/src/api/resources/jobs/client/Client.ts +++ b/src/api/resources/jobs/client/Client.ts @@ -1,9 +1,11 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; -import * as core from "../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import { toJson } from "../../../../core/json.js"; +import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; @@ -12,85 +14,188 @@ import * as TrueFoundry from "../../../index.js"; export declare namespace JobsClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class JobsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: JobsClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** * List Job Runs for provided Job Id. Filter the data based on parameters passed in the query * * @param {string} jobId - Job id of the application - * @param {TrueFoundry.JobsListRunsRequest} request + * @param {TrueFoundry.ListRunsJobsRequest} request * @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.ForbiddenError} * @throws {@link TrueFoundry.NotFoundError} * @throws {@link TrueFoundry.UnprocessableEntityError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.jobs.listRuns("jobId", { * limit: 10, - * offset: 0, - * searchPrefix: "searchPrefix", - * sortBy: "startTime", - * order: "asc", - * triggeredBy: ["triggeredBy"], - * status: ["CREATED"], - * versionNumbers: [1.1] + * offset: 0 * }) */ - public async listRuns(jobId: string, request: TrueFoundry.JobsListRunsRequest = {}, requestOptions?: JobsClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.JobsListRunsRequest): Promise> => { const { limit = 100, offset = 0, searchPrefix, sortBy, order, triggeredBy, status, versionNumbers } = request; const _queryParams: Record = { - limit, - offset, - searchPrefix, - sortBy: sortBy != null ? serializers.JobRunsSortBy.jsonOrThrow(sortBy, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }) : undefined, - order: order != null ? serializers.SortDirection.jsonOrThrow(order, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }) : undefined, - triggeredBy, - status: Array.isArray(status) ? status.map(item => serializers.JobRunStatus.jsonOrThrow(item, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true })) : status != null ? serializers.JobRunStatus.jsonOrThrow(status, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }) : undefined, - versionNumbers - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/jobs/${core.url.encodePathParam(jobId)}/runs`), - method: "GET", - headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.ListJobRunResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - case 422: throw new TrueFoundry.UnprocessableEntityError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse + public async listRuns( + jobId: string, + request: TrueFoundry.ListRunsJobsRequest = {}, + requestOptions?: JobsClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.ListRunsJobsRequest, + ): Promise> => { + const { + limit = 100, + offset = 0, + searchPrefix, + sortBy, + order, + triggeredBy, + status, + versionNumbers, + } = request; + const _queryParams: Record = { + limit, + offset, + searchPrefix, + sortBy: + sortBy != null + ? serializers.JobRunsSortBy.jsonOrThrow(sortBy, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }) + : undefined, + order: + order != null + ? serializers.SortDirection.jsonOrThrow(order, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }) + : undefined, + triggeredBy: triggeredBy !== undefined ? toJson(triggeredBy) : undefined, + status: Array.isArray(status) + ? status.map((item) => + serializers.JobRunStatus.jsonOrThrow(item, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + ) + : status != null + ? serializers.JobRunStatus.jsonOrThrow(status, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }) + : undefined, + versionNumbers: versionNumbers !== undefined ? toJson(versionNumbers) : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/jobs/${core.url.encodePathParam(jobId)}/runs`, + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, }); - } - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/jobs/{jobId}/runs"); }); + if (_response.ok) { + return { + data: serializers.ListJobRunResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + case 422: + throw new TrueFoundry.UnprocessableEntityError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/jobs/{jobId}/runs", + ); + }, + ); let _offset = request?.offset != null ? request?.offset : 0; const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => (response?.data ?? []).length > 0 && (request?.limit == null || (response?.data ?? []).length >= request?.limit), - getItems: response => response?.data ?? [], - loadPage: response => { _offset += response?.data != null ? response.data.length : 1; return list(core.setObjectProperty(request, "offset", _offset)); } + hasNextPage: (response) => + (response?.data ?? []).length > 0 && + (request?.limit == null || (response?.data ?? []).length >= request?.limit), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + _offset += response?.data != null ? response.data.length : 1; + return list(core.setObjectProperty(request, "offset", _offset)); + }, }); } @@ -103,19 +208,37 @@ export class JobsClient { * * @throws {@link TrueFoundry.ForbiddenError} * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.jobs.getRun("jobId", "jobRunName") */ - public getRun(jobId: string, jobRunName: string, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise { + public getRun( + jobId: string, + jobRunName: string, + requestOptions?: JobsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__getRun(jobId, jobRunName, requestOptions)); } - private async __getRun(jobId: string, jobRunName: string, requestOptions?: JobsClient.RequestOptions): Promise> { + private async __getRun( + jobId: string, + jobRunName: string, + requestOptions?: JobsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/jobs/${core.url.encodePathParam(jobId)}/runs/${core.url.encodePathParam(jobRunName)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/jobs/${core.url.encodePathParam(jobId)}/runs/${core.url.encodePathParam(jobRunName)}`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -123,25 +246,51 @@ export class JobsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetJobRunResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetJobRunResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/jobs/{jobId}/runs/{jobRunName}"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/jobs/{jobId}/runs/{jobRunName}", + ); } /** @@ -154,19 +303,37 @@ export class JobsClient { * @throws {@link TrueFoundry.ForbiddenError} * @throws {@link TrueFoundry.NotFoundError} * @throws {@link TrueFoundry.ConflictError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.jobs.deleteRun("jobId", "jobRunName") */ - public deleteRun(jobId: string, jobRunName: string, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise { + public deleteRun( + jobId: string, + jobRunName: string, + requestOptions?: JobsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__deleteRun(jobId, jobRunName, requestOptions)); } - private async __deleteRun(jobId: string, jobRunName: string, requestOptions?: JobsClient.RequestOptions): Promise> { + private async __deleteRun( + jobId: string, + jobRunName: string, + requestOptions?: JobsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/jobs/${core.url.encodePathParam(jobId)}/runs/${core.url.encodePathParam(jobRunName)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/jobs/${core.url.encodePathParam(jobId)}/runs/${core.url.encodePathParam(jobRunName)}`, + ), method: "DELETE", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -174,26 +341,62 @@ export class JobsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.DeleteJobRunResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.DeleteJobRunResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - case 409: throw new TrueFoundry.ConflictError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + case 409: + throw new TrueFoundry.ConflictError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/api/svc/v1/jobs/{jobId}/runs/{jobRunName}"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/api/svc/v1/jobs/{jobId}/runs/{jobRunName}", + ); } /** @@ -206,46 +409,102 @@ export class JobsClient { * @throws {@link TrueFoundry.ForbiddenError} * @throws {@link TrueFoundry.NotFoundError} * @throws {@link TrueFoundry.UnprocessableEntityError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.jobs.trigger() */ - public trigger(request: TrueFoundry.TriggerJobRequest = {}, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise { + public trigger( + request: TrueFoundry.TriggerJobRequest = {}, + requestOptions?: JobsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__trigger(request, requestOptions)); } - private async __trigger(request: TrueFoundry.TriggerJobRequest = {}, requestOptions?: JobsClient.RequestOptions): Promise> { + private async __trigger( + request: TrueFoundry.TriggerJobRequest = {}, + requestOptions?: JobsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/jobs/trigger"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/jobs/trigger", + ), method: "POST", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.TriggerJobRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.TriggerJobRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.TriggerJobRunResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.TriggerJobRunResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 400: throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - case 422: throw new TrueFoundry.UnprocessableEntityError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 400: + throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + case 422: + throw new TrueFoundry.UnprocessableEntityError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -255,13 +514,15 @@ export class JobsClient { /** * Terminate Job for provided deploymentId and jobRunName * - * @param {TrueFoundry.JobsTerminateRequest} request + * @param {TrueFoundry.TerminateJobsRequest} request * @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.ForbiddenError} * @throws {@link TrueFoundry.NotFoundError} * @throws {@link TrueFoundry.ExpectationFailedError} * @throws {@link TrueFoundry.UnprocessableEntityError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.jobs.terminate({ @@ -269,44 +530,103 @@ export class JobsClient { * jobRunName: "jobRunName" * }) */ - public terminate(request: TrueFoundry.JobsTerminateRequest, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise { + public terminate( + request: TrueFoundry.TerminateJobsRequest, + requestOptions?: JobsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__terminate(request, requestOptions)); } - private async __terminate(request: TrueFoundry.JobsTerminateRequest, requestOptions?: JobsClient.RequestOptions): Promise> { + private async __terminate( + request: TrueFoundry.TerminateJobsRequest, + requestOptions?: JobsClient.RequestOptions, + ): Promise> { const { deploymentId, jobRunName } = request; const _queryParams: Record = { deploymentId, - jobRunName + jobRunName, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/jobs/terminate"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/jobs/terminate", + ), method: "POST", headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.TerminateJobResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.TerminateJobResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - case 417: throw new TrueFoundry.ExpectationFailedError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 422: throw new TrueFoundry.UnprocessableEntityError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + case 417: + throw new TrueFoundry.ExpectationFailedError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 422: + throw new TrueFoundry.UnprocessableEntityError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } diff --git a/src/api/resources/jobs/client/requests/JobsListRunsRequest.ts b/src/api/resources/jobs/client/requests/ListRunsJobsRequest.ts similarity index 55% rename from src/api/resources/jobs/client/requests/JobsListRunsRequest.ts rename to src/api/resources/jobs/client/requests/ListRunsJobsRequest.ts index 54f66511..abf4bd8d 100644 --- a/src/api/resources/jobs/client/requests/JobsListRunsRequest.ts +++ b/src/api/resources/jobs/client/requests/ListRunsJobsRequest.ts @@ -1,35 +1,29 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../index.js"; +import type * as TrueFoundry from "../../../../index.js"; /** * @example * { * limit: 10, - * offset: 0, - * searchPrefix: "searchPrefix", - * sortBy: "startTime", - * order: "asc", - * triggeredBy: ["triggeredBy"], - * status: ["CREATED"], - * versionNumbers: [1.1] + * offset: 0 * } */ -export interface JobsListRunsRequest { +export interface ListRunsJobsRequest { /** Number of items per page */ - limit?: number; + limit?: number | null; /** Number of items to skip */ - offset?: number; + offset?: number | null; /** Prefix used to search for job runs by name or identifier */ - searchPrefix?: string; + searchPrefix?: string | null; /** Attribute to sort by */ sortBy?: TrueFoundry.JobRunsSortBy; /** Sorting order */ order?: TrueFoundry.SortDirection; /** Array of subject slugs */ - triggeredBy?: string | string[]; + triggeredBy?: string[] | null; /** Status of the job run */ status?: TrueFoundry.JobRunStatus | TrueFoundry.JobRunStatus[]; /** Version number of the deployment */ - versionNumbers?: number | number[]; + versionNumbers?: number[] | null; } diff --git a/src/api/resources/jobs/client/requests/JobsTerminateRequest.ts b/src/api/resources/jobs/client/requests/TerminateJobsRequest.ts similarity index 88% rename from src/api/resources/jobs/client/requests/JobsTerminateRequest.ts rename to src/api/resources/jobs/client/requests/TerminateJobsRequest.ts index cf036e66..f05d9819 100644 --- a/src/api/resources/jobs/client/requests/JobsTerminateRequest.ts +++ b/src/api/resources/jobs/client/requests/TerminateJobsRequest.ts @@ -7,7 +7,7 @@ * jobRunName: "jobRunName" * } */ -export interface JobsTerminateRequest { +export interface TerminateJobsRequest { /** Deployment Id of the Deployment */ deploymentId: string; /** Job Run name */ diff --git a/src/api/resources/jobs/client/requests/TriggerJobRequest.ts b/src/api/resources/jobs/client/requests/TriggerJobRequest.ts index ab8db082..b5952980 100644 --- a/src/api/resources/jobs/client/requests/TriggerJobRequest.ts +++ b/src/api/resources/jobs/client/requests/TriggerJobRequest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../index.js"; +import type * as TrueFoundry from "../../../../index.js"; /** * @example @@ -8,11 +8,11 @@ import * as TrueFoundry from "../../../../index.js"; */ export interface TriggerJobRequest { /** Deployment Id of the job */ - deploymentId?: string; + deploymentId?: string | null; /** Application Id of the job */ - applicationId?: string; + applicationId?: string | null; /** Job trigger input */ - input?: TrueFoundry.TriggerJobRequestInput; + input?: TrueFoundry.TriggerJobRequestInput | null; /** Metadata for the job run including job_alias_name */ - metadata?: TrueFoundry.Metadata; + metadata?: TrueFoundry.Metadata | null; } diff --git a/src/api/resources/jobs/client/requests/index.ts b/src/api/resources/jobs/client/requests/index.ts index fd31105d..fa2a4b94 100644 --- a/src/api/resources/jobs/client/requests/index.ts +++ b/src/api/resources/jobs/client/requests/index.ts @@ -1,3 +1,3 @@ -export type { JobsListRunsRequest } from "./JobsListRunsRequest.js"; -export type { JobsTerminateRequest } from "./JobsTerminateRequest.js"; +export type { ListRunsJobsRequest } from "./ListRunsJobsRequest.js"; +export type { TerminateJobsRequest } from "./TerminateJobsRequest.js"; export type { TriggerJobRequest } from "./TriggerJobRequest.js"; diff --git a/src/api/resources/jobs/types/TriggerJobRequestInput.ts b/src/api/resources/jobs/types/TriggerJobRequestInput.ts index b6a1d854..4f4f3d4c 100644 --- a/src/api/resources/jobs/types/TriggerJobRequestInput.ts +++ b/src/api/resources/jobs/types/TriggerJobRequestInput.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../index.js"; +import type * as TrueFoundry from "../../../index.js"; /** * Job trigger input */ -export type TriggerJobRequestInput = - | TrueFoundry.JobTriggerInput - | TrueFoundry.SparkJobTriggerInput; +export type TriggerJobRequestInput = TrueFoundry.JobTriggerInput | TrueFoundry.SparkJobTriggerInput; diff --git a/src/api/resources/logs/client/Client.ts b/src/api/resources/logs/client/Client.ts index 79721e08..990adf5d 100644 --- a/src/api/resources/logs/client/Client.ts +++ b/src/api/resources/logs/client/Client.ts @@ -1,9 +1,10 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; -import * as core from "../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import { toJson } from "../../../../core/json.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; @@ -12,60 +13,76 @@ import * as TrueFoundry from "../../../index.js"; export declare namespace LogsClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class LogsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: LogsClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** * Get runtime logs (stdout/stderr) emitted by the pods of a deployed application. * - * @param {TrueFoundry.LogsGetRequest} request + * @param {TrueFoundry.GetLogsRequest} request * @param {LogsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.BadRequestError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.logs.get({ * startTs: "1779262323000000000", * endTs: "1779348723000000000", - * limit: 1, - * direction: "asc", - * numLogsToIgnore: 1, - * applicationId: "applicationId", - * applicationFqn: "applicationFqn", - * deploymentId: "deploymentId", - * jobRunName: "jobRunName", - * podName: "podName", - * containerName: "containerName", - * podNames: ["podNames"], - * podNamesRegex: "podNamesRegex", - * searchFilters: "[{\"string\":\"error\",\"type\":\"substring\",\"operator\":\"equal\"}]", - * searchString: "searchString", - * searchType: "regex", - * searchOperator: "equal" + * searchFilters: "[{\"string\":\"error\",\"type\":\"substring\",\"operator\":\"equal\"}]" * }) */ - public get(request: TrueFoundry.LogsGetRequest = {}, requestOptions?: LogsClient.RequestOptions): core.HttpResponsePromise { + public get( + request: TrueFoundry.GetLogsRequest = {}, + requestOptions?: LogsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } - private async __get(request: TrueFoundry.LogsGetRequest = {}, requestOptions?: LogsClient.RequestOptions): Promise> { - const { startTs, endTs, limit = 5000, direction, numLogsToIgnore, applicationId, applicationFqn, deploymentId, jobRunName, podName, containerName, podNames, podNamesRegex, searchFilters, searchString, searchType, searchOperator } = request; + private async __get( + request: TrueFoundry.GetLogsRequest = {}, + requestOptions?: LogsClient.RequestOptions, + ): Promise> { + const { + startTs, + endTs, + limit = 5000, + direction, + numLogsToIgnore, + applicationId, + applicationFqn, + deploymentId, + jobRunName, + podName, + containerName, + podNames, + podNamesRegex, + searchFilters, + searchString, + searchType, + searchOperator, + } = request; const _queryParams: Record = { startTs, endTs, limit, - direction: direction != null ? serializers.LogsSortingDirection.jsonOrThrow(direction, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }) : undefined, + direction: + direction != null + ? serializers.LogsSortingDirection.jsonOrThrow(direction, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }) + : undefined, numLogsToIgnore, applicationId, applicationFqn, @@ -73,38 +90,77 @@ export class LogsClient { jobRunName, podName, containerName, - podNames, + podNames: podNames !== undefined ? toJson(podNames) : undefined, podNamesRegex, searchFilters, searchString, - searchType: searchType != null ? serializers.LogsSearchFilterType.jsonOrThrow(searchType, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }) : undefined, - searchOperator: searchOperator != null ? serializers.LogsSearchOperatorType.jsonOrThrow(searchOperator, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }) : undefined + searchType: + searchType != null + ? serializers.LogsSearchFilterType.jsonOrThrow(searchType, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }) + : undefined, + searchOperator: + searchOperator != null + ? serializers.LogsSearchOperatorType.jsonOrThrow(searchOperator, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }) + : undefined, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/logs"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/logs", + ), method: "GET", headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetLogsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetLogsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 400: throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 400: + throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } diff --git a/src/api/resources/logs/client/requests/LogsGetRequest.ts b/src/api/resources/logs/client/requests/GetLogsRequest.ts similarity index 64% rename from src/api/resources/logs/client/requests/LogsGetRequest.ts rename to src/api/resources/logs/client/requests/GetLogsRequest.ts index 07671b39..f18876b1 100644 --- a/src/api/resources/logs/client/requests/LogsGetRequest.ts +++ b/src/api/resources/logs/client/requests/GetLogsRequest.ts @@ -1,60 +1,46 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../index.js"; +import type * as TrueFoundry from "../../../../index.js"; /** * @example * { * startTs: "1779262323000000000", * endTs: "1779348723000000000", - * limit: 1, - * direction: "asc", - * numLogsToIgnore: 1, - * applicationId: "applicationId", - * applicationFqn: "applicationFqn", - * deploymentId: "deploymentId", - * jobRunName: "jobRunName", - * podName: "podName", - * containerName: "containerName", - * podNames: ["podNames"], - * podNamesRegex: "podNamesRegex", - * searchFilters: "[{\"string\":\"error\",\"type\":\"substring\",\"operator\":\"equal\"}]", - * searchString: "searchString", - * searchType: "regex", - * searchOperator: "equal" + * searchFilters: "[{\"string\":\"error\",\"type\":\"substring\",\"operator\":\"equal\"}]" * } */ -export interface LogsGetRequest { +export interface GetLogsRequest { /** Start timestamp for querying logs, in nanoseconds from the Unix epoch. */ - startTs?: string; + startTs?: string | null; /** End timestamp for querying logs, in nanoseconds from the Unix epoch. */ - endTs?: string; + endTs?: string | null; /** Maximum number of log lines to fetch. */ - limit?: number; + limit?: number | null; /** Direction of sorting logs by timestamp. */ direction?: TrueFoundry.LogsSortingDirection; /** Number of log lines at the start timestamp to skip. */ - numLogsToIgnore?: number; + numLogsToIgnore?: number | null; /** Unique identifier of the application. Either applicationId or applicationFqn must be provided. */ - applicationId?: string; + applicationId?: string | null; /** FQN of the application. Either applicationId or applicationFqn must be provided. */ - applicationFqn?: string; + applicationFqn?: string | null; /** Unique identifier of the deployment. */ - deploymentId?: string; + deploymentId?: string | null; /** Name of the job run whose logs to fetch. */ - jobRunName?: string; + jobRunName?: string | null; /** Name of a single pod whose logs to fetch. Cannot be used together with podNames or podNamesRegex. */ - podName?: string; + podName?: string | null; /** Name of the container whose logs to fetch. */ - containerName?: string; + containerName?: string | null; /** List of pod names whose logs to fetch. Cannot be used together with podName or podNamesRegex. */ - podNames?: string | string[]; + podNames?: string[] | null; /** Regex pattern matching pod names whose logs to fetch. Cannot be used together with podName or podNames. */ - podNamesRegex?: string; + podNamesRegex?: string | null; /** JSON-encoded array of search filters; each item is `{ string, type, operator }`. Takes precedence over `searchString` when provided. */ - searchFilters?: string; + searchFilters?: string | null; /** Substring or regex to match against log content. Used when `searchFilters` is not provided. */ - searchString?: string; + searchString?: string | null; /** How `searchString` should be matched against log content. */ searchType?: TrueFoundry.LogsSearchFilterType; /** Comparison operator applied to the `searchString` match. */ diff --git a/src/api/resources/logs/client/requests/index.ts b/src/api/resources/logs/client/requests/index.ts index 2e08f568..81f196ef 100644 --- a/src/api/resources/logs/client/requests/index.ts +++ b/src/api/resources/logs/client/requests/index.ts @@ -1 +1 @@ -export type { LogsGetRequest } from "./LogsGetRequest.js"; +export type { GetLogsRequest } from "./GetLogsRequest.js"; diff --git a/src/api/resources/mlRepos/client/Client.ts b/src/api/resources/mlRepos/client/Client.ts index 6b5d606e..cb2682a7 100644 --- a/src/api/resources/mlRepos/client/Client.ts +++ b/src/api/resources/mlRepos/client/Client.ts @@ -1,9 +1,11 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; -import * as core from "../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import { toJson } from "../../../../core/json.js"; +import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; @@ -12,18 +14,14 @@ import * as TrueFoundry from "../../../index.js"; export declare namespace MlReposClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class MlReposClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: MlReposClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** @@ -33,19 +31,35 @@ export class MlReposClient { * @param {MlReposClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.mlRepos.get("id") */ - public get(id: string, requestOptions?: MlReposClient.RequestOptions): core.HttpResponsePromise { + public get( + id: string, + requestOptions?: MlReposClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions)); } - private async __get(id: string, requestOptions?: MlReposClient.RequestOptions): Promise> { + private async __get( + id: string, + requestOptions?: MlReposClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/ml-repos/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/ml-repos/${core.url.encodePathParam(id)}`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -53,20 +67,31 @@ export class MlReposClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetMlRepoResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetMlRepoResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -80,19 +105,35 @@ export class MlReposClient { * @param {MlReposClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.mlRepos.delete("id") */ - public delete(id: string, requestOptions?: MlReposClient.RequestOptions): core.HttpResponsePromise { + public delete( + id: string, + requestOptions?: MlReposClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions)); } - private async __delete(id: string, requestOptions?: MlReposClient.RequestOptions): Promise> { + private async __delete( + id: string, + requestOptions?: MlReposClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/ml-repos/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/ml-repos/${core.url.encodePathParam(id)}`, + ), method: "DELETE", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -100,20 +141,31 @@ export class MlReposClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.EmptyResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.EmptyResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -123,50 +175,93 @@ export class MlReposClient { /** * List ML Repos with optional filtering by name. * - * @param {TrueFoundry.MlReposListRequest} request + * @param {TrueFoundry.ListMlReposRequest} request * @param {MlReposClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.mlRepos.list({ * limit: 10, - * offset: 0, - * name: "name", - * attributes: ["attributes"] + * offset: 0 * }) */ - public async list(request: TrueFoundry.MlReposListRequest = {}, requestOptions?: MlReposClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.MlReposListRequest): Promise> => { const { limit = 100, offset = 0, name, attributes } = request; const _queryParams: Record = { - limit, - offset, - name, - attributes - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/ml-repos"), - method: "GET", - headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.ListMlReposResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/ml-repos"); }); + public async list( + request: TrueFoundry.ListMlReposRequest = {}, + requestOptions?: MlReposClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.ListMlReposRequest, + ): Promise> => { + const { limit = 100, offset = 0, name, attributes } = request; + const _queryParams: Record = { + limit, + offset, + name, + attributes: attributes !== undefined ? toJson(attributes) : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/ml-repos", + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ListMlReposResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/ml-repos"); + }, + ); let _offset = request?.offset != null ? request?.offset : 0; const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => (response?.data ?? []).length > 0 && (request?.limit == null || (response?.data ?? []).length >= request?.limit), - getItems: response => response?.data ?? [], - loadPage: response => { _offset += response?.data != null ? response.data.length : 1; return list(core.setObjectProperty(request, "offset", _offset)); } + hasNextPage: (response) => + (response?.data ?? []).length > 0 && + (request?.limit == null || (response?.data ?? []).length >= request?.limit), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + _offset += response?.data != null ? response.data.length : 1; + return list(core.setObjectProperty(request, "offset", _offset)); + }, }); } @@ -180,6 +275,8 @@ export class MlReposClient { * @throws {@link TrueFoundry.NotFoundError} * @throws {@link TrueFoundry.ConflictError} * @throws {@link TrueFoundry.UnprocessableEntityError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.mlRepos.createOrUpdate({ @@ -194,42 +291,96 @@ export class MlReposClient { * } * }) */ - public createOrUpdate(request: TrueFoundry.ApplyMlRepoRequest, requestOptions?: MlReposClient.RequestOptions): core.HttpResponsePromise { + public createOrUpdate( + request: TrueFoundry.ApplyMlRepoRequest, + requestOptions?: MlReposClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__createOrUpdate(request, requestOptions)); } - private async __createOrUpdate(request: TrueFoundry.ApplyMlRepoRequest, requestOptions?: MlReposClient.RequestOptions): Promise> { + private async __createOrUpdate( + request: TrueFoundry.ApplyMlRepoRequest, + requestOptions?: MlReposClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/ml-repos"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/ml-repos", + ), method: "PUT", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.ApplyMlRepoRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.ApplyMlRepoRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetMlRepoResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetMlRepoResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 400: throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - case 409: throw new TrueFoundry.ConflictError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 422: throw new TrueFoundry.UnprocessableEntityError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 400: + throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + case 409: + throw new TrueFoundry.ConflictError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 422: + throw new TrueFoundry.UnprocessableEntityError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } diff --git a/src/api/resources/mlRepos/client/requests/ApplyMlRepoRequest.ts b/src/api/resources/mlRepos/client/requests/ApplyMlRepoRequest.ts index d5d72cb8..22fa205f 100644 --- a/src/api/resources/mlRepos/client/requests/ApplyMlRepoRequest.ts +++ b/src/api/resources/mlRepos/client/requests/ApplyMlRepoRequest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../index.js"; +import type * as TrueFoundry from "../../../../index.js"; /** * @example @@ -20,5 +20,5 @@ export interface ApplyMlRepoRequest { /** MLRepo manifest */ manifest: TrueFoundry.MlRepoManifest; /** Validate the manifest and collaborators without persisting changes or updating artifact location in the database */ - dryRun?: boolean; + dryRun?: boolean | null; } diff --git a/src/api/resources/mlRepos/client/requests/MlReposListRequest.ts b/src/api/resources/mlRepos/client/requests/ListMlReposRequest.ts similarity index 63% rename from src/api/resources/mlRepos/client/requests/MlReposListRequest.ts rename to src/api/resources/mlRepos/client/requests/ListMlReposRequest.ts index e522ca8d..5c42884e 100644 --- a/src/api/resources/mlRepos/client/requests/MlReposListRequest.ts +++ b/src/api/resources/mlRepos/client/requests/ListMlReposRequest.ts @@ -4,18 +4,16 @@ * @example * { * limit: 10, - * offset: 0, - * name: "name", - * attributes: ["attributes"] + * offset: 0 * } */ -export interface MlReposListRequest { +export interface ListMlReposRequest { /** Number of items per page */ - limit?: number; + limit?: number | null; /** Number of items to skip */ - offset?: number; + offset?: number | null; /** ML Repo Name */ - name?: string; + name?: string | null; /** Comma-separated list of attributes to return (e.g. id,name). When provided, only the specified fields are fetched. `id` is always included. */ - attributes?: string | string[]; + attributes?: string[] | null; } diff --git a/src/api/resources/mlRepos/client/requests/index.ts b/src/api/resources/mlRepos/client/requests/index.ts index d7ae0694..240819e6 100644 --- a/src/api/resources/mlRepos/client/requests/index.ts +++ b/src/api/resources/mlRepos/client/requests/index.ts @@ -1,2 +1,2 @@ export type { ApplyMlRepoRequest } from "./ApplyMlRepoRequest.js"; -export type { MlReposListRequest } from "./MlReposListRequest.js"; +export type { ListMlReposRequest } from "./ListMlReposRequest.js"; diff --git a/src/api/resources/modelVersions/client/Client.ts b/src/api/resources/modelVersions/client/Client.ts index 54c7ae7d..3336eb27 100644 --- a/src/api/resources/modelVersions/client/Client.ts +++ b/src/api/resources/modelVersions/client/Client.ts @@ -1,9 +1,11 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; -import * as core from "../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import { toJson } from "../../../../core/json.js"; +import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; @@ -12,81 +14,130 @@ import * as TrueFoundry from "../../../index.js"; export declare namespace ModelVersionsClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class ModelVersionsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: ModelVersionsClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** * List model versions with optional filtering by tag, FQN, model ID, ML Repo, name, version, run IDs, or run steps. * - * @param {TrueFoundry.ModelVersionsListRequest} request + * @param {TrueFoundry.ListModelVersionsRequest} request * @param {ModelVersionsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.modelVersions.list({ * limit: 10, - * offset: 0, - * tag: "tag", - * fqn: "fqn", - * modelId: "model_id", - * mlRepoId: "ml_repo_id", - * name: "name", - * version: 1, - * runIds: ["run_ids"], - * runSteps: [1.1], - * includeInternalMetadata: true + * offset: 0 * }) */ - public async list(request: TrueFoundry.ModelVersionsListRequest = {}, requestOptions?: ModelVersionsClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.ModelVersionsListRequest): Promise> => { const { limit = 100, offset = 0, tag, fqn, modelId, mlRepoId, name, version, runIds, runSteps, includeInternalMetadata = false } = request; const _queryParams: Record = { - limit, - offset, - tag, - fqn, - model_id: modelId, - ml_repo_id: mlRepoId, - name, - version, - run_ids: runIds, - run_steps: runSteps, - include_internal_metadata: includeInternalMetadata - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/model-versions"), - method: "GET", - headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.ListModelVersionsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/model-versions"); }); + public async list( + request: TrueFoundry.ListModelVersionsRequest = {}, + requestOptions?: ModelVersionsClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.ListModelVersionsRequest, + ): Promise> => { + const { + limit = 100, + offset = 0, + tag, + fqn, + modelId, + mlRepoId, + name, + version, + runIds, + runSteps, + includeInternalMetadata = false, + } = request; + const _queryParams: Record = { + limit, + offset, + tag, + fqn, + model_id: modelId, + ml_repo_id: mlRepoId, + name, + version, + run_ids: runIds !== undefined ? toJson(runIds) : undefined, + run_steps: runSteps !== undefined ? toJson(runSteps) : undefined, + include_internal_metadata: includeInternalMetadata, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/model-versions", + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ListModelVersionsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/model-versions", + ); + }, + ); let _offset = request?.offset != null ? request?.offset : 0; const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => (response?.data ?? []).length > 0 && (request?.limit == null || (response?.data ?? []).length >= request?.limit), - getItems: response => response?.data ?? [], - loadPage: response => { _offset += response?.data != null ? response.data.length : 1; return list(core.setObjectProperty(request, "offset", _offset)); } + hasNextPage: (response) => + (response?.data ?? []).length > 0 && + (request?.limit == null || (response?.data ?? []).length >= request?.limit), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + _offset += response?.data != null ? response.data.length : 1; + return list(core.setObjectProperty(request, "offset", _offset)); + }, }); } @@ -96,46 +147,85 @@ export class ModelVersionsClient { * @param {TrueFoundry.ApplyModelVersionTagsRequest} request * @param {ModelVersionsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.modelVersions.applyTags({ * modelVersionId: "model_version_id", * tags: ["tags"] * }) */ - public applyTags(request: TrueFoundry.ApplyModelVersionTagsRequest, requestOptions?: ModelVersionsClient.RequestOptions): core.HttpResponsePromise { + public applyTags( + request: TrueFoundry.ApplyModelVersionTagsRequest, + requestOptions?: ModelVersionsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__applyTags(request, requestOptions)); } - private async __applyTags(request: TrueFoundry.ApplyModelVersionTagsRequest, requestOptions?: ModelVersionsClient.RequestOptions): Promise> { + private async __applyTags( + request: TrueFoundry.ApplyModelVersionTagsRequest, + requestOptions?: ModelVersionsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/model-versions/tags"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/model-versions/tags", + ), method: "PUT", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.ApplyModelVersionTagsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.ApplyModelVersionTagsRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.EmptyResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.EmptyResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/api/svc/v1/model-versions/tags"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PUT", + "/api/svc/v1/model-versions/tags", + ); } /** @@ -145,19 +235,35 @@ export class ModelVersionsClient { * @param {ModelVersionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.modelVersions.get("id") */ - public get(id: string, requestOptions?: ModelVersionsClient.RequestOptions): core.HttpResponsePromise { + public get( + id: string, + requestOptions?: ModelVersionsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions)); } - private async __get(id: string, requestOptions?: ModelVersionsClient.RequestOptions): Promise> { + private async __get( + id: string, + requestOptions?: ModelVersionsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/model-versions/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/model-versions/${core.url.encodePathParam(id)}`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -165,24 +271,40 @@ export class ModelVersionsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetModelVersionResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetModelVersionResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/model-versions/{id}"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/model-versions/{id}", + ); } /** @@ -192,19 +314,35 @@ export class ModelVersionsClient { * @param {ModelVersionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.modelVersions.delete("id") */ - public delete(id: string, requestOptions?: ModelVersionsClient.RequestOptions): core.HttpResponsePromise { + public delete( + id: string, + requestOptions?: ModelVersionsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions)); } - private async __delete(id: string, requestOptions?: ModelVersionsClient.RequestOptions): Promise> { + private async __delete( + id: string, + requestOptions?: ModelVersionsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/model-versions/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/model-versions/${core.url.encodePathParam(id)}`, + ), method: "DELETE", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -212,23 +350,39 @@ export class ModelVersionsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.EmptyResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.EmptyResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/api/svc/v1/model-versions/{id}"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/api/svc/v1/model-versions/{id}", + ); } } diff --git a/src/api/resources/modelVersions/client/requests/ApplyModelVersionTagsRequest.ts b/src/api/resources/modelVersions/client/requests/ApplyModelVersionTagsRequest.ts index 1db6044d..48b91cdc 100644 --- a/src/api/resources/modelVersions/client/requests/ApplyModelVersionTagsRequest.ts +++ b/src/api/resources/modelVersions/client/requests/ApplyModelVersionTagsRequest.ts @@ -13,5 +13,5 @@ export interface ApplyModelVersionTagsRequest { /** Tags to apply to the model version. */ tags: string[]; /** Whether to overwrite existing tags that are already in use. */ - force?: boolean; + force?: boolean | null; } diff --git a/src/api/resources/modelVersions/client/requests/ModelVersionsListRequest.ts b/src/api/resources/modelVersions/client/requests/ListModelVersionsRequest.ts similarity index 53% rename from src/api/resources/modelVersions/client/requests/ModelVersionsListRequest.ts rename to src/api/resources/modelVersions/client/requests/ListModelVersionsRequest.ts index f159d5c2..d57d4a3e 100644 --- a/src/api/resources/modelVersions/client/requests/ModelVersionsListRequest.ts +++ b/src/api/resources/modelVersions/client/requests/ListModelVersionsRequest.ts @@ -4,39 +4,30 @@ * @example * { * limit: 10, - * offset: 0, - * tag: "tag", - * fqn: "fqn", - * modelId: "model_id", - * mlRepoId: "ml_repo_id", - * name: "name", - * version: 1, - * runIds: ["run_ids"], - * runSteps: [1.1], - * includeInternalMetadata: true + * offset: 0 * } */ -export interface ModelVersionsListRequest { +export interface ListModelVersionsRequest { /** Number of items per page */ - limit?: number; + limit?: number | null; /** Number of items to skip */ - offset?: number; + offset?: number | null; /** Filter model versions by tag. */ - tag?: string; + tag?: string | null; /** Filter model versions by Fully Qualified Name. */ - fqn?: string; + fqn?: string | null; /** Filter model versions by model identifier. */ - modelId?: string; + modelId?: string | null; /** Filter model versions by ML Repo identifier. */ - mlRepoId?: string; + mlRepoId?: string | null; /** Filter model versions by name. */ - name?: string; + name?: string | null; /** Version number (positive integer) to filter by. */ - version?: number; + version?: number | null; /** Filter model versions by associated run identifiers. */ - runIds?: string | string[]; + runIds?: string[] | null; /** Filter model versions by associated run steps. */ - runSteps?: number | number[]; + runSteps?: number[] | null; /** Whether to include internal metadata in the response. */ - includeInternalMetadata?: boolean; + includeInternalMetadata?: boolean | null; } diff --git a/src/api/resources/modelVersions/client/requests/index.ts b/src/api/resources/modelVersions/client/requests/index.ts index b9cf9fca..b43ccb95 100644 --- a/src/api/resources/modelVersions/client/requests/index.ts +++ b/src/api/resources/modelVersions/client/requests/index.ts @@ -1,2 +1,2 @@ export type { ApplyModelVersionTagsRequest } from "./ApplyModelVersionTagsRequest.js"; -export type { ModelVersionsListRequest } from "./ModelVersionsListRequest.js"; +export type { ListModelVersionsRequest } from "./ListModelVersionsRequest.js"; diff --git a/src/api/resources/models/client/Client.ts b/src/api/resources/models/client/Client.ts index ba6cc45d..c47e1ce7 100644 --- a/src/api/resources/models/client/Client.ts +++ b/src/api/resources/models/client/Client.ts @@ -1,9 +1,10 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; -import * as core from "../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; @@ -12,18 +13,14 @@ import * as TrueFoundry from "../../../index.js"; export declare namespace ModelsClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class ModelsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: ModelsClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** @@ -33,19 +30,35 @@ export class ModelsClient { * @param {ModelsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.models.get("id") */ - public get(id: string, requestOptions?: ModelsClient.RequestOptions): core.HttpResponsePromise { + public get( + id: string, + requestOptions?: ModelsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions)); } - private async __get(id: string, requestOptions?: ModelsClient.RequestOptions): Promise> { + private async __get( + id: string, + requestOptions?: ModelsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/models/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/models/${core.url.encodePathParam(id)}`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -53,20 +66,31 @@ export class ModelsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetModelResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetModelResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -80,19 +104,35 @@ export class ModelsClient { * @param {ModelsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.models.delete("id") */ - public delete(id: string, requestOptions?: ModelsClient.RequestOptions): core.HttpResponsePromise { + public delete( + id: string, + requestOptions?: ModelsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions)); } - private async __delete(id: string, requestOptions?: ModelsClient.RequestOptions): Promise> { + private async __delete( + id: string, + requestOptions?: ModelsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/models/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/models/${core.url.encodePathParam(id)}`, + ), method: "DELETE", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -100,20 +140,31 @@ export class ModelsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.EmptyResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.EmptyResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -123,56 +174,96 @@ export class ModelsClient { /** * List models with optional filtering by FQN, ML Repo, name, or run ID. * - * @param {TrueFoundry.ModelsListRequest} request + * @param {TrueFoundry.ListModelsRequest} request * @param {ModelsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.models.list({ * limit: 10, - * offset: 0, - * fqn: "fqn", - * mlRepoId: "ml_repo_id", - * name: "name", - * runId: "run_id", - * includeEmptyModels: true + * offset: 0 * }) */ - public async list(request: TrueFoundry.ModelsListRequest = {}, requestOptions?: ModelsClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.ModelsListRequest): Promise> => { const { limit = 100, offset = 0, fqn, mlRepoId, name, runId, includeEmptyModels = true } = request; const _queryParams: Record = { - limit, - offset, - fqn, - ml_repo_id: mlRepoId, - name, - run_id: runId, - include_empty_models: includeEmptyModels - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/models"), - method: "GET", - headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.ListModelsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/models"); }); + public async list( + request: TrueFoundry.ListModelsRequest = {}, + requestOptions?: ModelsClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.ListModelsRequest, + ): Promise> => { + const { limit = 100, offset = 0, fqn, mlRepoId, name, runId, includeEmptyModels = true } = request; + const _queryParams: Record = { + limit, + offset, + fqn, + ml_repo_id: mlRepoId, + name, + run_id: runId, + include_empty_models: includeEmptyModels, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/models", + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ListModelsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/models"); + }, + ); let _offset = request?.offset != null ? request?.offset : 0; const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => (response?.data ?? []).length > 0 && (request?.limit == null || (response?.data ?? []).length >= request?.limit), - getItems: response => response?.data ?? [], - loadPage: response => { _offset += response?.data != null ? response.data.length : 1; return list(core.setObjectProperty(request, "offset", _offset)); } + hasNextPage: (response) => + (response?.data ?? []).length > 0 && + (request?.limit == null || (response?.data ?? []).length >= request?.limit), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + _offset += response?.data != null ? response.data.length : 1; + return list(core.setObjectProperty(request, "offset", _offset)); + }, }); } @@ -182,6 +273,9 @@ export class ModelsClient { * @param {TrueFoundry.ApplyModelRequest} request * @param {ModelsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.models.createOrUpdate({ * manifest: { @@ -196,36 +290,67 @@ export class ModelsClient { * } * }) */ - public createOrUpdate(request: TrueFoundry.ApplyModelRequest, requestOptions?: ModelsClient.RequestOptions): core.HttpResponsePromise { + public createOrUpdate( + request: TrueFoundry.ApplyModelRequest, + requestOptions?: ModelsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__createOrUpdate(request, requestOptions)); } - private async __createOrUpdate(request: TrueFoundry.ApplyModelRequest, requestOptions?: ModelsClient.RequestOptions): Promise> { + private async __createOrUpdate( + request: TrueFoundry.ApplyModelRequest, + requestOptions?: ModelsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/model-versions"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/model-versions", + ), method: "PUT", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.ApplyModelRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.ApplyModelRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetModelVersionResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetModelVersionResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } diff --git a/src/api/resources/models/client/requests/ApplyModelRequest.ts b/src/api/resources/models/client/requests/ApplyModelRequest.ts index 72f74d88..6b51df7c 100644 --- a/src/api/resources/models/client/requests/ApplyModelRequest.ts +++ b/src/api/resources/models/client/requests/ApplyModelRequest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../index.js"; +import type * as TrueFoundry from "../../../../index.js"; /** * @example diff --git a/src/api/resources/models/client/requests/ModelsListRequest.ts b/src/api/resources/models/client/requests/ListModelsRequest.ts similarity index 55% rename from src/api/resources/models/client/requests/ModelsListRequest.ts rename to src/api/resources/models/client/requests/ListModelsRequest.ts index 91a74bfc..8c6b51fb 100644 --- a/src/api/resources/models/client/requests/ModelsListRequest.ts +++ b/src/api/resources/models/client/requests/ListModelsRequest.ts @@ -4,27 +4,22 @@ * @example * { * limit: 10, - * offset: 0, - * fqn: "fqn", - * mlRepoId: "ml_repo_id", - * name: "name", - * runId: "run_id", - * includeEmptyModels: true + * offset: 0 * } */ -export interface ModelsListRequest { +export interface ListModelsRequest { /** Number of items per page */ - limit?: number; + limit?: number | null; /** Number of items to skip */ - offset?: number; + offset?: number | null; /** Filter models by Fully Qualified Name. */ - fqn?: string; + fqn?: string | null; /** Filter models by ML Repo identifier. */ - mlRepoId?: string; + mlRepoId?: string | null; /** Filter models by name. */ - name?: string; + name?: string | null; /** Filter models by associated run identifier. */ - runId?: string; + runId?: string | null; /** Whether to include models that have no versions. */ - includeEmptyModels?: boolean; + includeEmptyModels?: boolean | null; } diff --git a/src/api/resources/models/client/requests/index.ts b/src/api/resources/models/client/requests/index.ts index 4886ee24..83c32dca 100644 --- a/src/api/resources/models/client/requests/index.ts +++ b/src/api/resources/models/client/requests/index.ts @@ -1,2 +1,2 @@ export type { ApplyModelRequest } from "./ApplyModelRequest.js"; -export type { ModelsListRequest } from "./ModelsListRequest.js"; +export type { ListModelsRequest } from "./ListModelsRequest.js"; diff --git a/src/api/resources/personalAccessTokens/client/Client.ts b/src/api/resources/personalAccessTokens/client/Client.ts index e0859e68..ae802714 100644 --- a/src/api/resources/personalAccessTokens/client/Client.ts +++ b/src/api/resources/personalAccessTokens/client/Client.ts @@ -1,9 +1,10 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; -import * as core from "../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; @@ -12,26 +13,25 @@ import * as TrueFoundry from "../../../index.js"; export declare namespace PersonalAccessTokensClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class PersonalAccessTokensClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: PersonalAccessTokensClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** * List personal access tokens created by the current user. * - * @param {TrueFoundry.PersonalAccessTokensListRequest} request + * @param {TrueFoundry.ListPersonalAccessTokensRequest} request * @param {PersonalAccessTokensClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.personalAccessTokens.list({ * limit: 10, @@ -39,38 +39,85 @@ export class PersonalAccessTokensClient { * nameSearchQuery: "ci-token" * }) */ - public async list(request: TrueFoundry.PersonalAccessTokensListRequest = {}, requestOptions?: PersonalAccessTokensClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.PersonalAccessTokensListRequest): Promise> => { const { limit = 100, offset = 0, nameSearchQuery } = request; const _queryParams: Record = { - limit, - offset, - nameSearchQuery - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/personal-access-tokens"), - method: "GET", - headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.ListPersonalAccessTokenResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/personal-access-tokens"); }); + public async list( + request: TrueFoundry.ListPersonalAccessTokensRequest = {}, + requestOptions?: PersonalAccessTokensClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.ListPersonalAccessTokensRequest, + ): Promise> => { + const { limit = 100, offset = 0, nameSearchQuery } = request; + const _queryParams: Record = { + limit, + offset, + nameSearchQuery, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/personal-access-tokens", + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ListPersonalAccessTokenResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/personal-access-tokens", + ); + }, + ); let _offset = request?.offset != null ? request?.offset : 0; const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => (response?.data ?? []).length > 0 && (request?.limit == null || (response?.data ?? []).length >= request?.limit), - getItems: response => response?.data ?? [], - loadPage: response => { _offset += response?.data != null ? response.data.length : 1; return list(core.setObjectProperty(request, "offset", _offset)); } + hasNextPage: (response) => + (response?.data ?? []).length > 0 && + (request?.limit == null || (response?.data ?? []).length >= request?.limit), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + _offset += response?.data != null ? response.data.length : 1; + return list(core.setObjectProperty(request, "offset", _offset)); + }, }); } @@ -82,50 +129,100 @@ export class PersonalAccessTokensClient { * * @throws {@link TrueFoundry.BadRequestError} * @throws {@link TrueFoundry.ConflictError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.personalAccessTokens.create({ * name: "my-ci-token" * }) */ - public create(request: TrueFoundry.CreatePersonalAccessTokenRequest, requestOptions?: PersonalAccessTokensClient.RequestOptions): core.HttpResponsePromise { + public create( + request: TrueFoundry.CreatePersonalAccessTokenRequest, + requestOptions?: PersonalAccessTokensClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } - private async __create(request: TrueFoundry.CreatePersonalAccessTokenRequest, requestOptions?: PersonalAccessTokensClient.RequestOptions): Promise> { + private async __create( + request: TrueFoundry.CreatePersonalAccessTokenRequest, + requestOptions?: PersonalAccessTokensClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/personal-access-tokens"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/personal-access-tokens", + ), method: "POST", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.CreatePersonalAccessTokenRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.CreatePersonalAccessTokenRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.CreatePersonalAccessTokenResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.CreatePersonalAccessTokenResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 400: throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); - case 409: throw new TrueFoundry.ConflictError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 400: + throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); + case 409: + throw new TrueFoundry.ConflictError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/svc/v1/personal-access-tokens"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/api/svc/v1/personal-access-tokens", + ); } /** @@ -135,49 +232,89 @@ export class PersonalAccessTokensClient { * @param {PersonalAccessTokensClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.personalAccessTokens.revokeAll({ * email: "alice@example.com" * }) */ - public revokeAll(request: TrueFoundry.RevokeAllPersonalAccessTokenRequest, requestOptions?: PersonalAccessTokensClient.RequestOptions): core.HttpResponsePromise { + public revokeAll( + request: TrueFoundry.RevokeAllPersonalAccessTokenRequest, + requestOptions?: PersonalAccessTokensClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__revokeAll(request, requestOptions)); } - private async __revokeAll(request: TrueFoundry.RevokeAllPersonalAccessTokenRequest, requestOptions?: PersonalAccessTokensClient.RequestOptions): Promise> { + private async __revokeAll( + request: TrueFoundry.RevokeAllPersonalAccessTokenRequest, + requestOptions?: PersonalAccessTokensClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/personal-access-tokens/revoke/all"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/personal-access-tokens/revoke/all", + ), method: "DELETE", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.RevokeAllPersonalAccessTokenRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.RevokeAllPersonalAccessTokenRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.RevokeAllPersonalAccessTokenResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.RevokeAllPersonalAccessTokenResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/api/svc/v1/personal-access-tokens/revoke/all"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/api/svc/v1/personal-access-tokens/revoke/all", + ); } /** @@ -187,19 +324,35 @@ export class PersonalAccessTokensClient { * @param {PersonalAccessTokensClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.personalAccessTokens.delete("jqfwg345gi25n5ju2yz5iz6m") */ - public delete(id: string, requestOptions?: PersonalAccessTokensClient.RequestOptions): core.HttpResponsePromise { + public delete( + id: string, + requestOptions?: PersonalAccessTokensClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions)); } - private async __delete(id: string, requestOptions?: PersonalAccessTokensClient.RequestOptions): Promise> { + private async __delete( + id: string, + requestOptions?: PersonalAccessTokensClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/personal-access-tokens/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/personal-access-tokens/${core.url.encodePathParam(id)}`, + ), method: "DELETE", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -207,77 +360,129 @@ export class PersonalAccessTokensClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.DeletePersonalAccessTokenResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.DeletePersonalAccessTokenResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/api/svc/v1/personal-access-tokens/{id}"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/api/svc/v1/personal-access-tokens/{id}", + ); } /** * Get an existing personal access token by name. If none exists, a new one is created and returned with a fresh token. * * @param {string} name - * @param {TrueFoundry.PersonalAccessTokensGetRequest} request + * @param {TrueFoundry.GetPersonalAccessTokensRequest} request * @param {PersonalAccessTokensClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.BadRequestError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example - * await client.personalAccessTokens.get("name", { - * teamName: "teamName" - * }) + * await client.personalAccessTokens.get("name") */ - public get(name: string, request: TrueFoundry.PersonalAccessTokensGetRequest = {}, requestOptions?: PersonalAccessTokensClient.RequestOptions): core.HttpResponsePromise { + public get( + name: string, + request: TrueFoundry.GetPersonalAccessTokensRequest = {}, + requestOptions?: PersonalAccessTokensClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(name, request, requestOptions)); } - private async __get(name: string, request: TrueFoundry.PersonalAccessTokensGetRequest = {}, requestOptions?: PersonalAccessTokensClient.RequestOptions): Promise> { + private async __get( + name: string, + request: TrueFoundry.GetPersonalAccessTokensRequest = {}, + requestOptions?: PersonalAccessTokensClient.RequestOptions, + ): Promise> { const { teamName } = request; const _queryParams: Record = { - teamName + teamName, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/personal-access-tokens/${core.url.encodePathParam(name)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/personal-access-tokens/${core.url.encodePathParam(name)}`, + ), method: "GET", headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetOrCreatePersonalAccessTokenResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetOrCreatePersonalAccessTokenResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 400: throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 400: + throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/personal-access-tokens/{name}"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/personal-access-tokens/{name}", + ); } } diff --git a/src/api/resources/personalAccessTokens/client/requests/CreatePersonalAccessTokenRequest.ts b/src/api/resources/personalAccessTokens/client/requests/CreatePersonalAccessTokenRequest.ts index ae60a2fd..a1ae9074 100644 --- a/src/api/resources/personalAccessTokens/client/requests/CreatePersonalAccessTokenRequest.ts +++ b/src/api/resources/personalAccessTokens/client/requests/CreatePersonalAccessTokenRequest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../index.js"; +import type * as TrueFoundry from "../../../../index.js"; /** * @example @@ -12,11 +12,11 @@ export interface CreatePersonalAccessTokenRequest { /** Name for the personal access token. Must be 3-36 characters, start with a lowercase letter, end with a lowercase alphanumeric character, and contain only lowercase letters, numbers, and hyphens. */ name: string; /** Expiration date in ISO format. The token becomes invalid after this date. */ - expirationDate?: string; + expirationDate?: string | null; /** Account name that owns this personal access token. */ - accountName?: string; + accountName?: string | null; /** Team name that owns this personal access token. */ - teamName?: string; + teamName?: string | null; /** Format of the issued token. Leave empty to use the tenant override or platform default. */ - tokenType?: TrueFoundry.CreatePersonalAccessTokenRequestTokenType; + tokenType?: TrueFoundry.CreatePersonalAccessTokenRequestTokenType | null; } diff --git a/src/api/resources/personalAccessTokens/client/requests/PersonalAccessTokensGetRequest.ts b/src/api/resources/personalAccessTokens/client/requests/GetPersonalAccessTokensRequest.ts similarity index 55% rename from src/api/resources/personalAccessTokens/client/requests/PersonalAccessTokensGetRequest.ts rename to src/api/resources/personalAccessTokens/client/requests/GetPersonalAccessTokensRequest.ts index ea2c2991..1b72b6b6 100644 --- a/src/api/resources/personalAccessTokens/client/requests/PersonalAccessTokensGetRequest.ts +++ b/src/api/resources/personalAccessTokens/client/requests/GetPersonalAccessTokensRequest.ts @@ -2,11 +2,9 @@ /** * @example - * { - * teamName: "teamName" - * } + * {} */ -export interface PersonalAccessTokensGetRequest { +export interface GetPersonalAccessTokensRequest { /** Team name that owns this PAT when a new PAT is created */ - teamName?: string; + teamName?: string | null; } diff --git a/src/api/resources/personalAccessTokens/client/requests/PersonalAccessTokensListRequest.ts b/src/api/resources/personalAccessTokens/client/requests/ListPersonalAccessTokensRequest.ts similarity index 70% rename from src/api/resources/personalAccessTokens/client/requests/PersonalAccessTokensListRequest.ts rename to src/api/resources/personalAccessTokens/client/requests/ListPersonalAccessTokensRequest.ts index ac9d253e..24334f74 100644 --- a/src/api/resources/personalAccessTokens/client/requests/PersonalAccessTokensListRequest.ts +++ b/src/api/resources/personalAccessTokens/client/requests/ListPersonalAccessTokensRequest.ts @@ -8,11 +8,11 @@ * nameSearchQuery: "ci-token" * } */ -export interface PersonalAccessTokensListRequest { +export interface ListPersonalAccessTokensRequest { /** Number of items per page */ - limit?: number; + limit?: number | null; /** Number of items to skip */ - offset?: number; + offset?: number | null; /** Return personal access tokens whose name contains this substring. */ - nameSearchQuery?: string; + nameSearchQuery?: string | null; } diff --git a/src/api/resources/personalAccessTokens/client/requests/index.ts b/src/api/resources/personalAccessTokens/client/requests/index.ts index 651f9fb2..9ce017c2 100644 --- a/src/api/resources/personalAccessTokens/client/requests/index.ts +++ b/src/api/resources/personalAccessTokens/client/requests/index.ts @@ -1,4 +1,4 @@ export type { CreatePersonalAccessTokenRequest } from "./CreatePersonalAccessTokenRequest.js"; -export type { PersonalAccessTokensGetRequest } from "./PersonalAccessTokensGetRequest.js"; -export type { PersonalAccessTokensListRequest } from "./PersonalAccessTokensListRequest.js"; +export type { GetPersonalAccessTokensRequest } from "./GetPersonalAccessTokensRequest.js"; +export type { ListPersonalAccessTokensRequest } from "./ListPersonalAccessTokensRequest.js"; export type { RevokeAllPersonalAccessTokenRequest } from "./RevokeAllPersonalAccessTokenRequest.js"; diff --git a/src/api/resources/personalAccessTokens/types/CreatePersonalAccessTokenRequestTokenType.ts b/src/api/resources/personalAccessTokens/types/CreatePersonalAccessTokenRequestTokenType.ts index 8f779bb3..6602f214 100644 --- a/src/api/resources/personalAccessTokens/types/CreatePersonalAccessTokenRequestTokenType.ts +++ b/src/api/resources/personalAccessTokens/types/CreatePersonalAccessTokenRequestTokenType.ts @@ -2,7 +2,8 @@ /** Format of the issued token. Leave empty to use the tenant override or platform default. */ export const CreatePersonalAccessTokenRequestTokenType = { - Jwt: "jwt", - Opaque: "opaque" - } as const; -export type CreatePersonalAccessTokenRequestTokenType = typeof CreatePersonalAccessTokenRequestTokenType[keyof typeof CreatePersonalAccessTokenRequestTokenType]; + Jwt: "jwt", + Opaque: "opaque", +} as const; +export type CreatePersonalAccessTokenRequestTokenType = + (typeof CreatePersonalAccessTokenRequestTokenType)[keyof typeof CreatePersonalAccessTokenRequestTokenType]; diff --git a/src/api/resources/promptVersions/client/Client.ts b/src/api/resources/promptVersions/client/Client.ts index 529dc541..adc51e51 100644 --- a/src/api/resources/promptVersions/client/Client.ts +++ b/src/api/resources/promptVersions/client/Client.ts @@ -1,9 +1,10 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; -import * as core from "../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; @@ -12,75 +13,115 @@ import * as TrueFoundry from "../../../index.js"; export declare namespace PromptVersionsClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class PromptVersionsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: PromptVersionsClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** * List prompt versions with optional filtering by tag, FQN, prompt ID, ML Repo, name, or version. * - * @param {TrueFoundry.PromptVersionsListRequest} request + * @param {TrueFoundry.ListPromptVersionsRequest} request * @param {PromptVersionsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.promptVersions.list({ * limit: 10, - * offset: 0, - * tag: "tag", - * fqn: "fqn", - * promptId: "prompt_id", - * mlRepoId: "ml_repo_id", - * name: "name", - * version: 1 + * offset: 0 * }) */ - public async list(request: TrueFoundry.PromptVersionsListRequest = {}, requestOptions?: PromptVersionsClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.PromptVersionsListRequest): Promise> => { const { limit = 100, offset = 0, tag, fqn, promptId, mlRepoId, name, version } = request; const _queryParams: Record = { - limit, - offset, - tag, - fqn, - prompt_id: promptId, - ml_repo_id: mlRepoId, - name, - version - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/prompt-versions"), - method: "GET", - headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.ListPromptVersionsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/prompt-versions"); }); + public async list( + request: TrueFoundry.ListPromptVersionsRequest = {}, + requestOptions?: PromptVersionsClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.ListPromptVersionsRequest, + ): Promise> => { + const { limit = 100, offset = 0, tag, fqn, promptId, mlRepoId, name, version } = request; + const _queryParams: Record = { + limit, + offset, + tag, + fqn, + prompt_id: promptId, + ml_repo_id: mlRepoId, + name, + version, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/prompt-versions", + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ListPromptVersionsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/prompt-versions", + ); + }, + ); let _offset = request?.offset != null ? request?.offset : 0; const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => (response?.data ?? []).length > 0 && (request?.limit == null || (response?.data ?? []).length >= request?.limit), - getItems: response => response?.data ?? [], - loadPage: response => { _offset += response?.data != null ? response.data.length : 1; return list(core.setObjectProperty(request, "offset", _offset)); } + hasNextPage: (response) => + (response?.data ?? []).length > 0 && + (request?.limit == null || (response?.data ?? []).length >= request?.limit), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + _offset += response?.data != null ? response.data.length : 1; + return list(core.setObjectProperty(request, "offset", _offset)); + }, }); } @@ -90,46 +131,85 @@ export class PromptVersionsClient { * @param {TrueFoundry.ApplyPromptVersionTagsRequest} request * @param {PromptVersionsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.promptVersions.applyTags({ * promptVersionId: "prompt_version_id", * tags: ["tags"] * }) */ - public applyTags(request: TrueFoundry.ApplyPromptVersionTagsRequest, requestOptions?: PromptVersionsClient.RequestOptions): core.HttpResponsePromise { + public applyTags( + request: TrueFoundry.ApplyPromptVersionTagsRequest, + requestOptions?: PromptVersionsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__applyTags(request, requestOptions)); } - private async __applyTags(request: TrueFoundry.ApplyPromptVersionTagsRequest, requestOptions?: PromptVersionsClient.RequestOptions): Promise> { + private async __applyTags( + request: TrueFoundry.ApplyPromptVersionTagsRequest, + requestOptions?: PromptVersionsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/prompt-versions/tags"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/prompt-versions/tags", + ), method: "PUT", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.ApplyPromptVersionTagsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.ApplyPromptVersionTagsRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.EmptyResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.EmptyResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/api/svc/v1/prompt-versions/tags"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PUT", + "/api/svc/v1/prompt-versions/tags", + ); } /** @@ -139,19 +219,35 @@ export class PromptVersionsClient { * @param {PromptVersionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.promptVersions.get("id") */ - public get(id: string, requestOptions?: PromptVersionsClient.RequestOptions): core.HttpResponsePromise { + public get( + id: string, + requestOptions?: PromptVersionsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions)); } - private async __get(id: string, requestOptions?: PromptVersionsClient.RequestOptions): Promise> { + private async __get( + id: string, + requestOptions?: PromptVersionsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/prompt-versions/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/prompt-versions/${core.url.encodePathParam(id)}`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -159,24 +255,40 @@ export class PromptVersionsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetPromptVersionResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetPromptVersionResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/prompt-versions/{id}"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/prompt-versions/{id}", + ); } /** @@ -186,19 +298,35 @@ export class PromptVersionsClient { * @param {PromptVersionsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.promptVersions.delete("id") */ - public delete(id: string, requestOptions?: PromptVersionsClient.RequestOptions): core.HttpResponsePromise { + public delete( + id: string, + requestOptions?: PromptVersionsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions)); } - private async __delete(id: string, requestOptions?: PromptVersionsClient.RequestOptions): Promise> { + private async __delete( + id: string, + requestOptions?: PromptVersionsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/prompt-versions/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/prompt-versions/${core.url.encodePathParam(id)}`, + ), method: "DELETE", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -206,23 +334,39 @@ export class PromptVersionsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.EmptyResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.EmptyResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/api/svc/v1/prompt-versions/{id}"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/api/svc/v1/prompt-versions/{id}", + ); } } diff --git a/src/api/resources/promptVersions/client/requests/ApplyPromptVersionTagsRequest.ts b/src/api/resources/promptVersions/client/requests/ApplyPromptVersionTagsRequest.ts index a4fd9ddc..b8782bf5 100644 --- a/src/api/resources/promptVersions/client/requests/ApplyPromptVersionTagsRequest.ts +++ b/src/api/resources/promptVersions/client/requests/ApplyPromptVersionTagsRequest.ts @@ -13,5 +13,5 @@ export interface ApplyPromptVersionTagsRequest { /** Tags to apply to the prompt version. */ tags: string[]; /** Whether to forcibly reassign tags already in use by other prompt versions. */ - force?: boolean; + force?: boolean | null; } diff --git a/src/api/resources/promptVersions/client/requests/PromptVersionsListRequest.ts b/src/api/resources/promptVersions/client/requests/ListPromptVersionsRequest.ts similarity index 59% rename from src/api/resources/promptVersions/client/requests/PromptVersionsListRequest.ts rename to src/api/resources/promptVersions/client/requests/ListPromptVersionsRequest.ts index b5c4dbb4..a0f90aeb 100644 --- a/src/api/resources/promptVersions/client/requests/PromptVersionsListRequest.ts +++ b/src/api/resources/promptVersions/client/requests/ListPromptVersionsRequest.ts @@ -4,30 +4,24 @@ * @example * { * limit: 10, - * offset: 0, - * tag: "tag", - * fqn: "fqn", - * promptId: "prompt_id", - * mlRepoId: "ml_repo_id", - * name: "name", - * version: 1 + * offset: 0 * } */ -export interface PromptVersionsListRequest { +export interface ListPromptVersionsRequest { /** Number of items per page */ - limit?: number; + limit?: number | null; /** Number of items to skip */ - offset?: number; + offset?: number | null; /** Filter prompt versions by tag. */ - tag?: string; + tag?: string | null; /** Filter prompt versions by Fully Qualified Name. */ - fqn?: string; + fqn?: string | null; /** Filter prompt versions by the identifier of the prompt they belong to. */ - promptId?: string; + promptId?: string | null; /** Filter prompt versions by the identifier of the ML Repo they belong to. */ - mlRepoId?: string; + mlRepoId?: string | null; /** Filter prompt versions by name. */ - name?: string; + name?: string | null; /** Version number (positive integer) to filter by. */ - version?: number; + version?: number | null; } diff --git a/src/api/resources/promptVersions/client/requests/index.ts b/src/api/resources/promptVersions/client/requests/index.ts index 424889e0..9f373332 100644 --- a/src/api/resources/promptVersions/client/requests/index.ts +++ b/src/api/resources/promptVersions/client/requests/index.ts @@ -1,2 +1,2 @@ export type { ApplyPromptVersionTagsRequest } from "./ApplyPromptVersionTagsRequest.js"; -export type { PromptVersionsListRequest } from "./PromptVersionsListRequest.js"; +export type { ListPromptVersionsRequest } from "./ListPromptVersionsRequest.js"; diff --git a/src/api/resources/prompts/client/Client.ts b/src/api/resources/prompts/client/Client.ts index 3527abf9..9fdf180b 100644 --- a/src/api/resources/prompts/client/Client.ts +++ b/src/api/resources/prompts/client/Client.ts @@ -1,9 +1,10 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; -import * as core from "../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; @@ -12,18 +13,14 @@ import * as TrueFoundry from "../../../index.js"; export declare namespace PromptsClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class PromptsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: PromptsClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** @@ -33,19 +30,35 @@ export class PromptsClient { * @param {PromptsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.prompts.get("id") */ - public get(id: string, requestOptions?: PromptsClient.RequestOptions): core.HttpResponsePromise { + public get( + id: string, + requestOptions?: PromptsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions)); } - private async __get(id: string, requestOptions?: PromptsClient.RequestOptions): Promise> { + private async __get( + id: string, + requestOptions?: PromptsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/prompts/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/prompts/${core.url.encodePathParam(id)}`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -53,20 +66,31 @@ export class PromptsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetPromptResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetPromptResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -80,19 +104,35 @@ export class PromptsClient { * @param {PromptsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.prompts.delete("id") */ - public delete(id: string, requestOptions?: PromptsClient.RequestOptions): core.HttpResponsePromise { + public delete( + id: string, + requestOptions?: PromptsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions)); } - private async __delete(id: string, requestOptions?: PromptsClient.RequestOptions): Promise> { + private async __delete( + id: string, + requestOptions?: PromptsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/prompts/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/prompts/${core.url.encodePathParam(id)}`, + ), method: "DELETE", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -100,20 +140,31 @@ export class PromptsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.EmptyResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.EmptyResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -123,54 +174,95 @@ export class PromptsClient { /** * List prompts with optional filtering by FQN, ML Repo, or name. * - * @param {TrueFoundry.PromptsListRequest} request + * @param {TrueFoundry.ListPromptsRequest} request * @param {PromptsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.prompts.list({ * limit: 10, - * offset: 0, - * fqn: "fqn", - * mlRepoId: "ml_repo_id", - * name: "name", - * includeEmptyPrompts: true + * offset: 0 * }) */ - public async list(request: TrueFoundry.PromptsListRequest = {}, requestOptions?: PromptsClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.PromptsListRequest): Promise> => { const { limit = 100, offset = 0, fqn, mlRepoId, name, includeEmptyPrompts = true } = request; const _queryParams: Record = { - limit, - offset, - fqn, - ml_repo_id: mlRepoId, - name, - include_empty_prompts: includeEmptyPrompts - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/prompts"), - method: "GET", - headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.ListPromptsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/prompts"); }); + public async list( + request: TrueFoundry.ListPromptsRequest = {}, + requestOptions?: PromptsClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.ListPromptsRequest, + ): Promise> => { + const { limit = 100, offset = 0, fqn, mlRepoId, name, includeEmptyPrompts = true } = request; + const _queryParams: Record = { + limit, + offset, + fqn, + ml_repo_id: mlRepoId, + name, + include_empty_prompts: includeEmptyPrompts, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/prompts", + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ListPromptsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/prompts"); + }, + ); let _offset = request?.offset != null ? request?.offset : 0; const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => (response?.data ?? []).length > 0 && (request?.limit == null || (response?.data ?? []).length >= request?.limit), - getItems: response => response?.data ?? [], - loadPage: response => { _offset += response?.data != null ? response.data.length : 1; return list(core.setObjectProperty(request, "offset", _offset)); } + hasNextPage: (response) => + (response?.data ?? []).length > 0 && + (request?.limit == null || (response?.data ?? []).length >= request?.limit), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + _offset += response?.data != null ? response.data.length : 1; + return list(core.setObjectProperty(request, "offset", _offset)); + }, }); } @@ -180,6 +272,9 @@ export class PromptsClient { * @param {TrueFoundry.ApplyPromptRequest} request * @param {PromptsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.prompts.createOrUpdate({ * manifest: { @@ -194,36 +289,67 @@ export class PromptsClient { * } * }) */ - public createOrUpdate(request: TrueFoundry.ApplyPromptRequest, requestOptions?: PromptsClient.RequestOptions): core.HttpResponsePromise { + public createOrUpdate( + request: TrueFoundry.ApplyPromptRequest, + requestOptions?: PromptsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__createOrUpdate(request, requestOptions)); } - private async __createOrUpdate(request: TrueFoundry.ApplyPromptRequest, requestOptions?: PromptsClient.RequestOptions): Promise> { + private async __createOrUpdate( + request: TrueFoundry.ApplyPromptRequest, + requestOptions?: PromptsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/prompt-versions"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/prompt-versions", + ), method: "PUT", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.ApplyPromptRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.ApplyPromptRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetPromptVersionResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetPromptVersionResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } diff --git a/src/api/resources/prompts/client/requests/ApplyPromptRequest.ts b/src/api/resources/prompts/client/requests/ApplyPromptRequest.ts index 333e609f..5f067cc2 100644 --- a/src/api/resources/prompts/client/requests/ApplyPromptRequest.ts +++ b/src/api/resources/prompts/client/requests/ApplyPromptRequest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../index.js"; +import type * as TrueFoundry from "../../../../index.js"; /** * @example diff --git a/src/api/resources/prompts/client/requests/PromptsListRequest.ts b/src/api/resources/prompts/client/requests/ListPromptsRequest.ts similarity index 57% rename from src/api/resources/prompts/client/requests/PromptsListRequest.ts rename to src/api/resources/prompts/client/requests/ListPromptsRequest.ts index 56c590ac..72db1c1a 100644 --- a/src/api/resources/prompts/client/requests/PromptsListRequest.ts +++ b/src/api/resources/prompts/client/requests/ListPromptsRequest.ts @@ -4,24 +4,20 @@ * @example * { * limit: 10, - * offset: 0, - * fqn: "fqn", - * mlRepoId: "ml_repo_id", - * name: "name", - * includeEmptyPrompts: true + * offset: 0 * } */ -export interface PromptsListRequest { +export interface ListPromptsRequest { /** Number of items per page */ - limit?: number; + limit?: number | null; /** Number of items to skip */ - offset?: number; + offset?: number | null; /** Filter prompts by Fully Qualified Name. */ - fqn?: string; + fqn?: string | null; /** Filter prompts by the identifier of the ML Repo they belong to. */ - mlRepoId?: string; + mlRepoId?: string | null; /** Filter prompts by name. */ - name?: string; + name?: string | null; /** Whether to include prompts that have no versions in the results. */ - includeEmptyPrompts?: boolean; + includeEmptyPrompts?: boolean | null; } diff --git a/src/api/resources/prompts/client/requests/index.ts b/src/api/resources/prompts/client/requests/index.ts index c34e6da9..22f0eac8 100644 --- a/src/api/resources/prompts/client/requests/index.ts +++ b/src/api/resources/prompts/client/requests/index.ts @@ -1,2 +1,2 @@ export type { ApplyPromptRequest } from "./ApplyPromptRequest.js"; -export type { PromptsListRequest } from "./PromptsListRequest.js"; +export type { ListPromptsRequest } from "./ListPromptsRequest.js"; diff --git a/src/api/resources/runs/client/Client.ts b/src/api/resources/runs/client/Client.ts index 30998966..6bb6ba83 100644 --- a/src/api/resources/runs/client/Client.ts +++ b/src/api/resources/runs/client/Client.ts @@ -1,9 +1,10 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; -import * as core from "../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; @@ -12,18 +13,14 @@ import * as TrueFoundry from "../../../index.js"; export declare namespace RunsClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class RunsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: RunsClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** @@ -32,42 +29,76 @@ export class RunsClient { * @param {TrueFoundry.CreateRunRequest} request * @param {RunsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.runs.create({ * experimentId: "experiment_id", * name: "name" * }) */ - public create(request: TrueFoundry.CreateRunRequest, requestOptions?: RunsClient.RequestOptions): core.HttpResponsePromise { + public create( + request: TrueFoundry.CreateRunRequest, + requestOptions?: RunsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } - private async __create(request: TrueFoundry.CreateRunRequest, requestOptions?: RunsClient.RequestOptions): Promise> { + private async __create( + request: TrueFoundry.CreateRunRequest, + requestOptions?: RunsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/runs"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/runs", + ), method: "POST", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.CreateRunRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.CreateRunRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.CreateRunResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.CreateRunResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } @@ -81,19 +112,35 @@ export class RunsClient { * @param {RunsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.runs.get("id") */ - public get(id: string, requestOptions?: RunsClient.RequestOptions): core.HttpResponsePromise { + public get( + id: string, + requestOptions?: RunsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions)); } - private async __get(id: string, requestOptions?: RunsClient.RequestOptions): Promise> { + private async __get( + id: string, + requestOptions?: RunsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/runs/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/runs/${core.url.encodePathParam(id)}`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -101,20 +148,31 @@ export class RunsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetRunResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetRunResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -129,43 +187,80 @@ export class RunsClient { * @param {RunsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.runs.update("id") */ - public update(id: string, request: TrueFoundry.UpdateRunRequest = {}, requestOptions?: RunsClient.RequestOptions): core.HttpResponsePromise { + public update( + id: string, + request: TrueFoundry.UpdateRunRequest = {}, + requestOptions?: RunsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(id, request, requestOptions)); } - private async __update(id: string, request: TrueFoundry.UpdateRunRequest = {}, requestOptions?: RunsClient.RequestOptions): Promise> { + private async __update( + id: string, + request: TrueFoundry.UpdateRunRequest = {}, + requestOptions?: RunsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/runs/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/runs/${core.url.encodePathParam(id)}`, + ), method: "PUT", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.UpdateRunRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.UpdateRunRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.UpdateRunResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.UpdateRunResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -179,19 +274,35 @@ export class RunsClient { * @param {RunsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.runs.delete("id") */ - public delete(id: string, requestOptions?: RunsClient.RequestOptions): core.HttpResponsePromise { + public delete( + id: string, + requestOptions?: RunsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions)); } - private async __delete(id: string, requestOptions?: RunsClient.RequestOptions): Promise> { + private async __delete( + id: string, + requestOptions?: RunsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/runs/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/runs/${core.url.encodePathParam(id)}`, + ), method: "DELETE", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -199,20 +310,31 @@ export class RunsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.EmptyResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.EmptyResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -225,39 +347,90 @@ export class RunsClient { * @param {TrueFoundry.SearchRunsRequest} request * @param {RunsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.runs.search() */ - public async search(request: TrueFoundry.SearchRunsRequest = {}, requestOptions?: RunsClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.SearchRunsRequest): Promise> => { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/runs/search"), - method: "POST", - headers: _headers, - contentType: "application/json", - queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), - requestType: "json", - body: serializers.SearchRunsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.SearchRunsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/svc/v1/runs/search"); }); + public async search( + request: TrueFoundry.SearchRunsRequest = {}, + requestOptions?: RunsClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.SearchRunsRequest, + ): Promise> => { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/runs/search", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + requestType: "json", + body: mergeAdditionalBodyParameters( + serializers.SearchRunsRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.SearchRunsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/api/svc/v1/runs/search", + ); + }, + ); const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => response?.nextPageToken != null && !(typeof response?.nextPageToken === "string" && response?.nextPageToken === ""), - getItems: response => response?.runs ?? [], - loadPage: response => { return list(core.setObjectProperty(request, "pageToken", response?.nextPageToken)); } + hasNextPage: (response) => + response?.nextPageToken != null && + !(typeof response?.nextPageToken === "string" && response?.nextPageToken === ""), + getItems: (response) => response?.runs ?? [], + loadPage: (response) => { + return list(core.setObjectProperty(request, "pageToken", response?.nextPageToken)); + }, }); } @@ -265,54 +438,92 @@ export class RunsClient { * Get full time-series history for a metric key on a run. * * @param {string} id - System-generated unique identifier for the run. - * @param {TrueFoundry.RunsGetMetricHistoryRequest} request + * @param {TrueFoundry.GetMetricHistoryRunsRequest} request * @param {RunsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.runs.getMetricHistory("id", { * metricKey: "metric_key" * }) */ - public getMetricHistory(id: string, request: TrueFoundry.RunsGetMetricHistoryRequest, requestOptions?: RunsClient.RequestOptions): core.HttpResponsePromise { + public getMetricHistory( + id: string, + request: TrueFoundry.GetMetricHistoryRunsRequest, + requestOptions?: RunsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__getMetricHistory(id, request, requestOptions)); } - private async __getMetricHistory(id: string, request: TrueFoundry.RunsGetMetricHistoryRequest, requestOptions?: RunsClient.RequestOptions): Promise> { + private async __getMetricHistory( + id: string, + request: TrueFoundry.GetMetricHistoryRunsRequest, + requestOptions?: RunsClient.RequestOptions, + ): Promise> { const { metricKey } = request; const _queryParams: Record = { - metric_key: metricKey + metric_key: metricKey, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/runs/${core.url.encodePathParam(id)}/metrics/history`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/runs/${core.url.encodePathParam(id)}/metrics/history`, + ), method: "GET", headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetMetricHistoryResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetMetricHistoryResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/runs/{id}/metrics/history"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/runs/{id}/metrics/history", + ); } /** @@ -323,47 +534,89 @@ export class RunsClient { * @param {RunsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.runs.listMetricHistory("id") */ - public listMetricHistory(id: string, request: TrueFoundry.ListMetricHistoryRequest = {}, requestOptions?: RunsClient.RequestOptions): core.HttpResponsePromise { + public listMetricHistory( + id: string, + request: TrueFoundry.ListMetricHistoryRequest = {}, + requestOptions?: RunsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__listMetricHistory(id, request, requestOptions)); } - private async __listMetricHistory(id: string, request: TrueFoundry.ListMetricHistoryRequest = {}, requestOptions?: RunsClient.RequestOptions): Promise> { + private async __listMetricHistory( + id: string, + request: TrueFoundry.ListMetricHistoryRequest = {}, + requestOptions?: RunsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/runs/${core.url.encodePathParam(id)}/metrics/list`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/runs/${core.url.encodePathParam(id)}/metrics/list`, + ), method: "POST", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.ListMetricHistoryRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.ListMetricHistoryRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.ListMetricHistoryResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.ListMetricHistoryResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/svc/v1/runs/{id}/metrics/list"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/api/svc/v1/runs/{id}/metrics/list", + ); } /** @@ -373,6 +626,9 @@ export class RunsClient { * @param {TrueFoundry.LogMetricRequest} request * @param {RunsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.runs.logMetric("id", { * key: "key", @@ -380,40 +636,78 @@ export class RunsClient { * timestamp: 1.1 * }) */ - public logMetric(id: string, request: TrueFoundry.LogMetricRequest, requestOptions?: RunsClient.RequestOptions): core.HttpResponsePromise { + public logMetric( + id: string, + request: TrueFoundry.LogMetricRequest, + requestOptions?: RunsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__logMetric(id, request, requestOptions)); } - private async __logMetric(id: string, request: TrueFoundry.LogMetricRequest, requestOptions?: RunsClient.RequestOptions): Promise> { + private async __logMetric( + id: string, + request: TrueFoundry.LogMetricRequest, + requestOptions?: RunsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/runs/${core.url.encodePathParam(id)}/metrics`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/runs/${core.url.encodePathParam(id)}/metrics`, + ), method: "POST", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.LogMetricRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.LogMetricRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.EmptyResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.EmptyResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/svc/v1/runs/{id}/metrics"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/api/svc/v1/runs/{id}/metrics", + ); } /** @@ -423,46 +717,87 @@ export class RunsClient { * @param {TrueFoundry.LogParamRequest} request * @param {RunsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.runs.logParameter("id", { * key: "key", * value: "value" * }) */ - public logParameter(id: string, request: TrueFoundry.LogParamRequest, requestOptions?: RunsClient.RequestOptions): core.HttpResponsePromise { + public logParameter( + id: string, + request: TrueFoundry.LogParamRequest, + requestOptions?: RunsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__logParameter(id, request, requestOptions)); } - private async __logParameter(id: string, request: TrueFoundry.LogParamRequest, requestOptions?: RunsClient.RequestOptions): Promise> { + private async __logParameter( + id: string, + request: TrueFoundry.LogParamRequest, + requestOptions?: RunsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/runs/${core.url.encodePathParam(id)}/parameters`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/runs/${core.url.encodePathParam(id)}/parameters`, + ), method: "POST", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.LogParamRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.LogParamRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.EmptyResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.EmptyResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/svc/v1/runs/{id}/parameters"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/api/svc/v1/runs/{id}/parameters", + ); } /** @@ -472,42 +807,78 @@ export class RunsClient { * @param {TrueFoundry.SetTagRequest} request * @param {RunsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.runs.setTag("id", { * key: "key", * value: "value" * }) */ - public setTag(id: string, request: TrueFoundry.SetTagRequest, requestOptions?: RunsClient.RequestOptions): core.HttpResponsePromise { + public setTag( + id: string, + request: TrueFoundry.SetTagRequest, + requestOptions?: RunsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__setTag(id, request, requestOptions)); } - private async __setTag(id: string, request: TrueFoundry.SetTagRequest, requestOptions?: RunsClient.RequestOptions): Promise> { + private async __setTag( + id: string, + request: TrueFoundry.SetTagRequest, + requestOptions?: RunsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/runs/${core.url.encodePathParam(id)}/tags`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/runs/${core.url.encodePathParam(id)}/tags`, + ), method: "PUT", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.SetTagRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.SetTagRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.EmptyResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.EmptyResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } @@ -521,45 +892,86 @@ export class RunsClient { * @param {TrueFoundry.DeleteTagRequest} request * @param {RunsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.runs.deleteTag("id", { * key: "key" * }) */ - public deleteTag(id: string, request: TrueFoundry.DeleteTagRequest, requestOptions?: RunsClient.RequestOptions): core.HttpResponsePromise { + public deleteTag( + id: string, + request: TrueFoundry.DeleteTagRequest, + requestOptions?: RunsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__deleteTag(id, request, requestOptions)); } - private async __deleteTag(id: string, request: TrueFoundry.DeleteTagRequest, requestOptions?: RunsClient.RequestOptions): Promise> { + private async __deleteTag( + id: string, + request: TrueFoundry.DeleteTagRequest, + requestOptions?: RunsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/runs/${core.url.encodePathParam(id)}/tags/delete`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/runs/${core.url.encodePathParam(id)}/tags/delete`, + ), method: "POST", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.DeleteTagRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.DeleteTagRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.EmptyResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.EmptyResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/svc/v1/runs/{id}/tags/delete"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/api/svc/v1/runs/{id}/tags/delete", + ); } /** @@ -569,39 +981,75 @@ export class RunsClient { * @param {TrueFoundry.LogBatchRequest} request * @param {RunsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.runs.logBatch("id") */ - public logBatch(id: string, request: TrueFoundry.LogBatchRequest = {}, requestOptions?: RunsClient.RequestOptions): core.HttpResponsePromise { + public logBatch( + id: string, + request: TrueFoundry.LogBatchRequest = {}, + requestOptions?: RunsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__logBatch(id, request, requestOptions)); } - private async __logBatch(id: string, request: TrueFoundry.LogBatchRequest = {}, requestOptions?: RunsClient.RequestOptions): Promise> { + private async __logBatch( + id: string, + request: TrueFoundry.LogBatchRequest = {}, + requestOptions?: RunsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/runs/${core.url.encodePathParam(id)}/batch`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/runs/${core.url.encodePathParam(id)}/batch`, + ), method: "POST", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.LogBatchRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.LogBatchRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.EmptyResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.EmptyResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } diff --git a/src/api/resources/runs/client/requests/CreateRunRequest.ts b/src/api/resources/runs/client/requests/CreateRunRequest.ts index 92d8cfc0..ef4326c5 100644 --- a/src/api/resources/runs/client/requests/CreateRunRequest.ts +++ b/src/api/resources/runs/client/requests/CreateRunRequest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../index.js"; +import type * as TrueFoundry from "../../../../index.js"; /** * @example @@ -15,9 +15,9 @@ export interface CreateRunRequest { /** Human-readable name of the run. */ name: string; /** Unix timestamp in milliseconds when the run started. Defaults to the current time. */ - startTime?: number; + startTime?: number | null; /** Initial tags to set on the run. */ tags?: TrueFoundry.RunTagInput[]; /** Description of the run. */ - description?: string; + description?: string | null; } diff --git a/src/api/resources/runs/client/requests/RunsGetMetricHistoryRequest.ts b/src/api/resources/runs/client/requests/GetMetricHistoryRunsRequest.ts similarity index 81% rename from src/api/resources/runs/client/requests/RunsGetMetricHistoryRequest.ts rename to src/api/resources/runs/client/requests/GetMetricHistoryRunsRequest.ts index b64e1b11..d75a029e 100644 --- a/src/api/resources/runs/client/requests/RunsGetMetricHistoryRequest.ts +++ b/src/api/resources/runs/client/requests/GetMetricHistoryRunsRequest.ts @@ -6,7 +6,7 @@ * metricKey: "metric_key" * } */ -export interface RunsGetMetricHistoryRequest { +export interface GetMetricHistoryRunsRequest { /** Metric key (may contain slashes). */ metricKey: string; } diff --git a/src/api/resources/runs/client/requests/ListMetricHistoryRequest.ts b/src/api/resources/runs/client/requests/ListMetricHistoryRequest.ts index 4099d198..55642129 100644 --- a/src/api/resources/runs/client/requests/ListMetricHistoryRequest.ts +++ b/src/api/resources/runs/client/requests/ListMetricHistoryRequest.ts @@ -8,5 +8,5 @@ export interface ListMetricHistoryRequest { /** Metric keys to filter by. When omitted, returns all metric keys for the run. */ metricKeys?: string[]; /** Training step to filter metric history by. */ - step?: number; + step?: number | null; } diff --git a/src/api/resources/runs/client/requests/LogBatchRequest.ts b/src/api/resources/runs/client/requests/LogBatchRequest.ts index 8d8d7718..ecb492ca 100644 --- a/src/api/resources/runs/client/requests/LogBatchRequest.ts +++ b/src/api/resources/runs/client/requests/LogBatchRequest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../index.js"; +import type * as TrueFoundry from "../../../../index.js"; /** * @example diff --git a/src/api/resources/runs/client/requests/SearchRunsRequest.ts b/src/api/resources/runs/client/requests/SearchRunsRequest.ts index 774604c2..91ee0ef6 100644 --- a/src/api/resources/runs/client/requests/SearchRunsRequest.ts +++ b/src/api/resources/runs/client/requests/SearchRunsRequest.ts @@ -8,7 +8,7 @@ export interface SearchRunsRequest { /** List of ML Repo experiment IDs to search over. */ experimentIds?: string[]; /** Filter expression over params, metrics, and tags. Supports SQL-like comparisons (e.g. metrics.rmse < 1 and params.model_class = "LogisticRegression"). */ - filter?: string; + filter?: string | null; /** Whether to return active only, deleted only, or all runs. */ runViewType?: string; /** Maximum number of runs to return. */ @@ -16,15 +16,15 @@ export interface SearchRunsRequest { /** Sort order for results (e.g. metrics.accuracy DESC, params.lr ASC). */ orderBy?: string[]; /** Token for fetching the next page of results. */ - pageToken?: string; + pageToken?: string | null; /** Zero-based offset for pagination. */ - offset?: number; + offset?: number | null; /** Exact FQN lookup. */ - fqn?: string; + fqn?: string | null; /** Run name lookup within experiment. */ - name?: string; + name?: string | null; /** System-generated unique identifier for the ML Repo. */ - experimentId?: string; + experimentId?: string | null; /** ML Repo name when resolving by run name. */ - mlRepoName?: string; + mlRepoName?: string | null; } diff --git a/src/api/resources/runs/client/requests/UpdateRunRequest.ts b/src/api/resources/runs/client/requests/UpdateRunRequest.ts index 2fdad014..d475c247 100644 --- a/src/api/resources/runs/client/requests/UpdateRunRequest.ts +++ b/src/api/resources/runs/client/requests/UpdateRunRequest.ts @@ -6,9 +6,9 @@ */ export interface UpdateRunRequest { /** Updated status of the run (e.g. RUNNING, FINISHED, FAILED). */ - status?: string; + status?: string | null; /** Unix timestamp in milliseconds when the run ended. */ - endTime?: number; + endTime?: number | null; /** Updated description of the run. */ - description?: string; + description?: string | null; } diff --git a/src/api/resources/runs/client/requests/index.ts b/src/api/resources/runs/client/requests/index.ts index 1a7b6f4b..a4455ea8 100644 --- a/src/api/resources/runs/client/requests/index.ts +++ b/src/api/resources/runs/client/requests/index.ts @@ -1,10 +1,10 @@ export type { CreateRunRequest } from "./CreateRunRequest.js"; export type { DeleteTagRequest } from "./DeleteTagRequest.js"; +export type { GetMetricHistoryRunsRequest } from "./GetMetricHistoryRunsRequest.js"; export type { ListMetricHistoryRequest } from "./ListMetricHistoryRequest.js"; export type { LogBatchRequest } from "./LogBatchRequest.js"; export type { LogMetricRequest } from "./LogMetricRequest.js"; export type { LogParamRequest } from "./LogParamRequest.js"; -export type { RunsGetMetricHistoryRequest } from "./RunsGetMetricHistoryRequest.js"; export type { SearchRunsRequest } from "./SearchRunsRequest.js"; export type { SetTagRequest } from "./SetTagRequest.js"; export type { UpdateRunRequest } from "./UpdateRunRequest.js"; diff --git a/src/api/resources/secretGroups/client/Client.ts b/src/api/resources/secretGroups/client/Client.ts index ce565305..fc5e7c98 100644 --- a/src/api/resources/secretGroups/client/Client.ts +++ b/src/api/resources/secretGroups/client/Client.ts @@ -1,9 +1,11 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; -import * as core from "../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import { toJson } from "../../../../core/json.js"; +import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; @@ -12,69 +14,112 @@ import * as TrueFoundry from "../../../index.js"; export declare namespace SecretGroupsClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class SecretGroupsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: SecretGroupsClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** * List secret groups the caller has access to, along with associated secrets for each group. Secret values are not included in the response. * - * @param {TrueFoundry.SecretGroupsListRequest} request + * @param {TrueFoundry.ListSecretGroupsRequest} request * @param {SecretGroupsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.secretGroups.list({ * limit: 10, - * offset: 0, - * fqn: "fqn", - * search: "search", - * attributes: ["attributes"] + * offset: 0 * }) */ - public async list(request: TrueFoundry.SecretGroupsListRequest = {}, requestOptions?: SecretGroupsClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.SecretGroupsListRequest): Promise> => { const { limit = 100, offset = 0, fqn, search, attributes } = request; const _queryParams: Record = { - limit, - offset, - fqn, - search, - attributes - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/secret-groups"), - method: "GET", - headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.ListSecretGroupResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/secret-groups"); }); + public async list( + request: TrueFoundry.ListSecretGroupsRequest = {}, + requestOptions?: SecretGroupsClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.ListSecretGroupsRequest, + ): Promise> => { + const { limit = 100, offset = 0, fqn, search, attributes } = request; + const _queryParams: Record = { + limit, + offset, + fqn, + search, + attributes: attributes !== undefined ? toJson(attributes) : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/secret-groups", + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ListSecretGroupResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/secret-groups", + ); + }, + ); let _offset = request?.offset != null ? request?.offset : 0; const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => (response?.data ?? []).length > 0 && (request?.limit == null || (response?.data ?? []).length >= request?.limit), - getItems: response => response?.data ?? [], - loadPage: response => { _offset += response?.data != null ? response.data.length : 1; return list(core.setObjectProperty(request, "offset", _offset)); } + hasNextPage: (response) => + (response?.data ?? []).length > 0 && + (request?.limit == null || (response?.data ?? []).length >= request?.limit), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + _offset += response?.data != null ? response.data.length : 1; + return list(core.setObjectProperty(request, "offset", _offset)); + }, }); } @@ -86,6 +131,8 @@ export class SecretGroupsClient { * * @throws {@link TrueFoundry.UnprocessableEntityError} * @throws {@link TrueFoundry.FailedDependencyError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.secretGroups.create({ @@ -97,40 +144,92 @@ export class SecretGroupsClient { * }] * }) */ - public create(request: TrueFoundry.CreateSecretGroupRequest, requestOptions?: SecretGroupsClient.RequestOptions): core.HttpResponsePromise { + public create( + request: TrueFoundry.CreateSecretGroupRequest, + requestOptions?: SecretGroupsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } - private async __create(request: TrueFoundry.CreateSecretGroupRequest, requestOptions?: SecretGroupsClient.RequestOptions): Promise> { + private async __create( + request: TrueFoundry.CreateSecretGroupRequest, + requestOptions?: SecretGroupsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/secret-groups"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/secret-groups", + ), method: "POST", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.CreateSecretGroupRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.CreateSecretGroupRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetSecretGroupResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetSecretGroupResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 422: throw new TrueFoundry.UnprocessableEntityError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 424: throw new TrueFoundry.FailedDependencyError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 422: + throw new TrueFoundry.UnprocessableEntityError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 424: + throw new TrueFoundry.FailedDependencyError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -148,6 +247,8 @@ export class SecretGroupsClient { * @throws {@link TrueFoundry.NotFoundError} * @throws {@link TrueFoundry.ConflictError} * @throws {@link TrueFoundry.UnprocessableEntityError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.secretGroups.createOrUpdate({ @@ -162,43 +263,107 @@ export class SecretGroupsClient { * } * }) */ - public createOrUpdate(request: TrueFoundry.CreateOrUpdateSecretGroupRequest, requestOptions?: SecretGroupsClient.RequestOptions): core.HttpResponsePromise { + public createOrUpdate( + request: TrueFoundry.CreateOrUpdateSecretGroupRequest, + requestOptions?: SecretGroupsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__createOrUpdate(request, requestOptions)); } - private async __createOrUpdate(request: TrueFoundry.CreateOrUpdateSecretGroupRequest, requestOptions?: SecretGroupsClient.RequestOptions): Promise> { + private async __createOrUpdate( + request: TrueFoundry.CreateOrUpdateSecretGroupRequest, + requestOptions?: SecretGroupsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/secret-groups"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/secret-groups", + ), method: "PUT", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.CreateOrUpdateSecretGroupRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.CreateOrUpdateSecretGroupRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetSecretGroupResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetSecretGroupResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 400: throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - case 409: throw new TrueFoundry.ConflictError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 422: throw new TrueFoundry.UnprocessableEntityError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 400: + throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + case 409: + throw new TrueFoundry.ConflictError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 422: + throw new TrueFoundry.UnprocessableEntityError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -213,19 +378,35 @@ export class SecretGroupsClient { * * @throws {@link TrueFoundry.ForbiddenError} * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.secretGroups.get("id") */ - public get(id: string, requestOptions?: SecretGroupsClient.RequestOptions): core.HttpResponsePromise { + public get( + id: string, + requestOptions?: SecretGroupsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions)); } - private async __get(id: string, requestOptions?: SecretGroupsClient.RequestOptions): Promise> { + private async __get( + id: string, + requestOptions?: SecretGroupsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/secret-groups/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/secret-groups/${core.url.encodePathParam(id)}`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -233,25 +414,51 @@ export class SecretGroupsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetSecretGroupResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetSecretGroupResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/secret-groups/{id}"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/secret-groups/{id}", + ); } /** @@ -265,6 +472,8 @@ export class SecretGroupsClient { * @throws {@link TrueFoundry.ForbiddenError} * @throws {@link TrueFoundry.NotFoundError} * @throws {@link TrueFoundry.UnprocessableEntityError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.secretGroups.update("id", { @@ -273,103 +482,220 @@ export class SecretGroupsClient { * }] * }) */ - public update(id: string, request: TrueFoundry.UpdateSecretGroupRequest, requestOptions?: SecretGroupsClient.RequestOptions): core.HttpResponsePromise { + public update( + id: string, + request: TrueFoundry.UpdateSecretGroupRequest, + requestOptions?: SecretGroupsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(id, request, requestOptions)); } - private async __update(id: string, request: TrueFoundry.UpdateSecretGroupRequest, requestOptions?: SecretGroupsClient.RequestOptions): Promise> { + private async __update( + id: string, + request: TrueFoundry.UpdateSecretGroupRequest, + requestOptions?: SecretGroupsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/secret-groups/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/secret-groups/${core.url.encodePathParam(id)}`, + ), method: "PUT", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.UpdateSecretGroupRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.UpdateSecretGroupRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetSecretGroupResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetSecretGroupResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 400: throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - case 422: throw new TrueFoundry.UnprocessableEntityError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 400: + throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + case 422: + throw new TrueFoundry.UnprocessableEntityError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/api/svc/v1/secret-groups/{id}"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PUT", + "/api/svc/v1/secret-groups/{id}", + ); } /** * Delete the secret group and all its associated secrets and secret versions permanently. * * @param {string} id - Unique identifier of the secret group. - * @param {TrueFoundry.SecretGroupsDeleteRequest} request + * @param {TrueFoundry.DeleteSecretGroupsRequest} request * @param {SecretGroupsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.ForbiddenError} * @throws {@link TrueFoundry.NotFoundError} * @throws {@link TrueFoundry.FailedDependencyError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example - * await client.secretGroups.delete("id", { - * forceDelete: true - * }) + * await client.secretGroups.delete("id") */ - public delete(id: string, request: TrueFoundry.SecretGroupsDeleteRequest = {}, requestOptions?: SecretGroupsClient.RequestOptions): core.HttpResponsePromise { + public delete( + id: string, + request: TrueFoundry.DeleteSecretGroupsRequest = {}, + requestOptions?: SecretGroupsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(id, request, requestOptions)); } - private async __delete(id: string, request: TrueFoundry.SecretGroupsDeleteRequest = {}, requestOptions?: SecretGroupsClient.RequestOptions): Promise> { + private async __delete( + id: string, + request: TrueFoundry.DeleteSecretGroupsRequest = {}, + requestOptions?: SecretGroupsClient.RequestOptions, + ): Promise> { const { forceDelete } = request; const _queryParams: Record = { - forceDelete + forceDelete, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/secret-groups/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/secret-groups/${core.url.encodePathParam(id)}`, + ), method: "DELETE", headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.DeleteSecretGroupResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.DeleteSecretGroupResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - case 424: throw new TrueFoundry.FailedDependencyError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + case 424: + throw new TrueFoundry.FailedDependencyError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/api/svc/v1/secret-groups/{id}"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/api/svc/v1/secret-groups/{id}", + ); } } diff --git a/src/api/resources/secretGroups/client/requests/CreateOrUpdateSecretGroupRequest.ts b/src/api/resources/secretGroups/client/requests/CreateOrUpdateSecretGroupRequest.ts index d087ac3a..c4092a72 100644 --- a/src/api/resources/secretGroups/client/requests/CreateOrUpdateSecretGroupRequest.ts +++ b/src/api/resources/secretGroups/client/requests/CreateOrUpdateSecretGroupRequest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../index.js"; +import type * as TrueFoundry from "../../../../index.js"; /** * @example @@ -20,5 +20,5 @@ export interface CreateOrUpdateSecretGroupRequest { /** Secret Group Manifest */ manifest: TrueFoundry.SecretGroupManifest; /** Validate the manifest and collaborators without persisting or updating authorizations and secret groups */ - dryRun?: boolean; + dryRun?: boolean | null; } diff --git a/src/api/resources/secretGroups/client/requests/CreateSecretGroupRequest.ts b/src/api/resources/secretGroups/client/requests/CreateSecretGroupRequest.ts index 431a84fd..51f4b4c2 100644 --- a/src/api/resources/secretGroups/client/requests/CreateSecretGroupRequest.ts +++ b/src/api/resources/secretGroups/client/requests/CreateSecretGroupRequest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../index.js"; +import type * as TrueFoundry from "../../../../index.js"; /** * @example diff --git a/src/api/resources/secretGroups/client/requests/SecretGroupsDeleteRequest.ts b/src/api/resources/secretGroups/client/requests/DeleteSecretGroupsRequest.ts similarity index 63% rename from src/api/resources/secretGroups/client/requests/SecretGroupsDeleteRequest.ts rename to src/api/resources/secretGroups/client/requests/DeleteSecretGroupsRequest.ts index 53100e29..53d147bb 100644 --- a/src/api/resources/secretGroups/client/requests/SecretGroupsDeleteRequest.ts +++ b/src/api/resources/secretGroups/client/requests/DeleteSecretGroupsRequest.ts @@ -2,11 +2,9 @@ /** * @example - * { - * forceDelete: true - * } + * {} */ -export interface SecretGroupsDeleteRequest { +export interface DeleteSecretGroupsRequest { /** Whether to force delete the secret group even when the associated secret integration is faulty or unavailable. */ - forceDelete?: boolean; + forceDelete?: boolean | null; } diff --git a/src/api/resources/secretGroups/client/requests/SecretGroupsListRequest.ts b/src/api/resources/secretGroups/client/requests/ListSecretGroupsRequest.ts similarity index 51% rename from src/api/resources/secretGroups/client/requests/SecretGroupsListRequest.ts rename to src/api/resources/secretGroups/client/requests/ListSecretGroupsRequest.ts index 7a765136..8df7d758 100644 --- a/src/api/resources/secretGroups/client/requests/SecretGroupsListRequest.ts +++ b/src/api/resources/secretGroups/client/requests/ListSecretGroupsRequest.ts @@ -4,21 +4,18 @@ * @example * { * limit: 10, - * offset: 0, - * fqn: "fqn", - * search: "search", - * attributes: ["attributes"] + * offset: 0 * } */ -export interface SecretGroupsListRequest { +export interface ListSecretGroupsRequest { /** Number of items per page */ - limit?: number; + limit?: number | null; /** Number of items to skip */ - offset?: number; + offset?: number | null; /** Fqn of secret group. */ - fqn?: string; - /** Search query - filters by secret group names that contain the search string */ - search?: string; + fqn?: string | null; + /** Search query - filters by secret group names or secret names that contain the search string */ + search?: string | null; /** Comma-separated list of attributes to return (e.g. id,name). When provided, only the specified fields are fetched. `id` is always included. */ - attributes?: string | string[]; + attributes?: string[] | null; } diff --git a/src/api/resources/secretGroups/client/requests/UpdateSecretGroupRequest.ts b/src/api/resources/secretGroups/client/requests/UpdateSecretGroupRequest.ts index 707b02ce..eeac3ddb 100644 --- a/src/api/resources/secretGroups/client/requests/UpdateSecretGroupRequest.ts +++ b/src/api/resources/secretGroups/client/requests/UpdateSecretGroupRequest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../index.js"; +import type * as TrueFoundry from "../../../../index.js"; /** * @example diff --git a/src/api/resources/secretGroups/client/requests/index.ts b/src/api/resources/secretGroups/client/requests/index.ts index c622804e..0b7964e0 100644 --- a/src/api/resources/secretGroups/client/requests/index.ts +++ b/src/api/resources/secretGroups/client/requests/index.ts @@ -1,5 +1,5 @@ export type { CreateOrUpdateSecretGroupRequest } from "./CreateOrUpdateSecretGroupRequest.js"; export type { CreateSecretGroupRequest } from "./CreateSecretGroupRequest.js"; -export type { SecretGroupsDeleteRequest } from "./SecretGroupsDeleteRequest.js"; -export type { SecretGroupsListRequest } from "./SecretGroupsListRequest.js"; +export type { DeleteSecretGroupsRequest } from "./DeleteSecretGroupsRequest.js"; +export type { ListSecretGroupsRequest } from "./ListSecretGroupsRequest.js"; export type { UpdateSecretGroupRequest } from "./UpdateSecretGroupRequest.js"; diff --git a/src/api/resources/secrets/client/Client.ts b/src/api/resources/secrets/client/Client.ts index a3855d37..ce1535ba 100644 --- a/src/api/resources/secrets/client/Client.ts +++ b/src/api/resources/secrets/client/Client.ts @@ -1,9 +1,10 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; -import * as core from "../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; @@ -12,18 +13,14 @@ import * as TrueFoundry from "../../../index.js"; export declare namespace SecretsClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class SecretsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: SecretsClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** @@ -34,45 +31,103 @@ export class SecretsClient { * * @throws {@link TrueFoundry.ForbiddenError} * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.secrets.list() */ - public async list(request: TrueFoundry.ListSecretsRequest = {}, requestOptions?: SecretsClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.ListSecretsRequest): Promise> => { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/secrets"), - method: "POST", - headers: _headers, - contentType: "application/json", - queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), - requestType: "json", - body: serializers.ListSecretsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.ListSecretsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse + public async list( + request: TrueFoundry.ListSecretsRequest = {}, + requestOptions?: SecretsClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.ListSecretsRequest, + ): Promise> => { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/secrets", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + requestType: "json", + body: mergeAdditionalBodyParameters( + serializers.ListSecretsRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, }); - } - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/svc/v1/secrets"); }); + if (_response.ok) { + return { + data: serializers.ListSecretsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/svc/v1/secrets"); + }, + ); let _offset = request?.offset != null ? request?.offset : 0; const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => (response?.data ?? []).length > 0 && (request?.limit == null || (response?.data ?? []).length >= request?.limit), - getItems: response => response?.data ?? [], - loadPage: response => { _offset += response?.data != null ? response.data.length : 1; return list(core.setObjectProperty(request, "offset", _offset)); } + hasNextPage: (response) => + (response?.data ?? []).length > 0 && + (request?.limit == null || (response?.data ?? []).length >= request?.limit), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + _offset += response?.data != null ? response.data.length : 1; + return list(core.setObjectProperty(request, "offset", _offset)); + }, }); } @@ -84,19 +139,35 @@ export class SecretsClient { * * @throws {@link TrueFoundry.ForbiddenError} * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.secrets.get("id") */ - public get(id: string, requestOptions?: SecretsClient.RequestOptions): core.HttpResponsePromise { + public get( + id: string, + requestOptions?: SecretsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions)); } - private async __get(id: string, requestOptions?: SecretsClient.RequestOptions): Promise> { + private async __get( + id: string, + requestOptions?: SecretsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/secrets/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/secrets/${core.url.encodePathParam(id)}`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -104,21 +175,42 @@ export class SecretsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetSecretResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetSecretResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -129,54 +221,105 @@ export class SecretsClient { * Delete the secret and all its versions permanently. * * @param {string} id - Unique identifier of the secret. - * @param {TrueFoundry.SecretsDeleteRequest} request + * @param {TrueFoundry.DeleteSecretsRequest} request * @param {SecretsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.ForbiddenError} * @throws {@link TrueFoundry.NotFoundError} * @throws {@link TrueFoundry.FailedDependencyError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example - * await client.secrets.delete("id", { - * forceDelete: true - * }) + * await client.secrets.delete("id") */ - public delete(id: string, request: TrueFoundry.SecretsDeleteRequest = {}, requestOptions?: SecretsClient.RequestOptions): core.HttpResponsePromise { + public delete( + id: string, + request: TrueFoundry.DeleteSecretsRequest = {}, + requestOptions?: SecretsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(id, request, requestOptions)); } - private async __delete(id: string, request: TrueFoundry.SecretsDeleteRequest = {}, requestOptions?: SecretsClient.RequestOptions): Promise> { + private async __delete( + id: string, + request: TrueFoundry.DeleteSecretsRequest = {}, + requestOptions?: SecretsClient.RequestOptions, + ): Promise> { const { forceDelete } = request; const _queryParams: Record = { - forceDelete + forceDelete, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/secrets/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/secrets/${core.url.encodePathParam(id)}`, + ), method: "DELETE", headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.secrets.delete.Response.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.secrets.delete.Response.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - case 424: throw new TrueFoundry.FailedDependencyError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + case 424: + throw new TrueFoundry.FailedDependencyError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } diff --git a/src/api/resources/secrets/client/requests/SecretsDeleteRequest.ts b/src/api/resources/secrets/client/requests/DeleteSecretsRequest.ts similarity index 54% rename from src/api/resources/secrets/client/requests/SecretsDeleteRequest.ts rename to src/api/resources/secrets/client/requests/DeleteSecretsRequest.ts index cfa8ac4e..756c8d5c 100644 --- a/src/api/resources/secrets/client/requests/SecretsDeleteRequest.ts +++ b/src/api/resources/secrets/client/requests/DeleteSecretsRequest.ts @@ -2,11 +2,9 @@ /** * @example - * { - * forceDelete: true - * } + * {} */ -export interface SecretsDeleteRequest { +export interface DeleteSecretsRequest { /** Whether to force delete the secret. */ - forceDelete?: boolean; + forceDelete?: boolean | null; } diff --git a/src/api/resources/secrets/client/requests/ListSecretsRequest.ts b/src/api/resources/secrets/client/requests/ListSecretsRequest.ts index b700109a..9a4286f5 100644 --- a/src/api/resources/secrets/client/requests/ListSecretsRequest.ts +++ b/src/api/resources/secrets/client/requests/ListSecretsRequest.ts @@ -6,13 +6,13 @@ */ export interface ListSecretsRequest { /** Number of items per page */ - limit?: number; + limit?: number | null; /** Number of items to skip */ - offset?: number; + offset?: number | null; /** Filter by secret FQNs. */ - secretFqns?: string[]; + secretFqns?: string[] | null; /** Filter by secret group ID. */ - secretGroupId?: string; + secretGroupId?: string | null; /** Whether to include the secret values in the response. Defaults to false. */ - withValue?: boolean; + withValue?: boolean | null; } diff --git a/src/api/resources/secrets/client/requests/index.ts b/src/api/resources/secrets/client/requests/index.ts index fb48172a..06506fba 100644 --- a/src/api/resources/secrets/client/requests/index.ts +++ b/src/api/resources/secrets/client/requests/index.ts @@ -1,2 +1,2 @@ +export type { DeleteSecretsRequest } from "./DeleteSecretsRequest.js"; export type { ListSecretsRequest } from "./ListSecretsRequest.js"; -export type { SecretsDeleteRequest } from "./SecretsDeleteRequest.js"; diff --git a/src/api/resources/teams/client/Client.ts b/src/api/resources/teams/client/Client.ts index d6e785d1..3fc0a380 100644 --- a/src/api/resources/teams/client/Client.ts +++ b/src/api/resources/teams/client/Client.ts @@ -1,9 +1,11 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; -import * as core from "../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import { toJson } from "../../../../core/json.js"; +import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; @@ -12,67 +14,112 @@ import * as TrueFoundry from "../../../index.js"; export declare namespace TeamsClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class TeamsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: TeamsClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** - * List teams accessible to the current user. + * List teams accessible to the current user. Set includeMembership=false to omit full member and manager lists and return cached membership summaries instead. * - * @param {TrueFoundry.TeamsListRequest} request + * @param {TrueFoundry.ListTeamsRequest} request * @param {TeamsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.teams.list({ * limit: 10, - * offset: 0, - * role: "manager", - * attributes: ["attributes"] + * offset: 0 * }) */ - public async list(request: TrueFoundry.TeamsListRequest = {}, requestOptions?: TeamsClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.TeamsListRequest): Promise> => { const { limit = 100, offset = 0, role, attributes } = request; const _queryParams: Record = { - limit, - offset, - role: role != null ? role : undefined, - attributes - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/teams/user"), - method: "GET", - headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.ListTeamsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/teams/user"); }); + public async list( + request: TrueFoundry.ListTeamsRequest = {}, + requestOptions?: TeamsClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.ListTeamsRequest, + ): Promise> => { + const { limit = 100, offset = 0, role, attributes, includeMembership = true } = request; + const _queryParams: Record = { + limit, + offset, + role: role !== undefined ? role : undefined, + attributes: attributes !== undefined ? toJson(attributes) : undefined, + includeMembership, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/teams/user", + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ListTeamsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/teams/user", + ); + }, + ); let _offset = request?.offset != null ? request?.offset : 0; const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => (response?.data ?? []).length > 0 && (request?.limit == null || (response?.data ?? []).length >= request?.limit), - getItems: response => response?.data ?? [], - loadPage: response => { _offset += response?.data != null ? response.data.length : 1; return list(core.setObjectProperty(request, "offset", _offset)); } + hasNextPage: (response) => + (response?.data ?? []).length > 0 && + (request?.limit == null || (response?.data ?? []).length >= request?.limit), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + _offset += response?.data != null ? response.data.length : 1; + return list(core.setObjectProperty(request, "offset", _offset)); + }, }); } @@ -84,6 +131,8 @@ export class TeamsClient { * * @throws {@link TrueFoundry.ConflictError} * @throws {@link TrueFoundry.UnprocessableEntityError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.teams.createOrUpdate({ @@ -94,40 +143,92 @@ export class TeamsClient { * } * }) */ - public createOrUpdate(request: TrueFoundry.ApplyTeamRequest, requestOptions?: TeamsClient.RequestOptions): core.HttpResponsePromise { + public createOrUpdate( + request: TrueFoundry.ApplyTeamRequest, + requestOptions?: TeamsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__createOrUpdate(request, requestOptions)); } - private async __createOrUpdate(request: TrueFoundry.ApplyTeamRequest, requestOptions?: TeamsClient.RequestOptions): Promise> { + private async __createOrUpdate( + request: TrueFoundry.ApplyTeamRequest, + requestOptions?: TeamsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/teams"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/teams", + ), method: "PUT", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.ApplyTeamRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.ApplyTeamRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetTeamResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetTeamResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 409: throw new TrueFoundry.ConflictError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 422: throw new TrueFoundry.UnprocessableEntityError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 409: + throw new TrueFoundry.ConflictError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 422: + throw new TrueFoundry.UnprocessableEntityError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -138,55 +239,117 @@ export class TeamsClient { * List users who are members of a team. * * @param {string} id - System-generated team ID. - * @param {TrueFoundry.TeamsListMembersRequest} request + * @param {TrueFoundry.ListMembersTeamsRequest} request * @param {TeamsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.ForbiddenError} * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.teams.listMembers("jqfwg345gi25n5ju2yz5iz6m", { - * limit: 10, * offset: 0, + * limit: 10, * filter: "{\"type\":\"AND\",\"children\":[{\"column\":\"email\",\"op\":\"STRING_CONTAINS\",\"value\":\"@example.com\"}]}" * }) */ - public async listMembers(id: string, request: TrueFoundry.TeamsListMembersRequest = {}, requestOptions?: TeamsClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.TeamsListMembersRequest): Promise> => { const { limit = 100, offset = 0, filter } = request; const _queryParams: Record = { - limit, - offset, - filter - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/teams/${core.url.encodePathParam(id)}/members`), - method: "GET", - headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.ListTeamMembersResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse + public async listMembers( + id: string, + request: TrueFoundry.ListMembersTeamsRequest = {}, + requestOptions?: TeamsClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.ListMembersTeamsRequest, + ): Promise> => { + const { offset = 0, limit, filter } = request; + const _queryParams: Record = { + offset, + limit, + filter, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/teams/${core.url.encodePathParam(id)}/members`, + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, }); - } - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/teams/{id}/members"); }); + if (_response.ok) { + return { + data: serializers.ListTeamMembersResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/teams/{id}/members", + ); + }, + ); let _offset = request?.offset != null ? request?.offset : 0; const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => (response?.data ?? []).length > 0 && (request?.limit == null || (response?.data ?? []).length >= request?.limit), - getItems: response => response?.data ?? [], - loadPage: response => { _offset += response?.data != null ? response.data.length : 1; return list(core.setObjectProperty(request, "offset", _offset)); } + hasNextPage: (response) => + (response?.data ?? []).length > 0 && + (request?.limit == null || (response?.data ?? []).length >= request?.limit), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + _offset += response?.data != null ? response.data.length : 1; + return list(core.setObjectProperty(request, "offset", _offset)); + }, }); } @@ -194,55 +357,117 @@ export class TeamsClient { * List users who hold the team-manager role on a team. * * @param {string} id - System-generated team ID. - * @param {TrueFoundry.TeamsListManagersRequest} request + * @param {TrueFoundry.ListManagersTeamsRequest} request * @param {TeamsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.ForbiddenError} * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.teams.listManagers("jqfwg345gi25n5ju2yz5iz6m", { - * limit: 10, * offset: 0, + * limit: 10, * filter: "{\"type\":\"AND\",\"children\":[{\"column\":\"email\",\"op\":\"STRING_CONTAINS\",\"value\":\"@example.com\"}]}" * }) */ - public async listManagers(id: string, request: TrueFoundry.TeamsListManagersRequest = {}, requestOptions?: TeamsClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.TeamsListManagersRequest): Promise> => { const { limit = 100, offset = 0, filter } = request; const _queryParams: Record = { - limit, - offset, - filter - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/teams/${core.url.encodePathParam(id)}/managers`), - method: "GET", - headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.ListTeamManagersResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse + public async listManagers( + id: string, + request: TrueFoundry.ListManagersTeamsRequest = {}, + requestOptions?: TeamsClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.ListManagersTeamsRequest, + ): Promise> => { + const { offset = 0, limit, filter } = request; + const _queryParams: Record = { + offset, + limit, + filter, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/teams/${core.url.encodePathParam(id)}/managers`, + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, }); - } - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/teams/{id}/managers"); }); + if (_response.ok) { + return { + data: serializers.ListTeamManagersResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/teams/{id}/managers", + ); + }, + ); let _offset = request?.offset != null ? request?.offset : 0; const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => (response?.data ?? []).length > 0 && (request?.limit == null || (response?.data ?? []).length >= request?.limit), - getItems: response => response?.data ?? [], - loadPage: response => { _offset += response?.data != null ? response.data.length : 1; return list(core.setObjectProperty(request, "offset", _offset)); } + hasNextPage: (response) => + (response?.data ?? []).length > 0 && + (request?.limit == null || (response?.data ?? []).length >= request?.limit), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + _offset += response?.data != null ? response.data.length : 1; + return list(core.setObjectProperty(request, "offset", _offset)); + }, }); } @@ -253,19 +478,35 @@ export class TeamsClient { * @param {TeamsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.teams.get("jqfwg345gi25n5ju2yz5iz6m") */ - public get(id: string, requestOptions?: TeamsClient.RequestOptions): core.HttpResponsePromise { + public get( + id: string, + requestOptions?: TeamsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions)); } - private async __get(id: string, requestOptions?: TeamsClient.RequestOptions): Promise> { + private async __get( + id: string, + requestOptions?: TeamsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/teams/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/teams/${core.url.encodePathParam(id)}`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -273,20 +514,31 @@ export class TeamsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetTeamResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetTeamResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -301,19 +553,35 @@ export class TeamsClient { * * @throws {@link TrueFoundry.NotFoundError} * @throws {@link TrueFoundry.ConflictError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.teams.delete("jqfwg345gi25n5ju2yz5iz6m") */ - public delete(id: string, requestOptions?: TeamsClient.RequestOptions): core.HttpResponsePromise { + public delete( + id: string, + requestOptions?: TeamsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions)); } - private async __delete(id: string, requestOptions?: TeamsClient.RequestOptions): Promise> { + private async __delete( + id: string, + requestOptions?: TeamsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/teams/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/teams/${core.url.encodePathParam(id)}`, + ), method: "DELETE", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -321,21 +589,42 @@ export class TeamsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.DeleteTeamResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.DeleteTeamResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - case 409: throw new TrueFoundry.ConflictError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + case 409: + throw new TrueFoundry.ConflictError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -350,19 +639,35 @@ export class TeamsClient { * * @throws {@link TrueFoundry.ForbiddenError} * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.teams.getPermissions("jqfwg345gi25n5ju2yz5iz6m") */ - public getPermissions(id: string, requestOptions?: TeamsClient.RequestOptions): core.HttpResponsePromise { + public getPermissions( + id: string, + requestOptions?: TeamsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__getPermissions(id, requestOptions)); } - private async __getPermissions(id: string, requestOptions?: TeamsClient.RequestOptions): Promise> { + private async __getPermissions( + id: string, + requestOptions?: TeamsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/teams/${core.url.encodePathParam(id)}/permissions`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/teams/${core.url.encodePathParam(id)}/permissions`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -370,24 +675,50 @@ export class TeamsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetTeamPermissionsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetTeamPermissionsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/teams/{id}/permissions"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/teams/{id}/permissions", + ); } } diff --git a/src/api/resources/teams/client/requests/ApplyTeamRequest.ts b/src/api/resources/teams/client/requests/ApplyTeamRequest.ts index 2a9d225b..faa7a59b 100644 --- a/src/api/resources/teams/client/requests/ApplyTeamRequest.ts +++ b/src/api/resources/teams/client/requests/ApplyTeamRequest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../index.js"; +import type * as TrueFoundry from "../../../../index.js"; /** * @example @@ -16,5 +16,5 @@ export interface ApplyTeamRequest { /** The team manifest describing the team to create or update. */ manifest: TrueFoundry.TeamManifest; /** When true, validate the request without persisting any changes. */ - dryRun?: boolean; + dryRun?: boolean | null; } diff --git a/src/api/resources/teams/client/requests/TeamsListMembersRequest.ts b/src/api/resources/teams/client/requests/ListManagersTeamsRequest.ts similarity index 82% rename from src/api/resources/teams/client/requests/TeamsListMembersRequest.ts rename to src/api/resources/teams/client/requests/ListManagersTeamsRequest.ts index d62025de..ddfb47be 100644 --- a/src/api/resources/teams/client/requests/TeamsListMembersRequest.ts +++ b/src/api/resources/teams/client/requests/ListManagersTeamsRequest.ts @@ -3,16 +3,16 @@ /** * @example * { - * limit: 10, * offset: 0, + * limit: 10, * filter: "{\"type\":\"AND\",\"children\":[{\"column\":\"email\",\"op\":\"STRING_CONTAINS\",\"value\":\"@example.com\"}]}" * } */ -export interface TeamsListMembersRequest { - /** Number of items per page */ - limit?: number; +export interface ListManagersTeamsRequest { /** Number of items to skip */ - offset?: number; + offset?: number | null; + /** Number of items per page */ + limit?: number | null; /** JSON string: structured filter tree (AND/OR groups, column leaves on `email` and `userId`). */ filter?: string; } diff --git a/src/api/resources/teams/client/requests/TeamsListManagersRequest.ts b/src/api/resources/teams/client/requests/ListMembersTeamsRequest.ts similarity index 82% rename from src/api/resources/teams/client/requests/TeamsListManagersRequest.ts rename to src/api/resources/teams/client/requests/ListMembersTeamsRequest.ts index 863550d5..a571beef 100644 --- a/src/api/resources/teams/client/requests/TeamsListManagersRequest.ts +++ b/src/api/resources/teams/client/requests/ListMembersTeamsRequest.ts @@ -3,16 +3,16 @@ /** * @example * { - * limit: 10, * offset: 0, + * limit: 10, * filter: "{\"type\":\"AND\",\"children\":[{\"column\":\"email\",\"op\":\"STRING_CONTAINS\",\"value\":\"@example.com\"}]}" * } */ -export interface TeamsListManagersRequest { - /** Number of items per page */ - limit?: number; +export interface ListMembersTeamsRequest { /** Number of items to skip */ - offset?: number; + offset?: number | null; + /** Number of items per page */ + limit?: number | null; /** JSON string: structured filter tree (AND/OR groups, column leaves on `email` and `userId`). */ filter?: string; } diff --git a/src/api/resources/teams/client/requests/TeamsListRequest.ts b/src/api/resources/teams/client/requests/ListTeamsRequest.ts similarity index 58% rename from src/api/resources/teams/client/requests/TeamsListRequest.ts rename to src/api/resources/teams/client/requests/ListTeamsRequest.ts index c9719ff0..061aa8cf 100644 --- a/src/api/resources/teams/client/requests/TeamsListRequest.ts +++ b/src/api/resources/teams/client/requests/ListTeamsRequest.ts @@ -4,18 +4,18 @@ * @example * { * limit: 10, - * offset: 0, - * role: "manager", - * attributes: ["attributes"] + * offset: 0 * } */ -export interface TeamsListRequest { +export interface ListTeamsRequest { /** Number of items per page */ - limit?: number; + limit?: number | null; /** Number of items to skip */ - offset?: number; + offset?: number | null; /** Filter to teams where the caller holds this role. `manager` returns teams the caller can manage (team managers and admins). */ - role?: "manager"; + role?: "manager" | null; /** Comma-separated list of attributes to return (e.g. `id,teamName`). When provided, only the specified fields are fetched. `id` is always included. */ - attributes?: string | string[]; + attributes?: string[] | null; + /** Whether to include full member and manager lists. Set to false for a metadata-only response with cached membership summaries. */ + includeMembership?: boolean | null; } diff --git a/src/api/resources/teams/client/requests/index.ts b/src/api/resources/teams/client/requests/index.ts index 8a78cb23..449d39ba 100644 --- a/src/api/resources/teams/client/requests/index.ts +++ b/src/api/resources/teams/client/requests/index.ts @@ -1,4 +1,4 @@ export type { ApplyTeamRequest } from "./ApplyTeamRequest.js"; -export type { TeamsListManagersRequest } from "./TeamsListManagersRequest.js"; -export type { TeamsListMembersRequest } from "./TeamsListMembersRequest.js"; -export type { TeamsListRequest } from "./TeamsListRequest.js"; +export type { ListManagersTeamsRequest } from "./ListManagersTeamsRequest.js"; +export type { ListMembersTeamsRequest } from "./ListMembersTeamsRequest.js"; +export type { ListTeamsRequest } from "./ListTeamsRequest.js"; diff --git a/src/api/resources/traces/client/Client.ts b/src/api/resources/traces/client/Client.ts index 77b884d8..79c1c79f 100644 --- a/src/api/resources/traces/client/Client.ts +++ b/src/api/resources/traces/client/Client.ts @@ -1,70 +1,118 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; -import * as core from "../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; -import * as TrueFoundry from "../../../index.js"; +import type * as TrueFoundry from "../../../index.js"; export declare namespace TracesClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class TracesClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: TracesClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** * @param {TrueFoundry.QuerySpansRequest} request * @param {TracesClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.traces.querySpans({ * startTime: "startTime" * }) */ - public async querySpans(request: TrueFoundry.QuerySpansRequest, requestOptions?: TracesClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.QuerySpansRequest): Promise> => { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/spans/query"), - method: "POST", - headers: _headers, - contentType: "application/json", - queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), - requestType: "json", - body: serializers.QuerySpansRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.QuerySpansResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/svc/v1/spans/query"); }); + public async querySpans( + request: TrueFoundry.QuerySpansRequest, + requestOptions?: TracesClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.QuerySpansRequest, + ): Promise> => { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/spans/query", + ), + method: "POST", + headers: _headers, + contentType: "application/json", + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + requestType: "json", + body: mergeAdditionalBodyParameters( + serializers.QuerySpansRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.QuerySpansResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/api/svc/v1/spans/query", + ); + }, + ); const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => response?.pagination.nextPageToken != null && !(typeof response?.pagination.nextPageToken === "string" && response?.pagination.nextPageToken === ""), - getItems: response => response?.data ?? [], - loadPage: response => { return list(core.setObjectProperty(request, "pageToken", response?.pagination.nextPageToken)); } + hasNextPage: (response) => + response?.pagination.nextPageToken != null && + !(typeof response?.pagination.nextPageToken === "string" && response?.pagination.nextPageToken === ""), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + return list(core.setObjectProperty(request, "pageToken", response?.pagination.nextPageToken)); + }, }); } } diff --git a/src/api/resources/traces/client/requests/QuerySpansRequest.ts b/src/api/resources/traces/client/requests/QuerySpansRequest.ts index 31f89daf..bdd037cd 100644 --- a/src/api/resources/traces/client/requests/QuerySpansRequest.ts +++ b/src/api/resources/traces/client/requests/QuerySpansRequest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../index.js"; +import type * as TrueFoundry from "../../../../index.js"; /** * @example @@ -12,31 +12,31 @@ export interface QuerySpansRequest { /** Start time in ISO 8601 format (e.g., 2025-03-12T00:00:09.872Z) */ startTime: string; /** End time in ISO 8601 format (e.g., 2025-03-12T00:10:00.000Z). Defaults to current time if not provided. */ - endTime?: string; + endTime?: string | null; /** Array of trace IDs to filter by */ - traceIds?: string[]; + traceIds?: string[] | null; /** Array of span IDs to filter by */ - spanIds?: string[]; + spanIds?: string[] | null; /** Array of parent span IDs to filter by */ - parentSpanIds?: string[]; + parentSpanIds?: string[] | null; /** Array of subject types to filter by */ - createdBySubjectTypes?: TrueFoundry.SubjectType[]; + createdBySubjectTypes?: TrueFoundry.SubjectType[] | null; /** Array of subject slugs to filter by */ - createdBySubjectSlugs?: string[]; + createdBySubjectSlugs?: string[] | null; /** Array of application names to filter by */ - applicationNames?: string[]; + applicationNames?: string[] | null; /** The maximum number of spans to return per page. Defaults to 200 if not provided. */ - limit?: number; + limit?: number | null; /** Sort direction for results based on time. Defaults to descending (latest first) */ - sortDirection?: TrueFoundry.SortDirection; + sortDirection?: TrueFoundry.SortDirection | null; /** An opaque string that should be passed as-is from previous response for fetching the next page. Pass `$response.pagination.nextPageToken` from previous response for fetching the next page. */ - pageToken?: string; + pageToken?: string | null; /** Tracing project FQN (e.g., truefoundry:tracing-project:tfy-default) */ - tracingProjectFqn?: string; + tracingProjectFqn?: string | null; /** Data Routing Destination. One of tracingProjectFqn or dataRoutingDestination is required. */ - dataRoutingDestination?: string; + dataRoutingDestination?: string | null; /** Array of filters */ - filters?: TrueFoundry.QuerySpansRequestFiltersItem[]; + filters?: TrueFoundry.QuerySpansRequestFiltersItem[] | null; /** When true, feedback data is included in the response. When false, feedback data is excluded (returns empty array). */ - includeFeedbacks?: boolean; + includeFeedbacks?: boolean | null; } diff --git a/src/api/resources/traces/types/QuerySpansRequestFiltersItem.ts b/src/api/resources/traces/types/QuerySpansRequestFiltersItem.ts index c03517cf..019bfb89 100644 --- a/src/api/resources/traces/types/QuerySpansRequestFiltersItem.ts +++ b/src/api/resources/traces/types/QuerySpansRequestFiltersItem.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../index.js"; +import type * as TrueFoundry from "../../../index.js"; -export type QuerySpansRequestFiltersItem = +export type QuerySpansRequestFiltersItem = | TrueFoundry.SpanFieldFilter | TrueFoundry.SpanAttributeFilter | TrueFoundry.GatewayRequestMetadataFilter; diff --git a/src/api/resources/users/client/Client.ts b/src/api/resources/users/client/Client.ts index 3582112b..99c38990 100644 --- a/src/api/resources/users/client/Client.ts +++ b/src/api/resources/users/client/Client.ts @@ -1,9 +1,10 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; -import * as core from "../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; @@ -12,67 +13,107 @@ import * as TrueFoundry from "../../../index.js"; export declare namespace UsersClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class UsersClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: UsersClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** * List users in the current tenant. * - * @param {TrueFoundry.UsersListRequest} request + * @param {TrueFoundry.ListUsersRequest} request * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.users.list({ * limit: 10, * offset: 0, - * query: "john@example.com", - * showInvalidUsers: true + * query: "john@example.com" * }) */ - public async list(request: TrueFoundry.UsersListRequest = {}, requestOptions?: UsersClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.UsersListRequest): Promise> => { const { limit = 100, offset = 0, query, showInvalidUsers = false } = request; const _queryParams: Record = { - limit, - offset, - query, - showInvalidUsers - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/users"), - method: "GET", - headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.ListUsersResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/users"); }); + public async list( + request: TrueFoundry.ListUsersRequest = {}, + requestOptions?: UsersClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.ListUsersRequest, + ): Promise> => { + const { limit = 100, offset = 0, query, showInvalidUsers = false } = request; + const _queryParams: Record = { + limit, + offset, + query, + showInvalidUsers, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/users", + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ListUsersResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/users"); + }, + ); let _offset = request?.offset != null ? request?.offset : 0; const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => (response?.data ?? []).length > 0 && (request?.limit == null || (response?.data ?? []).length >= request?.limit), - getItems: response => response?.data ?? [], - loadPage: response => { _offset += response?.data != null ? response.data.length : 1; return list(core.setObjectProperty(request, "offset", _offset)); } + hasNextPage: (response) => + (response?.data ?? []).length > 0 && + (request?.limit == null || (response?.data ?? []).length >= request?.limit), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + _offset += response?.data != null ? response.data.length : 1; + return list(core.setObjectProperty(request, "offset", _offset)); + }, }); } @@ -85,47 +126,111 @@ export class UsersClient { * @throws {@link TrueFoundry.UnauthorizedError} * @throws {@link TrueFoundry.ConflictError} * @throws {@link TrueFoundry.UnprocessableEntityError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.users.preRegisterUsers({ * email: "user@example.com" * }) */ - public preRegisterUsers(request: TrueFoundry.RegisterUsersRequest, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise { + public preRegisterUsers( + request: TrueFoundry.RegisterUsersRequest, + requestOptions?: UsersClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__preRegisterUsers(request, requestOptions)); } - private async __preRegisterUsers(request: TrueFoundry.RegisterUsersRequest, requestOptions?: UsersClient.RequestOptions): Promise> { + private async __preRegisterUsers( + request: TrueFoundry.RegisterUsersRequest, + requestOptions?: UsersClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/users/register"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/users/register", + ), method: "POST", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.RegisterUsersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.RegisterUsersRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.RegisterUsersResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.RegisterUsersResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 401: throw new TrueFoundry.UnauthorizedError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 409: throw new TrueFoundry.ConflictError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 422: throw new TrueFoundry.UnprocessableEntityError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 401: + throw new TrueFoundry.UnauthorizedError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 409: + throw new TrueFoundry.ConflictError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 422: + throw new TrueFoundry.UnprocessableEntityError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -141,6 +246,8 @@ export class UsersClient { * @throws {@link TrueFoundry.UnauthorizedError} * @throws {@link TrueFoundry.NotFoundError} * @throws {@link TrueFoundry.UnprocessableEntityError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.users.updateRoles({ @@ -148,41 +255,94 @@ export class UsersClient { * roles: ["tenant-admin"] * }) */ - public updateRoles(request: TrueFoundry.UpdateUserRolesRequest, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise { + public updateRoles( + request: TrueFoundry.UpdateUserRolesRequest, + requestOptions?: UsersClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__updateRoles(request, requestOptions)); } - private async __updateRoles(request: TrueFoundry.UpdateUserRolesRequest, requestOptions?: UsersClient.RequestOptions): Promise> { + private async __updateRoles( + request: TrueFoundry.UpdateUserRolesRequest, + requestOptions?: UsersClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/users/roles"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/users/roles", + ), method: "PATCH", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.UpdateUserRolesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.UpdateUserRolesRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.UpdateUserRolesResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.UpdateUserRolesResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 401: throw new TrueFoundry.UnauthorizedError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - case 422: throw new TrueFoundry.UnprocessableEntityError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 401: + throw new TrueFoundry.UnauthorizedError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + case 422: + throw new TrueFoundry.UnprocessableEntityError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -196,19 +356,35 @@ export class UsersClient { * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.users.get("jqfwg345gi25n5ju2yz5iz6m") */ - public get(id: string, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise { + public get( + id: string, + requestOptions?: UsersClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions)); } - private async __get(id: string, requestOptions?: UsersClient.RequestOptions): Promise> { + private async __get( + id: string, + requestOptions?: UsersClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/users/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/users/${core.url.encodePathParam(id)}`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -216,20 +392,31 @@ export class UsersClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetUserResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetUserResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -240,54 +427,97 @@ export class UsersClient { * Permanently delete a user by ID. The user must not be a collaborator on any resource and must not belong to any team other than "everyone". * * @param {string} id - System-generated user ID. - * @param {TrueFoundry.UsersDeleteRequest} request + * @param {TrueFoundry.DeleteUsersRequest} request * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.BadRequestError} * @throws {@link TrueFoundry.UnauthorizedError} * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example - * await client.users.delete("jqfwg345gi25n5ju2yz5iz6m", { - * tenantName: "tenantName" - * }) + * await client.users.delete("jqfwg345gi25n5ju2yz5iz6m") */ - public delete(id: string, request: TrueFoundry.UsersDeleteRequest = {}, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise { + public delete( + id: string, + request: TrueFoundry.DeleteUsersRequest = {}, + requestOptions?: UsersClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(id, request, requestOptions)); } - private async __delete(id: string, request: TrueFoundry.UsersDeleteRequest = {}, requestOptions?: UsersClient.RequestOptions): Promise> { - const { tenantName } = request; + private async __delete( + id: string, + request: TrueFoundry.DeleteUsersRequest = {}, + requestOptions?: UsersClient.RequestOptions, + ): Promise> { + const { tenantName, forceDelete } = request; const _queryParams: Record = { - tenantName + tenantName, + forceDelete, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/users/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/users/${core.url.encodePathParam(id)}`, + ), method: "DELETE", headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.DeleteUserResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.DeleteUserResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 400: throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); - case 401: throw new TrueFoundry.UnauthorizedError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 400: + throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new TrueFoundry.UnauthorizedError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -303,6 +533,8 @@ export class UsersClient { * @throws {@link TrueFoundry.UnauthorizedError} * @throws {@link TrueFoundry.ForbiddenError} * @throws {@link TrueFoundry.ConflictError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.users.inviteUser({ @@ -310,41 +542,103 @@ export class UsersClient { * email: "user@example.com" * }) */ - public inviteUser(request: TrueFoundry.InviteUserRequest, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise { + public inviteUser( + request: TrueFoundry.InviteUserRequest, + requestOptions?: UsersClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__inviteUser(request, requestOptions)); } - private async __inviteUser(request: TrueFoundry.InviteUserRequest, requestOptions?: UsersClient.RequestOptions): Promise> { + private async __inviteUser( + request: TrueFoundry.InviteUserRequest, + requestOptions?: UsersClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/users/invite"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/users/invite", + ), method: "POST", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.InviteUserRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.InviteUserRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.InviteUserResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.InviteUserResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 401: throw new TrueFoundry.UnauthorizedError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 409: throw new TrueFoundry.ConflictError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 401: + throw new TrueFoundry.UnauthorizedError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 409: + throw new TrueFoundry.ConflictError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -359,50 +653,100 @@ export class UsersClient { * * @throws {@link TrueFoundry.UnauthorizedError} * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.users.deactivate({ * email: "user@example.com" * }) */ - public deactivate(request: TrueFoundry.DeactivateUserRequest, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise { + public deactivate( + request: TrueFoundry.DeactivateUserRequest, + requestOptions?: UsersClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__deactivate(request, requestOptions)); } - private async __deactivate(request: TrueFoundry.DeactivateUserRequest, requestOptions?: UsersClient.RequestOptions): Promise> { + private async __deactivate( + request: TrueFoundry.DeactivateUserRequest, + requestOptions?: UsersClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/users/deactivate"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/users/deactivate", + ), method: "PATCH", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.DeactivateUserRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.DeactivateUserRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.DeactivateUserResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.DeactivateUserResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 401: throw new TrueFoundry.UnauthorizedError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 401: + throw new TrueFoundry.UnauthorizedError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/api/svc/v1/users/deactivate"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PATCH", + "/api/svc/v1/users/deactivate", + ); } /** @@ -413,46 +757,91 @@ export class UsersClient { * * @throws {@link TrueFoundry.UnauthorizedError} * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.users.activate({ * email: "user@example.com" * }) */ - public activate(request: TrueFoundry.ActivateUserRequest, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise { + public activate( + request: TrueFoundry.ActivateUserRequest, + requestOptions?: UsersClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__activate(request, requestOptions)); } - private async __activate(request: TrueFoundry.ActivateUserRequest, requestOptions?: UsersClient.RequestOptions): Promise> { + private async __activate( + request: TrueFoundry.ActivateUserRequest, + requestOptions?: UsersClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/users/activate"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/users/activate", + ), method: "PATCH", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.ActivateUserRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.ActivateUserRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.ActivateUserResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.ActivateUserResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 401: throw new TrueFoundry.UnauthorizedError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 401: + throw new TrueFoundry.UnauthorizedError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -465,6 +854,9 @@ export class UsersClient { * @param {TrueFoundry.ChangePasswordRequest} request * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.users.changePassword({ * loginId: "user@example.com", @@ -472,40 +864,76 @@ export class UsersClient { * oldPassword: "oldPassword" * }) */ - public changePassword(request: TrueFoundry.ChangePasswordRequest, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise { + public changePassword( + request: TrueFoundry.ChangePasswordRequest, + requestOptions?: UsersClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__changePassword(request, requestOptions)); } - private async __changePassword(request: TrueFoundry.ChangePasswordRequest, requestOptions?: UsersClient.RequestOptions): Promise> { + private async __changePassword( + request: TrueFoundry.ChangePasswordRequest, + requestOptions?: UsersClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/users/change-password"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/users/change-password", + ), method: "POST", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.ChangePasswordRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.ChangePasswordRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.ChangePasswordResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.ChangePasswordResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/svc/v1/users/change-password"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/api/svc/v1/users/change-password", + ); } /** @@ -516,19 +944,35 @@ export class UsersClient { * * @throws {@link TrueFoundry.ForbiddenError} * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.users.getResources("jqfwg345gi25n5ju2yz5iz6m") */ - public getResources(id: string, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise { + public getResources( + id: string, + requestOptions?: UsersClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__getResources(id, requestOptions)); } - private async __getResources(id: string, requestOptions?: UsersClient.RequestOptions): Promise> { + private async __getResources( + id: string, + requestOptions?: UsersClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/x/users/${core.url.encodePathParam(id)}/resources`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/x/users/${core.url.encodePathParam(id)}/resources`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -536,25 +980,51 @@ export class UsersClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetUserResourcesResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetUserResourcesResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/x/users/{id}/resources"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/x/users/{id}/resources", + ); } /** @@ -565,19 +1035,35 @@ export class UsersClient { * * @throws {@link TrueFoundry.ForbiddenError} * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.users.getPermissions("jqfwg345gi25n5ju2yz5iz6m") */ - public getPermissions(id: string, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise { + public getPermissions( + id: string, + requestOptions?: UsersClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__getPermissions(id, requestOptions)); } - private async __getPermissions(id: string, requestOptions?: UsersClient.RequestOptions): Promise> { + private async __getPermissions( + id: string, + requestOptions?: UsersClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/x/users/${core.url.encodePathParam(id)}/permissions`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/x/users/${core.url.encodePathParam(id)}/permissions`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -585,25 +1071,51 @@ export class UsersClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetUserPermissionsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetUserPermissionsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/x/users/{id}/permissions"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/x/users/{id}/permissions", + ); } /** @@ -614,19 +1126,35 @@ export class UsersClient { * * @throws {@link TrueFoundry.ForbiddenError} * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.users.getTeams("jqfwg345gi25n5ju2yz5iz6m") */ - public getTeams(id: string, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise { + public getTeams( + id: string, + requestOptions?: UsersClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__getTeams(id, requestOptions)); } - private async __getTeams(id: string, requestOptions?: UsersClient.RequestOptions): Promise> { + private async __getTeams( + id: string, + requestOptions?: UsersClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/x/users/${core.url.encodePathParam(id)}/teams`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/x/users/${core.url.encodePathParam(id)}/teams`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -634,24 +1162,50 @@ export class UsersClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetUserTeamsResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetUserTeamsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/x/users/{id}/teams"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/x/users/{id}/teams", + ); } } diff --git a/src/api/resources/users/client/requests/ActivateUserRequest.ts b/src/api/resources/users/client/requests/ActivateUserRequest.ts index 7314345c..13494378 100644 --- a/src/api/resources/users/client/requests/ActivateUserRequest.ts +++ b/src/api/resources/users/client/requests/ActivateUserRequest.ts @@ -10,5 +10,5 @@ export interface ActivateUserRequest { /** Email of the user to activate. */ email: string; /** Tenant name override. Defaults to the caller's tenant when omitted. */ - tenantName?: string; + tenantName?: string | null; } diff --git a/src/api/resources/users/client/requests/DeactivateUserRequest.ts b/src/api/resources/users/client/requests/DeactivateUserRequest.ts index 09766ae0..41743e65 100644 --- a/src/api/resources/users/client/requests/DeactivateUserRequest.ts +++ b/src/api/resources/users/client/requests/DeactivateUserRequest.ts @@ -10,5 +10,5 @@ export interface DeactivateUserRequest { /** Email of the user to deactivate. */ email: string; /** Tenant name override. Defaults to the caller's tenant when omitted. */ - tenantName?: string; + tenantName?: string | null; } diff --git a/src/api/resources/users/client/requests/DeleteUsersRequest.ts b/src/api/resources/users/client/requests/DeleteUsersRequest.ts new file mode 100644 index 00000000..1bdb2132 --- /dev/null +++ b/src/api/resources/users/client/requests/DeleteUsersRequest.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * @example + * {} + */ +export interface DeleteUsersRequest { + /** Tenant name override. Defaults to the caller's tenant when omitted. */ + tenantName?: string | null; + /** When true, force-deletes the user by automatically removing all resource collaborations and team memberships. */ + forceDelete?: boolean | null; +} diff --git a/src/api/resources/users/client/requests/UsersListRequest.ts b/src/api/resources/users/client/requests/ListUsersRequest.ts similarity index 62% rename from src/api/resources/users/client/requests/UsersListRequest.ts rename to src/api/resources/users/client/requests/ListUsersRequest.ts index edf96888..ea432204 100644 --- a/src/api/resources/users/client/requests/UsersListRequest.ts +++ b/src/api/resources/users/client/requests/ListUsersRequest.ts @@ -5,17 +5,16 @@ * { * limit: 10, * offset: 0, - * query: "john@example.com", - * showInvalidUsers: true + * query: "john@example.com" * } */ -export interface UsersListRequest { +export interface ListUsersRequest { /** Number of items per page */ - limit?: number; + limit?: number | null; /** Number of items to skip */ - offset?: number; + offset?: number | null; /** Filter users by email substring match. */ - query?: string; + query?: string | null; /** When true, includes deactivated users in the response. */ - showInvalidUsers?: boolean; + showInvalidUsers?: boolean | null; } diff --git a/src/api/resources/users/client/requests/RegisterUsersRequest.ts b/src/api/resources/users/client/requests/RegisterUsersRequest.ts index a6abb372..11520ef1 100644 --- a/src/api/resources/users/client/requests/RegisterUsersRequest.ts +++ b/src/api/resources/users/client/requests/RegisterUsersRequest.ts @@ -10,11 +10,11 @@ export interface RegisterUsersRequest { /** Email address of the user to register. */ email: string; /** When true, sends an invite email to the user after registration. */ - sendInviteEmail?: boolean; + sendInviteEmail?: boolean | null; /** When true, silently skips registration if the user already exists instead of returning an error. */ - skipIfUserExists?: boolean; + skipIfUserExists?: boolean | null; /** When true, validates the request without persisting changes. */ - dryRun?: boolean; + dryRun?: boolean | null; /** URL the user is redirected to when they accept the invite. Required when sendInviteEmail is true. */ - acceptInviteClientUrl?: string; + acceptInviteClientUrl?: string | null; } diff --git a/src/api/resources/users/client/requests/UpdateUserRolesRequest.ts b/src/api/resources/users/client/requests/UpdateUserRolesRequest.ts index d878b854..4a3dfb2c 100644 --- a/src/api/resources/users/client/requests/UpdateUserRolesRequest.ts +++ b/src/api/resources/users/client/requests/UpdateUserRolesRequest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../index.js"; +import type * as TrueFoundry from "../../../../index.js"; /** * @example @@ -15,5 +15,5 @@ export interface UpdateUserRolesRequest { /** Role names to assign to the user. */ roles: string[]; /** Resource type scope for the role assignment. */ - resourceType?: TrueFoundry.ResourceType; + resourceType?: TrueFoundry.UpdateUserRolesRequestResourceType | null; } diff --git a/src/api/resources/users/client/requests/UsersDeleteRequest.ts b/src/api/resources/users/client/requests/UsersDeleteRequest.ts deleted file mode 100644 index 126a8180..00000000 --- a/src/api/resources/users/client/requests/UsersDeleteRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * tenantName: "tenantName" - * } - */ -export interface UsersDeleteRequest { - /** Tenant name override. Defaults to the caller's tenant when omitted. */ - tenantName?: string; -} diff --git a/src/api/resources/users/client/requests/index.ts b/src/api/resources/users/client/requests/index.ts index 51acdb1b..b419a105 100644 --- a/src/api/resources/users/client/requests/index.ts +++ b/src/api/resources/users/client/requests/index.ts @@ -1,8 +1,8 @@ export type { ActivateUserRequest } from "./ActivateUserRequest.js"; export type { ChangePasswordRequest } from "./ChangePasswordRequest.js"; export type { DeactivateUserRequest } from "./DeactivateUserRequest.js"; +export type { DeleteUsersRequest } from "./DeleteUsersRequest.js"; export type { InviteUserRequest } from "./InviteUserRequest.js"; +export type { ListUsersRequest } from "./ListUsersRequest.js"; export type { RegisterUsersRequest } from "./RegisterUsersRequest.js"; export type { UpdateUserRolesRequest } from "./UpdateUserRolesRequest.js"; -export type { UsersDeleteRequest } from "./UsersDeleteRequest.js"; -export type { UsersListRequest } from "./UsersListRequest.js"; diff --git a/src/api/resources/users/index.ts b/src/api/resources/users/index.ts index 914b8c3c..d9adb1af 100644 --- a/src/api/resources/users/index.ts +++ b/src/api/resources/users/index.ts @@ -1 +1,2 @@ export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/users/types/UpdateUserRolesRequestResourceType.ts b/src/api/resources/users/types/UpdateUserRolesRequestResourceType.ts new file mode 100644 index 00000000..6c3b6920 --- /dev/null +++ b/src/api/resources/users/types/UpdateUserRolesRequestResourceType.ts @@ -0,0 +1,49 @@ +// This file was auto-generated by Fern from our API Definition. + +/** Resource type scope for the role assignment. */ +export const UpdateUserRolesRequestResourceType = { + Role: "role", + Account: "account", + Cluster: "cluster", + Workspace: "workspace", + Environment: "environment", + SecretGroup: "secret-group", + Deployment: "deployment", + Application: "application", + Secret: "secret", + DockerRegistry: "docker-registry", + Tenant: "tenant", + VcsIntegration: "vcs-integration", + MlfProject: "mlf-project", + Repository: "repository", + ProviderIntegration: "provider-integration", + Team: "team", + ServiceAccount: "service-account", + LlmGateway: "llm-gateway", + Policy: "policy", + RoleBinding: "role-binding", + Settings: "settings", + ProviderAccount: "provider-account", + User: "user", + AlertConfig: "alert-config", + AlertRule: "alert-rule", + GatewayConfig: "gateway-config", + GatewayControls: "gateway-controls", + GatewayBudget: "gateway-budget", + GatewayPolicy: "gateway-policy", + GatewayApprovalRequest: "gateway-approval-request", + TracingProject: "tracing-project", + TracingApplication: "tracing-application", + Agent: "agent", + AgentApp: "agent-app", + AgentChannel: "agent-channel", + GatewayInstallation: "gateway-installation", + VirtualAccount: "virtual-account", + SsoBasedIdentity: "sso-based-identity", + ExternalIdentity: "external-identity", + McpServer: "mcp-server", + ExternalIdentityProvider: "external-identity-provider", + AgentIdentity: "agent-identity", +} as const; +export type UpdateUserRolesRequestResourceType = + (typeof UpdateUserRolesRequestResourceType)[keyof typeof UpdateUserRolesRequestResourceType]; diff --git a/src/api/resources/users/types/index.ts b/src/api/resources/users/types/index.ts new file mode 100644 index 00000000..d5c06e6e --- /dev/null +++ b/src/api/resources/users/types/index.ts @@ -0,0 +1 @@ +export * from "./UpdateUserRolesRequestResourceType.js"; diff --git a/src/api/resources/virtualAccounts/client/Client.ts b/src/api/resources/virtualAccounts/client/Client.ts index fa32693f..dd160ac1 100644 --- a/src/api/resources/virtualAccounts/client/Client.ts +++ b/src/api/resources/virtualAccounts/client/Client.ts @@ -1,9 +1,11 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; -import * as core from "../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import { toJson } from "../../../../core/json.js"; +import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; @@ -12,71 +14,115 @@ import * as TrueFoundry from "../../../index.js"; export declare namespace VirtualAccountsClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class VirtualAccountsClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: VirtualAccountsClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** * List virtual accounts accessible to the current user. * - * @param {TrueFoundry.VirtualAccountsListRequest} request + * @param {TrueFoundry.ListVirtualAccountsRequest} request * @param {VirtualAccountsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.virtualAccounts.list({ * limit: 10, * offset: 0, * nameSearchQuery: "staging-bot", - * ownedByTeams: ["ownedByTeams"], - * isExpired: true, * filter: "{\"type\":\"AND\",\"children\":[{\"column\":\"name\",\"op\":\"STRING_CONTAINS\",\"value\":\"bot\"}]}" * }) */ - public async list(request: TrueFoundry.VirtualAccountsListRequest = {}, requestOptions?: VirtualAccountsClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.VirtualAccountsListRequest): Promise> => { const { limit = 100, offset = 0, nameSearchQuery, ownedByTeams, isExpired, filter } = request; const _queryParams: Record = { - limit, - offset, - nameSearchQuery, - ownedByTeams, - isExpired, - filter - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/virtual-accounts"), - method: "GET", - headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.ListVirtualAccountResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/virtual-accounts"); }); + public async list( + request: TrueFoundry.ListVirtualAccountsRequest = {}, + requestOptions?: VirtualAccountsClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.ListVirtualAccountsRequest, + ): Promise> => { + const { limit = 100, offset = 0, nameSearchQuery, ownedByTeams, isExpired, filter } = request; + const _queryParams: Record = { + limit, + offset, + nameSearchQuery, + ownedByTeams: ownedByTeams !== undefined ? toJson(ownedByTeams) : undefined, + isExpired, + filter, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/virtual-accounts", + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ListVirtualAccountResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/virtual-accounts", + ); + }, + ); let _offset = request?.offset != null ? request?.offset : 0; const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => (response?.data ?? []).length > 0 && (request?.limit == null || (response?.data ?? []).length >= request?.limit), - getItems: response => response?.data ?? [], - loadPage: response => { _offset += response?.data != null ? response.data.length : 1; return list(core.setObjectProperty(request, "offset", _offset)); } + hasNextPage: (response) => + (response?.data ?? []).length > 0 && + (request?.limit == null || (response?.data ?? []).length >= request?.limit), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + _offset += response?.data != null ? response.data.length : 1; + return list(core.setObjectProperty(request, "offset", _offset)); + }, }); } @@ -88,6 +134,8 @@ export class VirtualAccountsClient { * * @throws {@link TrueFoundry.BadRequestError} * @throws {@link TrueFoundry.UnprocessableEntityError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.virtualAccounts.createOrUpdate({ @@ -102,40 +150,83 @@ export class VirtualAccountsClient { * } * }) */ - public createOrUpdate(request: TrueFoundry.ApplyVirtualAccountRequest, requestOptions?: VirtualAccountsClient.RequestOptions): core.HttpResponsePromise { + public createOrUpdate( + request: TrueFoundry.ApplyVirtualAccountRequest, + requestOptions?: VirtualAccountsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__createOrUpdate(request, requestOptions)); } - private async __createOrUpdate(request: TrueFoundry.ApplyVirtualAccountRequest, requestOptions?: VirtualAccountsClient.RequestOptions): Promise> { + private async __createOrUpdate( + request: TrueFoundry.ApplyVirtualAccountRequest, + requestOptions?: VirtualAccountsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/virtual-accounts"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/virtual-accounts", + ), method: "PUT", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.ApplyVirtualAccountRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.ApplyVirtualAccountRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetVirtualAccountResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetVirtualAccountResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 400: throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); - case 422: throw new TrueFoundry.UnprocessableEntityError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 400: + throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); + case 422: + throw new TrueFoundry.UnprocessableEntityError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -149,19 +240,35 @@ export class VirtualAccountsClient { * @param {VirtualAccountsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.virtualAccounts.get("jqfwg345gi25n5ju2yz5iz6m") */ - public get(id: string, requestOptions?: VirtualAccountsClient.RequestOptions): core.HttpResponsePromise { + public get( + id: string, + requestOptions?: VirtualAccountsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions)); } - private async __get(id: string, requestOptions?: VirtualAccountsClient.RequestOptions): Promise> { + private async __get( + id: string, + requestOptions?: VirtualAccountsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/virtual-accounts/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/virtual-accounts/${core.url.encodePathParam(id)}`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -169,24 +276,40 @@ export class VirtualAccountsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetVirtualAccountResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetVirtualAccountResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/virtual-accounts/{id}"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/virtual-accounts/{id}", + ); } /** @@ -196,19 +319,35 @@ export class VirtualAccountsClient { * @param {VirtualAccountsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.virtualAccounts.delete("jqfwg345gi25n5ju2yz5iz6m") */ - public delete(id: string, requestOptions?: VirtualAccountsClient.RequestOptions): core.HttpResponsePromise { + public delete( + id: string, + requestOptions?: VirtualAccountsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions)); } - private async __delete(id: string, requestOptions?: VirtualAccountsClient.RequestOptions): Promise> { + private async __delete( + id: string, + requestOptions?: VirtualAccountsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/virtual-accounts/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/virtual-accounts/${core.url.encodePathParam(id)}`, + ), method: "DELETE", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -216,24 +355,40 @@ export class VirtualAccountsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.DeleteVirtualAccountResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.DeleteVirtualAccountResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/api/svc/v1/virtual-accounts/{id}"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/api/svc/v1/virtual-accounts/{id}", + ); } /** @@ -243,19 +398,35 @@ export class VirtualAccountsClient { * @param {VirtualAccountsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.virtualAccounts.getToken("jqfwg345gi25n5ju2yz5iz6m") */ - public getToken(id: string, requestOptions?: VirtualAccountsClient.RequestOptions): core.HttpResponsePromise { + public getToken( + id: string, + requestOptions?: VirtualAccountsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__getToken(id, requestOptions)); } - private async __getToken(id: string, requestOptions?: VirtualAccountsClient.RequestOptions): Promise> { + private async __getToken( + id: string, + requestOptions?: VirtualAccountsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/virtual-accounts/${core.url.encodePathParam(id)}/token`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/virtual-accounts/${core.url.encodePathParam(id)}/token`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -263,24 +434,40 @@ export class VirtualAccountsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetTokenForVirtualAccountResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetTokenForVirtualAccountResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/virtual-accounts/{id}/token"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/virtual-accounts/{id}/token", + ); } /** @@ -291,19 +478,35 @@ export class VirtualAccountsClient { * * @throws {@link TrueFoundry.BadRequestError} * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.virtualAccounts.syncToSecretStore("jqfwg345gi25n5ju2yz5iz6m") */ - public syncToSecretStore(id: string, requestOptions?: VirtualAccountsClient.RequestOptions): core.HttpResponsePromise { + public syncToSecretStore( + id: string, + requestOptions?: VirtualAccountsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__syncToSecretStore(id, requestOptions)); } - private async __syncToSecretStore(id: string, requestOptions?: VirtualAccountsClient.RequestOptions): Promise> { + private async __syncToSecretStore( + id: string, + requestOptions?: VirtualAccountsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/virtual-accounts/${core.url.encodePathParam(id)}/sync-to-secret-store`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/virtual-accounts/${core.url.encodePathParam(id)}/sync-to-secret-store`, + ), method: "POST", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -311,25 +514,42 @@ export class VirtualAccountsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.SyncVirtualAccountTokenResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.SyncVirtualAccountTokenResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 400: throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 400: + throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/svc/v1/virtual-accounts/{id}/sync-to-secret-store"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/api/svc/v1/virtual-accounts/{id}/sync-to-secret-store", + ); } /** @@ -340,49 +560,91 @@ export class VirtualAccountsClient { * @param {VirtualAccountsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.virtualAccounts.regenerateToken("jqfwg345gi25n5ju2yz5iz6m", { * gracePeriodInDays: 30 * }) */ - public regenerateToken(id: string, request: TrueFoundry.RegenerateVirtualAccountTokenRequest, requestOptions?: VirtualAccountsClient.RequestOptions): core.HttpResponsePromise { + public regenerateToken( + id: string, + request: TrueFoundry.RegenerateVirtualAccountTokenRequest, + requestOptions?: VirtualAccountsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__regenerateToken(id, request, requestOptions)); } - private async __regenerateToken(id: string, request: TrueFoundry.RegenerateVirtualAccountTokenRequest, requestOptions?: VirtualAccountsClient.RequestOptions): Promise> { + private async __regenerateToken( + id: string, + request: TrueFoundry.RegenerateVirtualAccountTokenRequest, + requestOptions?: VirtualAccountsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/virtual-accounts/${core.url.encodePathParam(id)}/regenerate-token`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/virtual-accounts/${core.url.encodePathParam(id)}/regenerate-token`, + ), method: "POST", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.RegenerateVirtualAccountTokenRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.RegenerateVirtualAccountTokenRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetTokenForVirtualAccountResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetTokenForVirtualAccountResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/api/svc/v1/virtual-accounts/{id}/regenerate-token"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "POST", + "/api/svc/v1/virtual-accounts/{id}/regenerate-token", + ); } /** @@ -392,18 +654,37 @@ export class VirtualAccountsClient { * @param {string} jwtId - System-generated JWT ID to delete. * @param {VirtualAccountsClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.virtualAccounts.deleteJwt("jqfwg345gi25n5ju2yz5iz6m", "jwt_abc123def456") */ - public deleteJwt(id: string, jwtId: string, requestOptions?: VirtualAccountsClient.RequestOptions): core.HttpResponsePromise { + public deleteJwt( + id: string, + jwtId: string, + requestOptions?: VirtualAccountsClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__deleteJwt(id, jwtId, requestOptions)); } - private async __deleteJwt(id: string, jwtId: string, requestOptions?: VirtualAccountsClient.RequestOptions): Promise> { + private async __deleteJwt( + id: string, + jwtId: string, + requestOptions?: VirtualAccountsClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/virtual-accounts/${core.url.encodePathParam(id)}/jwt/${core.url.encodePathParam(jwtId)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/virtual-accounts/${core.url.encodePathParam(id)}/jwt/${core.url.encodePathParam(jwtId)}`, + ), method: "DELETE", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -411,7 +692,7 @@ export class VirtualAccountsClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { return { data: undefined, rawResponse: _response.rawResponse }; @@ -421,10 +702,15 @@ export class VirtualAccountsClient { throw new errors.TrueFoundryError({ statusCode: _response.error.statusCode, body: _response.error.body, - rawResponse: _response.rawResponse + rawResponse: _response.rawResponse, }); } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/api/svc/v1/virtual-accounts/{id}/jwt/{jwtId}"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/api/svc/v1/virtual-accounts/{id}/jwt/{jwtId}", + ); } } diff --git a/src/api/resources/virtualAccounts/client/requests/ApplyVirtualAccountRequest.ts b/src/api/resources/virtualAccounts/client/requests/ApplyVirtualAccountRequest.ts index 2b72007a..10253932 100644 --- a/src/api/resources/virtualAccounts/client/requests/ApplyVirtualAccountRequest.ts +++ b/src/api/resources/virtualAccounts/client/requests/ApplyVirtualAccountRequest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../index.js"; +import type * as TrueFoundry from "../../../../index.js"; /** * @example @@ -20,5 +20,5 @@ export interface ApplyVirtualAccountRequest { /** The virtual account manifest describing the virtual account to create or update. */ manifest: TrueFoundry.VirtualAccountManifest; /** When true, validate the request without persisting any changes. */ - dryRun?: boolean; + dryRun?: boolean | null; } diff --git a/src/api/resources/virtualAccounts/client/requests/VirtualAccountsListRequest.ts b/src/api/resources/virtualAccounts/client/requests/ListVirtualAccountsRequest.ts similarity index 73% rename from src/api/resources/virtualAccounts/client/requests/VirtualAccountsListRequest.ts rename to src/api/resources/virtualAccounts/client/requests/ListVirtualAccountsRequest.ts index 5614c159..731d3a65 100644 --- a/src/api/resources/virtualAccounts/client/requests/VirtualAccountsListRequest.ts +++ b/src/api/resources/virtualAccounts/client/requests/ListVirtualAccountsRequest.ts @@ -6,22 +6,20 @@ * limit: 10, * offset: 0, * nameSearchQuery: "staging-bot", - * ownedByTeams: ["ownedByTeams"], - * isExpired: true, * filter: "{\"type\":\"AND\",\"children\":[{\"column\":\"name\",\"op\":\"STRING_CONTAINS\",\"value\":\"bot\"}]}" * } */ -export interface VirtualAccountsListRequest { +export interface ListVirtualAccountsRequest { /** Number of items per page */ - limit?: number; + limit?: number | null; /** Number of items to skip */ - offset?: number; + offset?: number | null; /** Return virtual accounts with names that contain this string. */ - nameSearchQuery?: string; + nameSearchQuery?: string | null; /** Comma-separated team names. Return virtual accounts owned by these teams. */ - ownedByTeams?: string | string[]; + ownedByTeams?: string[] | null; /** Filter by expiration status. `true` = expired only, `false` = not expired only. */ - isExpired?: boolean; + isExpired?: boolean | null; /** JSON string: structured filter tree (AND/OR groups, column leaves on `name`, json_map leaves on `manifest.tags`). */ - filter?: string; + filter?: string | null; } diff --git a/src/api/resources/virtualAccounts/client/requests/index.ts b/src/api/resources/virtualAccounts/client/requests/index.ts index 4fadc202..2de8bcf9 100644 --- a/src/api/resources/virtualAccounts/client/requests/index.ts +++ b/src/api/resources/virtualAccounts/client/requests/index.ts @@ -1,3 +1,3 @@ export type { ApplyVirtualAccountRequest } from "./ApplyVirtualAccountRequest.js"; +export type { ListVirtualAccountsRequest } from "./ListVirtualAccountsRequest.js"; export type { RegenerateVirtualAccountTokenRequest } from "./RegenerateVirtualAccountTokenRequest.js"; -export type { VirtualAccountsListRequest } from "./VirtualAccountsListRequest.js"; diff --git a/src/api/resources/workspaces/client/Client.ts b/src/api/resources/workspaces/client/Client.ts index b80ec27b..47036149 100644 --- a/src/api/resources/workspaces/client/Client.ts +++ b/src/api/resources/workspaces/client/Client.ts @@ -1,9 +1,11 @@ // This file was auto-generated by Fern from our API Definition. import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; -import { normalizeClientOptionsWithAuth, type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; -import * as core from "../../../../core/index.js"; +import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient.js"; import { mergeHeaders } from "../../../../core/headers.js"; +import * as core from "../../../../core/index.js"; +import { toJson } from "../../../../core/json.js"; +import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.js"; import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js"; import * as errors from "../../../../errors/index.js"; import * as serializers from "../../../../serialization/index.js"; @@ -12,73 +14,115 @@ import * as TrueFoundry from "../../../index.js"; export declare namespace WorkspacesClient { export type Options = BaseClientOptions; - export interface RequestOptions extends BaseRequestOptions { - } + export interface RequestOptions extends BaseRequestOptions {} } export class WorkspacesClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options: WorkspacesClient.Options) { - - - this._options = normalizeClientOptionsWithAuth(options); - + this._options = normalizeClientOptionsWithAuth(options); } /** * List workspaces the caller can read. * - * @param {TrueFoundry.WorkspacesListRequest} request + * @param {TrueFoundry.ListWorkspacesRequest} request * @param {WorkspacesClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.workspaces.list({ * limit: 10, * offset: 0, - * clusterId: "jqfwg345gi25n5ju2yz5iz6m", - * name: "name", - * fqn: "fqn", - * includeCluster: true, - * attributes: ["attributes"] + * clusterId: "jqfwg345gi25n5ju2yz5iz6m" * }) */ - public async list(request: TrueFoundry.WorkspacesListRequest = {}, requestOptions?: WorkspacesClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.WorkspacesListRequest): Promise> => { const { limit = 100, offset = 0, clusterId, name, fqn, includeCluster, attributes } = request; const _queryParams: Record = { - limit, - offset, - clusterId, - name, - fqn, - includeCluster, - attributes - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/workspaces"), - method: "GET", - headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.ListWorkspacesResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/workspaces"); }); + public async list( + request: TrueFoundry.ListWorkspacesRequest = {}, + requestOptions?: WorkspacesClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.ListWorkspacesRequest, + ): Promise> => { + const { limit = 100, offset = 0, clusterId, name, fqn, includeCluster, attributes } = request; + const _queryParams: Record = { + limit, + offset, + clusterId, + name, + fqn, + includeCluster, + attributes: attributes !== undefined ? toJson(attributes) : undefined, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/workspaces", + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ListWorkspacesResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/workspaces", + ); + }, + ); let _offset = request?.offset != null ? request?.offset : 0; const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => (response?.data ?? []).length > 0 && (request?.limit == null || (response?.data ?? []).length >= request?.limit), - getItems: response => response?.data ?? [], - loadPage: response => { _offset += response?.data != null ? response.data.length : 1; return list(core.setObjectProperty(request, "offset", _offset)); } + hasNextPage: (response) => + (response?.data ?? []).length > 0 && + (request?.limit == null || (response?.data ?? []).length >= request?.limit), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + _offset += response?.data != null ? response.data.length : 1; + return list(core.setObjectProperty(request, "offset", _offset)); + }, }); } @@ -92,6 +136,8 @@ export class WorkspacesClient { * @throws {@link TrueFoundry.ForbiddenError} * @throws {@link TrueFoundry.NotFoundError} * @throws {@link TrueFoundry.UnprocessableEntityError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.workspaces.createOrUpdate({ @@ -102,42 +148,96 @@ export class WorkspacesClient { * } * }) */ - public createOrUpdate(request: TrueFoundry.CreateOrUpdateWorkspaceRequest, requestOptions?: WorkspacesClient.RequestOptions): core.HttpResponsePromise { + public createOrUpdate( + request: TrueFoundry.CreateOrUpdateWorkspaceRequest, + requestOptions?: WorkspacesClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__createOrUpdate(request, requestOptions)); } - private async __createOrUpdate(request: TrueFoundry.CreateOrUpdateWorkspaceRequest, requestOptions?: WorkspacesClient.RequestOptions): Promise> { + private async __createOrUpdate( + request: TrueFoundry.CreateOrUpdateWorkspaceRequest, + requestOptions?: WorkspacesClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/workspaces"), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/workspaces", + ), method: "PUT", headers: _headers, contentType: "application/json", queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", - body: serializers.CreateOrUpdateWorkspaceRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, omitUndefined: true }), + body: mergeAdditionalBodyParameters( + serializers.CreateOrUpdateWorkspaceRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + omitUndefined: true, + }), + requestOptions?.additionalBodyParameters, + ), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetWorkspaceResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetWorkspaceResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 400: throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); - case 403: throw new TrueFoundry.ForbiddenError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - case 422: throw new TrueFoundry.UnprocessableEntityError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 400: + throw new TrueFoundry.BadRequestError(_response.error.body, _response.rawResponse); + case 403: + throw new TrueFoundry.ForbiddenError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + case 422: + throw new TrueFoundry.UnprocessableEntityError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -147,50 +247,99 @@ export class WorkspacesClient { /** * Search workspaces using a structured filter expression. Return a paginated list of workspaces matching the filter criteria. * - * @param {TrueFoundry.WorkspacesSearchRequest} request + * @param {TrueFoundry.SearchWorkspacesRequest} request * @param {WorkspacesClient.RequestOptions} requestOptions - Request-specific configuration. * + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} + * * @example * await client.workspaces.search({ * limit: 10, * offset: 0, - * filter: "[{\"type\":\"name\",\"operator\":\"STRING_CONTAINS\",\"value\":\"prod\"}]", - * includeCluster: true + * filter: "[{\"type\":\"name\",\"operator\":\"STRING_CONTAINS\",\"value\":\"prod\"}]" * }) */ - public async search(request: TrueFoundry.WorkspacesSearchRequest = {}, requestOptions?: WorkspacesClient.RequestOptions): Promise> { - const list = core.HttpResponsePromise.interceptFunction(async (request: TrueFoundry.WorkspacesSearchRequest): Promise> => { const { limit = 100, offset = 0, filter, includeCluster } = request; const _queryParams: Record = { - limit, - offset, - filter, - includeCluster - }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), "api/svc/v1/workspaces/search"), - method: "GET", - headers: _headers, - queryString: core.url.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging - }); if (_response.ok) { - return { data: serializers.ListWorkspacesResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; - } if (_response.error.reason === "status-code") { - throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/api/svc/v1/workspaces/search"); }); + public async search( + request: TrueFoundry.SearchWorkspacesRequest = {}, + requestOptions?: WorkspacesClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: TrueFoundry.SearchWorkspacesRequest, + ): Promise> => { + const { limit = 100, offset = 0, filter, includeCluster } = request; + const _queryParams: Record = { + limit, + offset, + filter, + includeCluster, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + "api/svc/v1/workspaces/search", + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ListWorkspacesResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/api/svc/v1/workspaces/search", + ); + }, + ); let _offset = request?.offset != null ? request?.offset : 0; const dataWithRawResponse = await list(request).withRawResponse(); return new core.Page({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: response => (response?.data ?? []).length > 0 && (request?.limit == null || (response?.data ?? []).length >= request?.limit), - getItems: response => response?.data ?? [], - loadPage: response => { _offset += response?.data != null ? response.data.length : 1; return list(core.setObjectProperty(request, "offset", _offset)); } + hasNextPage: (response) => + (response?.data ?? []).length > 0 && + (request?.limit == null || (response?.data ?? []).length >= request?.limit), + getItems: (response) => response?.data ?? [], + loadPage: (response) => { + _offset += response?.data != null ? response.data.length : 1; + return list(core.setObjectProperty(request, "offset", _offset)); + }, }); } @@ -201,19 +350,35 @@ export class WorkspacesClient { * @param {WorkspacesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link TrueFoundry.NotFoundError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.workspaces.get("jqfwg345gi25n5ju2yz5iz6m") */ - public get(id: string, requestOptions?: WorkspacesClient.RequestOptions): core.HttpResponsePromise { + public get( + id: string, + requestOptions?: WorkspacesClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(id, requestOptions)); } - private async __get(id: string, requestOptions?: WorkspacesClient.RequestOptions): Promise> { + private async __get( + id: string, + requestOptions?: WorkspacesClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/workspaces/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/workspaces/${core.url.encodePathParam(id)}`, + ), method: "GET", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -221,20 +386,31 @@ export class WorkspacesClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.GetWorkspaceResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.GetWorkspaceResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } @@ -249,19 +425,35 @@ export class WorkspacesClient { * * @throws {@link TrueFoundry.NotFoundError} * @throws {@link TrueFoundry.ExpectationFailedError} + * @throws {@link errors.TrueFoundryError} + * @throws {@link errors.TrueFoundryTimeoutError} * * @example * await client.workspaces.delete("jqfwg345gi25n5ju2yz5iz6m") */ - public delete(id: string, requestOptions?: WorkspacesClient.RequestOptions): core.HttpResponsePromise { + public delete( + id: string, + requestOptions?: WorkspacesClient.RequestOptions, + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions)); } - private async __delete(id: string, requestOptions?: WorkspacesClient.RequestOptions): Promise> { + private async __delete( + id: string, + requestOptions?: WorkspacesClient.RequestOptions, + ): Promise> { const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - let _headers: core.Fetcher.Args["headers"] = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join(await core.Supplier.get(this._options.baseUrl) ?? await core.Supplier.get(this._options.environment), `api/svc/v1/workspaces/${core.url.encodePathParam(id)}`), + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)), + `api/svc/v1/workspaces/${core.url.encodePathParam(id)}`, + ), method: "DELETE", headers: _headers, queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), @@ -269,24 +461,50 @@ export class WorkspacesClient { maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, fetchFn: this._options?.fetch, - logging: this._options.logging + logging: this._options.logging, }); if (_response.ok) { - return { data: serializers.DeleteWorkspaceResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), rawResponse: _response.rawResponse }; + return { + data: serializers.DeleteWorkspaceResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; } if (_response.error.reason === "status-code") { switch (_response.error.statusCode) { - case 404: throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); - case 417: throw new TrueFoundry.ExpectationFailedError(serializers.HttpError.parseOrThrow(_response.error.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, skipValidation: true, breadcrumbsPrefix: ["response"] }), _response.rawResponse); - default: throw new errors.TrueFoundryError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); + case 404: + throw new TrueFoundry.NotFoundError(_response.error.body, _response.rawResponse); + case 417: + throw new TrueFoundry.ExpectationFailedError( + serializers.HttpError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.TrueFoundryError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); } } - return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/api/svc/v1/workspaces/{id}"); + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "DELETE", + "/api/svc/v1/workspaces/{id}", + ); } } diff --git a/src/api/resources/workspaces/client/requests/CreateOrUpdateWorkspaceRequest.ts b/src/api/resources/workspaces/client/requests/CreateOrUpdateWorkspaceRequest.ts index 17273f2b..324c56a5 100644 --- a/src/api/resources/workspaces/client/requests/CreateOrUpdateWorkspaceRequest.ts +++ b/src/api/resources/workspaces/client/requests/CreateOrUpdateWorkspaceRequest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../index.js"; +import type * as TrueFoundry from "../../../../index.js"; /** * @example @@ -16,5 +16,5 @@ export interface CreateOrUpdateWorkspaceRequest { /** Workspace manifest */ manifest: TrueFoundry.WorkspaceManifest; /** When true, validates the request without persisting changes. */ - dryRun?: boolean; + dryRun?: boolean | null; } diff --git a/src/api/resources/workspaces/client/requests/WorkspacesListRequest.ts b/src/api/resources/workspaces/client/requests/ListWorkspacesRequest.ts similarity index 62% rename from src/api/resources/workspaces/client/requests/WorkspacesListRequest.ts rename to src/api/resources/workspaces/client/requests/ListWorkspacesRequest.ts index f65928ca..2c8c6940 100644 --- a/src/api/resources/workspaces/client/requests/WorkspacesListRequest.ts +++ b/src/api/resources/workspaces/client/requests/ListWorkspacesRequest.ts @@ -5,26 +5,22 @@ * { * limit: 10, * offset: 0, - * clusterId: "jqfwg345gi25n5ju2yz5iz6m", - * name: "name", - * fqn: "fqn", - * includeCluster: true, - * attributes: ["attributes"] + * clusterId: "jqfwg345gi25n5ju2yz5iz6m" * } */ -export interface WorkspacesListRequest { +export interface ListWorkspacesRequest { /** Number of items per page */ - limit?: number; + limit?: number | null; /** Number of items to skip */ - offset?: number; + offset?: number | null; /** System-generated cluster ID to filter by. */ - clusterId?: string; + clusterId?: string | null; /** Filter workspaces by exact name match. */ - name?: string; + name?: string | null; /** Human-readable Fully Qualified Name to filter by. */ - fqn?: string; + fqn?: string | null; /** When true, each workspace in the response includes summary information about its cluster. */ - includeCluster?: boolean; + includeCluster?: boolean | null; /** Comma-separated list of attributes to return (e.g. id,name). When provided, only the specified fields are fetched. `id` is always included. */ - attributes?: string | string[]; + attributes?: string[] | null; } diff --git a/src/api/resources/workspaces/client/requests/WorkspacesSearchRequest.ts b/src/api/resources/workspaces/client/requests/SearchWorkspacesRequest.ts similarity index 75% rename from src/api/resources/workspaces/client/requests/WorkspacesSearchRequest.ts rename to src/api/resources/workspaces/client/requests/SearchWorkspacesRequest.ts index 9a121586..0e2b5285 100644 --- a/src/api/resources/workspaces/client/requests/WorkspacesSearchRequest.ts +++ b/src/api/resources/workspaces/client/requests/SearchWorkspacesRequest.ts @@ -5,17 +5,16 @@ * { * limit: 10, * offset: 0, - * filter: "[{\"type\":\"name\",\"operator\":\"STRING_CONTAINS\",\"value\":\"prod\"}]", - * includeCluster: true + * filter: "[{\"type\":\"name\",\"operator\":\"STRING_CONTAINS\",\"value\":\"prod\"}]" * } */ -export interface WorkspacesSearchRequest { +export interface SearchWorkspacesRequest { /** Number of items per page */ - limit?: number; + limit?: number | null; /** Number of items to skip */ - offset?: number; + offset?: number | null; /** JSON-encoded filter string for structured search. Supported fields: name, id, environmentId, cluster_fqn. Supported operators: STRING_CONTAINS, STRING_STARTS_WITH, STRING_ENDS_WITH, EQUAL, IN, NOT_IN, IS_NULL. */ - filter?: string; + filter?: string | null; /** When true, each workspace in the response includes summary information about its cluster. */ - includeCluster?: boolean; + includeCluster?: boolean | null; } diff --git a/src/api/resources/workspaces/client/requests/index.ts b/src/api/resources/workspaces/client/requests/index.ts index f448fb9b..d6310d30 100644 --- a/src/api/resources/workspaces/client/requests/index.ts +++ b/src/api/resources/workspaces/client/requests/index.ts @@ -1,3 +1,3 @@ export type { CreateOrUpdateWorkspaceRequest } from "./CreateOrUpdateWorkspaceRequest.js"; -export type { WorkspacesListRequest } from "./WorkspacesListRequest.js"; -export type { WorkspacesSearchRequest } from "./WorkspacesSearchRequest.js"; +export type { ListWorkspacesRequest } from "./ListWorkspacesRequest.js"; +export type { SearchWorkspacesRequest } from "./SearchWorkspacesRequest.js"; diff --git a/src/api/types/Account.ts b/src/api/types/Account.ts index e2cb869c..a4917c3d 100644 --- a/src/api/types/Account.ts +++ b/src/api/types/Account.ts @@ -1,17 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface Account { /** System-generated account ID. */ - id?: string; + id?: string | null; tenantName: string; /** Human-readable Fully Qualified Name of the account. */ fqn: string; /** Account manifest */ manifest: Record; createdBySubject: TrueFoundry.Subject; - createdAt?: Date; - updatedAt?: Date; + createdAt?: Date | null; + updatedAt?: Date | null; isEditable: boolean; } diff --git a/src/api/types/ActivateUserResponse.ts b/src/api/types/ActivateUserResponse.ts index 77085162..3d60fab1 100644 --- a/src/api/types/ActivateUserResponse.ts +++ b/src/api/types/ActivateUserResponse.ts @@ -1,4 +1,3 @@ // This file was auto-generated by Fern from our API Definition. -export interface ActivateUserResponse { -} +export type ActivateUserResponse = {}; diff --git a/src/api/types/AddonComponent.ts b/src/api/types/AddonComponent.ts index dacc6619..61a6c1f1 100644 --- a/src/api/types/AddonComponent.ts +++ b/src/api/types/AddonComponent.ts @@ -1,29 +1,29 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface AddonComponent { name: TrueFoundry.AddonComponentName; - appName?: string; - namespace?: string; - applicationId?: string; - description?: string; - path?: string; - addonFolder?: string; - installed?: boolean; - status?: TrueFoundry.AddonComponentStatus; - version?: string; - manifest?: Record; - installationSource?: string; - unsupportedClusterTypes?: TrueFoundry.ClusterType[]; - required?: boolean; - knownCrDs?: string[]; - source?: TrueFoundry.AddOnComponentSource; - upgrades?: TrueFoundry.UpgradeData; - labels?: string[]; + appName?: string | null; + namespace?: string | null; + applicationId?: string | null; + description?: string | null; + path?: string | null; + addonFolder?: string | null; + installed?: boolean | null; + status?: TrueFoundry.AddonComponentStatus | null; + version?: string | null; + manifest?: Record | null; + installationSource?: string | null; + unsupportedClusterTypes?: TrueFoundry.ClusterType[] | null; + required?: boolean | null; + knownCrDs?: string[] | null; + source?: TrueFoundry.AddOnComponentSource | null; + upgrades?: TrueFoundry.UpgradeData | null; + labels?: string[] | null; /** Recommendations */ - recommendations?: TrueFoundry.Recommendation[]; - workspaceId?: string; + recommendations?: TrueFoundry.Recommendation[] | null; + workspaceId?: string | null; /** Addon metadata. autopilotEnabled is true when the backing addon application has autopilot enabled; otherwise false. */ - metadata?: Record; + metadata?: Record | null; } diff --git a/src/api/types/AddonComponentName.ts b/src/api/types/AddonComponentName.ts index df9ca759..9b18dc0c 100644 --- a/src/api/types/AddonComponentName.ts +++ b/src/api/types/AddonComponentName.ts @@ -1,32 +1,32 @@ // This file was auto-generated by Fern from our API Definition. export const AddonComponentName = { - Argocd: "ARGOCD", - ArgoRollout: "ARGO_ROLLOUT", - ArgoWorkflow: "ARGO_WORKFLOW", - TfyAgent: "TFY_AGENT", - IstioBase: "ISTIO_BASE", - IstioDiscovery: "ISTIO_DISCOVERY", - TfyIstioIngress: "TFY_ISTIO_INGRESS", - AwsLoadBalancerController: "AWS_LOAD_BALANCER_CONTROLLER", - CertManager: "CERT_MANAGER", - Karpenter: "KARPENTER", - KarpenterConfig: "KARPENTER_CONFIG", - Prometheus: "PROMETHEUS", - MetricsServer: "METRICS_SERVER", - Kubecost: "KUBECOST", - Keda: "KEDA", - AwsEfsCsiDriver: "AWS_EFS_CSI_DRIVER", - AwsEbsCsiDriver: "AWS_EBS_CSI_DRIVER", - TfyGpuOperator: "TFY_GPU_OPERATOR", - TfyInferentiaOperator: "TFY_INFERENTIA_OPERATOR", - Elasti: "ELASTI", - TfyWorkflowPropeller: "TFY_WORKFLOW_PROPELLER", - Grafana: "GRAFANA", - Truefoundry: "TRUEFOUNDRY", - TfyPrometheusConfig: "TFY_PROMETHEUS_CONFIG", - SparkOperator: "SPARK_OPERATOR", - TfyLogs: "TFY_LOGS", - TfyCertManagerConfig: "TFY_CERT_MANAGER_CONFIG" - } as const; -export type AddonComponentName = typeof AddonComponentName[keyof typeof AddonComponentName]; + Argocd: "ARGOCD", + ArgoRollout: "ARGO_ROLLOUT", + ArgoWorkflow: "ARGO_WORKFLOW", + TfyAgent: "TFY_AGENT", + IstioBase: "ISTIO_BASE", + IstioDiscovery: "ISTIO_DISCOVERY", + TfyIstioIngress: "TFY_ISTIO_INGRESS", + AwsLoadBalancerController: "AWS_LOAD_BALANCER_CONTROLLER", + CertManager: "CERT_MANAGER", + Karpenter: "KARPENTER", + KarpenterConfig: "KARPENTER_CONFIG", + Prometheus: "PROMETHEUS", + MetricsServer: "METRICS_SERVER", + Kubecost: "KUBECOST", + Keda: "KEDA", + AwsEfsCsiDriver: "AWS_EFS_CSI_DRIVER", + AwsEbsCsiDriver: "AWS_EBS_CSI_DRIVER", + TfyGpuOperator: "TFY_GPU_OPERATOR", + TfyInferentiaOperator: "TFY_INFERENTIA_OPERATOR", + Elasti: "ELASTI", + TfyWorkflowPropeller: "TFY_WORKFLOW_PROPELLER", + Grafana: "GRAFANA", + Truefoundry: "TRUEFOUNDRY", + TfyPrometheusConfig: "TFY_PROMETHEUS_CONFIG", + SparkOperator: "SPARK_OPERATOR", + TfyLogs: "TFY_LOGS", + TfyCertManagerConfig: "TFY_CERT_MANAGER_CONFIG", +} as const; +export type AddonComponentName = (typeof AddonComponentName)[keyof typeof AddonComponentName]; diff --git a/src/api/types/AddonComponentStatus.ts b/src/api/types/AddonComponentStatus.ts index b732fd53..3cf8c0f2 100644 --- a/src/api/types/AddonComponentStatus.ts +++ b/src/api/types/AddonComponentStatus.ts @@ -2,9 +2,9 @@ export interface AddonComponentStatus { /** Health status of the addon */ - healthStatus?: string; + healthStatus?: string | null; /** Sync status of the addon */ - syncStatus?: string; + syncStatus?: string | null; /** Indicates whether the addon is installed */ installed: boolean; } diff --git a/src/api/types/Agent.ts b/src/api/types/Agent.ts index 397d0f6c..29a00703 100644 --- a/src/api/types/Agent.ts +++ b/src/api/types/Agent.ts @@ -1,10 +1,10 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface Agent { /** System-generated agent ID. */ - id?: string; + id?: string | null; name: string; /** Human-readable Fully Qualified Name of the agent. */ fqn: string; @@ -12,7 +12,11 @@ export interface Agent { accountId: string; latestVersion: number; type: string; - latestVersionDetails?: TrueFoundry.AgentVersion; + latestVersionDetails?: TrueFoundry.AgentVersion | null; createdBySubject: TrueFoundry.Subject; - createdBy?: string; + /** Copy of the agent manifest (v2). */ + manifest?: Record | null; + /** ID of the agent identity created for this agent. */ + agentIdentityId?: string | null; + createdBy?: string | null; } diff --git a/src/api/types/AgentChannel.ts b/src/api/types/AgentChannel.ts new file mode 100644 index 00000000..ba1d958f --- /dev/null +++ b/src/api/types/AgentChannel.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +export interface AgentChannel { + /** System-generated agent channel id. */ + id: string; + manifest: Record; + createdBySubject: TrueFoundry.Subject; + createdAt?: Date | null; + updatedAt?: Date | null; +} diff --git a/src/api/types/AgentChannelAgent.ts b/src/api/types/AgentChannelAgent.ts new file mode 100644 index 00000000..1dde1a4b --- /dev/null +++ b/src/api/types/AgentChannelAgent.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Agent + */ +export interface AgentChannelAgent { + /** The name of the agent this channel routes messages to. */ + name: string; +} diff --git a/src/api/types/AgentChannelConfig.ts b/src/api/types/AgentChannelConfig.ts new file mode 100644 index 00000000..efea65f9 --- /dev/null +++ b/src/api/types/AgentChannelConfig.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +export type AgentChannelConfig = TrueFoundry.AgentChannelSlackConfig; diff --git a/src/api/types/AgentChannelManifest.ts b/src/api/types/AgentChannelManifest.ts new file mode 100644 index 00000000..1bffcf79 --- /dev/null +++ b/src/api/types/AgentChannelManifest.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +/** + * Expose an agent over a chat channel (e.g. Slack) with no integration code. + */ +export interface AgentChannelManifest { + /** +value=agent-channel */ + type: "agent-channel"; + /** The name of the agent channel. */ + name: string; + agent: TrueFoundry.AgentChannelAgent; + channel: TrueFoundry.AgentChannelConfig; +} diff --git a/src/api/types/AgentChannelSlackAuth.ts b/src/api/types/AgentChannelSlackAuth.ts new file mode 100644 index 00000000..68254113 --- /dev/null +++ b/src/api/types/AgentChannelSlackAuth.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +export type AgentChannelSlackAuth = TrueFoundry.AgentChannelSlackBotTokenAuth; diff --git a/src/api/types/AgentChannelSlackBotTokenAuth.ts b/src/api/types/AgentChannelSlackBotTokenAuth.ts new file mode 100644 index 00000000..082f70e7 --- /dev/null +++ b/src/api/types/AgentChannelSlackBotTokenAuth.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Provide the Slack bot token directly. + */ +export interface AgentChannelSlackBotTokenAuth { + /** + * +value=bot-token + * +uiType=Hidden + */ + type: "bot-token"; + /** Slack bot token (xoxb-…) used to post replies. Requires chat:write, chat:write.public. */ + botToken: string; +} diff --git a/src/api/types/AgentChannelSlackConfig.ts b/src/api/types/AgentChannelSlackConfig.ts new file mode 100644 index 00000000..9a466812 --- /dev/null +++ b/src/api/types/AgentChannelSlackConfig.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +/** + * Reach the agent from a Slack app (one Slack app per channel). + */ +export interface AgentChannelSlackConfig { + /** + * +uiType=Hidden + * +value=slack + */ + type: "slack"; + /** The Slack app id (api_app_id). Inbound events are routed to this channel by app id. */ + appId: string; + /** Slack app signing secret, used to verify inbound event request signatures. App-level; common to all auth methods. */ + signingSecret: string; + auth: TrueFoundry.AgentChannelSlackAuth; +} diff --git a/src/api/types/AgentFramework.ts b/src/api/types/AgentFramework.ts index d7b8010d..19803446 100644 --- a/src/api/types/AgentFramework.ts +++ b/src/api/types/AgentFramework.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +discriminator=type */ -export type AgentFramework = - | TrueFoundry.A2AFramework - | TrueFoundry.CustomFramework; +export type AgentFramework = TrueFoundry.A2AFramework | TrueFoundry.CustomFramework; diff --git a/src/api/types/AgentIdentity.ts b/src/api/types/AgentIdentity.ts new file mode 100644 index 00000000..138368b7 --- /dev/null +++ b/src/api/types/AgentIdentity.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +export interface AgentIdentity { + id?: string | null; + tenantName: string; + /** Agent identity manifest */ + manifest: Record; + createdBySubject: TrueFoundry.Subject; + accountId: string; + createdAt: Date; + updatedAt: Date; +} diff --git a/src/api/types/AgentIdentityConfig.ts b/src/api/types/AgentIdentityConfig.ts index 32dc6190..928144e0 100644 --- a/src/api/types/AgentIdentityConfig.ts +++ b/src/api/types/AgentIdentityConfig.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +discriminator=type */ -export type AgentIdentityConfig = - | TrueFoundry.TruefoundryBackedIdentity - | TrueFoundry.IdentityProviderBackedIdentity; +export type AgentIdentityConfig = TrueFoundry.TruefoundryBackedIdentity | TrueFoundry.IdentityProviderBackedIdentity; diff --git a/src/api/types/AgentIdentityManifest.ts b/src/api/types/AgentIdentityManifest.ts index 767b5f03..a9b503be 100644 --- a/src/api/types/AgentIdentityManifest.ts +++ b/src/api/types/AgentIdentityManifest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface AgentIdentityManifest { /** Agent Identity Name */ @@ -10,5 +10,5 @@ export interface AgentIdentityManifest { identity: TrueFoundry.AgentIdentityConfig; /** Key-value pairs to categorize this Agent Identity (e.g., by owner or environment). */ tags?: Record; - ownedBy: TrueFoundry.AgentIdentityOwnedBy; + ownedBy?: TrueFoundry.AgentIdentityOwnedBy; } diff --git a/src/api/types/AgentManifest.ts b/src/api/types/AgentManifest.ts index c149a186..9fe05702 100644 --- a/src/api/types/AgentManifest.ts +++ b/src/api/types/AgentManifest.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; -export type AgentManifest = +export type AgentManifest = | TrueFoundry.TrueFoundryAgentManifest | TrueFoundry.RemoteAgent | TrueFoundry.LegacyAgentManifest; diff --git a/src/api/types/AgentSkill.ts b/src/api/types/AgentSkill.ts index 805b30a9..ed5dfa08 100644 --- a/src/api/types/AgentSkill.ts +++ b/src/api/types/AgentSkill.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface AgentSkill { /** Unique identifier of the agent skill. */ @@ -16,9 +16,9 @@ export interface AgentSkill { /** Subject (user, team, or service account) that created the agent skill. */ createdBySubject: TrueFoundry.Subject; /** Timestamp when the agent skill was created. */ - createdAt?: Date; + createdAt?: Date | null; /** Timestamp when the agent skill was last updated. */ - updatedAt?: Date; + updatedAt?: Date | null; /** Most recently created version of the agent skill, if any exist. */ - latestVersion?: TrueFoundry.AgentSkillVersion; + latestVersion?: TrueFoundry.AgentSkillVersion | null; } diff --git a/src/api/types/AgentSkillManifest.ts b/src/api/types/AgentSkillManifest.ts index 9cf2acb6..9af3c48c 100644 --- a/src/api/types/AgentSkillManifest.ts +++ b/src/api/types/AgentSkillManifest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Agent skill version. diff --git a/src/api/types/AgentSkillManifestSource.ts b/src/api/types/AgentSkillManifestSource.ts index 28e4810d..04669bf0 100644 --- a/src/api/types/AgentSkillManifestSource.ts +++ b/src/api/types/AgentSkillManifestSource.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Source */ -export type AgentSkillManifestSource = +export type AgentSkillManifestSource = | TrueFoundry.AgentSkillSourceInline | TrueFoundry.AgentSkillSourceBlobStorage | TrueFoundry.AgentSkillSourceLocal; diff --git a/src/api/types/AgentSkillVersion.ts b/src/api/types/AgentSkillVersion.ts index ee11dfc2..5b2e0827 100644 --- a/src/api/types/AgentSkillVersion.ts +++ b/src/api/types/AgentSkillVersion.ts @@ -1,12 +1,12 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface AgentSkillVersion { /** Timestamp when the agent skill version was created. */ - createdAt?: Date; + createdAt?: Date | null; /** Timestamp when the agent skill version was last updated. */ - updatedAt?: Date; + updatedAt?: Date | null; /** Manifest describing the agent skill version. */ manifest: TrueFoundry.AgentSkillManifest; /** Unique identifier of the agent skill version. */ diff --git a/src/api/types/AgentSource.ts b/src/api/types/AgentSource.ts index 7e3d7edc..01c0fe18 100644 --- a/src/api/types/AgentSource.ts +++ b/src/api/types/AgentSource.ts @@ -1,11 +1,9 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +discriminator=type * +sort=300 */ -export type AgentSource = - | TrueFoundry.PromptSource - | TrueFoundry.HostedA2AAgent; +export type AgentSource = TrueFoundry.PromptSource | TrueFoundry.HostedA2AAgent; diff --git a/src/api/types/AgentVersion.ts b/src/api/types/AgentVersion.ts index 74a0feb4..5019ff83 100644 --- a/src/api/types/AgentVersion.ts +++ b/src/api/types/AgentVersion.ts @@ -1,10 +1,10 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface AgentVersion { /** System-generated agent version ID. */ - id?: string; + id?: string | null; agentId: string; /** Human-readable Fully Qualified Name of the agent version. */ fqn: string; @@ -12,6 +12,6 @@ export interface AgentVersion { manifest: TrueFoundry.AgentManifest; version: number; /** Optional metadata attached to the agent version. */ - metadata?: TrueFoundry.AgentVersionMetadata; - createdBySubject?: TrueFoundry.Subject; + metadata?: TrueFoundry.AgentVersionMetadata | null; + createdBySubject?: TrueFoundry.Subject | null; } diff --git a/src/api/types/AgentVersionMetadata.ts b/src/api/types/AgentVersionMetadata.ts index e6ef77c7..d9a169b9 100644 --- a/src/api/types/AgentVersionMetadata.ts +++ b/src/api/types/AgentVersionMetadata.ts @@ -2,5 +2,5 @@ export interface AgentVersionMetadata { /** Prompt template variables (variable name to default value) saved from the linked prompt version. Only set for agents with an instruction. */ - promptVariables?: Record; + promptVariables?: Record | null; } diff --git a/src/api/types/Ai21Integrations.ts b/src/api/types/Ai21Integrations.ts index 96a98a51..e3882d9f 100644 --- a/src/api/types/Ai21Integrations.ts +++ b/src/api/types/Ai21Integrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type Ai21Integrations = TrueFoundry.Ai21Model; diff --git a/src/api/types/Ai21Model.ts b/src/api/types/Ai21Model.ts index 8ff77744..6b1ef720 100644 --- a/src/api/types/Ai21Model.ts +++ b/src/api/types/Ai21Model.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * AI21 Model diff --git a/src/api/types/Ai21ProviderAccount.ts b/src/api/types/Ai21ProviderAccount.ts index 9e7f2404..8bab9cd2 100644 --- a/src/api/types/Ai21ProviderAccount.ts +++ b/src/api/types/Ai21ProviderAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * AI21 @@ -8,14 +8,14 @@ import * as TrueFoundry from "../index.js"; export interface Ai21ProviderAccount { /** +value=provider-account/ai21 */ type: "provider-account/ai21"; - /** The name of the AI21 provider account */ + /** The name of the AI21 model account */ name: string; authData: TrueFoundry.Ai21KeyAuth; - /** List of integrations that are associated with the AI21 provider account */ + /** List of integrations that are associated with the AI21 model account */ integrations?: TrueFoundry.Ai21Integrations[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/AktoGuardrailConfig.ts b/src/api/types/AktoGuardrailConfig.ts index c85b661e..a18c6f0d 100644 --- a/src/api/types/AktoGuardrailConfig.ts +++ b/src/api/types/AktoGuardrailConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Akto diff --git a/src/api/types/Alert.ts b/src/api/types/Alert.ts index 15106108..40fcfd55 100644 --- a/src/api/types/Alert.ts +++ b/src/api/types/Alert.ts @@ -1,16 +1,16 @@ // This file was auto-generated by Fern from our API Definition. export interface Alert { - id?: string; + id?: string | null; name: string; timestamps: Date[]; startTime: Date; - resolvedTime?: Date; - applicationId?: string; + resolvedTime?: Date | null; + applicationId?: string | null; clusterId: string; - tenantName?: string; + tenantName?: string | null; fingerprint: string; - updatedAt?: string; - createdAt?: string; - applicationDebugInfoId?: string; + updatedAt?: string | null; + createdAt?: string | null; + applicationDebugInfoId?: string | null; } diff --git a/src/api/types/AlertConfig.ts b/src/api/types/AlertConfig.ts index 96b4dc30..56892c77 100644 --- a/src/api/types/AlertConfig.ts +++ b/src/api/types/AlertConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface AlertConfig { /** Type */ diff --git a/src/api/types/AlertConfigEntity.ts b/src/api/types/AlertConfigEntity.ts new file mode 100644 index 00000000..1a773cc0 --- /dev/null +++ b/src/api/types/AlertConfigEntity.ts @@ -0,0 +1,3 @@ +// This file was auto-generated by Fern from our API Definition. + +export type AlertConfigEntity = {}; diff --git a/src/api/types/AlertConfigResource.ts b/src/api/types/AlertConfigResource.ts index ff3a95f6..5c50c5fe 100644 --- a/src/api/types/AlertConfigResource.ts +++ b/src/api/types/AlertConfigResource.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface AlertConfigResource { /** The type of resource this alert config belongs to. Can be either an application or a cluster. */ diff --git a/src/api/types/AlertConfigResourceType.ts b/src/api/types/AlertConfigResourceType.ts index 33c50b03..7a2696ee 100644 --- a/src/api/types/AlertConfigResourceType.ts +++ b/src/api/types/AlertConfigResourceType.ts @@ -2,7 +2,7 @@ /** The type of resource this alert config belongs to. Can be either an application or a cluster. */ export const AlertConfigResourceType = { - Application: "application", - Cluster: "cluster" - } as const; -export type AlertConfigResourceType = typeof AlertConfigResourceType[keyof typeof AlertConfigResourceType]; + Application: "application", + Cluster: "cluster", +} as const; +export type AlertConfigResourceType = (typeof AlertConfigResourceType)[keyof typeof AlertConfigResourceType]; diff --git a/src/api/types/AlertSeverity.ts b/src/api/types/AlertSeverity.ts index 65a49688..e63099f5 100644 --- a/src/api/types/AlertSeverity.ts +++ b/src/api/types/AlertSeverity.ts @@ -1,7 +1,7 @@ // This file was auto-generated by Fern from our API Definition. export const AlertSeverity = { - Warning: "warning", - Critical: "critical" - } as const; -export type AlertSeverity = typeof AlertSeverity[keyof typeof AlertSeverity]; + Warning: "warning", + Critical: "critical", +} as const; +export type AlertSeverity = (typeof AlertSeverity)[keyof typeof AlertSeverity]; diff --git a/src/api/types/AlertStatus.ts b/src/api/types/AlertStatus.ts index cb810c8e..6daf159c 100644 --- a/src/api/types/AlertStatus.ts +++ b/src/api/types/AlertStatus.ts @@ -1,7 +1,7 @@ // This file was auto-generated by Fern from our API Definition. export const AlertStatus = { - Firing: "firing", - Resolved: "resolved" - } as const; -export type AlertStatus = typeof AlertStatus[keyof typeof AlertStatus]; + Firing: "firing", + Resolved: "resolved", +} as const; +export type AlertStatus = (typeof AlertStatus)[keyof typeof AlertStatus]; diff --git a/src/api/types/AllDataAccessRule.ts b/src/api/types/AllDataAccessRule.ts index bb4d6c78..59f5a242 100644 --- a/src/api/types/AllDataAccessRule.ts +++ b/src/api/types/AllDataAccessRule.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * All Data diff --git a/src/api/types/AllDataAccessRuleFiltersItem.ts b/src/api/types/AllDataAccessRuleFiltersItem.ts index 918f1ab1..b72f56ba 100644 --- a/src/api/types/AllDataAccessRuleFiltersItem.ts +++ b/src/api/types/AllDataAccessRuleFiltersItem.ts @@ -1,7 +1,7 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; -export type AllDataAccessRuleFiltersItem = +export type AllDataAccessRuleFiltersItem = | TrueFoundry.GatewayDataMetadataFilter | TrueFoundry.GatewayDataCreatedByFilter; diff --git a/src/api/types/AnthropicIntegrations.ts b/src/api/types/AnthropicIntegrations.ts index 3ec41deb..b8df9f6c 100644 --- a/src/api/types/AnthropicIntegrations.ts +++ b/src/api/types/AnthropicIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type AnthropicIntegrations = TrueFoundry.AnthropicModel; diff --git a/src/api/types/AnthropicModel.ts b/src/api/types/AnthropicModel.ts index e7adb12b..e4058c3b 100644 --- a/src/api/types/AnthropicModel.ts +++ b/src/api/types/AnthropicModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Anthropic Model diff --git a/src/api/types/AnthropicProviderAccount.ts b/src/api/types/AnthropicProviderAccount.ts index c5f6689a..e4fcc859 100644 --- a/src/api/types/AnthropicProviderAccount.ts +++ b/src/api/types/AnthropicProviderAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Anthropic @@ -8,14 +8,16 @@ import * as TrueFoundry from "../index.js"; export interface AnthropicProviderAccount { /** +value=provider-account/anthropic */ type: "provider-account/anthropic"; - /** The name of the Anthropic provider account */ + /** The name of the Anthropic model account */ name: string; authData?: TrueFoundry.AnthropicKeyAuth; - /** List of integrations that are associated with the Anthropic provider account */ + /** Optional custom base URL for the Anthropic API. Must include the version path, e.g. https://my-proxy.example.com/v1. When set, requests are sent here instead of the default https://api.anthropic.com/v1. */ + baseUrl?: string; + /** List of integrations that are associated with the Anthropic model account */ integrations?: TrueFoundry.AnthropicIntegrations[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/Application.ts b/src/api/types/Application.ts index 2b8be4cf..a121f4e4 100644 --- a/src/api/types/Application.ts +++ b/src/api/types/Application.ts @@ -1,48 +1,48 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface Application { /** Unique identifier of the application */ - id?: string; + id?: string | null; /** FQN of the application */ - fqn?: string; + fqn?: string | null; /** Human-readable application name */ - name?: string; + name?: string | null; /** Type of the application */ - type?: TrueFoundry.ApplicationType; + type?: TrueFoundry.ApplicationType | null; /** Subject (user or service account) that created this application */ createdBySubject: TrueFoundry.Subject; /** Tenant this application belongs to */ - tenantName?: string; + tenantName?: string | null; /** Application metadata including pause state and sync info */ - metadata?: TrueFoundry.ApplicationMetadata; + metadata?: TrueFoundry.ApplicationMetadata | null; /** Current lifecycle stage of the application */ lifecycleStage: TrueFoundry.ApplicationLifecycleStage; /** Unique identifier of the workspace this application belongs to */ - workspaceId?: string; + workspaceId?: string | null; /** Version number of the latest deployment */ - lastVersion?: number; + lastVersion?: number | null; /** Version number of the currently active deployment */ - activeVersion?: number; + activeVersion?: number | null; /** Unique identifier of the application set this application belongs to, if any */ - applicationSetId?: string; - createdAt?: Date; - updatedAt?: Date; + applicationSetId?: string | null; + createdAt?: Date | null; + updatedAt?: Date | null; /** Recommendations for this application */ - recommendations?: TrueFoundry.Recommendation[]; + recommendations?: TrueFoundry.Recommendation[] | null; /** Alerts for this application */ - alerts?: TrueFoundry.Alert[]; + alerts?: TrueFoundry.Alert[] | null; /** Summary of alerts for this application */ - alertsSummary?: Record; + alertsSummary?: Record | null; /** Debug infos for this application */ - applicationDebugInfos?: TrueFoundry.ApplicationDebugInfo[]; + applicationDebugInfos?: TrueFoundry.ApplicationDebugInfo[] | null; /** Potential problems with the application */ - potentialProblems?: TrueFoundry.ApplicationProblem[]; + potentialProblems?: TrueFoundry.ApplicationProblem[] | null; autopilot: Record; - workspaceFqn?: string; - createdBy?: string; - deployment?: TrueFoundry.Deployment; - activeDeploymentId?: string; - lastDeploymentId?: string; + workspaceFqn?: string | null; + createdBy?: string | null; + deployment?: TrueFoundry.Deployment | null; + activeDeploymentId?: string | null; + lastDeploymentId?: string | null; } diff --git a/src/api/types/ApplicationDebugInfo.ts b/src/api/types/ApplicationDebugInfo.ts index b2f1ead4..acd7c294 100644 --- a/src/api/types/ApplicationDebugInfo.ts +++ b/src/api/types/ApplicationDebugInfo.ts @@ -1,12 +1,12 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ApplicationDebugInfo { - id?: string; + id?: string | null; applicationId: string; - application?: TrueFoundry.Application; + application?: TrueFoundry.Application | null; debugInfo: Record; - createdAt?: Date; - updatedAt?: Date; + createdAt?: Date | null; + updatedAt?: Date | null; } diff --git a/src/api/types/ApplicationLifecycleStage.ts b/src/api/types/ApplicationLifecycleStage.ts index 50e18b94..14af4f6c 100644 --- a/src/api/types/ApplicationLifecycleStage.ts +++ b/src/api/types/ApplicationLifecycleStage.ts @@ -2,8 +2,8 @@ /** Current lifecycle stage of the application */ export const ApplicationLifecycleStage = { - Active: "active", - Deleting: "deleting", - DeletionFailed: "deletion_failed" - } as const; -export type ApplicationLifecycleStage = typeof ApplicationLifecycleStage[keyof typeof ApplicationLifecycleStage]; + Active: "active", + Deleting: "deleting", + DeletionFailed: "deletion_failed", +} as const; +export type ApplicationLifecycleStage = (typeof ApplicationLifecycleStage)[keyof typeof ApplicationLifecycleStage]; diff --git a/src/api/types/ApplicationMetadata.ts b/src/api/types/ApplicationMetadata.ts index e13d08ab..3f48dbef 100644 --- a/src/api/types/ApplicationMetadata.ts +++ b/src/api/types/ApplicationMetadata.ts @@ -2,5 +2,5 @@ export interface ApplicationMetadata { /** Explicit pause state. true = user has paused the app (all pods removed). false = user has explicitly resumed the app. null/undefined = user has never toggled pause; the app is managed normally, but autoshutdown may have scaled it to zero pods due to inactivity. */ - paused?: boolean; + paused?: boolean | null; } diff --git a/src/api/types/ApplicationSet.ts b/src/api/types/ApplicationSet.ts index 0fcde279..77a8922c 100644 --- a/src/api/types/ApplicationSet.ts +++ b/src/api/types/ApplicationSet.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Describes the configuration for the application set diff --git a/src/api/types/ApplicationSetComponentsItem.ts b/src/api/types/ApplicationSetComponentsItem.ts index 39844bdb..5d6a61c9 100644 --- a/src/api/types/ApplicationSetComponentsItem.ts +++ b/src/api/types/ApplicationSetComponentsItem.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; -export type ApplicationSetComponentsItem = +export type ApplicationSetComponentsItem = | TrueFoundry.Service | TrueFoundry.AsyncService | TrueFoundry.Job diff --git a/src/api/types/ApplicationSummary.ts b/src/api/types/ApplicationSummary.ts index caaf60a4..459edff9 100644 --- a/src/api/types/ApplicationSummary.ts +++ b/src/api/types/ApplicationSummary.ts @@ -1,24 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ApplicationSummary { /** Unique identifier of the application */ - id?: string; + id?: string | null; /** FQN of the application */ - fqn?: string; + fqn?: string | null; /** Human-readable application name */ - name?: string; + name?: string | null; /** Type of the application */ - type?: TrueFoundry.ApplicationType; + type?: TrueFoundry.ApplicationType | null; /** Application metadata including pause state and sync info */ - metadata?: TrueFoundry.ApplicationMetadata; + metadata?: TrueFoundry.ApplicationMetadata | null; /** Current lifecycle stage of the application */ lifecycleStage: TrueFoundry.ApplicationLifecycleStage; /** Unique identifier of the workspace this application belongs to */ - workspaceId?: string; + workspaceId?: string | null; /** Version number of the currently active deployment */ - activeVersion?: number; + activeVersion?: number | null; /** Unique identifier of the application set this application belongs to, if any */ - applicationSetId?: string; + applicationSetId?: string | null; } diff --git a/src/api/types/ApplicationType.ts b/src/api/types/ApplicationType.ts index 3885e541..9c778aad 100644 --- a/src/api/types/ApplicationType.ts +++ b/src/api/types/ApplicationType.ts @@ -1,20 +1,20 @@ // This file was auto-generated by Fern from our API Definition. export const ApplicationType = { - AsyncService: "async-service", - Service: "service", - Job: "job", - SparkJob: "spark-job", - Helm: "helm", - Notebook: "notebook", - SparkNotebook: "spark-notebook", - Codeserver: "codeserver", - Rstudio: "rstudio", - SshServer: "ssh-server", - Volume: "volume", - Application: "application", - ApplicationSet: "application-set", - Intercept: "intercept", - Workflow: "workflow" - } as const; -export type ApplicationType = typeof ApplicationType[keyof typeof ApplicationType]; + AsyncService: "async-service", + Service: "service", + Job: "job", + SparkJob: "spark-job", + Helm: "helm", + Notebook: "notebook", + SparkNotebook: "spark-notebook", + Codeserver: "codeserver", + Rstudio: "rstudio", + SshServer: "ssh-server", + Volume: "volume", + Application: "application", + ApplicationSet: "application-set", + Intercept: "intercept", + Workflow: "workflow", +} as const; +export type ApplicationType = (typeof ApplicationType)[keyof typeof ApplicationType]; diff --git a/src/api/types/Artifact.ts b/src/api/types/Artifact.ts index a4672dd2..a6fd38dd 100644 --- a/src/api/types/Artifact.ts +++ b/src/api/types/Artifact.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface Artifact { /** System-generated artifact ID. */ @@ -16,11 +16,11 @@ export interface Artifact { /** Subject (user, team, or service account) that created the artifact. */ createdBySubject: TrueFoundry.Subject; /** Timestamp when the artifact was created. */ - createdAt?: Date; + createdAt?: Date | null; /** Timestamp when the artifact was last updated. */ - updatedAt?: Date; + updatedAt?: Date | null; /** Most recently created version of the artifact, if any exist. */ - latestVersion?: TrueFoundry.ArtifactVersion; + latestVersion?: TrueFoundry.ArtifactVersion | null; /** Run steps associated with the artifact. */ - runSteps?: number[]; + runSteps?: number[] | null; } diff --git a/src/api/types/ArtifactManifest.ts b/src/api/types/ArtifactManifest.ts index bf9d716b..f42cf6ef 100644 --- a/src/api/types/ArtifactManifest.ts +++ b/src/api/types/ArtifactManifest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Log a new Artifact Version containing files and folders with metadata @@ -9,7 +9,7 @@ export interface ArtifactManifest extends TrueFoundry.BaseArtifactVersion { /** Artifact Version */ type: "artifact-version"; /** Description */ - description?: string; + description?: string | null; /** Version alias is alternate, ideally human readable, version string to reference an artifact version. It should start with `v` followed by alphanumeric and it can include `.` and `-` in between (e.g. `v1.0.0`, `v1-prod`, `v3-dev`, etc) */ versionAlias?: string; /** Artifact Source */ diff --git a/src/api/types/ArtifactManifestSource.ts b/src/api/types/ArtifactManifestSource.ts index e82a00cf..0e6315e5 100644 --- a/src/api/types/ArtifactManifestSource.ts +++ b/src/api/types/ArtifactManifestSource.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Artifact Source */ -export type ArtifactManifestSource = +export type ArtifactManifestSource = | TrueFoundry.TrueFoundryManagedSource | TrueFoundry.ExternalBlobStorageSource | TrueFoundry.LocalArtifactSource; diff --git a/src/api/types/ArtifactVersion.ts b/src/api/types/ArtifactVersion.ts index 7db9d69e..d6e5ceb7 100644 --- a/src/api/types/ArtifactVersion.ts +++ b/src/api/types/ArtifactVersion.ts @@ -1,12 +1,12 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ArtifactVersion { /** Timestamp when the artifact version was created. */ - createdAt?: Date; + createdAt?: Date | null; /** Timestamp when the artifact version was last updated. */ - updatedAt?: Date; + updatedAt?: Date | null; /** Manifest describing the artifact version. */ manifest: TrueFoundry.ArtifactManifest; /** System-generated artifact version ID. */ @@ -18,9 +18,9 @@ export interface ArtifactVersion { /** Identifier of the ML Repo the artifact version belongs to. */ mlRepoId: string; /** Code snippet demonstrating how to use the artifact version. */ - usageCodeSnippet?: string; + usageCodeSnippet?: string | null; /** Tags associated with the artifact version. */ - tags?: string[]; + tags?: string[] | null; /** Identifier of the artifact this version belongs to. */ artifactId: string; } diff --git a/src/api/types/ArtifactsDownload.ts b/src/api/types/ArtifactsDownload.ts index ad525c61..efe70076 100644 --- a/src/api/types/ArtifactsDownload.ts +++ b/src/api/types/ArtifactsDownload.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Download and cache models in a volume to enhance loading speeds and reduce costs by avoiding repeated downloads. [Docs](https://docs.truefoundry.com/docs/download-and-cache-models) diff --git a/src/api/types/ArtifactsDownloadArtifactsItem.ts b/src/api/types/ArtifactsDownloadArtifactsItem.ts index 4267c5e8..590b2702 100644 --- a/src/api/types/ArtifactsDownloadArtifactsItem.ts +++ b/src/api/types/ArtifactsDownloadArtifactsItem.ts @@ -1,7 +1,7 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; -export type ArtifactsDownloadArtifactsItem = +export type ArtifactsDownloadArtifactsItem = | TrueFoundry.TrueFoundryArtifactSource | TrueFoundry.HuggingfaceArtifactSource; diff --git a/src/api/types/AssistantMessage.ts b/src/api/types/AssistantMessage.ts index cfd1ba98..f5313a0c 100644 --- a/src/api/types/AssistantMessage.ts +++ b/src/api/types/AssistantMessage.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Assistant message turn diff --git a/src/api/types/AssistantMessageContent.ts b/src/api/types/AssistantMessageContent.ts index a50a7f4d..8e1d9161 100644 --- a/src/api/types/AssistantMessageContent.ts +++ b/src/api/types/AssistantMessageContent.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Text content for the assistant message */ -export type AssistantMessageContent = +export type AssistantMessageContent = | string | TrueFoundry.AssistantMessageContentOneItem[] | TrueFoundry.BlobStorageReference; diff --git a/src/api/types/AssistantMessageContentOneItem.ts b/src/api/types/AssistantMessageContentOneItem.ts index 18eda9c3..7555f232 100644 --- a/src/api/types/AssistantMessageContentOneItem.ts +++ b/src/api/types/AssistantMessageContentOneItem.ts @@ -1,7 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; -export type AssistantMessageContentOneItem = - | TrueFoundry.TextContentPart - | TrueFoundry.RefusalContentPart; +export type AssistantMessageContentOneItem = TrueFoundry.TextContentPart | TrueFoundry.RefusalContentPart; diff --git a/src/api/types/AsyncService.ts b/src/api/types/AsyncService.ts index da56fea8..878cad73 100644 --- a/src/api/types/AsyncService.ts +++ b/src/api/types/AsyncService.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Describes the configuration for the async-service diff --git a/src/api/types/AsyncServiceAutoscaling.ts b/src/api/types/AsyncServiceAutoscaling.ts index 4e35787d..a01281d7 100644 --- a/src/api/types/AsyncServiceAutoscaling.ts +++ b/src/api/types/AsyncServiceAutoscaling.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface AsyncServiceAutoscaling extends TrueFoundry.BaseAutoscaling { /** Metrics to use for the autoscaler */ diff --git a/src/api/types/AsyncServiceAutoscalingMetrics.ts b/src/api/types/AsyncServiceAutoscalingMetrics.ts index dd88e57c..a0cdd44a 100644 --- a/src/api/types/AsyncServiceAutoscalingMetrics.ts +++ b/src/api/types/AsyncServiceAutoscalingMetrics.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Metrics to use for the autoscaler */ -export type AsyncServiceAutoscalingMetrics = +export type AsyncServiceAutoscalingMetrics = | TrueFoundry.SqsQueueMetricConfig | TrueFoundry.NatsMetricConfig | TrueFoundry.KafkaMetricConfig diff --git a/src/api/types/AsyncServiceReplicas.ts b/src/api/types/AsyncServiceReplicas.ts index bfb5766a..1610ce21 100644 --- a/src/api/types/AsyncServiceReplicas.ts +++ b/src/api/types/AsyncServiceReplicas.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Deploy multiple instances of your pods to distribute incoming traffic across them, ensuring effective load balancing. */ -export type AsyncServiceReplicas = - | number - | TrueFoundry.AsyncServiceAutoscaling; +export type AsyncServiceReplicas = number | TrueFoundry.AsyncServiceAutoscaling; diff --git a/src/api/types/AwsBedrockAssumedRoleBasedAuth.ts b/src/api/types/AwsBedrockAssumedRoleBasedAuth.ts index 31b33941..1f5bbf24 100644 --- a/src/api/types/AwsBedrockAssumedRoleBasedAuth.ts +++ b/src/api/types/AwsBedrockAssumedRoleBasedAuth.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Assumed Role Based diff --git a/src/api/types/AwsBedrockGuardrailConfig.ts b/src/api/types/AwsBedrockGuardrailConfig.ts index 8b0dc0cd..c876fb4f 100644 --- a/src/api/types/AwsBedrockGuardrailConfig.ts +++ b/src/api/types/AwsBedrockGuardrailConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * AWS Bedrock diff --git a/src/api/types/AwsBedrockGuardrailConfigAuthData.ts b/src/api/types/AwsBedrockGuardrailConfigAuthData.ts index 03c1a5cb..d5b95a68 100644 --- a/src/api/types/AwsBedrockGuardrailConfigAuthData.ts +++ b/src/api/types/AwsBedrockGuardrailConfigAuthData.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Authentication data for the AWS account */ -export type AwsBedrockGuardrailConfigAuthData = +export type AwsBedrockGuardrailConfigAuthData = | TrueFoundry.AwsAccessKeyBasedAuth | TrueFoundry.AwsBedrockAssumedRoleBasedAuth | TrueFoundry.AwsBedrockApiKeyAuth; diff --git a/src/api/types/AwsBedrockGuardrailConfigConfig.ts b/src/api/types/AwsBedrockGuardrailConfigConfig.ts index 5b937423..06dc2a39 100644 --- a/src/api/types/AwsBedrockGuardrailConfigConfig.ts +++ b/src/api/types/AwsBedrockGuardrailConfigConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +uiType=Ignore diff --git a/src/api/types/AwsBedrockGuardrailConfigOperation.ts b/src/api/types/AwsBedrockGuardrailConfigOperation.ts index af9e5142..e3fbbaa0 100644 --- a/src/api/types/AwsBedrockGuardrailConfigOperation.ts +++ b/src/api/types/AwsBedrockGuardrailConfigOperation.ts @@ -5,7 +5,8 @@ * Validate guardrails are run in parallel while mutate guardrails are run sequentially. */ export const AwsBedrockGuardrailConfigOperation = { - Validate: "validate", - Mutate: "mutate" - } as const; -export type AwsBedrockGuardrailConfigOperation = typeof AwsBedrockGuardrailConfigOperation[keyof typeof AwsBedrockGuardrailConfigOperation]; + Validate: "validate", + Mutate: "mutate", +} as const; +export type AwsBedrockGuardrailConfigOperation = + (typeof AwsBedrockGuardrailConfigOperation)[keyof typeof AwsBedrockGuardrailConfigOperation]; diff --git a/src/api/types/AwsBedrockMantleIntegrations.ts b/src/api/types/AwsBedrockMantleIntegrations.ts index 7f08616f..31d40e2c 100644 --- a/src/api/types/AwsBedrockMantleIntegrations.ts +++ b/src/api/types/AwsBedrockMantleIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type AwsBedrockMantleIntegrations = TrueFoundry.BedrockMantleModel; diff --git a/src/api/types/AwsBedrockMantleProviderAccount.ts b/src/api/types/AwsBedrockMantleProviderAccount.ts index 50153acd..e9501a28 100644 --- a/src/api/types/AwsBedrockMantleProviderAccount.ts +++ b/src/api/types/AwsBedrockMantleProviderAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * AWS Bedrock Mantle @@ -8,16 +8,18 @@ import * as TrueFoundry from "../index.js"; export interface AwsBedrockMantleProviderAccount { /** +value=provider-account/aws-bedrock-mantle */ type: "provider-account/aws-bedrock-mantle"; - /** The name of the AWS Bedrock Mantle provider account */ + /** The name of the AWS Bedrock Mantle model account */ name: string; region: TrueFoundry.AwsRegion; + /** Optional custom base URL (e.g. a VPC/PrivateLink endpoint) for AWS Bedrock Mantle. When set, requests are sent here instead of the default bedrock-mantle.{region}.api.aws host. */ + baseUrl?: string; /** Authentication data for the AWS account */ authData?: TrueFoundry.AwsBedrockMantleProviderAccountAuthData; - /** List of integrations that are associated with the AWS Bedrock Mantle provider account */ + /** List of integrations that are associated with the AWS Bedrock Mantle model account */ integrations: TrueFoundry.AwsBedrockMantleIntegrations[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/AwsBedrockMantleProviderAccountAuthData.ts b/src/api/types/AwsBedrockMantleProviderAccountAuthData.ts index 5319d826..df47fbcc 100644 --- a/src/api/types/AwsBedrockMantleProviderAccountAuthData.ts +++ b/src/api/types/AwsBedrockMantleProviderAccountAuthData.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Authentication data for the AWS account */ -export type AwsBedrockMantleProviderAccountAuthData = +export type AwsBedrockMantleProviderAccountAuthData = | TrueFoundry.AwsAccessKeyBasedAuth | TrueFoundry.AwsBedrockAssumedRoleBasedAuth | TrueFoundry.AwsBedrockApiKeyAuth; diff --git a/src/api/types/AwsBedrockProviderAccount.ts b/src/api/types/AwsBedrockProviderAccount.ts index eff87c8c..6aa88be1 100644 --- a/src/api/types/AwsBedrockProviderAccount.ts +++ b/src/api/types/AwsBedrockProviderAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * AWS Bedrock @@ -8,16 +8,18 @@ import * as TrueFoundry from "../index.js"; export interface AwsBedrockProviderAccount { /** +value=provider-account/aws-bedrock */ type: "provider-account/aws-bedrock"; - /** The name of the AWS Bedrock provider account */ + /** The name of the AWS Bedrock model account */ name: string; region: TrueFoundry.AwsRegion; + /** Optional custom base URL (e.g. a VPC/PrivateLink endpoint) for AWS Bedrock. When set, requests are sent here instead of the default bedrock-runtime.{region}.amazonaws.com host. */ + baseUrl?: string; /** Authentication data for the AWS account */ authData?: TrueFoundry.AwsBedrockProviderAccountAuthData; - /** List of integrations that are associated with the AWS Bedrock provider account */ + /** List of integrations that are associated with the AWS Bedrock model account */ integrations: TrueFoundry.BedrockModel[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/AwsBedrockProviderAccountAuthData.ts b/src/api/types/AwsBedrockProviderAccountAuthData.ts index 6a7c2056..ab56a696 100644 --- a/src/api/types/AwsBedrockProviderAccountAuthData.ts +++ b/src/api/types/AwsBedrockProviderAccountAuthData.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Authentication data for the AWS account */ -export type AwsBedrockProviderAccountAuthData = +export type AwsBedrockProviderAccountAuthData = | TrueFoundry.AwsAccessKeyBasedAuth | TrueFoundry.AwsBedrockAssumedRoleBasedAuth | TrueFoundry.AwsBedrockApiKeyAuth; diff --git a/src/api/types/AwsClaudePlatformAssumedRoleBasedAuth.ts b/src/api/types/AwsClaudePlatformAssumedRoleBasedAuth.ts index e40d00ee..082a2b74 100644 --- a/src/api/types/AwsClaudePlatformAssumedRoleBasedAuth.ts +++ b/src/api/types/AwsClaudePlatformAssumedRoleBasedAuth.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Assumed Role Based diff --git a/src/api/types/AwsClaudePlatformIntegrations.ts b/src/api/types/AwsClaudePlatformIntegrations.ts index f58c98c0..04e7f7bb 100644 --- a/src/api/types/AwsClaudePlatformIntegrations.ts +++ b/src/api/types/AwsClaudePlatformIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type AwsClaudePlatformIntegrations = TrueFoundry.AwsClaudePlatformModel; diff --git a/src/api/types/AwsClaudePlatformModel.ts b/src/api/types/AwsClaudePlatformModel.ts index 1ba17e61..4af21d41 100644 --- a/src/api/types/AwsClaudePlatformModel.ts +++ b/src/api/types/AwsClaudePlatformModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * AWS Claude Platform Model diff --git a/src/api/types/AwsClaudePlatformProviderAccount.ts b/src/api/types/AwsClaudePlatformProviderAccount.ts index a74f9040..d8831879 100644 --- a/src/api/types/AwsClaudePlatformProviderAccount.ts +++ b/src/api/types/AwsClaudePlatformProviderAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * AWS Claude Platform @@ -8,18 +8,20 @@ import * as TrueFoundry from "../index.js"; export interface AwsClaudePlatformProviderAccount { /** +value=provider-account/aws-claude-platform */ type: "provider-account/aws-claude-platform"; - /** The name of the AWS Claude Platform provider account */ + /** The name of the AWS Claude Platform model account */ name: string; /** Your Claude Platform on AWS workspace ID, in the format wrkspc_. */ workspaceId: string; region: TrueFoundry.AwsRegion; + /** Optional custom base URL (e.g. a VPC/PrivateLink endpoint) for Claude Platform on AWS. Must include the version path, e.g. https://my-endpoint.example.com/v1. When set, requests are sent here instead of the default aws-external-anthropic.{region}.api.aws/v1 host. */ + baseUrl?: string; /** Authentication data for the AWS account. Supports SigV4 (access key or assumed role) and API key authentication. */ authData?: TrueFoundry.AwsClaudePlatformProviderAccountAuthData; - /** List of integrations that are associated with the AWS Claude Platform provider account */ + /** List of integrations that are associated with the AWS Claude Platform model account */ integrations?: TrueFoundry.AwsClaudePlatformIntegrations[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/AwsClaudePlatformProviderAccountAuthData.ts b/src/api/types/AwsClaudePlatformProviderAccountAuthData.ts index a183ca82..4e1f36c7 100644 --- a/src/api/types/AwsClaudePlatformProviderAccountAuthData.ts +++ b/src/api/types/AwsClaudePlatformProviderAccountAuthData.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Authentication data for the AWS account. Supports SigV4 (access key or assumed role) and API key authentication. */ -export type AwsClaudePlatformProviderAccountAuthData = +export type AwsClaudePlatformProviderAccountAuthData = | TrueFoundry.AwsAccessKeyBasedAuth | TrueFoundry.AwsClaudePlatformAssumedRoleBasedAuth | TrueFoundry.AwsClaudePlatformApiKeyAuth; diff --git a/src/api/types/AwsEcr.ts b/src/api/types/AwsEcr.ts index 02810c36..adc96aed 100644 --- a/src/api/types/AwsEcr.ts +++ b/src/api/types/AwsEcr.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * AWS ECR diff --git a/src/api/types/AwsEcrAuthData.ts b/src/api/types/AwsEcrAuthData.ts index e99bd5c3..60546ce5 100644 --- a/src/api/types/AwsEcrAuthData.ts +++ b/src/api/types/AwsEcrAuthData.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Custom authentication data for the integration. */ -export type AwsEcrAuthData = - | TrueFoundry.AwsAccessKeyBasedAuth - | TrueFoundry.AwsAssumedRoleBasedAuth; +export type AwsEcrAuthData = TrueFoundry.AwsAccessKeyBasedAuth | TrueFoundry.AwsAssumedRoleBasedAuth; diff --git a/src/api/types/AwsEksIntegration.ts b/src/api/types/AwsEksIntegration.ts index 786d185f..c94cd47a 100644 --- a/src/api/types/AwsEksIntegration.ts +++ b/src/api/types/AwsEksIntegration.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * AWS EKS diff --git a/src/api/types/AwsEksIntegrationAuthData.ts b/src/api/types/AwsEksIntegrationAuthData.ts index 32f5718b..0461b2b7 100644 --- a/src/api/types/AwsEksIntegrationAuthData.ts +++ b/src/api/types/AwsEksIntegrationAuthData.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Custom authentication data for the integration. */ -export type AwsEksIntegrationAuthData = - | TrueFoundry.AwsAccessKeyBasedAuth - | TrueFoundry.AwsAssumedRoleBasedAuth; +export type AwsEksIntegrationAuthData = TrueFoundry.AwsAccessKeyBasedAuth | TrueFoundry.AwsAssumedRoleBasedAuth; diff --git a/src/api/types/AwsIntegrations.ts b/src/api/types/AwsIntegrations.ts index 52b80624..280e1633 100644 --- a/src/api/types/AwsIntegrations.ts +++ b/src/api/types/AwsIntegrations.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +discriminator=type */ -export type AwsIntegrations = +export type AwsIntegrations = | TrueFoundry.AwsEcr | TrueFoundry.AwsS3 | TrueFoundry.AwsParameterStore diff --git a/src/api/types/AwsParameterStore.ts b/src/api/types/AwsParameterStore.ts index 409b8fcb..35f46228 100644 --- a/src/api/types/AwsParameterStore.ts +++ b/src/api/types/AwsParameterStore.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * AWS Parameter Store diff --git a/src/api/types/AwsParameterStoreAuthData.ts b/src/api/types/AwsParameterStoreAuthData.ts index 39e585bf..19e54479 100644 --- a/src/api/types/AwsParameterStoreAuthData.ts +++ b/src/api/types/AwsParameterStoreAuthData.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Custom authentication data for the integration. */ -export type AwsParameterStoreAuthData = - | TrueFoundry.AwsAccessKeyBasedAuth - | TrueFoundry.AwsAssumedRoleBasedAuth; +export type AwsParameterStoreAuthData = TrueFoundry.AwsAccessKeyBasedAuth | TrueFoundry.AwsAssumedRoleBasedAuth; diff --git a/src/api/types/AwsProviderAccount.ts b/src/api/types/AwsProviderAccount.ts index b14fe29e..56b3a3f4 100644 --- a/src/api/types/AwsProviderAccount.ts +++ b/src/api/types/AwsProviderAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * AWS diff --git a/src/api/types/AwsProviderAccountAuthData.ts b/src/api/types/AwsProviderAccountAuthData.ts index 9a1ec02e..d506e496 100644 --- a/src/api/types/AwsProviderAccountAuthData.ts +++ b/src/api/types/AwsProviderAccountAuthData.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Authentication data for the AWS account. */ -export type AwsProviderAccountAuthData = - | TrueFoundry.AwsAccessKeyBasedAuth - | TrueFoundry.AwsAssumedRoleBasedAuth; +export type AwsProviderAccountAuthData = TrueFoundry.AwsAccessKeyBasedAuth | TrueFoundry.AwsAssumedRoleBasedAuth; diff --git a/src/api/types/AwsRegion.ts b/src/api/types/AwsRegion.ts index b2075699..f1e885e0 100644 --- a/src/api/types/AwsRegion.ts +++ b/src/api/types/AwsRegion.ts @@ -1,43 +1,43 @@ // This file was auto-generated by Fern from our API Definition. export const AwsRegion = { - AfSouth1: "af-south-1", - ApEast1: "ap-east-1", - ApNortheast1: "ap-northeast-1", - ApNortheast2: "ap-northeast-2", - ApNortheast3: "ap-northeast-3", - ApSouth1: "ap-south-1", - ApSouth2: "ap-south-2", - ApSoutheast1: "ap-southeast-1", - ApSoutheast2: "ap-southeast-2", - ApSoutheast3: "ap-southeast-3", - ApSoutheast4: "ap-southeast-4", - ApSoutheast5: "ap-southeast-5", - ApSoutheast7: "ap-southeast-7", - CaCentral1: "ca-central-1", - CaWest1: "ca-west-1", - CnNorth1: "cn-north-1", - CnNorthwest1: "cn-northwest-1", - EuCentral1: "eu-central-1", - EuCentral2: "eu-central-2", - EuNorth1: "eu-north-1", - EuSouth1: "eu-south-1", - EuSouth2: "eu-south-2", - EuWest1: "eu-west-1", - EuWest2: "eu-west-2", - EuWest3: "eu-west-3", - IlCentral1: "il-central-1", - MeCentral1: "me-central-1", - MeSouth1: "me-south-1", - MxCentral1: "mx-central-1", - SaEast1: "sa-east-1", - UsEast1: "us-east-1", - UsEast2: "us-east-2", - UsGovEast1: "us-gov-east-1", - UsGovWest1: "us-gov-west-1", - UsWest1: "us-west-1", - UsWest2: "us-west-2", - ApSoutheast6: "ap-southeast-6", - ApEast2: "ap-east-2" - } as const; -export type AwsRegion = typeof AwsRegion[keyof typeof AwsRegion]; + AfSouth1: "af-south-1", + ApEast1: "ap-east-1", + ApNortheast1: "ap-northeast-1", + ApNortheast2: "ap-northeast-2", + ApNortheast3: "ap-northeast-3", + ApSouth1: "ap-south-1", + ApSouth2: "ap-south-2", + ApSoutheast1: "ap-southeast-1", + ApSoutheast2: "ap-southeast-2", + ApSoutheast3: "ap-southeast-3", + ApSoutheast4: "ap-southeast-4", + ApSoutheast5: "ap-southeast-5", + ApSoutheast7: "ap-southeast-7", + CaCentral1: "ca-central-1", + CaWest1: "ca-west-1", + CnNorth1: "cn-north-1", + CnNorthwest1: "cn-northwest-1", + EuCentral1: "eu-central-1", + EuCentral2: "eu-central-2", + EuNorth1: "eu-north-1", + EuSouth1: "eu-south-1", + EuSouth2: "eu-south-2", + EuWest1: "eu-west-1", + EuWest2: "eu-west-2", + EuWest3: "eu-west-3", + IlCentral1: "il-central-1", + MeCentral1: "me-central-1", + MeSouth1: "me-south-1", + MxCentral1: "mx-central-1", + SaEast1: "sa-east-1", + UsEast1: "us-east-1", + UsEast2: "us-east-2", + UsGovEast1: "us-gov-east-1", + UsGovWest1: "us-gov-west-1", + UsWest1: "us-west-1", + UsWest2: "us-west-2", + ApSoutheast6: "ap-southeast-6", + ApEast2: "ap-east-2", +} as const; +export type AwsRegion = (typeof AwsRegion)[keyof typeof AwsRegion]; diff --git a/src/api/types/AwsS3.ts b/src/api/types/AwsS3.ts index d12a9991..7080cca1 100644 --- a/src/api/types/AwsS3.ts +++ b/src/api/types/AwsS3.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * AWS S3 diff --git a/src/api/types/AwsS3AuthData.ts b/src/api/types/AwsS3AuthData.ts index 2099ec08..216ca58d 100644 --- a/src/api/types/AwsS3AuthData.ts +++ b/src/api/types/AwsS3AuthData.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Custom authentication data for the integration. */ -export type AwsS3AuthData = - | TrueFoundry.AwsAccessKeyBasedAuth - | TrueFoundry.AwsAssumedRoleBasedAuth; +export type AwsS3AuthData = TrueFoundry.AwsAccessKeyBasedAuth | TrueFoundry.AwsAssumedRoleBasedAuth; diff --git a/src/api/types/AwsSagemakerProviderAccount.ts b/src/api/types/AwsSagemakerProviderAccount.ts index 8d6e3fa9..0de63a80 100644 --- a/src/api/types/AwsSagemakerProviderAccount.ts +++ b/src/api/types/AwsSagemakerProviderAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Sagemaker @@ -8,16 +8,16 @@ import * as TrueFoundry from "../index.js"; export interface AwsSagemakerProviderAccount { /** +value=provider-account/aws-sagemaker */ type: "provider-account/aws-sagemaker"; - /** The name of the Sagemaker provider account */ + /** The name of the Sagemaker model account */ name: string; region: TrueFoundry.AwsRegion; /** Authentication data for the AWS account */ authData?: TrueFoundry.AwsSagemakerProviderAccountAuthData; - /** List of integrations that are associated with the Sagemaker provider account */ + /** List of integrations that are associated with the Sagemaker model account */ integrations: TrueFoundry.SagemakerModel[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/AwsSagemakerProviderAccountAuthData.ts b/src/api/types/AwsSagemakerProviderAccountAuthData.ts index bab6b732..009eb60b 100644 --- a/src/api/types/AwsSagemakerProviderAccountAuthData.ts +++ b/src/api/types/AwsSagemakerProviderAccountAuthData.ts @@ -1,10 +1,10 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Authentication data for the AWS account */ -export type AwsSagemakerProviderAccountAuthData = +export type AwsSagemakerProviderAccountAuthData = | TrueFoundry.AwsAccessKeyBasedAuth | TrueFoundry.SagemakerAssumedRoleBasedAuth; diff --git a/src/api/types/AwsSecretsManager.ts b/src/api/types/AwsSecretsManager.ts index c301293a..4e97c28c 100644 --- a/src/api/types/AwsSecretsManager.ts +++ b/src/api/types/AwsSecretsManager.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * AWS Secrets Manager diff --git a/src/api/types/AwsSecretsManagerAuthData.ts b/src/api/types/AwsSecretsManagerAuthData.ts index 7e20e677..446e48b4 100644 --- a/src/api/types/AwsSecretsManagerAuthData.ts +++ b/src/api/types/AwsSecretsManagerAuthData.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Custom authentication data for the integration. */ -export type AwsSecretsManagerAuthData = - | TrueFoundry.AwsAccessKeyBasedAuth - | TrueFoundry.AwsAssumedRoleBasedAuth; +export type AwsSecretsManagerAuthData = TrueFoundry.AwsAccessKeyBasedAuth | TrueFoundry.AwsAssumedRoleBasedAuth; diff --git a/src/api/types/AzureAksIntegration.ts b/src/api/types/AzureAksIntegration.ts index 37dfc64b..cccbce06 100644 --- a/src/api/types/AzureAksIntegration.ts +++ b/src/api/types/AzureAksIntegration.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Azure AKS diff --git a/src/api/types/AzureBlobStorage.ts b/src/api/types/AzureBlobStorage.ts index 7eabe270..68cfe224 100644 --- a/src/api/types/AzureBlobStorage.ts +++ b/src/api/types/AzureBlobStorage.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Azure ABS diff --git a/src/api/types/AzureContainerRegistry.ts b/src/api/types/AzureContainerRegistry.ts index 91aaa650..4f416f61 100644 --- a/src/api/types/AzureContainerRegistry.ts +++ b/src/api/types/AzureContainerRegistry.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Azure ACR diff --git a/src/api/types/AzureContentSafetyCategory.ts b/src/api/types/AzureContentSafetyCategory.ts index 15cc0a49..e3eb9ae3 100644 --- a/src/api/types/AzureContentSafetyCategory.ts +++ b/src/api/types/AzureContentSafetyCategory.ts @@ -1,9 +1,9 @@ // This file was auto-generated by Fern from our API Definition. export const AzureContentSafetyCategory = { - Hate: "Hate", - SelfHarm: "SelfHarm", - Sexual: "Sexual", - Violence: "Violence" - } as const; -export type AzureContentSafetyCategory = typeof AzureContentSafetyCategory[keyof typeof AzureContentSafetyCategory]; + Hate: "Hate", + SelfHarm: "SelfHarm", + Sexual: "Sexual", + Violence: "Violence", +} as const; +export type AzureContentSafetyCategory = (typeof AzureContentSafetyCategory)[keyof typeof AzureContentSafetyCategory]; diff --git a/src/api/types/AzureContentSafetyGuardrailConfig.ts b/src/api/types/AzureContentSafetyGuardrailConfig.ts index 74f2bdc1..5be2b703 100644 --- a/src/api/types/AzureContentSafetyGuardrailConfig.ts +++ b/src/api/types/AzureContentSafetyGuardrailConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Azure Content Safety diff --git a/src/api/types/AzureContentSafetyGuardrailConfigAuthData.ts b/src/api/types/AzureContentSafetyGuardrailConfigAuthData.ts index eb8263f8..33e41eb7 100644 --- a/src/api/types/AzureContentSafetyGuardrailConfigAuthData.ts +++ b/src/api/types/AzureContentSafetyGuardrailConfigAuthData.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Authentication data for the Azure account */ -export type AzureContentSafetyGuardrailConfigAuthData = +export type AzureContentSafetyGuardrailConfigAuthData = | TrueFoundry.AzureKeyAuth | TrueFoundry.AzureCertificateAuth | TrueFoundry.AzureClientSecretAuth diff --git a/src/api/types/AzureContentSafetyGuardrailConfigConfig.ts b/src/api/types/AzureContentSafetyGuardrailConfigConfig.ts index a29d1570..287e567f 100644 --- a/src/api/types/AzureContentSafetyGuardrailConfigConfig.ts +++ b/src/api/types/AzureContentSafetyGuardrailConfigConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +uiType=Ignore diff --git a/src/api/types/AzureFoundryModel.ts b/src/api/types/AzureFoundryModel.ts index 4062c1ff..ea8b5e84 100644 --- a/src/api/types/AzureFoundryModel.ts +++ b/src/api/types/AzureFoundryModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Azure AI Foundry Model diff --git a/src/api/types/AzureFoundryModelAuthData.ts b/src/api/types/AzureFoundryModelAuthData.ts index 85685581..8987ba76 100644 --- a/src/api/types/AzureFoundryModelAuthData.ts +++ b/src/api/types/AzureFoundryModelAuthData.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Azure AI Foundry authentication credentials */ -export type AzureFoundryModelAuthData = +export type AzureFoundryModelAuthData = | TrueFoundry.AzureKeyAuth | TrueFoundry.AzureCertificateAuth | TrueFoundry.AzureClientSecretAuth diff --git a/src/api/types/AzureFoundryProviderAccount.ts b/src/api/types/AzureFoundryProviderAccount.ts index f7d6304d..7b6587d2 100644 --- a/src/api/types/AzureFoundryProviderAccount.ts +++ b/src/api/types/AzureFoundryProviderAccount.ts @@ -1,20 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** - * Azure AI Foundry Provider Account + * Azure AI Foundry Model Account */ export interface AzureFoundryProviderAccount { /** +value=provider-account/azure-foundry */ type: "provider-account/azure-foundry"; - /** The name of the Azure AI Foundry provider account */ + /** The name of the Azure AI Foundry model account */ name: string; - /** List of integrations that are associated with the Azure Foundry provider account */ + /** List of integrations that are associated with the Azure Foundry model account */ integrations: TrueFoundry.AzureFoundryModel[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/AzureIntegrations.ts b/src/api/types/AzureIntegrations.ts index 24e5cada..b930b29c 100644 --- a/src/api/types/AzureIntegrations.ts +++ b/src/api/types/AzureIntegrations.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +discriminator=type */ -export type AzureIntegrations = +export type AzureIntegrations = | TrueFoundry.AzureAksIntegration | TrueFoundry.AzureContainerRegistry | TrueFoundry.AzureBlobStorage diff --git a/src/api/types/AzureOpenAiModel.ts b/src/api/types/AzureOpenAiModel.ts index 60dbb350..7cca5326 100644 --- a/src/api/types/AzureOpenAiModel.ts +++ b/src/api/types/AzureOpenAiModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Azure OpenAI Model diff --git a/src/api/types/AzureOpenAiModelDeploymentType.ts b/src/api/types/AzureOpenAiModelDeploymentType.ts index 89073e5c..051f116c 100644 --- a/src/api/types/AzureOpenAiModelDeploymentType.ts +++ b/src/api/types/AzureOpenAiModelDeploymentType.ts @@ -2,9 +2,10 @@ /** Global: worldwide processing; Data zone (US): US data zone processing; Data zone (EU): EU data zone processing; Standard: single-region processing */ export const AzureOpenAiModelDeploymentType = { - Standard: "standard", - DatazoneUs: "datazone_us", - DatazoneEu: "datazone_eu", - Global: "global" - } as const; -export type AzureOpenAiModelDeploymentType = typeof AzureOpenAiModelDeploymentType[keyof typeof AzureOpenAiModelDeploymentType]; + Standard: "standard", + DatazoneUs: "datazone_us", + DatazoneEu: "datazone_eu", + Global: "global", +} as const; +export type AzureOpenAiModelDeploymentType = + (typeof AzureOpenAiModelDeploymentType)[keyof typeof AzureOpenAiModelDeploymentType]; diff --git a/src/api/types/AzureOpenAiProviderAccount.ts b/src/api/types/AzureOpenAiProviderAccount.ts index d84840f6..ef086cec 100644 --- a/src/api/types/AzureOpenAiProviderAccount.ts +++ b/src/api/types/AzureOpenAiProviderAccount.ts @@ -1,24 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** - * Azure OpenAI Provider Account + * Azure OpenAI Model Account */ export interface AzureOpenAiProviderAccount { /** +value=provider-account/azure-openai */ type: "provider-account/azure-openai"; - /** The name of the Azure OpenAI provider account */ + /** The name of the Azure OpenAI model account */ name: string; /** The Azure OpenAI Service endpoint URL. Should look like https://{resource-name}.openai.azure.com */ azureEndpoint: string; /** Azure OpenAI authentication credentials */ authData: TrueFoundry.AzureOpenAiProviderAccountAuthData; - /** List of integrations that are associated with the Azure OpenAI provider account */ + /** List of integrations that are associated with the Azure OpenAI model account */ integrations: TrueFoundry.AzureOpenAiModel[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/AzureOpenAiProviderAccountAuthData.ts b/src/api/types/AzureOpenAiProviderAccountAuthData.ts index 89c41e52..fec682cb 100644 --- a/src/api/types/AzureOpenAiProviderAccountAuthData.ts +++ b/src/api/types/AzureOpenAiProviderAccountAuthData.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Azure OpenAI authentication credentials */ -export type AzureOpenAiProviderAccountAuthData = +export type AzureOpenAiProviderAccountAuthData = | TrueFoundry.AzureKeyAuth | TrueFoundry.AzureCertificateAuth | TrueFoundry.AzureClientSecretAuth diff --git a/src/api/types/AzurePiiCategory.ts b/src/api/types/AzurePiiCategory.ts index 1dcda4e8..c46c16cd 100644 --- a/src/api/types/AzurePiiCategory.ts +++ b/src/api/types/AzurePiiCategory.ts @@ -1,167 +1,167 @@ // This file was auto-generated by Fern from our API Definition. export const AzurePiiCategory = { - All: "*", - AbaRoutingNumber: "ABARoutingNumber", - Address: "Address", - Age: "Age", - ArNationalIdentityNumber: "ARNationalIdentityNumber", - AuBankAccountNumber: "AUBankAccountNumber", - AuDriversLicenseNumber: "AUDriversLicenseNumber", - AuMedicalAccountNumber: "AUMedicalAccountNumber", - AuPassportNumber: "AUPassportNumber", - AuTaxFileNumber: "AUTaxFileNumber", - AuBusinessNumber: "AUBusinessNumber", - AuCompanyNumber: "AUCompanyNumber", - AtIdentityCard: "ATIdentityCard", - AtTaxIdentificationNumber: "ATTaxIdentificationNumber", - AtValueAddedTaxNumber: "ATValueAddedTaxNumber", - AzureDocumentDbAuthKey: "AzureDocumentDBAuthKey", - AzureIaasDatabaseConnectionAndSqlString: "AzureIAASDatabaseConnectionAndSQLString", - AzureIoTConnectionString: "AzureIoTConnectionString", - AzurePublishSettingPassword: "AzurePublishSettingPassword", - AzureRedisCacheString: "AzureRedisCacheString", - AzureSas: "AzureSAS", - AzureServiceBusString: "AzureServiceBusString", - AzureStorageAccountKey: "AzureStorageAccountKey", - AzureStorageAccountGeneric: "AzureStorageAccountGeneric", - BankAccountNumber: "BankAccountNumber", - BeNationalNumber: "BENationalNumber", - BeValueAddedTaxNumber: "BEValueAddedTaxNumber", - BrcpfNumber: "BRCPFNumber", - BrLegalEntityNumber: "BRLegalEntityNumber", - BrNationalIdrg: "BRNationalIDRG", - BgUniformCivilNumber: "BGUniformCivilNumber", - CaBankAccountNumber: "CABankAccountNumber", - CaDriversLicenseNumber: "CADriversLicenseNumber", - CaHealthServiceNumber: "CAHealthServiceNumber", - CaPassportNumber: "CAPassportNumber", - CaPersonalHealthId: "CAPersonalHealthID", - CaSocialInsuranceNumber: "CASocialInsuranceNumber", - ClIdentityCardNumber: "CLIdentityCardNumber", - CnResidentIdentityCardNumber: "CNResidentIdentityCardNumber", - CreditCardNumber: "CreditCardNumber", - HrIdentityCardNumber: "HRIdentityCardNumber", - HrNationalIdCardNumber: "HRNationalIDCardNumber", - HrPersonalIdentificationNumber: "HRPersonalIdentificationNumber", - CyIdentityCard: "CYIdentityCard", - CyTaxIdentificationNumber: "CYTaxIdentificationNumber", - CzPersonalIdentityNumber: "CZPersonalIdentityNumber", - Date: "Date", - DateTime: "DateTime", - DkPersonalIdentificationNumber: "DKPersonalIdentificationNumber", - DeaNumber: "DEANumber", - Email: "Email", - EePersonalIdentificationCode: "EEPersonalIdentificationCode", - EuDebitCardNumber: "EUDebitCardNumber", - EuDriversLicenseNumber: "EUDriversLicenseNumber", - EugpsCoordinates: "EUGPSCoordinates", - EuNationalIdentificationNumber: "EUNationalIdentificationNumber", - EuPassportNumber: "EUPassportNumber", - EuSocialSecurityNumber: "EUSocialSecurityNumber", - EuTaxIdentificationNumber: "EUTaxIdentificationNumber", - FiEuropeanHealthNumber: "FIEuropeanHealthNumber", - FiNationalId: "FINationalID", - FiPassportNumber: "FIPassportNumber", - FrDriversLicenseNumber: "FRDriversLicenseNumber", - FrHealthInsuranceNumber: "FRHealthInsuranceNumber", - FrNationalId: "FRNationalID", - FrPassportNumber: "FRPassportNumber", - FrSocialSecurityNumber: "FRSocialSecurityNumber", - FrTaxIdentificationNumber: "FRTaxIdentificationNumber", - FrValueAddedTaxNumber: "FRValueAddedTaxNumber", - DeDriversLicenseNumber: "DEDriversLicenseNumber", - DePassportNumber: "DEPassportNumber", - DeIdentityCardNumber: "DEIdentityCardNumber", - DeTaxIdentificationNumber: "DETaxIdentificationNumber", - DeValueAddedTaxNumber: "DEValueAddedTaxNumber", - GrNationalIdCard: "GRNationalIDCard", - GrTaxIdentificationNumber: "GRTaxIdentificationNumber", - HkIdentityCardNumber: "HKIdentityCardNumber", - HuValueAddedTaxNumber: "HUValueAddedTaxNumber", - HuPersonalIdentificationNumber: "HUPersonalIdentificationNumber", - HuTaxIdentificationNumber: "HUTaxIdentificationNumber", - InPermanentAccountNumber: "INPermanentAccountNumber", - InUniqueIdentificationNumber: "INUniqueIdentificationNumber", - IdIdentityCardNumber: "IDIdentityCardNumber", - InternationalBankingAccountNumber: "InternationalBankingAccountNumber", - IpAddress: "IPAddress", - IePersonalPublicServiceNumber: "IEPersonalPublicServiceNumber", - IlBankAccountNumber: "ILBankAccountNumber", - IlNationalId: "ILNationalID", - ItDriversLicenseNumber: "ITDriversLicenseNumber", - ItFiscalCode: "ITFiscalCode", - ItValueAddedTaxNumber: "ITValueAddedTaxNumber", - JpBankAccountNumber: "JPBankAccountNumber", - JpDriversLicenseNumber: "JPDriversLicenseNumber", - JpPassportNumber: "JPPassportNumber", - JpResidentRegistrationNumber: "JPResidentRegistrationNumber", - JpSocialInsuranceNumber: "JPSocialInsuranceNumber", - JpMyNumberCorporate: "JPMyNumberCorporate", - JpMyNumberPersonal: "JPMyNumberPersonal", - JpResidenceCardNumber: "JPResidenceCardNumber", - LvPersonalCode: "LVPersonalCode", - LtPersonalCode: "LTPersonalCode", - LuNationalIdentificationNumberNatural: "LUNationalIdentificationNumberNatural", - LuNationalIdentificationNumberNonNatural: "LUNationalIdentificationNumberNonNatural", - MyIdentityCardNumber: "MYIdentityCardNumber", - MtIdentityCardNumber: "MTIdentityCardNumber", - MtTaxIdNumber: "MTTaxIDNumber", - NlCitizensServiceNumber: "NLCitizensServiceNumber", - NlTaxIdentificationNumber: "NLTaxIdentificationNumber", - NlValueAddedTaxNumber: "NLValueAddedTaxNumber", - NzBankAccountNumber: "NZBankAccountNumber", - NzDriversLicenseNumber: "NZDriversLicenseNumber", - NzInlandRevenueNumber: "NZInlandRevenueNumber", - NzMinistryOfHealthNumber: "NZMinistryOfHealthNumber", - NzSocialWelfareNumber: "NZSocialWelfareNumber", - NoIdentityNumber: "NOIdentityNumber", - Organization: "Organization", - Person: "Person", - PersonType: "PersonType", - PhUnifiedMultiPurposeIdNumber: "PHUnifiedMultiPurposeIDNumber", - PhoneNumber: "PhoneNumber", - PlIdentityCard: "PLIdentityCard", - PlNationalId: "PLNationalID", - PlPassportNumber: "PLPassportNumber", - PlTaxIdentificationNumber: "PLTaxIdentificationNumber", - PlregonNumber: "PLREGONNumber", - PtCitizenCardNumber: "PTCitizenCardNumber", - PtTaxIdentificationNumber: "PTTaxIdentificationNumber", - RoPersonalNumericalCode: "ROPersonalNumericalCode", - RuPassportNumberDomestic: "RUPassportNumberDomestic", - RuPassportNumberInternational: "RUPassportNumberInternational", - SaNationalId: "SANationalID", - SgNationalRegistrationIdentityCardNumber: "SGNationalRegistrationIdentityCardNumber", - SkPersonalNumber: "SKPersonalNumber", - SiTaxIdentificationNumber: "SITaxIdentificationNumber", - SiUniqueMasterCitizenNumber: "SIUniqueMasterCitizenNumber", - ZaIdentificationNumber: "ZAIdentificationNumber", - KrResidentRegistrationNumber: "KRResidentRegistrationNumber", - Esdni: "ESDNI", - EsSocialSecurityNumber: "ESSocialSecurityNumber", - EsTaxIdentificationNumber: "ESTaxIdentificationNumber", - AzureSqlConnectionString: "AzureSQLConnectionString", - SeNationalId: "SENationalID", - SePassportNumber: "SEPassportNumber", - SeTaxIdentificationNumber: "SETaxIdentificationNumber", - SwiftCode: "SWIFTCode", - ChSocialSecurityNumber: "CHSocialSecurityNumber", - TwNationalId: "TWNationalID", - TwPassportNumber: "TWPassportNumber", - TwResidentCertificate: "TWResidentCertificate", - ThPopulationIdentificationCode: "THPopulationIdentificationCode", - TrNationalIdentificationNumber: "TRNationalIdentificationNumber", - UkDriversLicenseNumber: "UKDriversLicenseNumber", - UkElectoralRollNumber: "UKElectoralRollNumber", - UkNationalHealthNumber: "UKNationalHealthNumber", - UkNationalInsuranceNumber: "UKNationalInsuranceNumber", - UkUniqueTaxpayerNumber: "UKUniqueTaxpayerNumber", - UsukPassportNumber: "USUKPassportNumber", - UsBankAccountNumber: "USBankAccountNumber", - UsDriversLicenseNumber: "USDriversLicenseNumber", - UsIndividualTaxpayerIdentification: "USIndividualTaxpayerIdentification", - UsSocialSecurityNumber: "USSocialSecurityNumber", - Url: "URL" - } as const; -export type AzurePiiCategory = typeof AzurePiiCategory[keyof typeof AzurePiiCategory]; + All: "*", + AbaRoutingNumber: "ABARoutingNumber", + Address: "Address", + Age: "Age", + ArNationalIdentityNumber: "ARNationalIdentityNumber", + AuBankAccountNumber: "AUBankAccountNumber", + AuDriversLicenseNumber: "AUDriversLicenseNumber", + AuMedicalAccountNumber: "AUMedicalAccountNumber", + AuPassportNumber: "AUPassportNumber", + AuTaxFileNumber: "AUTaxFileNumber", + AuBusinessNumber: "AUBusinessNumber", + AuCompanyNumber: "AUCompanyNumber", + AtIdentityCard: "ATIdentityCard", + AtTaxIdentificationNumber: "ATTaxIdentificationNumber", + AtValueAddedTaxNumber: "ATValueAddedTaxNumber", + AzureDocumentDbAuthKey: "AzureDocumentDBAuthKey", + AzureIaasDatabaseConnectionAndSqlString: "AzureIAASDatabaseConnectionAndSQLString", + AzureIoTConnectionString: "AzureIoTConnectionString", + AzurePublishSettingPassword: "AzurePublishSettingPassword", + AzureRedisCacheString: "AzureRedisCacheString", + AzureSas: "AzureSAS", + AzureServiceBusString: "AzureServiceBusString", + AzureStorageAccountKey: "AzureStorageAccountKey", + AzureStorageAccountGeneric: "AzureStorageAccountGeneric", + BankAccountNumber: "BankAccountNumber", + BeNationalNumber: "BENationalNumber", + BeValueAddedTaxNumber: "BEValueAddedTaxNumber", + BrcpfNumber: "BRCPFNumber", + BrLegalEntityNumber: "BRLegalEntityNumber", + BrNationalIdrg: "BRNationalIDRG", + BgUniformCivilNumber: "BGUniformCivilNumber", + CaBankAccountNumber: "CABankAccountNumber", + CaDriversLicenseNumber: "CADriversLicenseNumber", + CaHealthServiceNumber: "CAHealthServiceNumber", + CaPassportNumber: "CAPassportNumber", + CaPersonalHealthId: "CAPersonalHealthID", + CaSocialInsuranceNumber: "CASocialInsuranceNumber", + ClIdentityCardNumber: "CLIdentityCardNumber", + CnResidentIdentityCardNumber: "CNResidentIdentityCardNumber", + CreditCardNumber: "CreditCardNumber", + HrIdentityCardNumber: "HRIdentityCardNumber", + HrNationalIdCardNumber: "HRNationalIDCardNumber", + HrPersonalIdentificationNumber: "HRPersonalIdentificationNumber", + CyIdentityCard: "CYIdentityCard", + CyTaxIdentificationNumber: "CYTaxIdentificationNumber", + CzPersonalIdentityNumber: "CZPersonalIdentityNumber", + Date: "Date", + DateTime: "DateTime", + DkPersonalIdentificationNumber: "DKPersonalIdentificationNumber", + DeaNumber: "DEANumber", + Email: "Email", + EePersonalIdentificationCode: "EEPersonalIdentificationCode", + EuDebitCardNumber: "EUDebitCardNumber", + EuDriversLicenseNumber: "EUDriversLicenseNumber", + EugpsCoordinates: "EUGPSCoordinates", + EuNationalIdentificationNumber: "EUNationalIdentificationNumber", + EuPassportNumber: "EUPassportNumber", + EuSocialSecurityNumber: "EUSocialSecurityNumber", + EuTaxIdentificationNumber: "EUTaxIdentificationNumber", + FiEuropeanHealthNumber: "FIEuropeanHealthNumber", + FiNationalId: "FINationalID", + FiPassportNumber: "FIPassportNumber", + FrDriversLicenseNumber: "FRDriversLicenseNumber", + FrHealthInsuranceNumber: "FRHealthInsuranceNumber", + FrNationalId: "FRNationalID", + FrPassportNumber: "FRPassportNumber", + FrSocialSecurityNumber: "FRSocialSecurityNumber", + FrTaxIdentificationNumber: "FRTaxIdentificationNumber", + FrValueAddedTaxNumber: "FRValueAddedTaxNumber", + DeDriversLicenseNumber: "DEDriversLicenseNumber", + DePassportNumber: "DEPassportNumber", + DeIdentityCardNumber: "DEIdentityCardNumber", + DeTaxIdentificationNumber: "DETaxIdentificationNumber", + DeValueAddedTaxNumber: "DEValueAddedTaxNumber", + GrNationalIdCard: "GRNationalIDCard", + GrTaxIdentificationNumber: "GRTaxIdentificationNumber", + HkIdentityCardNumber: "HKIdentityCardNumber", + HuValueAddedTaxNumber: "HUValueAddedTaxNumber", + HuPersonalIdentificationNumber: "HUPersonalIdentificationNumber", + HuTaxIdentificationNumber: "HUTaxIdentificationNumber", + InPermanentAccountNumber: "INPermanentAccountNumber", + InUniqueIdentificationNumber: "INUniqueIdentificationNumber", + IdIdentityCardNumber: "IDIdentityCardNumber", + InternationalBankingAccountNumber: "InternationalBankingAccountNumber", + IpAddress: "IPAddress", + IePersonalPublicServiceNumber: "IEPersonalPublicServiceNumber", + IlBankAccountNumber: "ILBankAccountNumber", + IlNationalId: "ILNationalID", + ItDriversLicenseNumber: "ITDriversLicenseNumber", + ItFiscalCode: "ITFiscalCode", + ItValueAddedTaxNumber: "ITValueAddedTaxNumber", + JpBankAccountNumber: "JPBankAccountNumber", + JpDriversLicenseNumber: "JPDriversLicenseNumber", + JpPassportNumber: "JPPassportNumber", + JpResidentRegistrationNumber: "JPResidentRegistrationNumber", + JpSocialInsuranceNumber: "JPSocialInsuranceNumber", + JpMyNumberCorporate: "JPMyNumberCorporate", + JpMyNumberPersonal: "JPMyNumberPersonal", + JpResidenceCardNumber: "JPResidenceCardNumber", + LvPersonalCode: "LVPersonalCode", + LtPersonalCode: "LTPersonalCode", + LuNationalIdentificationNumberNatural: "LUNationalIdentificationNumberNatural", + LuNationalIdentificationNumberNonNatural: "LUNationalIdentificationNumberNonNatural", + MyIdentityCardNumber: "MYIdentityCardNumber", + MtIdentityCardNumber: "MTIdentityCardNumber", + MtTaxIdNumber: "MTTaxIDNumber", + NlCitizensServiceNumber: "NLCitizensServiceNumber", + NlTaxIdentificationNumber: "NLTaxIdentificationNumber", + NlValueAddedTaxNumber: "NLValueAddedTaxNumber", + NzBankAccountNumber: "NZBankAccountNumber", + NzDriversLicenseNumber: "NZDriversLicenseNumber", + NzInlandRevenueNumber: "NZInlandRevenueNumber", + NzMinistryOfHealthNumber: "NZMinistryOfHealthNumber", + NzSocialWelfareNumber: "NZSocialWelfareNumber", + NoIdentityNumber: "NOIdentityNumber", + Organization: "Organization", + Person: "Person", + PersonType: "PersonType", + PhUnifiedMultiPurposeIdNumber: "PHUnifiedMultiPurposeIDNumber", + PhoneNumber: "PhoneNumber", + PlIdentityCard: "PLIdentityCard", + PlNationalId: "PLNationalID", + PlPassportNumber: "PLPassportNumber", + PlTaxIdentificationNumber: "PLTaxIdentificationNumber", + PlregonNumber: "PLREGONNumber", + PtCitizenCardNumber: "PTCitizenCardNumber", + PtTaxIdentificationNumber: "PTTaxIdentificationNumber", + RoPersonalNumericalCode: "ROPersonalNumericalCode", + RuPassportNumberDomestic: "RUPassportNumberDomestic", + RuPassportNumberInternational: "RUPassportNumberInternational", + SaNationalId: "SANationalID", + SgNationalRegistrationIdentityCardNumber: "SGNationalRegistrationIdentityCardNumber", + SkPersonalNumber: "SKPersonalNumber", + SiTaxIdentificationNumber: "SITaxIdentificationNumber", + SiUniqueMasterCitizenNumber: "SIUniqueMasterCitizenNumber", + ZaIdentificationNumber: "ZAIdentificationNumber", + KrResidentRegistrationNumber: "KRResidentRegistrationNumber", + Esdni: "ESDNI", + EsSocialSecurityNumber: "ESSocialSecurityNumber", + EsTaxIdentificationNumber: "ESTaxIdentificationNumber", + AzureSqlConnectionString: "AzureSQLConnectionString", + SeNationalId: "SENationalID", + SePassportNumber: "SEPassportNumber", + SeTaxIdentificationNumber: "SETaxIdentificationNumber", + SwiftCode: "SWIFTCode", + ChSocialSecurityNumber: "CHSocialSecurityNumber", + TwNationalId: "TWNationalID", + TwPassportNumber: "TWPassportNumber", + TwResidentCertificate: "TWResidentCertificate", + ThPopulationIdentificationCode: "THPopulationIdentificationCode", + TrNationalIdentificationNumber: "TRNationalIdentificationNumber", + UkDriversLicenseNumber: "UKDriversLicenseNumber", + UkElectoralRollNumber: "UKElectoralRollNumber", + UkNationalHealthNumber: "UKNationalHealthNumber", + UkNationalInsuranceNumber: "UKNationalInsuranceNumber", + UkUniqueTaxpayerNumber: "UKUniqueTaxpayerNumber", + UsukPassportNumber: "USUKPassportNumber", + UsBankAccountNumber: "USBankAccountNumber", + UsDriversLicenseNumber: "USDriversLicenseNumber", + UsIndividualTaxpayerIdentification: "USIndividualTaxpayerIdentification", + UsSocialSecurityNumber: "USSocialSecurityNumber", + Url: "URL", +} as const; +export type AzurePiiCategory = (typeof AzurePiiCategory)[keyof typeof AzurePiiCategory]; diff --git a/src/api/types/AzurePiiGuardrailConfig.ts b/src/api/types/AzurePiiGuardrailConfig.ts index f12d43fd..6cf207fc 100644 --- a/src/api/types/AzurePiiGuardrailConfig.ts +++ b/src/api/types/AzurePiiGuardrailConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Azure PII diff --git a/src/api/types/AzurePiiGuardrailConfigAuthData.ts b/src/api/types/AzurePiiGuardrailConfigAuthData.ts index f239eade..fcd47769 100644 --- a/src/api/types/AzurePiiGuardrailConfigAuthData.ts +++ b/src/api/types/AzurePiiGuardrailConfigAuthData.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Authentication data for the Azure account */ -export type AzurePiiGuardrailConfigAuthData = +export type AzurePiiGuardrailConfigAuthData = | TrueFoundry.AzureKeyAuth | TrueFoundry.AzureCertificateAuth | TrueFoundry.AzureClientSecretAuth diff --git a/src/api/types/AzurePiiGuardrailConfigConfig.ts b/src/api/types/AzurePiiGuardrailConfigConfig.ts index 3a45c2f0..8e0e4a4e 100644 --- a/src/api/types/AzurePiiGuardrailConfigConfig.ts +++ b/src/api/types/AzurePiiGuardrailConfigConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +uiType=Ignore diff --git a/src/api/types/AzurePiiGuardrailConfigConfigDomain.ts b/src/api/types/AzurePiiGuardrailConfigConfigDomain.ts index a7bcda0b..18c75f92 100644 --- a/src/api/types/AzurePiiGuardrailConfigConfigDomain.ts +++ b/src/api/types/AzurePiiGuardrailConfigConfigDomain.ts @@ -2,7 +2,8 @@ /** Specialized domain for PII detection. Use phi for PHI (Protected Health Information) or none for general text */ export const AzurePiiGuardrailConfigConfigDomain = { - None: "none", - Phi: "phi" - } as const; -export type AzurePiiGuardrailConfigConfigDomain = typeof AzurePiiGuardrailConfigConfigDomain[keyof typeof AzurePiiGuardrailConfigConfigDomain]; + None: "none", + Phi: "phi", +} as const; +export type AzurePiiGuardrailConfigConfigDomain = + (typeof AzurePiiGuardrailConfigConfigDomain)[keyof typeof AzurePiiGuardrailConfigConfigDomain]; diff --git a/src/api/types/AzurePiiGuardrailConfigOperation.ts b/src/api/types/AzurePiiGuardrailConfigOperation.ts index 4e0fd770..80e9b7a2 100644 --- a/src/api/types/AzurePiiGuardrailConfigOperation.ts +++ b/src/api/types/AzurePiiGuardrailConfigOperation.ts @@ -2,7 +2,8 @@ /** The operation type to use for the Guardrail. Validate guardrails are used to validate requests and mutate can validate as well as mutate requests. Validate guardrails are run in parallel while mutate guardrails are run sequentially. */ export const AzurePiiGuardrailConfigOperation = { - Mutate: "mutate", - Validate: "validate" - } as const; -export type AzurePiiGuardrailConfigOperation = typeof AzurePiiGuardrailConfigOperation[keyof typeof AzurePiiGuardrailConfigOperation]; + Mutate: "mutate", + Validate: "validate", +} as const; +export type AzurePiiGuardrailConfigOperation = + (typeof AzurePiiGuardrailConfigOperation)[keyof typeof AzurePiiGuardrailConfigOperation]; diff --git a/src/api/types/AzurePromptShieldGuardrailConfig.ts b/src/api/types/AzurePromptShieldGuardrailConfig.ts index 3a2090b0..b8ee21b0 100644 --- a/src/api/types/AzurePromptShieldGuardrailConfig.ts +++ b/src/api/types/AzurePromptShieldGuardrailConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Azure Prompt Shield diff --git a/src/api/types/AzurePromptShieldGuardrailConfigAuthData.ts b/src/api/types/AzurePromptShieldGuardrailConfigAuthData.ts index 0a53a68c..ada15271 100644 --- a/src/api/types/AzurePromptShieldGuardrailConfigAuthData.ts +++ b/src/api/types/AzurePromptShieldGuardrailConfigAuthData.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Authentication data for the Azure account */ -export type AzurePromptShieldGuardrailConfigAuthData = +export type AzurePromptShieldGuardrailConfigAuthData = | TrueFoundry.AzureKeyAuth | TrueFoundry.AzureCertificateAuth | TrueFoundry.AzureClientSecretAuth diff --git a/src/api/types/AzureProviderAccount.ts b/src/api/types/AzureProviderAccount.ts index 626eaeb0..0eeaee15 100644 --- a/src/api/types/AzureProviderAccount.ts +++ b/src/api/types/AzureProviderAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Azure diff --git a/src/api/types/AzureReposIntegration.ts b/src/api/types/AzureReposIntegration.ts index 67575148..dc1b4a14 100644 --- a/src/api/types/AzureReposIntegration.ts +++ b/src/api/types/AzureReposIntegration.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Azure Repo diff --git a/src/api/types/AzureReposIntegrationAuthData.ts b/src/api/types/AzureReposIntegrationAuthData.ts index 0baafe4d..9d125d6d 100644 --- a/src/api/types/AzureReposIntegrationAuthData.ts +++ b/src/api/types/AzureReposIntegrationAuthData.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Auth */ -export type AzureReposIntegrationAuthData = - | TrueFoundry.VcsoAuthAuthData - | TrueFoundry.VcsTokenAuthData; +export type AzureReposIntegrationAuthData = TrueFoundry.VcsoAuthAuthData | TrueFoundry.VcsTokenAuthData; diff --git a/src/api/types/AzureVault.ts b/src/api/types/AzureVault.ts index 71da8367..b3dea534 100644 --- a/src/api/types/AzureVault.ts +++ b/src/api/types/AzureVault.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Azure Vault diff --git a/src/api/types/BaseOAuth2Login.ts b/src/api/types/BaseOAuth2Login.ts index 5935ac0d..4cf3f07f 100644 --- a/src/api/types/BaseOAuth2Login.ts +++ b/src/api/types/BaseOAuth2Login.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * OAuth2 client configuration to get the JWT. diff --git a/src/api/types/BaseOAuth2LoginJwtSource.ts b/src/api/types/BaseOAuth2LoginJwtSource.ts index 1c860f81..e85cd745 100644 --- a/src/api/types/BaseOAuth2LoginJwtSource.ts +++ b/src/api/types/BaseOAuth2LoginJwtSource.ts @@ -2,7 +2,7 @@ /** Source of the JWT token to be used for verification. */ export const BaseOAuth2LoginJwtSource = { - AccessToken: "access_token", - IdToken: "id_token" - } as const; -export type BaseOAuth2LoginJwtSource = typeof BaseOAuth2LoginJwtSource[keyof typeof BaseOAuth2LoginJwtSource]; + AccessToken: "access_token", + IdToken: "id_token", +} as const; +export type BaseOAuth2LoginJwtSource = (typeof BaseOAuth2LoginJwtSource)[keyof typeof BaseOAuth2LoginJwtSource]; diff --git a/src/api/types/BaseRemoteAgent.ts b/src/api/types/BaseRemoteAgent.ts index ed13b147..e8cf95e5 100644 --- a/src/api/types/BaseRemoteAgent.ts +++ b/src/api/types/BaseRemoteAgent.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface BaseRemoteAgent { /** The name of the Agent */ diff --git a/src/api/types/BaseService.ts b/src/api/types/BaseService.ts index adbb6ed8..304c7587 100644 --- a/src/api/types/BaseService.ts +++ b/src/api/types/BaseService.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface BaseService { /** @@ -13,7 +13,7 @@ export interface BaseService { artifactsDownload?: TrueFoundry.ArtifactsDownload; resources?: TrueFoundry.Resources; /** Configure environment variables to be injected in the service either as plain text or secrets. [Docs](https://docs.truefoundry.com/docs/env-variables) */ - env?: Record; + env?: Record | null; /** Expose the deployment to make it accessible over the internet or keep it private. Implement authentication to restrict access. [Docs](https://docs.truefoundry.com/docs/define-ports-and-domains) */ ports: TrueFoundry.Port[]; serviceAccount?: string; diff --git a/src/api/types/BaseServiceImage.ts b/src/api/types/BaseServiceImage.ts index 3044b9b6..19b85fab 100644 --- a/src/api/types/BaseServiceImage.ts +++ b/src/api/types/BaseServiceImage.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Specify whether you want to deploy a Docker image or build and deploy from source code */ -export type BaseServiceImage = - | TrueFoundry.Build - | TrueFoundry.Image; +export type BaseServiceImage = TrueFoundry.Build | TrueFoundry.Image; diff --git a/src/api/types/BaseServiceMountsItem.ts b/src/api/types/BaseServiceMountsItem.ts index 47dcdb2f..6cb2a955 100644 --- a/src/api/types/BaseServiceMountsItem.ts +++ b/src/api/types/BaseServiceMountsItem.ts @@ -1,8 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; -export type BaseServiceMountsItem = - | TrueFoundry.SecretMount - | TrueFoundry.StringDataMount - | TrueFoundry.VolumeMount; +export type BaseServiceMountsItem = TrueFoundry.SecretMount | TrueFoundry.StringDataMount | TrueFoundry.VolumeMount; diff --git a/src/api/types/BaseWorkbenchInput.ts b/src/api/types/BaseWorkbenchInput.ts index 58a5a455..55e5f96a 100644 --- a/src/api/types/BaseWorkbenchInput.ts +++ b/src/api/types/BaseWorkbenchInput.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Describes the configuration for the service @@ -15,7 +15,7 @@ export interface BaseWorkbenchInput { homeDirectorySize: number; resources?: TrueFoundry.Resources; /** Configure environment variables to be injected in the service either as plain text or secrets. [Docs](https://docs.truefoundry.com/docs/environment-variables-and-secrets-jobs) */ - env?: Record; + env?: Record | null; /** Configure data to be mounted to workbench pod(s) as a string, secret or volume. [Docs](https://docs.truefoundry.com/docs/mounting-volumes-job) */ mounts?: TrueFoundry.BaseWorkbenchInputMountsItem[]; /** +sort=10113 */ diff --git a/src/api/types/BaseWorkbenchInputMountsItem.ts b/src/api/types/BaseWorkbenchInputMountsItem.ts index 1ed5758d..23001a45 100644 --- a/src/api/types/BaseWorkbenchInputMountsItem.ts +++ b/src/api/types/BaseWorkbenchInputMountsItem.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; -export type BaseWorkbenchInputMountsItem = +export type BaseWorkbenchInputMountsItem = | TrueFoundry.SecretMount | TrueFoundry.StringDataMount | TrueFoundry.VolumeMount; diff --git a/src/api/types/BasetenIntegrations.ts b/src/api/types/BasetenIntegrations.ts index db533f39..14d84cde 100644 --- a/src/api/types/BasetenIntegrations.ts +++ b/src/api/types/BasetenIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type BasetenIntegrations = TrueFoundry.BasetenModel; diff --git a/src/api/types/BasetenModel.ts b/src/api/types/BasetenModel.ts index c2ed0cbb..2a01cdc2 100644 --- a/src/api/types/BasetenModel.ts +++ b/src/api/types/BasetenModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Baseten Model diff --git a/src/api/types/BasetenProviderAccount.ts b/src/api/types/BasetenProviderAccount.ts index bda3990d..e10ede76 100644 --- a/src/api/types/BasetenProviderAccount.ts +++ b/src/api/types/BasetenProviderAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Baseten @@ -8,14 +8,14 @@ import * as TrueFoundry from "../index.js"; export interface BasetenProviderAccount { /** +value=provider-account/baseten */ type: "provider-account/baseten"; - /** The name of the Baseten provider account */ + /** The name of the Baseten model account */ name: string; authData: TrueFoundry.BasetenKeyAuth; - /** List of integrations that are associated with the Baseten provider account */ + /** List of integrations that are associated with the Baseten model account */ integrations?: TrueFoundry.BasetenIntegrations[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/BedrockMantleModel.ts b/src/api/types/BedrockMantleModel.ts index cc78fa63..b6a1fd33 100644 --- a/src/api/types/BedrockMantleModel.ts +++ b/src/api/types/BedrockMantleModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Bedrock Mantle Model diff --git a/src/api/types/BedrockModel.ts b/src/api/types/BedrockModel.ts index 4448c6f3..55b7207a 100644 --- a/src/api/types/BedrockModel.ts +++ b/src/api/types/BedrockModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Bedrock Model diff --git a/src/api/types/BitbucketDataCenterIntegration.ts b/src/api/types/BitbucketDataCenterIntegration.ts index 88f0b22f..f74ebd93 100644 --- a/src/api/types/BitbucketDataCenterIntegration.ts +++ b/src/api/types/BitbucketDataCenterIntegration.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Bitbucket Data Center diff --git a/src/api/types/BitbucketIntegration.ts b/src/api/types/BitbucketIntegration.ts index 4a065899..94275884 100644 --- a/src/api/types/BitbucketIntegration.ts +++ b/src/api/types/BitbucketIntegration.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Bitbucket diff --git a/src/api/types/BitbucketIntegrationAuthData.ts b/src/api/types/BitbucketIntegrationAuthData.ts index b8fcd825..72064d9a 100644 --- a/src/api/types/BitbucketIntegrationAuthData.ts +++ b/src/api/types/BitbucketIntegrationAuthData.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Auth */ -export type BitbucketIntegrationAuthData = - | TrueFoundry.VcsoAuthAuthData - | TrueFoundry.VcsTokenAuthData; +export type BitbucketIntegrationAuthData = TrueFoundry.VcsoAuthAuthData | TrueFoundry.VcsTokenAuthData; diff --git a/src/api/types/BitbucketIntegrations.ts b/src/api/types/BitbucketIntegrations.ts index ee269968..ec31312c 100644 --- a/src/api/types/BitbucketIntegrations.ts +++ b/src/api/types/BitbucketIntegrations.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +discriminator=type */ -export type BitbucketIntegrations = - | TrueFoundry.BitbucketIntegration - | TrueFoundry.BitbucketDataCenterIntegration; +export type BitbucketIntegrations = TrueFoundry.BitbucketIntegration | TrueFoundry.BitbucketDataCenterIntegration; diff --git a/src/api/types/BitbucketProviderAccount.ts b/src/api/types/BitbucketProviderAccount.ts index 3d86d67d..86b6e39b 100644 --- a/src/api/types/BitbucketProviderAccount.ts +++ b/src/api/types/BitbucketProviderAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Bitbucket diff --git a/src/api/types/BlobStorageReference.ts b/src/api/types/BlobStorageReference.ts index 2d68bd13..c5e6b30f 100644 --- a/src/api/types/BlobStorageReference.ts +++ b/src/api/types/BlobStorageReference.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * A reference to content offloaded to blob storage diff --git a/src/api/types/BudgetAlert.ts b/src/api/types/BudgetAlert.ts index fd3d39c2..84424b92 100644 --- a/src/api/types/BudgetAlert.ts +++ b/src/api/types/BudgetAlert.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Budget Alert diff --git a/src/api/types/BudgetConfig.ts b/src/api/types/BudgetConfig.ts index 5154e39e..41e38afc 100644 --- a/src/api/types/BudgetConfig.ts +++ b/src/api/types/BudgetConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Budget Configuration diff --git a/src/api/types/BudgetEntityUsage.ts b/src/api/types/BudgetEntityUsage.ts new file mode 100644 index 00000000..5a90c9eb --- /dev/null +++ b/src/api/types/BudgetEntityUsage.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +export interface BudgetEntityUsage { + /** Entity counter this usage maps to; null for aggregate budgets. */ + entity?: string | null; + /** Per-period usage keyed by period (cost_per_day, cost_per_month, ...). */ + periods: Record; +} diff --git a/src/api/types/BudgetLimitUnit.ts b/src/api/types/BudgetLimitUnit.ts index 77033cb0..0ce3cdc0 100644 --- a/src/api/types/BudgetLimitUnit.ts +++ b/src/api/types/BudgetLimitUnit.ts @@ -2,11 +2,11 @@ /** Unit for budget limit calculation */ export const BudgetLimitUnit = { - CostPerDay: "cost_per_day", - CostPerMonth: "cost_per_month", - CostPerWeek: "cost_per_week", - CostPerQuarter: "cost_per_quarter", - TokensPerDay: "tokens_per_day", - TokensPerMonth: "tokens_per_month" - } as const; -export type BudgetLimitUnit = typeof BudgetLimitUnit[keyof typeof BudgetLimitUnit]; + CostPerDay: "cost_per_day", + CostPerMonth: "cost_per_month", + CostPerWeek: "cost_per_week", + CostPerQuarter: "cost_per_quarter", + TokensPerDay: "tokens_per_day", + TokensPerMonth: "tokens_per_month", +} as const; +export type BudgetLimitUnit = (typeof BudgetLimitUnit)[keyof typeof BudgetLimitUnit]; diff --git a/src/api/types/BudgetRule.ts b/src/api/types/BudgetRule.ts index bc48530b..a4fa245a 100644 --- a/src/api/types/BudgetRule.ts +++ b/src/api/types/BudgetRule.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Budget Rule diff --git a/src/api/types/BudgetUsageEntry.ts b/src/api/types/BudgetUsageEntry.ts new file mode 100644 index 00000000..ff9662a8 --- /dev/null +++ b/src/api/types/BudgetUsageEntry.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +export interface BudgetUsageEntry { + /** Human-readable name of the budget. */ + name: string; + /** Budget type. */ + type: TrueFoundry.BudgetUsageEntryType; + /** Team that owns the budget; null for tenant-budget-config. */ + teamName?: string | null; + /** How counters are partitioned (per-user, per-model, per-virtual-account, aggregate, or metadata:). */ + appliesTo: string; + /** Budget mode. */ + mode: TrueFoundry.BudgetUsageEntryMode; + /** Per-entity usage for this budget. For my-usage and simulate this contains a single entity; leaderboard-style endpoints may return many. */ + entities: TrueFoundry.BudgetEntityUsage[]; +} diff --git a/src/api/types/BudgetUsageEntryMode.ts b/src/api/types/BudgetUsageEntryMode.ts new file mode 100644 index 00000000..2d4677f9 --- /dev/null +++ b/src/api/types/BudgetUsageEntryMode.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +/** Budget mode. */ +export const BudgetUsageEntryMode = { + Enforce: "enforce", + Audit: "audit", + SoftEnforce: "soft_enforce", +} as const; +export type BudgetUsageEntryMode = (typeof BudgetUsageEntryMode)[keyof typeof BudgetUsageEntryMode]; diff --git a/src/api/types/BudgetUsageEntryType.ts b/src/api/types/BudgetUsageEntryType.ts new file mode 100644 index 00000000..8b2171af --- /dev/null +++ b/src/api/types/BudgetUsageEntryType.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +/** Budget type. */ +export const BudgetUsageEntryType = { + TenantBudgetConfig: "tenant-budget-config", + TeamBudgetConfig: "team-budget-config", +} as const; +export type BudgetUsageEntryType = (typeof BudgetUsageEntryType)[keyof typeof BudgetUsageEntryType]; diff --git a/src/api/types/BudgetUsageResponse.ts b/src/api/types/BudgetUsageResponse.ts new file mode 100644 index 00000000..cba19108 --- /dev/null +++ b/src/api/types/BudgetUsageResponse.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +export interface BudgetUsageResponse { + /** Budgets that apply, with current usage. */ + matched: TrueFoundry.BudgetUsageEntry[]; +} diff --git a/src/api/types/BudgetV2Alert.ts b/src/api/types/BudgetV2Alert.ts index f4e582a2..13d23a79 100644 --- a/src/api/types/BudgetV2Alert.ts +++ b/src/api/types/BudgetV2Alert.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Budget Alert @@ -8,8 +8,6 @@ import * as TrueFoundry from "../index.js"; export interface BudgetV2Alert { /** List of usage percentages (0-100) at which alerts should be triggered. Default thresholds are [75, 90, 95, 100]. */ thresholds: number[]; - /** Notify the user who caused the breach. Only applies to per-user budgets. */ - notifyBreachingUser?: boolean; /** Select where to send budget alert notifications */ notificationTarget?: TrueFoundry.NotificationTarget[]; } diff --git a/src/api/types/BudgetV2AppliesTo.ts b/src/api/types/BudgetV2AppliesTo.ts index e9393ce2..ef46e238 100644 --- a/src/api/types/BudgetV2AppliesTo.ts +++ b/src/api/types/BudgetV2AppliesTo.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +discriminator=type */ -export type BudgetV2AppliesTo = +export type BudgetV2AppliesTo = | TrueFoundry.BudgetV2AppliesToAggregate | TrueFoundry.BudgetV2AppliesToPerUser | TrueFoundry.BudgetV2AppliesToPerModel diff --git a/src/api/types/BudgetV2AppliesToMetadata.ts b/src/api/types/BudgetV2AppliesToMetadata.ts index 815bca49..a6ce5067 100644 --- a/src/api/types/BudgetV2AppliesToMetadata.ts +++ b/src/api/types/BudgetV2AppliesToMetadata.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Track a separate budget for each unique value of a metadata key. diff --git a/src/api/types/BudgetV2AppliesToPerModel.ts b/src/api/types/BudgetV2AppliesToPerModel.ts index 56fdd7f7..9b23db2d 100644 --- a/src/api/types/BudgetV2AppliesToPerModel.ts +++ b/src/api/types/BudgetV2AppliesToPerModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Track a separate budget for each model. diff --git a/src/api/types/BudgetV2AppliesToPerUser.ts b/src/api/types/BudgetV2AppliesToPerUser.ts index f80c1d2f..27727878 100644 --- a/src/api/types/BudgetV2AppliesToPerUser.ts +++ b/src/api/types/BudgetV2AppliesToPerUser.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Track a separate budget for each unique user. diff --git a/src/api/types/BudgetV2AppliesToPerVirtualAccount.ts b/src/api/types/BudgetV2AppliesToPerVirtualAccount.ts index 48fadbe6..668262ec 100644 --- a/src/api/types/BudgetV2AppliesToPerVirtualAccount.ts +++ b/src/api/types/BudgetV2AppliesToPerVirtualAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Track a separate budget for each virtual account. diff --git a/src/api/types/BudgetV2InNotInFilter.ts b/src/api/types/BudgetV2InNotInFilter.ts index c3ea587a..799b7616 100644 --- a/src/api/types/BudgetV2InNotInFilter.ts +++ b/src/api/types/BudgetV2InNotInFilter.ts @@ -5,7 +5,7 @@ */ export interface BudgetV2InNotInFilter { /** Match when the value is present in this list */ - "in"?: string[]; + in?: string[]; /** Match when the value is NOT present in this list */ notIn?: string[]; } diff --git a/src/api/types/BudgetV2Limits.ts b/src/api/types/BudgetV2Limits.ts index d94177d7..5bc4e5df 100644 --- a/src/api/types/BudgetV2Limits.ts +++ b/src/api/types/BudgetV2Limits.ts @@ -12,4 +12,6 @@ export interface BudgetV2Limits { costPerMonth?: number; /** Maximum quarterly cost in USD */ costPerQuarter?: number; + /** Maximum lifetime cost in USD. Mutually exclusive with the day/week/month/quarter limits. */ + costPerLifetime?: number; } diff --git a/src/api/types/BudgetV2OverrideLimits.ts b/src/api/types/BudgetV2OverrideLimits.ts index 3f1be54d..e20b4193 100644 --- a/src/api/types/BudgetV2OverrideLimits.ts +++ b/src/api/types/BudgetV2OverrideLimits.ts @@ -12,4 +12,6 @@ export interface BudgetV2OverrideLimits { costPerMonth?: number; /** Override quarterly cost cap in USD */ costPerQuarter?: number; + /** Override lifetime cost cap in USD */ + costPerLifetime?: number; } diff --git a/src/api/types/BudgetV2PerMetadataOverride.ts b/src/api/types/BudgetV2PerMetadataOverride.ts index cc592bf5..239c193f 100644 --- a/src/api/types/BudgetV2PerMetadataOverride.ts +++ b/src/api/types/BudgetV2PerMetadataOverride.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Per-Metadata Override diff --git a/src/api/types/BudgetV2PerModelOverride.ts b/src/api/types/BudgetV2PerModelOverride.ts index 3487b84a..bbbed475 100644 --- a/src/api/types/BudgetV2PerModelOverride.ts +++ b/src/api/types/BudgetV2PerModelOverride.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Per-Model Override diff --git a/src/api/types/BudgetV2PerUserOverride.ts b/src/api/types/BudgetV2PerUserOverride.ts index cdf3c3b1..b39f9bf9 100644 --- a/src/api/types/BudgetV2PerUserOverride.ts +++ b/src/api/types/BudgetV2PerUserOverride.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Per-User Override diff --git a/src/api/types/BudgetV2PerVirtualAccountOverride.ts b/src/api/types/BudgetV2PerVirtualAccountOverride.ts index 4f02cd5c..c7987467 100644 --- a/src/api/types/BudgetV2PerVirtualAccountOverride.ts +++ b/src/api/types/BudgetV2PerVirtualAccountOverride.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Per-Virtual-Account Override diff --git a/src/api/types/BudgetV2SubjectsTeamScoped.ts b/src/api/types/BudgetV2SubjectsTeamScoped.ts index ac2eddbb..0dfa117c 100644 --- a/src/api/types/BudgetV2SubjectsTeamScoped.ts +++ b/src/api/types/BudgetV2SubjectsTeamScoped.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Team Budget Subjects diff --git a/src/api/types/BudgetV2SubjectsTenantScoped.ts b/src/api/types/BudgetV2SubjectsTenantScoped.ts index 6752b326..b13f3040 100644 --- a/src/api/types/BudgetV2SubjectsTenantScoped.ts +++ b/src/api/types/BudgetV2SubjectsTenantScoped.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Tenant Budget Subjects diff --git a/src/api/types/BudgetV2WhenTeamScoped.ts b/src/api/types/BudgetV2WhenTeamScoped.ts index 1e83bf25..f18f07f1 100644 --- a/src/api/types/BudgetV2WhenTeamScoped.ts +++ b/src/api/types/BudgetV2WhenTeamScoped.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Team Budget Conditions @@ -8,6 +8,7 @@ import * as TrueFoundry from "../index.js"; export interface BudgetV2WhenTeamScoped { subjects?: TrueFoundry.BudgetV2SubjectsTeamScoped; models?: TrueFoundry.BudgetV2InNotInFilter; + providerAccounts?: TrueFoundry.BudgetV2InNotInFilter; /** Filter by metadata key-value pairs this budget applies to */ metadata?: Record; } diff --git a/src/api/types/BudgetV2WhenTenantScoped.ts b/src/api/types/BudgetV2WhenTenantScoped.ts index 8c15cbc9..c3bbfe7f 100644 --- a/src/api/types/BudgetV2WhenTenantScoped.ts +++ b/src/api/types/BudgetV2WhenTenantScoped.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Tenant Budget Conditions @@ -8,6 +8,7 @@ import * as TrueFoundry from "../index.js"; export interface BudgetV2WhenTenantScoped { subjects?: TrueFoundry.BudgetV2SubjectsTenantScoped; models?: TrueFoundry.BudgetV2InNotInFilter; + providerAccounts?: TrueFoundry.BudgetV2InNotInFilter; /** Filter by metadata key-value pairs this budget applies to */ metadata?: Record; } diff --git a/src/api/types/Build.ts b/src/api/types/Build.ts index b411185e..41f0c571 100644 --- a/src/api/types/Build.ts +++ b/src/api/types/Build.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Describes how we build our code into a Docker image. diff --git a/src/api/types/BuildBuildSource.ts b/src/api/types/BuildBuildSource.ts index 67164c99..4f8db71f 100644 --- a/src/api/types/BuildBuildSource.ts +++ b/src/api/types/BuildBuildSource.ts @@ -1,11 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Source code location. */ -export type BuildBuildSource = - | TrueFoundry.RemoteSource - | TrueFoundry.GitSource - | TrueFoundry.LocalSource; +export type BuildBuildSource = TrueFoundry.RemoteSource | TrueFoundry.GitSource | TrueFoundry.LocalSource; diff --git a/src/api/types/BuildBuildSpec.ts b/src/api/types/BuildBuildSpec.ts index 63c4ba75..055b8a49 100644 --- a/src/api/types/BuildBuildSpec.ts +++ b/src/api/types/BuildBuildSpec.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Instructions to build a container image out of the build source */ -export type BuildBuildSpec = - | TrueFoundry.DockerFileBuild - | TrueFoundry.PythonBuild; +export type BuildBuildSpec = TrueFoundry.DockerFileBuild | TrueFoundry.PythonBuild; diff --git a/src/api/types/BuildInfo.ts b/src/api/types/BuildInfo.ts index dc23d390..0f8181f7 100644 --- a/src/api/types/BuildInfo.ts +++ b/src/api/types/BuildInfo.ts @@ -7,7 +7,7 @@ export interface BuildInfo { * STARTED = 20, * SUCCEEDED = 30, * FAILED = 40 - * + * */ status: number; } diff --git a/src/api/types/BuildStatus.ts b/src/api/types/BuildStatus.ts deleted file mode 100644 index 9f5cfa0a..00000000 --- a/src/api/types/BuildStatus.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const BuildStatus = { - Started: "STARTED", - Succeeded: "SUCCEEDED", - Failed: "FAILED" - } as const; -export type BuildStatus = typeof BuildStatus[keyof typeof BuildStatus]; diff --git a/src/api/types/CalypsoAiApiKeyAuth.ts b/src/api/types/CalypsoAiApiKeyAuth.ts new file mode 100644 index 00000000..f92fedcf --- /dev/null +++ b/src/api/types/CalypsoAiApiKeyAuth.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * CalypsoAI API Key Auth + */ +export interface CalypsoAiApiKeyAuth { + /** +value=api-key */ + type: "api-key"; + /** CalypsoAI API token from Configuration → API tokens */ + apiKey: string; +} diff --git a/src/api/types/CalypsoAiGuardrailConfig.ts b/src/api/types/CalypsoAiGuardrailConfig.ts new file mode 100644 index 00000000..5ef2d14b --- /dev/null +++ b/src/api/types/CalypsoAiGuardrailConfig.ts @@ -0,0 +1,32 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +/** + * CalypsoAI (F5 AI Security) + */ +export interface CalypsoAiGuardrailConfig { + /** The name of the Guardrail Config. */ + name: string; + /** Optional description for this Guardrail Config. */ + description?: string; + /** + * +uiType=Hidden + * +value=integration/guardrail-config/calypsoai + */ + type: "integration/guardrail-config/calypsoai"; + authData: TrueFoundry.CalypsoAiApiKeyAuth; + /** + * The operation type to use for the Guardrail. Validate guardrails are used to validate requests and mutate can validate as well as mutate requests (forward redactedInput). + * Validate guardrails are run in parallel while mutate guardrails are run sequentially. + */ + operation: TrueFoundry.CalypsoAiGuardrailConfigOperation; + /** Execution order for mutate guardrails. Lower values run first. Only applicable when operation is mutate. */ + priority?: number; + enforcingStrategy: TrueFoundry.EnforcingStrategy; + /** + * +uiType=Ignore + * +uiProps={"forwardJsonKey": true} + */ + config: TrueFoundry.CalypsoAiGuardrailConfigConfig; +} diff --git a/src/api/types/CalypsoAiGuardrailConfigConfig.ts b/src/api/types/CalypsoAiGuardrailConfigConfig.ts new file mode 100644 index 00000000..2806da03 --- /dev/null +++ b/src/api/types/CalypsoAiGuardrailConfigConfig.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * +uiType=Ignore + * +uiProps={"forwardJsonKey": true} + */ +export interface CalypsoAiGuardrailConfigConfig { + /** Optional override for the CalypsoAI base URL. Defaults to https://www.us1.calypsoai.app if not provided. Set this if your tenant is provisioned in another region (e.g. https://www.eu1.calypsoai.app). */ + baseUrl?: string; + /** Optional CalypsoAI project ID or friendly ID. Omit to use the tenant's global default scanner configuration. */ + project?: string; +} diff --git a/src/api/types/CalypsoAiGuardrailConfigOperation.ts b/src/api/types/CalypsoAiGuardrailConfigOperation.ts new file mode 100644 index 00000000..b7cf66d2 --- /dev/null +++ b/src/api/types/CalypsoAiGuardrailConfigOperation.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * The operation type to use for the Guardrail. Validate guardrails are used to validate requests and mutate can validate as well as mutate requests (forward redactedInput). + * Validate guardrails are run in parallel while mutate guardrails are run sequentially. + */ +export const CalypsoAiGuardrailConfigOperation = { + Validate: "validate", + Mutate: "mutate", +} as const; +export type CalypsoAiGuardrailConfigOperation = + (typeof CalypsoAiGuardrailConfigOperation)[keyof typeof CalypsoAiGuardrailConfigOperation]; diff --git a/src/api/types/Canary.ts b/src/api/types/Canary.ts index 355b4e17..4444e6c8 100644 --- a/src/api/types/Canary.ts +++ b/src/api/types/Canary.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * This strategy brings up the new release without bringing the older release down. Traffic is shifted from the older release to the newer release in a staged manner. diff --git a/src/api/types/CartesiaModel.ts b/src/api/types/CartesiaModel.ts index 2f5005c8..e920b0c7 100644 --- a/src/api/types/CartesiaModel.ts +++ b/src/api/types/CartesiaModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Cartesia Model diff --git a/src/api/types/CartesiaProviderAccount.ts b/src/api/types/CartesiaProviderAccount.ts index 30e8ecc2..396d29a5 100644 --- a/src/api/types/CartesiaProviderAccount.ts +++ b/src/api/types/CartesiaProviderAccount.ts @@ -1,25 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** - * Cartesia Provider Account + * Cartesia Model Account */ export interface CartesiaProviderAccount { /** +value=provider-account/cartesia */ type: "provider-account/cartesia"; - /** The name of the Cartesia provider account */ + /** The name of the Cartesia model account */ name: string; /** Optional custom base URL for Cartesia API */ baseUrl?: string; /** The Cartesia API version header. Must be set to a supported API version. */ cartesiaVersion: TrueFoundry.CartesiaProviderAccountCartesiaVersion; authData: TrueFoundry.CartesiaApiKeyAuth; - /** List of integrations that are associated with the Cartesia provider account */ + /** List of integrations that are associated with the Cartesia model account */ integrations: TrueFoundry.CartesiaModel[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/CartesiaProviderAccountCartesiaVersion.ts b/src/api/types/CartesiaProviderAccountCartesiaVersion.ts index a75f114d..906c94ff 100644 --- a/src/api/types/CartesiaProviderAccountCartesiaVersion.ts +++ b/src/api/types/CartesiaProviderAccountCartesiaVersion.ts @@ -2,8 +2,9 @@ /** The Cartesia API version header. Must be set to a supported API version. */ export const CartesiaProviderAccountCartesiaVersion = { - TwoThousandTwentyFive0416: "2025-04-16", - TwoThousandTwentyFour1113: "2024-11-13", - TwoThousandTwentyFour0610: "2024-06-10" - } as const; -export type CartesiaProviderAccountCartesiaVersion = typeof CartesiaProviderAccountCartesiaVersion[keyof typeof CartesiaProviderAccountCartesiaVersion]; + TwoThousandTwentyFive0416: "2025-04-16", + TwoThousandTwentyFour1113: "2024-11-13", + TwoThousandTwentyFour0610: "2024-06-10", +} as const; +export type CartesiaProviderAccountCartesiaVersion = + (typeof CartesiaProviderAccountCartesiaVersion)[keyof typeof CartesiaProviderAccountCartesiaVersion]; diff --git a/src/api/types/CedarGuardrailConfig.ts b/src/api/types/CedarGuardrailConfig.ts index 4b6cbcea..a428a4ff 100644 --- a/src/api/types/CedarGuardrailConfig.ts +++ b/src/api/types/CedarGuardrailConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Cedar diff --git a/src/api/types/CerebrasIntegrations.ts b/src/api/types/CerebrasIntegrations.ts index d3a2ba97..cd6f1b49 100644 --- a/src/api/types/CerebrasIntegrations.ts +++ b/src/api/types/CerebrasIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type CerebrasIntegrations = TrueFoundry.CerebrasModel; diff --git a/src/api/types/CerebrasModel.ts b/src/api/types/CerebrasModel.ts index dfa0e4d5..a8996eb3 100644 --- a/src/api/types/CerebrasModel.ts +++ b/src/api/types/CerebrasModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface CerebrasModel { /** +value=integration/model/cerebras */ diff --git a/src/api/types/CerebrasProviderAccount.ts b/src/api/types/CerebrasProviderAccount.ts index 0a87baa6..f7490cae 100644 --- a/src/api/types/CerebrasProviderAccount.ts +++ b/src/api/types/CerebrasProviderAccount.ts @@ -1,21 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** - * Cerebras Provider Account + * Cerebras Model Account */ export interface CerebrasProviderAccount { /** +value=provider-account/cerebras */ type: "provider-account/cerebras"; - /** The name of the Cerebras provider account */ + /** The name of the Cerebras model account */ name: string; authData: TrueFoundry.CerebrasKeyAuth; - /** List of integrations that are associated with the Cerebras provider account */ + /** List of integrations that are associated with the Cerebras model account */ integrations?: TrueFoundry.CerebrasIntegrations[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/ChangePasswordResponse.ts b/src/api/types/ChangePasswordResponse.ts index 2091997a..11b1faf1 100644 --- a/src/api/types/ChangePasswordResponse.ts +++ b/src/api/types/ChangePasswordResponse.ts @@ -1,4 +1,3 @@ // This file was auto-generated by Fern from our API Definition. -export interface ChangePasswordResponse { -} +export type ChangePasswordResponse = {}; diff --git a/src/api/types/ChatMessageTurn.ts b/src/api/types/ChatMessageTurn.ts index bf92c2e3..4c9fc78c 100644 --- a/src/api/types/ChatMessageTurn.ts +++ b/src/api/types/ChatMessageTurn.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * A single chat message turn */ -export type ChatMessageTurn = +export type ChatMessageTurn = | TrueFoundry.SystemMessage | TrueFoundry.AssistantMessage | TrueFoundry.UserMessage diff --git a/src/api/types/ChatPromptManifest.ts b/src/api/types/ChatPromptManifest.ts index 32d8c4a0..9f5944c6 100644 --- a/src/api/types/ChatPromptManifest.ts +++ b/src/api/types/ChatPromptManifest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Fill in the information for opening a new chat prompt @@ -9,13 +9,13 @@ export interface ChatPromptManifest extends TrueFoundry.BaseArtifactVersion { /** Type of the prompt */ type: "chat_prompt"; /** Description */ - description?: string; + description?: string | null; /** Version alias is alternate, ideally human readable, version string to reference an artifact version. It should start with `v` followed by alphanumeric and it can include `.` and `-` in between (e.g. `v1.0.0`, `v1-prod`, `v3-dev`, etc) */ versionAlias?: string; /** List of messages in the chat conversation, must be non-empty */ messages: TrueFoundry.ChatMessageTurn[]; /** Variables referenced in messages and that can be replaced when running generation */ - variables?: Record; + variables?: Record; modelConfiguration?: TrueFoundry.ModelConfiguration; /** List of tools to be used in the chat prompt */ tools?: TrueFoundry.ToolSchema[]; diff --git a/src/api/types/ChatPromptManifestCacheConfig.ts b/src/api/types/ChatPromptManifestCacheConfig.ts index 1d5fbea8..6e79a906 100644 --- a/src/api/types/ChatPromptManifestCacheConfig.ts +++ b/src/api/types/ChatPromptManifestCacheConfig.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Cache configuration for the chat prompt */ -export type ChatPromptManifestCacheConfig = - | TrueFoundry.SemanticCacheConfig - | TrueFoundry.ExactMatchCacheConfig; +export type ChatPromptManifestCacheConfig = TrueFoundry.SemanticCacheConfig | TrueFoundry.ExactMatchCacheConfig; diff --git a/src/api/types/ChatPromptManifestMcpServersItem.ts b/src/api/types/ChatPromptManifestMcpServersItem.ts index 7bb90dc5..bd036f35 100644 --- a/src/api/types/ChatPromptManifestMcpServersItem.ts +++ b/src/api/types/ChatPromptManifestMcpServersItem.ts @@ -1,7 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; -export type ChatPromptManifestMcpServersItem = - | TrueFoundry.McpServerWithFqn - | TrueFoundry.McpServerWithUrl; +export type ChatPromptManifestMcpServersItem = TrueFoundry.McpServerWithFqn | TrueFoundry.McpServerWithUrl; diff --git a/src/api/types/ChatPromptManifestResponseFormat.ts b/src/api/types/ChatPromptManifestResponseFormat.ts index ffe79f5e..0421ceba 100644 --- a/src/api/types/ChatPromptManifestResponseFormat.ts +++ b/src/api/types/ChatPromptManifestResponseFormat.ts @@ -1,10 +1,10 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Response format configuration for structured outputs */ -export type ChatPromptManifestResponseFormat = +export type ChatPromptManifestResponseFormat = | TrueFoundry.JsonObjectResponseFormat | TrueFoundry.JsonSchemaResponseFormat; diff --git a/src/api/types/ChatPromptManifestRoutingConfig.ts b/src/api/types/ChatPromptManifestRoutingConfig.ts index af07f47e..cebf704d 100644 --- a/src/api/types/ChatPromptManifestRoutingConfig.ts +++ b/src/api/types/ChatPromptManifestRoutingConfig.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Configuration for routing requests to different model targets */ -export type ChatPromptManifestRoutingConfig = +export type ChatPromptManifestRoutingConfig = | TrueFoundry.WeightBasedLoadBalancing | TrueFoundry.LatencyBasedLoadBalancing | TrueFoundry.PriorityBasedLoadBalancing; diff --git a/src/api/types/CiscoAiDefenseGuardrailConfig.ts b/src/api/types/CiscoAiDefenseGuardrailConfig.ts new file mode 100644 index 00000000..f8cdbbfd --- /dev/null +++ b/src/api/types/CiscoAiDefenseGuardrailConfig.ts @@ -0,0 +1,27 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +/** + * Cisco AI Defense + */ +export interface CiscoAiDefenseGuardrailConfig { + /** The name of the Guardrail Config. */ + name: string; + /** Optional description for this Guardrail Config. */ + description?: string; + /** + * +uiType=Hidden + * +value=integration/guardrail-config/cisco-ai-defense + */ + type: "integration/guardrail-config/cisco-ai-defense"; + authData: TrueFoundry.CiscoAiDefenseKeyAuth; + /** Cisco AI Defense inspects and validates content without modifying it. */ + operation: "validate"; + enforcingStrategy: TrueFoundry.EnforcingStrategy; + /** + * +uiType=Ignore + * +uiProps={"forwardJsonKey": true} + */ + config: TrueFoundry.CiscoAiDefenseGuardrailConfigConfig; +} diff --git a/src/api/types/CiscoAiDefenseGuardrailConfigConfig.ts b/src/api/types/CiscoAiDefenseGuardrailConfigConfig.ts new file mode 100644 index 00000000..712f34d0 --- /dev/null +++ b/src/api/types/CiscoAiDefenseGuardrailConfigConfig.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +/** + * +uiType=Ignore + * +uiProps={"forwardJsonKey": true} + */ +export interface CiscoAiDefenseGuardrailConfigConfig { + /** Cisco AI Defense regional API endpoint. */ + region: TrueFoundry.CiscoAiDefenseGuardrailConfigConfigRegion; + /** Additional metadata forwarded to Cisco AI Defense. The authenticated TrueFoundry user is added automatically. */ + metadata?: Record; +} diff --git a/src/api/types/CiscoAiDefenseGuardrailConfigConfigRegion.ts b/src/api/types/CiscoAiDefenseGuardrailConfigConfigRegion.ts new file mode 100644 index 00000000..bb991352 --- /dev/null +++ b/src/api/types/CiscoAiDefenseGuardrailConfigConfigRegion.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +/** Cisco AI Defense regional API endpoint. */ +export const CiscoAiDefenseGuardrailConfigConfigRegion = { + Us: "us", + Eu: "eu", + Ap: "ap", +} as const; +export type CiscoAiDefenseGuardrailConfigConfigRegion = + (typeof CiscoAiDefenseGuardrailConfigConfigRegion)[keyof typeof CiscoAiDefenseGuardrailConfigConfigRegion]; diff --git a/src/api/types/CiscoAiDefenseKeyAuth.ts b/src/api/types/CiscoAiDefenseKeyAuth.ts new file mode 100644 index 00000000..eebbe404 --- /dev/null +++ b/src/api/types/CiscoAiDefenseKeyAuth.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface CiscoAiDefenseKeyAuth { + /** +value=api-key */ + type: "api-key"; + /** API key generated from the Cisco AI Defense UI */ + apiKey: string; +} diff --git a/src/api/types/ClouderaIntegrations.ts b/src/api/types/ClouderaIntegrations.ts index 460cc0ab..570b9b74 100644 --- a/src/api/types/ClouderaIntegrations.ts +++ b/src/api/types/ClouderaIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type ClouderaIntegrations = TrueFoundry.ClouderaModel; diff --git a/src/api/types/ClouderaModel.ts b/src/api/types/ClouderaModel.ts index c63ad24f..2aec766e 100644 --- a/src/api/types/ClouderaModel.ts +++ b/src/api/types/ClouderaModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Cloudera Model diff --git a/src/api/types/ClouderaProviderAccount.ts b/src/api/types/ClouderaProviderAccount.ts index e73c6b35..58fc9264 100644 --- a/src/api/types/ClouderaProviderAccount.ts +++ b/src/api/types/ClouderaProviderAccount.ts @@ -1,22 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** - * Cloudera Provider Account + * Cloudera Model Account */ export interface ClouderaProviderAccount { /** +value=provider-account/cloudera */ type: "provider-account/cloudera"; - /** The name of the Cloudera provider account */ + /** The name of the Cloudera model account */ name: string; /** Cloudera authentication credentials */ authData: TrueFoundry.ClouderaProviderAccountAuthData; - /** List of integrations that are associated with the Cloudera provider account */ + /** List of integrations that are associated with the Cloudera model account */ integrations: TrueFoundry.ClouderaIntegrations[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/ClouderaProviderAccountAuthData.ts b/src/api/types/ClouderaProviderAccountAuthData.ts index 934dfb95..00fc23cc 100644 --- a/src/api/types/ClouderaProviderAccountAuthData.ts +++ b/src/api/types/ClouderaProviderAccountAuthData.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Cloudera authentication credentials */ -export type ClouderaProviderAccountAuthData = - | TrueFoundry.ClouderaWorkloadAuthToken - | TrueFoundry.ClouderaTokenAuth; +export type ClouderaProviderAccountAuthData = TrueFoundry.ClouderaWorkloadAuthToken | TrueFoundry.ClouderaTokenAuth; diff --git a/src/api/types/Cluster.ts b/src/api/types/Cluster.ts index 8db952a2..67da53e8 100644 --- a/src/api/types/Cluster.ts +++ b/src/api/types/Cluster.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface Cluster { /** System-generated cluster ID. */ @@ -10,8 +10,8 @@ export interface Cluster { manifest: TrueFoundry.ClusterManifest; tenantName: string; accountId: string; - createdBySubject?: TrueFoundry.Subject; + createdBySubject?: TrueFoundry.Subject | null; createdAt: Date; updatedAt: Date; - createdBy?: string; + createdBy?: string | null; } diff --git a/src/api/types/ClusterGateway.ts b/src/api/types/ClusterGateway.ts index bb7cf416..30fcdf3c 100644 --- a/src/api/types/ClusterGateway.ts +++ b/src/api/types/ClusterGateway.ts @@ -1,10 +1,10 @@ // This file was auto-generated by Fern from our API Definition. export interface ClusterGateway { - uid?: string; + uid?: string | null; name: string; hosts: string[]; /** Used when there are 2 gateways with same host */ - isTieBreaker?: boolean; + isTieBreaker?: boolean | null; selector: Record; } diff --git a/src/api/types/ClusterManifest.ts b/src/api/types/ClusterManifest.ts index 3a717a01..59fb45b8 100644 --- a/src/api/types/ClusterManifest.ts +++ b/src/api/types/ClusterManifest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ClusterManifest { /** +value=cluster */ diff --git a/src/api/types/ClusterManifestClusterType.ts b/src/api/types/ClusterManifestClusterType.ts index ca169b97..75004b42 100644 --- a/src/api/types/ClusterManifestClusterType.ts +++ b/src/api/types/ClusterManifestClusterType.ts @@ -2,10 +2,10 @@ /** The cluster type of this cluster */ export const ClusterManifestClusterType = { - AwsEks: "aws-eks", - GcpGkeStandard: "gcp-gke-standard", - AzureAks: "azure-aks", - Generic: "generic", - CivoTalos: "civo-talos" - } as const; -export type ClusterManifestClusterType = typeof ClusterManifestClusterType[keyof typeof ClusterManifestClusterType]; + AwsEks: "aws-eks", + GcpGkeStandard: "gcp-gke-standard", + AzureAks: "azure-aks", + Generic: "generic", + CivoTalos: "civo-talos", +} as const; +export type ClusterManifestClusterType = (typeof ClusterManifestClusterType)[keyof typeof ClusterManifestClusterType]; diff --git a/src/api/types/ClusterManifestWorkbenchConfig.ts b/src/api/types/ClusterManifestWorkbenchConfig.ts index 20f88b7c..377369f4 100644 --- a/src/api/types/ClusterManifestWorkbenchConfig.ts +++ b/src/api/types/ClusterManifestWorkbenchConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Workbench Config diff --git a/src/api/types/ClusterType.ts b/src/api/types/ClusterType.ts index 334d41ca..0bf98284 100644 --- a/src/api/types/ClusterType.ts +++ b/src/api/types/ClusterType.ts @@ -1,10 +1,10 @@ // This file was auto-generated by Fern from our API Definition. export const ClusterType = { - AwsEks: "aws-eks", - GcpGkeStandard: "gcp-gke-standard", - AzureAks: "azure-aks", - Generic: "generic", - CivoTalos: "civo-talos" - } as const; -export type ClusterType = typeof ClusterType[keyof typeof ClusterType]; + AwsEks: "aws-eks", + GcpGkeStandard: "gcp-gke-standard", + AzureAks: "azure-aks", + Generic: "generic", + CivoTalos: "civo-talos", +} as const; +export type ClusterType = (typeof ClusterType)[keyof typeof ClusterType]; diff --git a/src/api/types/CodeSafetyLinterGuardrailConfig.ts b/src/api/types/CodeSafetyLinterGuardrailConfig.ts index edf6e742..e18f7c47 100644 --- a/src/api/types/CodeSafetyLinterGuardrailConfig.ts +++ b/src/api/types/CodeSafetyLinterGuardrailConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Code Safety Linter diff --git a/src/api/types/Codeserver.ts b/src/api/types/Codeserver.ts index 2eacfe65..89a028d8 100644 --- a/src/api/types/Codeserver.ts +++ b/src/api/types/Codeserver.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Describes the configuration for the code server diff --git a/src/api/types/CohereIntegrations.ts b/src/api/types/CohereIntegrations.ts index 3c9e0a54..1e779f35 100644 --- a/src/api/types/CohereIntegrations.ts +++ b/src/api/types/CohereIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type CohereIntegrations = TrueFoundry.CohereModel; diff --git a/src/api/types/CohereModel.ts b/src/api/types/CohereModel.ts index 77b3c26b..d6c38d6b 100644 --- a/src/api/types/CohereModel.ts +++ b/src/api/types/CohereModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Cohere Model diff --git a/src/api/types/CohereProviderAccount.ts b/src/api/types/CohereProviderAccount.ts index f8b25185..5b4c0e77 100644 --- a/src/api/types/CohereProviderAccount.ts +++ b/src/api/types/CohereProviderAccount.ts @@ -1,21 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** - * Cohere Provider Account + * Cohere Model Account */ export interface CohereProviderAccount { /** +value=provider-account/cohere */ type: "provider-account/cohere"; - /** The name of the Cohere provider account */ + /** The name of the Cohere model account */ name: string; authData: TrueFoundry.CohereKeyAuth; - /** List of integrations that are associated with the Cohere provider account */ + /** List of integrations that are associated with the Cohere model account */ integrations?: TrueFoundry.CohereIntegrations[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/ComplexityBasedLoadBalanceTarget.ts b/src/api/types/ComplexityBasedLoadBalanceTarget.ts new file mode 100644 index 00000000..2498d465 --- /dev/null +++ b/src/api/types/ComplexityBasedLoadBalanceTarget.ts @@ -0,0 +1,23 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +/** + * A target model together with the single complexity tier it serves. A model may appear at most once across a rule's targets (one model cannot serve more than one tier). + */ +export interface ComplexityBasedLoadBalanceTarget { + /** Target model or provider FQN */ + target: string; + /** Complexity tier this target serves. Each target serves exactly one tier; a model must not be listed under more than one tier. */ + tier: TrueFoundry.ComplexityBasedLoadBalanceTargetTier; + retryConfig?: TrueFoundry.RetryConfig; + /** Status Codes for which the request will fallback to other tiers. If the status code is not present in fallback_status_codes, it fails immediately. */ + fallbackStatusCodes?: string[]; + /** Whether this target is a fallback candidate. If set to false, this model will not be considered as a fallback option for other tiers of this rule. */ + fallbackCandidate?: boolean; + /** Optional parameters to override in the request */ + overrideParams?: Record; + headersOverride?: TrueFoundry.HeadersOverride; + /** Optional metadata key-value pairs that must match incoming request metadata headers for this target to be considered for routing. */ + metadataMatch?: Record; +} diff --git a/src/api/types/ComplexityBasedLoadBalanceTargetTier.ts b/src/api/types/ComplexityBasedLoadBalanceTargetTier.ts new file mode 100644 index 00000000..aa048cdb --- /dev/null +++ b/src/api/types/ComplexityBasedLoadBalanceTargetTier.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +/** Complexity tier this target serves. Each target serves exactly one tier; a model must not be listed under more than one tier. */ +export const ComplexityBasedLoadBalanceTargetTier = { + Simple: "simple", + Medium: "medium", + Complex: "complex", +} as const; +export type ComplexityBasedLoadBalanceTargetTier = + (typeof ComplexityBasedLoadBalanceTargetTier)[keyof typeof ComplexityBasedLoadBalanceTargetTier]; diff --git a/src/api/types/ComplexityBasedLoadBalancing.ts b/src/api/types/ComplexityBasedLoadBalancing.ts new file mode 100644 index 00000000..44fba376 --- /dev/null +++ b/src/api/types/ComplexityBasedLoadBalancing.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +/** + * Complexity-based Load Balancing + */ +export interface ComplexityBasedLoadBalancing { + /** Routing Type */ + type: "complexity-based-routing"; + /** How requests are classified into complexity tiers. Defaults to the heuristic classifier. */ + classificationStrategy?: TrueFoundry.ComplexityBasedLoadBalancingClassificationStrategy; + /** List of targets for complexity-based load balancing. Each target serves a single tier; a model must not appear under more than one tier. */ + loadBalanceTargets: TrueFoundry.ComplexityBasedLoadBalanceTarget[]; + stickyRouting?: TrueFoundry.ComplexityStickyRouting; +} diff --git a/src/api/types/ComplexityBasedLoadBalancingClassificationStrategy.ts b/src/api/types/ComplexityBasedLoadBalancingClassificationStrategy.ts new file mode 100644 index 00000000..eccaeb74 --- /dev/null +++ b/src/api/types/ComplexityBasedLoadBalancingClassificationStrategy.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +/** + * How requests are classified into complexity tiers. Defaults to the heuristic classifier. + */ +export type ComplexityBasedLoadBalancingClassificationStrategy = + | TrueFoundry.HeuristicClassificationStrategy + | TrueFoundry.LlmClassificationStrategy; diff --git a/src/api/types/ComplexityStickyRouting.ts b/src/api/types/ComplexityStickyRouting.ts new file mode 100644 index 00000000..b6c99e17 --- /dev/null +++ b/src/api/types/ComplexityStickyRouting.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +/** + * Sticky routing for complexity-based routing. A session is pinned to the tier/target chosen on its first classified turn for up to ttl_seconds (5 minutes to 1 hour). + */ +export interface ComplexityStickyRouting { + /** Sticky mapping TTL in seconds. Minimum 5 minutes, maximum 1 hour. */ + ttlSeconds: number; + /** List of identifier selectors used to build sticky key */ + sessionIdentifiers: TrueFoundry.StickySessionIdentifier[]; +} diff --git a/src/api/types/Config.ts b/src/api/types/Config.ts index d703ad64..5257bad8 100644 --- a/src/api/types/Config.ts +++ b/src/api/types/Config.ts @@ -1,4 +1,3 @@ // This file was auto-generated by Fern from our API Definition. -export interface Config { -} +export type Config = {}; diff --git a/src/api/types/ContainerTaskConfig.ts b/src/api/types/ContainerTaskConfig.ts index 865fd37c..a92cf1d0 100644 --- a/src/api/types/ContainerTaskConfig.ts +++ b/src/api/types/ContainerTaskConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ContainerTaskConfig { /** +value=container-task-config */ @@ -8,7 +8,7 @@ export interface ContainerTaskConfig { /** Specify whether you want to deploy a Docker image or build and deploy from source code */ image: TrueFoundry.ContainerTaskConfigImage; /** Configure environment variables to be injected in the task either as plain text or secrets. [Docs](https://docs.truefoundry.com/docs/env-variables) */ - env?: Record; + env?: Record | null; resources?: TrueFoundry.Resources; /** Configure data to be mounted to Workflow pod(s) as a volume. */ mounts?: TrueFoundry.ContainerTaskConfigMountsItem[]; diff --git a/src/api/types/ContainerTaskConfigImage.ts b/src/api/types/ContainerTaskConfigImage.ts index 8484011d..b82e350e 100644 --- a/src/api/types/ContainerTaskConfigImage.ts +++ b/src/api/types/ContainerTaskConfigImage.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Specify whether you want to deploy a Docker image or build and deploy from source code */ -export type ContainerTaskConfigImage = - | TrueFoundry.Build - | TrueFoundry.Image; +export type ContainerTaskConfigImage = TrueFoundry.Build | TrueFoundry.Image; diff --git a/src/api/types/ContainerTaskConfigMountsItem.ts b/src/api/types/ContainerTaskConfigMountsItem.ts index c47d9637..f85412ad 100644 --- a/src/api/types/ContainerTaskConfigMountsItem.ts +++ b/src/api/types/ContainerTaskConfigMountsItem.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; -export type ContainerTaskConfigMountsItem = +export type ContainerTaskConfigMountsItem = | TrueFoundry.SecretMount | TrueFoundry.StringDataMount | TrueFoundry.VolumeMount; diff --git a/src/api/types/CoreNatsOutputConfig.ts b/src/api/types/CoreNatsOutputConfig.ts index 2498bcce..4480da86 100644 --- a/src/api/types/CoreNatsOutputConfig.ts +++ b/src/api/types/CoreNatsOutputConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Describes the configuration for the output Core NATS worker diff --git a/src/api/types/CreateRunResponse.ts b/src/api/types/CreateRunResponse.ts index c3054bac..607c5686 100644 --- a/src/api/types/CreateRunResponse.ts +++ b/src/api/types/CreateRunResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface CreateRunResponse { /** The created run. */ diff --git a/src/api/types/CrowdStrikeAidrGuardrailConfig.ts b/src/api/types/CrowdStrikeAidrGuardrailConfig.ts index 79f0aeb4..3f1c02a0 100644 --- a/src/api/types/CrowdStrikeAidrGuardrailConfig.ts +++ b/src/api/types/CrowdStrikeAidrGuardrailConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * CrowdStrike AIDR diff --git a/src/api/types/CrowdStrikeAidrGuardrailConfigOperation.ts b/src/api/types/CrowdStrikeAidrGuardrailConfigOperation.ts index 86a822a8..6e138b78 100644 --- a/src/api/types/CrowdStrikeAidrGuardrailConfigOperation.ts +++ b/src/api/types/CrowdStrikeAidrGuardrailConfigOperation.ts @@ -2,7 +2,8 @@ /** The operation type to use for the Guardrail. Validate guardrails check for blocked content. Mutate guardrails additionally redact sensitive content (PII) and support unredaction on output. */ export const CrowdStrikeAidrGuardrailConfigOperation = { - Validate: "validate", - Mutate: "mutate" - } as const; -export type CrowdStrikeAidrGuardrailConfigOperation = typeof CrowdStrikeAidrGuardrailConfigOperation[keyof typeof CrowdStrikeAidrGuardrailConfigOperation]; + Validate: "validate", + Mutate: "mutate", +} as const; +export type CrowdStrikeAidrGuardrailConfigOperation = + (typeof CrowdStrikeAidrGuardrailConfigOperation)[keyof typeof CrowdStrikeAidrGuardrailConfigOperation]; diff --git a/src/api/types/CustomAgentServerAuth.ts b/src/api/types/CustomAgentServerAuth.ts index d044ab48..143be7f5 100644 --- a/src/api/types/CustomAgentServerAuth.ts +++ b/src/api/types/CustomAgentServerAuth.ts @@ -1,7 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; -export type CustomAgentServerAuth = - | TrueFoundry.CustomServerHeaderAuth - | TrueFoundry.CustomServerPassthrough; +export type CustomAgentServerAuth = TrueFoundry.CustomServerHeaderAuth | TrueFoundry.CustomServerPassthrough; diff --git a/src/api/types/CustomBlobStorage.ts b/src/api/types/CustomBlobStorage.ts index ab200f12..4625ca66 100644 --- a/src/api/types/CustomBlobStorage.ts +++ b/src/api/types/CustomBlobStorage.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Custom Blob Storage diff --git a/src/api/types/CustomEndpoint.ts b/src/api/types/CustomEndpoint.ts index 8f1e083f..59492559 100644 --- a/src/api/types/CustomEndpoint.ts +++ b/src/api/types/CustomEndpoint.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Custom Endpoint diff --git a/src/api/types/CustomEndpointIntegrations.ts b/src/api/types/CustomEndpointIntegrations.ts index 3196ae39..5613ec71 100644 --- a/src/api/types/CustomEndpointIntegrations.ts +++ b/src/api/types/CustomEndpointIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type CustomEndpointIntegrations = TrueFoundry.CustomEndpoint; diff --git a/src/api/types/CustomEndpointProviderAccount.ts b/src/api/types/CustomEndpointProviderAccount.ts index bdfc75a5..90b20420 100644 --- a/src/api/types/CustomEndpointProviderAccount.ts +++ b/src/api/types/CustomEndpointProviderAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Custom Endpoint @@ -8,7 +8,7 @@ import * as TrueFoundry from "../index.js"; export interface CustomEndpointProviderAccount { /** +value=provider-account/custom-endpoint */ type: "provider-account/custom-endpoint"; - /** The name of the custom endpoint provider account. */ + /** The name of the custom endpoint model account. */ name: string; /** The type of service behind this endpoint (used for tracking purposes) */ endpointType?: TrueFoundry.CustomEndpointProviderAccountEndpointType; @@ -17,7 +17,7 @@ export interface CustomEndpointProviderAccount { /** A unique identifier used to address the load-balanced endpoints of this account. When routing_type is "weight" or "priority", the load balancer is reachable at /proxy-api///, alongside the per-endpoint URLs. */ slug?: string; authData?: TrueFoundry.CustomHeaderAuth; - /** List of endpoint integrations associated with this provider account. */ + /** List of endpoint integrations associated with this model account. */ integrations: TrueFoundry.CustomEndpointIntegrations[]; /** Collaborators */ collaborators?: TrueFoundry.Collaborator[]; diff --git a/src/api/types/CustomEndpointProviderAccountEndpointType.ts b/src/api/types/CustomEndpointProviderAccountEndpointType.ts index f580ee3e..e21fe7c9 100644 --- a/src/api/types/CustomEndpointProviderAccountEndpointType.ts +++ b/src/api/types/CustomEndpointProviderAccountEndpointType.ts @@ -2,7 +2,8 @@ /** The type of service behind this endpoint (used for tracking purposes) */ export const CustomEndpointProviderAccountEndpointType = { - AzureSpeechService: "azure-speech-service", - Other: "other" - } as const; -export type CustomEndpointProviderAccountEndpointType = typeof CustomEndpointProviderAccountEndpointType[keyof typeof CustomEndpointProviderAccountEndpointType]; + AzureSpeechService: "azure-speech-service", + Other: "other", +} as const; +export type CustomEndpointProviderAccountEndpointType = + (typeof CustomEndpointProviderAccountEndpointType)[keyof typeof CustomEndpointProviderAccountEndpointType]; diff --git a/src/api/types/CustomEndpointProviderAccountRoutingType.ts b/src/api/types/CustomEndpointProviderAccountRoutingType.ts index 615f41b4..ccf079d1 100644 --- a/src/api/types/CustomEndpointProviderAccountRoutingType.ts +++ b/src/api/types/CustomEndpointProviderAccountRoutingType.ts @@ -2,7 +2,8 @@ /** How requests are routed across the endpoints in this account. When unset, each endpoint is reachable individually at /proxy-api//. Set to "weight" or "priority" to load balance across the endpoints, reachable at /proxy-api///. */ export const CustomEndpointProviderAccountRoutingType = { - Weight: "weight", - Priority: "priority" - } as const; -export type CustomEndpointProviderAccountRoutingType = typeof CustomEndpointProviderAccountRoutingType[keyof typeof CustomEndpointProviderAccountRoutingType]; + Weight: "weight", + Priority: "priority", +} as const; +export type CustomEndpointProviderAccountRoutingType = + (typeof CustomEndpointProviderAccountRoutingType)[keyof typeof CustomEndpointProviderAccountRoutingType]; diff --git a/src/api/types/CustomGuardrailConfig.ts b/src/api/types/CustomGuardrailConfig.ts index 8de2914f..c1ece350 100644 --- a/src/api/types/CustomGuardrailConfig.ts +++ b/src/api/types/CustomGuardrailConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Custom diff --git a/src/api/types/CustomGuardrailConfigAuthData.ts b/src/api/types/CustomGuardrailConfigAuthData.ts index 3f18a392..e084397c 100644 --- a/src/api/types/CustomGuardrailConfigAuthData.ts +++ b/src/api/types/CustomGuardrailConfigAuthData.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Authentication data for the Guardrail Server. */ -export type CustomGuardrailConfigAuthData = - | TrueFoundry.CustomBasicAuth - | TrueFoundry.CustomBearerAuth; +export type CustomGuardrailConfigAuthData = TrueFoundry.CustomBasicAuth | TrueFoundry.CustomBearerAuth; diff --git a/src/api/types/CustomGuardrailConfigOperation.ts b/src/api/types/CustomGuardrailConfigOperation.ts index 90456cea..ba25cd63 100644 --- a/src/api/types/CustomGuardrailConfigOperation.ts +++ b/src/api/types/CustomGuardrailConfigOperation.ts @@ -5,7 +5,8 @@ * Validate guardrails are run in parallel while mutate guardrails are run sequentially. */ export const CustomGuardrailConfigOperation = { - Validate: "validate", - Mutate: "mutate" - } as const; -export type CustomGuardrailConfigOperation = typeof CustomGuardrailConfigOperation[keyof typeof CustomGuardrailConfigOperation]; + Validate: "validate", + Mutate: "mutate", +} as const; +export type CustomGuardrailConfigOperation = + (typeof CustomGuardrailConfigOperation)[keyof typeof CustomGuardrailConfigOperation]; diff --git a/src/api/types/CustomGuardrailConfigTarget.ts b/src/api/types/CustomGuardrailConfigTarget.ts index 3b794860..54895994 100644 --- a/src/api/types/CustomGuardrailConfigTarget.ts +++ b/src/api/types/CustomGuardrailConfigTarget.ts @@ -2,7 +2,8 @@ /** Specify whether the guardrail should be applied to the request or response. Guardrails with target "Request" can be only used in input guardrails and guardrails with target "Response" can only be used in output guardrails. */ export const CustomGuardrailConfigTarget = { - Request: "request", - Response: "response" - } as const; -export type CustomGuardrailConfigTarget = typeof CustomGuardrailConfigTarget[keyof typeof CustomGuardrailConfigTarget]; + Request: "request", + Response: "response", +} as const; +export type CustomGuardrailConfigTarget = + (typeof CustomGuardrailConfigTarget)[keyof typeof CustomGuardrailConfigTarget]; diff --git a/src/api/types/CustomHelmRepo.ts b/src/api/types/CustomHelmRepo.ts index e7edf357..446bc43d 100644 --- a/src/api/types/CustomHelmRepo.ts +++ b/src/api/types/CustomHelmRepo.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Custom Helm Repo diff --git a/src/api/types/CustomIntegrations.ts b/src/api/types/CustomIntegrations.ts index 0d5c3e9f..89e50496 100644 --- a/src/api/types/CustomIntegrations.ts +++ b/src/api/types/CustomIntegrations.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +discriminator=type */ -export type CustomIntegrations = +export type CustomIntegrations = | TrueFoundry.CustomUsernamePasswordArtifactsRegistry | TrueFoundry.EmailNotificationChannel | TrueFoundry.CustomHelmRepo diff --git a/src/api/types/CustomJwtAuthIntegration.ts b/src/api/types/CustomJwtAuthIntegration.ts index 6a1b9d17..28dfa005 100644 --- a/src/api/types/CustomJwtAuthIntegration.ts +++ b/src/api/types/CustomJwtAuthIntegration.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Custom JWT Auth Integration diff --git a/src/api/types/CustomProviderAccount.ts b/src/api/types/CustomProviderAccount.ts index 3d876ee9..56c98b26 100644 --- a/src/api/types/CustomProviderAccount.ts +++ b/src/api/types/CustomProviderAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Custom diff --git a/src/api/types/CustomServerHeaderAuth.ts b/src/api/types/CustomServerHeaderAuth.ts index 5675840a..806dbfdd 100644 --- a/src/api/types/CustomServerHeaderAuth.ts +++ b/src/api/types/CustomServerHeaderAuth.ts @@ -6,5 +6,6 @@ export interface CustomServerHeaderAuth { /** +value=header */ type: "header"; + /** Map each header name to its value. */ headers: Record; } diff --git a/src/api/types/CustomUsernamePasswordArtifactsRegistry.ts b/src/api/types/CustomUsernamePasswordArtifactsRegistry.ts index e9109b48..c18477b9 100644 --- a/src/api/types/CustomUsernamePasswordArtifactsRegistry.ts +++ b/src/api/types/CustomUsernamePasswordArtifactsRegistry.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Custom Docker Registry diff --git a/src/api/types/DataAccessRule.ts b/src/api/types/DataAccessRule.ts index 7af22b12..d7927fc6 100644 --- a/src/api/types/DataAccessRule.ts +++ b/src/api/types/DataAccessRule.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Select the scope for the rule */ -export type DataAccessRule = +export type DataAccessRule = | TrueFoundry.OwnDataAccessRule | TrueFoundry.TeamDataAccessRule | TrueFoundry.AllDataAccessRule; diff --git a/src/api/types/DataAccessRuleBase.ts b/src/api/types/DataAccessRuleBase.ts index f0e13105..47b22679 100644 --- a/src/api/types/DataAccessRuleBase.ts +++ b/src/api/types/DataAccessRuleBase.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Data Access Rule diff --git a/src/api/types/DataDirectory.ts b/src/api/types/DataDirectory.ts index 8978405a..1198d519 100644 --- a/src/api/types/DataDirectory.ts +++ b/src/api/types/DataDirectory.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface DataDirectory { /** Unique identifier for the data directory */ @@ -20,5 +20,5 @@ export interface DataDirectory { /** Manifest describing the data directory. */ manifest: TrueFoundry.DataDirectoryManifest; /** Code snippet demonstrating how to use this data directory */ - usageCodeSnippet?: string; + usageCodeSnippet?: string | null; } diff --git a/src/api/types/DataDirectoryManifest.ts b/src/api/types/DataDirectoryManifest.ts index b304fdfc..9eed302a 100644 --- a/src/api/types/DataDirectoryManifest.ts +++ b/src/api/types/DataDirectoryManifest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Data Directory @@ -13,7 +13,7 @@ export interface DataDirectoryManifest { /** Name of the ML Repo to create the data directory under */ mlRepo: string; /** Description for the data directory */ - description?: string; + description?: string | null; /** Key Value metadata. Should be valid JSON. For e.g. `{"business-unit": "sales", "quality": "good", "rating": 4.5}` */ metadata: Record; /** Data Directory Source */ diff --git a/src/api/types/DataDirectoryManifestSource.ts b/src/api/types/DataDirectoryManifestSource.ts index 305d878f..94c96adf 100644 --- a/src/api/types/DataDirectoryManifestSource.ts +++ b/src/api/types/DataDirectoryManifestSource.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Data Directory Source */ -export type DataDirectoryManifestSource = - | TrueFoundry.TrueFoundryManagedSource - | TrueFoundry.ExternalBlobStorageSource; +export type DataDirectoryManifestSource = TrueFoundry.TrueFoundryManagedSource | TrueFoundry.ExternalBlobStorageSource; diff --git a/src/api/types/DatabricksIntegrations.ts b/src/api/types/DatabricksIntegrations.ts index 7a3940c7..c140616c 100644 --- a/src/api/types/DatabricksIntegrations.ts +++ b/src/api/types/DatabricksIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type DatabricksIntegrations = TrueFoundry.DatabricksModel; diff --git a/src/api/types/DatabricksJobTaskConfig.ts b/src/api/types/DatabricksJobTaskConfig.ts index 87b353e6..2a13b607 100644 --- a/src/api/types/DatabricksJobTaskConfig.ts +++ b/src/api/types/DatabricksJobTaskConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Task that triggers a Databricks job via API and polls until completion. Uses image and optional resources; no env or mounts. Execution is handled by the CLI (trigger + poll). @@ -17,12 +17,12 @@ export interface DatabricksJobTaskConfig { /** Service Account */ serviceAccount?: string; /** Optional parameters to pass to the job run (e.g. notebook params, jar params). */ - jobParameters?: Record; + jobParameters?: Record | null; /** Maximum seconds to wait for the job run to complete. Used by CLI when polling. */ - timeoutSeconds?: number; + timeoutSeconds?: number | null; /** If false, the task waits for the Databricks job run to complete (trigger and poll). If true, only triggers the job and returns. Default false. */ skipWaitForCompletion?: boolean; /** Configure environment variables to be injected in the task either as plain text or secrets. [Docs](https://docs.truefoundry.com/docs/env-variables) */ - env?: Record; + env?: Record | null; resources?: TrueFoundry.Resources; } diff --git a/src/api/types/DatabricksJobTaskConfigImage.ts b/src/api/types/DatabricksJobTaskConfigImage.ts index 7136508c..c39ef8e1 100644 --- a/src/api/types/DatabricksJobTaskConfigImage.ts +++ b/src/api/types/DatabricksJobTaskConfigImage.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Specify the image spec for the task */ -export type DatabricksJobTaskConfigImage = - | TrueFoundry.TaskPythonBuild - | TrueFoundry.TaskDockerFileBuild; +export type DatabricksJobTaskConfigImage = TrueFoundry.TaskPythonBuild | TrueFoundry.TaskDockerFileBuild; diff --git a/src/api/types/DatabricksModel.ts b/src/api/types/DatabricksModel.ts index b43cb929..ee1b34ca 100644 --- a/src/api/types/DatabricksModel.ts +++ b/src/api/types/DatabricksModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Databricks Model diff --git a/src/api/types/DatabricksProviderAccount.ts b/src/api/types/DatabricksProviderAccount.ts index 5d587fdc..cf1c6552 100644 --- a/src/api/types/DatabricksProviderAccount.ts +++ b/src/api/types/DatabricksProviderAccount.ts @@ -1,24 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** - * Databricks Provider Account + * Databricks Model Account */ export interface DatabricksProviderAccount { /** +value=provider-account/databricks */ type: "provider-account/databricks"; - /** The name of the Databricks provider account */ + /** The name of the Databricks model account */ name: string; /** Databricks authentication credentials */ authData: TrueFoundry.DatabricksProviderAccountAuthData; /** The base URL of your Databricks workspace */ baseUrl: string; - /** List of integrations that are associated with the Databricks provider account */ + /** List of integrations that are associated with the Databricks model account */ integrations: TrueFoundry.DatabricksIntegrations[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/DatabricksProviderAccountAuthData.ts b/src/api/types/DatabricksProviderAccountAuthData.ts index 7be14d9f..61a35cee 100644 --- a/src/api/types/DatabricksProviderAccountAuthData.ts +++ b/src/api/types/DatabricksProviderAccountAuthData.ts @@ -1,10 +1,10 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Databricks authentication credentials */ -export type DatabricksProviderAccountAuthData = +export type DatabricksProviderAccountAuthData = | TrueFoundry.DatabricksServicePrincipalAuth | TrueFoundry.DatabricksApiKeyAuth; diff --git a/src/api/types/DeactivateUserResponse.ts b/src/api/types/DeactivateUserResponse.ts index d0601622..391d846b 100644 --- a/src/api/types/DeactivateUserResponse.ts +++ b/src/api/types/DeactivateUserResponse.ts @@ -1,4 +1,3 @@ // This file was auto-generated by Fern from our API Definition. -export interface DeactivateUserResponse { -} +export type DeactivateUserResponse = {}; diff --git a/src/api/types/DeepgramModel.ts b/src/api/types/DeepgramModel.ts index 8323c1d6..0601b64e 100644 --- a/src/api/types/DeepgramModel.ts +++ b/src/api/types/DeepgramModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Deepgram Model diff --git a/src/api/types/DeepgramProviderAccount.ts b/src/api/types/DeepgramProviderAccount.ts index d74b6ed0..bc89b771 100644 --- a/src/api/types/DeepgramProviderAccount.ts +++ b/src/api/types/DeepgramProviderAccount.ts @@ -1,23 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** - * Deepgram Provider Account + * Deepgram Model Account */ export interface DeepgramProviderAccount { /** +value=provider-account/deepgram */ type: "provider-account/deepgram"; - /** The name of the Deepgram provider account */ + /** The name of the Deepgram model account */ name: string; authData: TrueFoundry.DeepgramApiKeyAuth; /** Optional custom base URL for Deepgram API */ baseUrl?: string; - /** List of integrations that are associated with the Deepgram provider account */ + /** List of integrations that are associated with the Deepgram model account */ integrations: TrueFoundry.DeepgramModel[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/DeepinfraIntegrations.ts b/src/api/types/DeepinfraIntegrations.ts index 069e1afa..4997cbb6 100644 --- a/src/api/types/DeepinfraIntegrations.ts +++ b/src/api/types/DeepinfraIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type DeepinfraIntegrations = TrueFoundry.DeepinfraModel; diff --git a/src/api/types/DeepinfraModel.ts b/src/api/types/DeepinfraModel.ts index 4d311dd8..db926550 100644 --- a/src/api/types/DeepinfraModel.ts +++ b/src/api/types/DeepinfraModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * DeepInfra Model diff --git a/src/api/types/DeepinfraProviderAccount.ts b/src/api/types/DeepinfraProviderAccount.ts index 21e5cdf3..0c1db414 100644 --- a/src/api/types/DeepinfraProviderAccount.ts +++ b/src/api/types/DeepinfraProviderAccount.ts @@ -1,21 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** - * DeepInfra Provider Account + * DeepInfra Model Account */ export interface DeepinfraProviderAccount { /** +value=provider-account/deepinfra */ type: "provider-account/deepinfra"; - /** The name of the DeepInfra provider account */ + /** The name of the DeepInfra model account */ name: string; authData: TrueFoundry.DeepinfraKeyAuth; - /** List of integrations that are associated with the DeepInfra provider account */ + /** List of integrations that are associated with the DeepInfra model account */ integrations?: TrueFoundry.DeepinfraIntegrations[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/DeletePersonalAccessTokenResponse.ts b/src/api/types/DeletePersonalAccessTokenResponse.ts index 99232b10..1651e942 100644 --- a/src/api/types/DeletePersonalAccessTokenResponse.ts +++ b/src/api/types/DeletePersonalAccessTokenResponse.ts @@ -1,4 +1,3 @@ // This file was auto-generated by Fern from our API Definition. -export interface DeletePersonalAccessTokenResponse { -} +export type DeletePersonalAccessTokenResponse = {}; diff --git a/src/api/types/DeleteSecretGroupResponse.ts b/src/api/types/DeleteSecretGroupResponse.ts index 51126563..ee367907 100644 --- a/src/api/types/DeleteSecretGroupResponse.ts +++ b/src/api/types/DeleteSecretGroupResponse.ts @@ -1,4 +1,3 @@ // This file was auto-generated by Fern from our API Definition. -export interface DeleteSecretGroupResponse { -} +export type DeleteSecretGroupResponse = {}; diff --git a/src/api/types/DeleteTeamResponse.ts b/src/api/types/DeleteTeamResponse.ts index edc43cce..68881e67 100644 --- a/src/api/types/DeleteTeamResponse.ts +++ b/src/api/types/DeleteTeamResponse.ts @@ -1,4 +1,3 @@ // This file was auto-generated by Fern from our API Definition. -export interface DeleteTeamResponse { -} +export type DeleteTeamResponse = {}; diff --git a/src/api/types/DeleteUserResponse.ts b/src/api/types/DeleteUserResponse.ts index 5bc3d4e3..d84a68b9 100644 --- a/src/api/types/DeleteUserResponse.ts +++ b/src/api/types/DeleteUserResponse.ts @@ -1,4 +1,3 @@ // This file was auto-generated by Fern from our API Definition. -export interface DeleteUserResponse { -} +export type DeleteUserResponse = {}; diff --git a/src/api/types/DeleteVirtualAccountResponse.ts b/src/api/types/DeleteVirtualAccountResponse.ts index b6d19788..a4e04519 100644 --- a/src/api/types/DeleteVirtualAccountResponse.ts +++ b/src/api/types/DeleteVirtualAccountResponse.ts @@ -1,4 +1,3 @@ // This file was auto-generated by Fern from our API Definition. -export interface DeleteVirtualAccountResponse { -} +export type DeleteVirtualAccountResponse = {}; diff --git a/src/api/types/DeleteWorkspaceResponse.ts b/src/api/types/DeleteWorkspaceResponse.ts index 18a5e956..8aa0719b 100644 --- a/src/api/types/DeleteWorkspaceResponse.ts +++ b/src/api/types/DeleteWorkspaceResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface DeleteWorkspaceResponse { /** The deleted workspace object. */ diff --git a/src/api/types/Deployment.ts b/src/api/types/Deployment.ts index d5305449..e0e2bf7b 100644 --- a/src/api/types/Deployment.ts +++ b/src/api/types/Deployment.ts @@ -1,36 +1,36 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface Deployment { /** Unique identifier of the deployment */ - id?: string; + id?: string | null; /** Incremental version number within the application */ - version?: number; + version?: number | null; /** FQN of the deployment */ - fqn?: string; + fqn?: string | null; /** Unique identifier of the application this deployment belongs to */ - applicationId?: string; + applicationId?: string | null; /** Deployment manifest defining the application configuration. */ manifest: TrueFoundry.DeploymentManifest; /** Summary of the parent application (included when requested) */ - application?: TrueFoundry.ApplicationSummary; + application?: TrueFoundry.ApplicationSummary | null; /** Subject (user or service account) that created this deployment */ createdBySubject: TrueFoundry.Subject; /** Timestamp when the deployment was created */ - createdAt?: Date; + createdAt?: Date | null; /** Timestamp when the deployment was last updated */ - updatedAt?: Date; + updatedAt?: Date | null; /** Build steps associated with this deployment */ - deploymentBuilds?: TrueFoundry.BuildInfo[]; + deploymentBuilds?: TrueFoundry.BuildInfo[] | null; /** Full history of deployment status transitions */ - deploymentStatuses?: TrueFoundry.DeploymentStatus[]; + deploymentStatuses?: TrueFoundry.DeploymentStatus[] | null; /** Unique identifier of the current deployment status record */ - currentStatusId?: string; + currentStatusId?: string | null; /** Current deployment status object. */ - currentStatus?: TrueFoundry.DeploymentStatus; + currentStatus?: TrueFoundry.DeploymentStatus | null; /** Applied recommendations for this deployment */ - appliedRecommendations?: TrueFoundry.Recommendation[]; + appliedRecommendations?: TrueFoundry.Recommendation[] | null; /** Slug of the subject that created this deployment */ - createdBy?: string; + createdBy?: string | null; } diff --git a/src/api/types/DeploymentBuild.ts b/src/api/types/DeploymentBuild.ts index 9e387a39..b0ea9408 100644 --- a/src/api/types/DeploymentBuild.ts +++ b/src/api/types/DeploymentBuild.ts @@ -1,20 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface DeploymentBuild { - id?: string; - deploymentId?: string; - componentName?: string; - build?: TrueFoundry.BuildInfo; - buildId?: string; - imageUri?: string; - name?: string; - status?: TrueFoundry.BuildStatus; - getLogsUrl?: string; - tailLogsUrl?: string; - logsStartTs?: string; - metadata?: Record; - createdAt?: Date; - updatedAt?: Date; + id?: string | null; + deploymentId?: string | null; + componentName?: string | null; + build?: TrueFoundry.BuildInfo | null; + buildId?: string | null; + imageUri?: string | null; + name?: string | null; + status?: TrueFoundry.DeploymentBuildStatus | null; + getLogsUrl?: string | null; + tailLogsUrl?: string | null; + logsStartTs?: string | null; + metadata?: Record | null; + createdAt?: Date | null; + updatedAt?: Date | null; } diff --git a/src/api/types/DeploymentBuildStatus.ts b/src/api/types/DeploymentBuildStatus.ts new file mode 100644 index 00000000..74b66c01 --- /dev/null +++ b/src/api/types/DeploymentBuildStatus.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const DeploymentBuildStatus = { + Started: "STARTED", + Succeeded: "SUCCEEDED", + Failed: "FAILED", +} as const; +export type DeploymentBuildStatus = (typeof DeploymentBuildStatus)[keyof typeof DeploymentBuildStatus]; diff --git a/src/api/types/DeploymentManifest.ts b/src/api/types/DeploymentManifest.ts index 25ea9984..2d15dccb 100644 --- a/src/api/types/DeploymentManifest.ts +++ b/src/api/types/DeploymentManifest.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Deployment manifest defining the application configuration. */ -export type DeploymentManifest = +export type DeploymentManifest = | TrueFoundry.Service | TrueFoundry.AsyncService | TrueFoundry.Job diff --git a/src/api/types/DeploymentStatus.ts b/src/api/types/DeploymentStatus.ts index 342ffac4..4dcb9c9c 100644 --- a/src/api/types/DeploymentStatus.ts +++ b/src/api/types/DeploymentStatus.ts @@ -1,15 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface DeploymentStatus { - id?: string; - deploymentId?: string; - status?: TrueFoundry.DeploymentStatusValue; - state?: Record; - transition?: TrueFoundry.DeploymentTransition; - message?: string; - retryCount?: number; - createdAt?: Date; - updatedAt?: Date; + id?: string | null; + deploymentId?: string | null; + status?: TrueFoundry.DeploymentStatusValue | null; + state?: Record | null; + transition?: TrueFoundry.DeploymentTransition | null; + message?: string | null; + retryCount?: number | null; + createdAt?: Date | null; + updatedAt?: Date | null; } diff --git a/src/api/types/DeploymentStatusValue.ts b/src/api/types/DeploymentStatusValue.ts index ca6ae80b..e7bf44ce 100644 --- a/src/api/types/DeploymentStatusValue.ts +++ b/src/api/types/DeploymentStatusValue.ts @@ -1,18 +1,18 @@ // This file was auto-generated by Fern from our API Definition. export const DeploymentStatusValue = { - Initialized: "INITIALIZED", - BuildSuccess: "BUILD_SUCCESS", - BuildFailed: "BUILD_FAILED", - DeployFailed: "DEPLOY_FAILED", - DeployFailedWithRetry: "DEPLOY_FAILED_WITH_RETRY", - DeploySuccess: "DEPLOY_SUCCESS", - RolloutStarted: "ROLLOUT_STARTED", - SetTraffic: "SET_TRAFFIC", - Paused: "PAUSED", - Failed: "FAILED", - Cancelled: "CANCELLED", - RedeployStarted: "REDEPLOY_STARTED", - Building: "BUILDING" - } as const; -export type DeploymentStatusValue = typeof DeploymentStatusValue[keyof typeof DeploymentStatusValue]; + Initialized: "INITIALIZED", + BuildSuccess: "BUILD_SUCCESS", + BuildFailed: "BUILD_FAILED", + DeployFailed: "DEPLOY_FAILED", + DeployFailedWithRetry: "DEPLOY_FAILED_WITH_RETRY", + DeploySuccess: "DEPLOY_SUCCESS", + RolloutStarted: "ROLLOUT_STARTED", + SetTraffic: "SET_TRAFFIC", + Paused: "PAUSED", + Failed: "FAILED", + Cancelled: "CANCELLED", + RedeployStarted: "REDEPLOY_STARTED", + Building: "BUILDING", +} as const; +export type DeploymentStatusValue = (typeof DeploymentStatusValue)[keyof typeof DeploymentStatusValue]; diff --git a/src/api/types/DeploymentTransition.ts b/src/api/types/DeploymentTransition.ts index 822d4ba3..7812373a 100644 --- a/src/api/types/DeploymentTransition.ts +++ b/src/api/types/DeploymentTransition.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. export const DeploymentTransition = { - Building: "BUILDING", - Deploying: "DEPLOYING", - ReusingExistingBuild: "REUSING_EXISTING_BUILD", - ComponentsDeploying: "COMPONENTS_DEPLOYING", - Waiting: "WAITING", - Empty: "" - } as const; -export type DeploymentTransition = typeof DeploymentTransition[keyof typeof DeploymentTransition]; + Building: "BUILDING", + Deploying: "DEPLOYING", + ReusingExistingBuild: "REUSING_EXISTING_BUILD", + ComponentsDeploying: "COMPONENTS_DEPLOYING", + Waiting: "WAITING", + Empty: "", +} as const; +export type DeploymentTransition = (typeof DeploymentTransition)[keyof typeof DeploymentTransition]; diff --git a/src/api/types/DeveloperMessage.ts b/src/api/types/DeveloperMessage.ts index e10dbcdb..0f81f091 100644 --- a/src/api/types/DeveloperMessage.ts +++ b/src/api/types/DeveloperMessage.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Developer message for the chat diff --git a/src/api/types/DeveloperMessageContent.ts b/src/api/types/DeveloperMessageContent.ts index e9c7cdc7..fc49a777 100644 --- a/src/api/types/DeveloperMessageContent.ts +++ b/src/api/types/DeveloperMessageContent.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * The contents of the developer message. */ -export type DeveloperMessageContent = - | string - | TrueFoundry.BlobStorageReference; +export type DeveloperMessageContent = string | TrueFoundry.BlobStorageReference; diff --git a/src/api/types/DockerFileBuild.ts b/src/api/types/DockerFileBuild.ts index fc834bad..67956ebf 100644 --- a/src/api/types/DockerFileBuild.ts +++ b/src/api/types/DockerFileBuild.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Describes that we are using a dockerfile to build our image diff --git a/src/api/types/DockerFileBuildCommand.ts b/src/api/types/DockerFileBuildCommand.ts index 2e1719d0..e97ca2c8 100644 --- a/src/api/types/DockerFileBuildCommand.ts +++ b/src/api/types/DockerFileBuildCommand.ts @@ -5,6 +5,4 @@ * When deploying a Job, the command can be templatized by defining `params` and referencing them in command * E.g. `python main.py --learning_rate {{learning_rate}}` */ -export type DockerFileBuildCommand = - | string - | string[]; +export type DockerFileBuildCommand = string | string[]; diff --git a/src/api/types/DockerhubIntegrations.ts b/src/api/types/DockerhubIntegrations.ts index a1fcddf5..d081d709 100644 --- a/src/api/types/DockerhubIntegrations.ts +++ b/src/api/types/DockerhubIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type DockerhubIntegrations = TrueFoundry.DockerhubRegistry; diff --git a/src/api/types/DockerhubProviderAccount.ts b/src/api/types/DockerhubProviderAccount.ts index eee0062e..7948baed 100644 --- a/src/api/types/DockerhubProviderAccount.ts +++ b/src/api/types/DockerhubProviderAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Dockerhub diff --git a/src/api/types/DockerhubRegistry.ts b/src/api/types/DockerhubRegistry.ts index 5f456e17..6ed2f477 100644 --- a/src/api/types/DockerhubRegistry.ts +++ b/src/api/types/DockerhubRegistry.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Dockerhub Registry diff --git a/src/api/types/ElevenLabsModel.ts b/src/api/types/ElevenLabsModel.ts index 1831e3a3..686fe53b 100644 --- a/src/api/types/ElevenLabsModel.ts +++ b/src/api/types/ElevenLabsModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * ElevenLabs Model diff --git a/src/api/types/ElevenLabsProviderAccount.ts b/src/api/types/ElevenLabsProviderAccount.ts index 694e1b31..e4f74593 100644 --- a/src/api/types/ElevenLabsProviderAccount.ts +++ b/src/api/types/ElevenLabsProviderAccount.ts @@ -1,23 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** - * ElevenLabs Provider Account + * ElevenLabs Model Account */ export interface ElevenLabsProviderAccount { /** +value=provider-account/elevenlabs */ type: "provider-account/elevenlabs"; - /** The name of the ElevenLabs provider account */ + /** The name of the ElevenLabs model account */ name: string; authData: TrueFoundry.ElevenLabsApiKeyAuth; /** Optional custom base URL for ElevenLabs API */ baseUrl?: string; - /** List of integrations that are associated with the ElevenLabs provider account */ + /** List of integrations that are associated with the ElevenLabs model account */ integrations: TrueFoundry.ElevenLabsModel[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/EmailNotificationChannel.ts b/src/api/types/EmailNotificationChannel.ts index a89d9a76..90d97ac2 100644 --- a/src/api/types/EmailNotificationChannel.ts +++ b/src/api/types/EmailNotificationChannel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Email Notification Channel diff --git a/src/api/types/EmptyResponse.ts b/src/api/types/EmptyResponse.ts index c1cd4801..82df7f37 100644 --- a/src/api/types/EmptyResponse.ts +++ b/src/api/types/EmptyResponse.ts @@ -1,4 +1,3 @@ // This file was auto-generated by Fern from our API Definition. -export interface EmptyResponse { -} +export type EmptyResponse = {}; diff --git a/src/api/types/EnforcingStrategy.ts b/src/api/types/EnforcingStrategy.ts index 27f691bf..6803a843 100644 --- a/src/api/types/EnforcingStrategy.ts +++ b/src/api/types/EnforcingStrategy.ts @@ -2,8 +2,8 @@ /** Strategy for enforcing this guardrail: enforce (block on failure), enforce_but_ignore_on_error (continue on error but block on failure), or audit (only audit violations) */ export const EnforcingStrategy = { - EnforceButIgnoreOnError: "enforce_but_ignore_on_error", - Enforce: "enforce", - Audit: "audit" - } as const; -export type EnforcingStrategy = typeof EnforcingStrategy[keyof typeof EnforcingStrategy]; + EnforceButIgnoreOnError: "enforce_but_ignore_on_error", + Enforce: "enforce", + Audit: "audit", +} as const; +export type EnforcingStrategy = (typeof EnforcingStrategy)[keyof typeof EnforcingStrategy]; diff --git a/src/api/types/EnkryptAiGuardrailConfig.ts b/src/api/types/EnkryptAiGuardrailConfig.ts index 9e98c1e9..8f21716a 100644 --- a/src/api/types/EnkryptAiGuardrailConfig.ts +++ b/src/api/types/EnkryptAiGuardrailConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Enkrypt AI diff --git a/src/api/types/EnkryptAiGuardrailConfigOperation.ts b/src/api/types/EnkryptAiGuardrailConfigOperation.ts index faab77a7..ea2fafc0 100644 --- a/src/api/types/EnkryptAiGuardrailConfigOperation.ts +++ b/src/api/types/EnkryptAiGuardrailConfigOperation.ts @@ -5,7 +5,8 @@ * Validate guardrails are run in parallel while mutate guardrails are run sequentially. */ export const EnkryptAiGuardrailConfigOperation = { - Validate: "validate", - Mutate: "mutate" - } as const; -export type EnkryptAiGuardrailConfigOperation = typeof EnkryptAiGuardrailConfigOperation[keyof typeof EnkryptAiGuardrailConfigOperation]; + Validate: "validate", + Mutate: "mutate", +} as const; +export type EnkryptAiGuardrailConfigOperation = + (typeof EnkryptAiGuardrailConfigOperation)[keyof typeof EnkryptAiGuardrailConfigOperation]; diff --git a/src/api/types/Environment.ts b/src/api/types/Environment.ts index 8ce212a0..3b8a0904 100644 --- a/src/api/types/Environment.ts +++ b/src/api/types/Environment.ts @@ -1,15 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface Environment { - id?: string; - priority?: number; + id?: string | null; + priority?: number | null; color: TrueFoundry.EnvironmentColor; tenantName: string; createdBySubject: TrueFoundry.Subject; isProduction: boolean; - optimizeFor?: TrueFoundry.EnvironmentOptimizeFor; + optimizeFor?: TrueFoundry.EnvironmentOptimizeFor | null; manifest: TrueFoundry.EnvironmentManifest; - createdBy?: string; + createdBy?: string | null; } diff --git a/src/api/types/EnvironmentManifest.ts b/src/api/types/EnvironmentManifest.ts index da3a6367..61c1150a 100644 --- a/src/api/types/EnvironmentManifest.ts +++ b/src/api/types/EnvironmentManifest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface EnvironmentManifest { /** +value=environment */ diff --git a/src/api/types/EnvironmentOptimizeFor.ts b/src/api/types/EnvironmentOptimizeFor.ts index 2c7b17b9..c55be399 100644 --- a/src/api/types/EnvironmentOptimizeFor.ts +++ b/src/api/types/EnvironmentOptimizeFor.ts @@ -1,7 +1,7 @@ // This file was auto-generated by Fern from our API Definition. export const EnvironmentOptimizeFor = { - Cost: "COST", - Availability: "AVAILABILITY" - } as const; -export type EnvironmentOptimizeFor = typeof EnvironmentOptimizeFor[keyof typeof EnvironmentOptimizeFor]; + Cost: "COST", + Availability: "AVAILABILITY", +} as const; +export type EnvironmentOptimizeFor = (typeof EnvironmentOptimizeFor)[keyof typeof EnvironmentOptimizeFor]; diff --git a/src/api/types/Event.ts b/src/api/types/Event.ts index 61ad57dd..e68b379f 100644 --- a/src/api/types/Event.ts +++ b/src/api/types/Event.ts @@ -1,12 +1,12 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface Event { /** Name of the event */ - name?: string; + name?: string | null; /** Timestamp when the event was first observed */ - firstTimestamp?: string; + firstTimestamp?: string | null; /** Timestamp when the event was last observed */ lastTimestamp: string; /** Details of the involved object */ @@ -20,7 +20,7 @@ export interface Event { /** Message describing the event */ message: string; /** Namespace of the event */ - namespace?: string; + namespace?: string | null; /** Chart of the event */ chart: TrueFoundry.EventChart; } diff --git a/src/api/types/EventChart.ts b/src/api/types/EventChart.ts index b096e7f2..a3f57628 100644 --- a/src/api/types/EventChart.ts +++ b/src/api/types/EventChart.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface EventChart { category: TrueFoundry.EventChartCategory; diff --git a/src/api/types/EventChartCategory.ts b/src/api/types/EventChartCategory.ts index 81b1efbf..aefc5f5a 100644 --- a/src/api/types/EventChartCategory.ts +++ b/src/api/types/EventChartCategory.ts @@ -1,10 +1,10 @@ // This file was auto-generated by Fern from our API Definition. export const EventChartCategory = { - ContainerTerminated: "ContainerTerminated", - ContainerOom: "ContainerOOM", - PodTerminated: "PodTerminated", - PodEvicted: "PodEvicted", - General: "General" - } as const; -export type EventChartCategory = typeof EventChartCategory[keyof typeof EventChartCategory]; + ContainerTerminated: "ContainerTerminated", + ContainerOom: "ContainerOOM", + PodTerminated: "PodTerminated", + PodEvicted: "PodEvicted", + General: "General", +} as const; +export type EventChartCategory = (typeof EventChartCategory)[keyof typeof EventChartCategory]; diff --git a/src/api/types/EventInvolvedObject.ts b/src/api/types/EventInvolvedObject.ts index a06b7fa7..34773a8f 100644 --- a/src/api/types/EventInvolvedObject.ts +++ b/src/api/types/EventInvolvedObject.ts @@ -3,7 +3,7 @@ export interface EventInvolvedObject { kind: string; name: string; - apiVersion?: string; - namespace?: string; - containerName?: string; + apiVersion?: string | null; + namespace?: string | null; + containerName?: string | null; } diff --git a/src/api/types/ExternalIdentityProvider.ts b/src/api/types/ExternalIdentityProvider.ts new file mode 100644 index 00000000..eede42ca --- /dev/null +++ b/src/api/types/ExternalIdentityProvider.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +export interface ExternalIdentityProvider { + id?: string | null; + fqn: string; + tenantName: string; + /** External identity provider manifest */ + manifest: Record; + createdBySubject: TrueFoundry.Subject; + createdAt?: Date | null; + updatedAt?: Date | null; + accountId: string; +} diff --git a/src/api/types/FiddlerGuardType.ts b/src/api/types/FiddlerGuardType.ts index 5f2d12fd..50a67dbd 100644 --- a/src/api/types/FiddlerGuardType.ts +++ b/src/api/types/FiddlerGuardType.ts @@ -1,7 +1,7 @@ // This file was auto-generated by Fern from our API Definition. export const FiddlerGuardType = { - FiddlerSafety: "fiddler-safety", - FiddlerResponseFaithfulness: "fiddler-response-faithfulness" - } as const; -export type FiddlerGuardType = typeof FiddlerGuardType[keyof typeof FiddlerGuardType]; + FiddlerSafety: "fiddler-safety", + FiddlerResponseFaithfulness: "fiddler-response-faithfulness", +} as const; +export type FiddlerGuardType = (typeof FiddlerGuardType)[keyof typeof FiddlerGuardType]; diff --git a/src/api/types/FiddlerGuardrailConfig.ts b/src/api/types/FiddlerGuardrailConfig.ts index 23555bfa..f1cc54b4 100644 --- a/src/api/types/FiddlerGuardrailConfig.ts +++ b/src/api/types/FiddlerGuardrailConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Fiddler diff --git a/src/api/types/FiddlerGuardrailConfigConfig.ts b/src/api/types/FiddlerGuardrailConfigConfig.ts index d33c333d..cd76c918 100644 --- a/src/api/types/FiddlerGuardrailConfigConfig.ts +++ b/src/api/types/FiddlerGuardrailConfigConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +uiType=Ignore diff --git a/src/api/types/FileInfo.ts b/src/api/types/FileInfo.ts index 701e95e7..e332b085 100644 --- a/src/api/types/FileInfo.ts +++ b/src/api/types/FileInfo.ts @@ -6,9 +6,9 @@ export interface FileInfo { /** Whether the entry is a directory. */ isDir: boolean; /** Size of the file in bytes. */ - fileSize?: number; + fileSize?: number | null; /** Signed URL used to download the file. */ - signedUrl?: string; + signedUrl?: string | null; /** Timestamp when the file was last modified. */ - lastModified?: Date; + lastModified?: Date | null; } diff --git a/src/api/types/FlyteLaunchPlan.ts b/src/api/types/FlyteLaunchPlan.ts index b6ee59ac..e5398d80 100644 --- a/src/api/types/FlyteLaunchPlan.ts +++ b/src/api/types/FlyteLaunchPlan.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface FlyteLaunchPlan { id: TrueFoundry.FlyteLaunchPlanId; diff --git a/src/api/types/FlyteLaunchPlanSpec.ts b/src/api/types/FlyteLaunchPlanSpec.ts index 007523ab..92c5e160 100644 --- a/src/api/types/FlyteLaunchPlanSpec.ts +++ b/src/api/types/FlyteLaunchPlanSpec.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface FlyteLaunchPlanSpec { workflowId: TrueFoundry.FlyteWorkflowId; diff --git a/src/api/types/FlyteTask.ts b/src/api/types/FlyteTask.ts index ff660062..dea3d0fd 100644 --- a/src/api/types/FlyteTask.ts +++ b/src/api/types/FlyteTask.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface FlyteTask { template: TrueFoundry.FlyteTaskTemplate; diff --git a/src/api/types/FlyteTaskCustom.ts b/src/api/types/FlyteTaskCustom.ts index 41bf2bd4..48548b1c 100644 --- a/src/api/types/FlyteTaskCustom.ts +++ b/src/api/types/FlyteTaskCustom.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface FlyteTaskCustom { /** +discriminator=type */ diff --git a/src/api/types/FlyteTaskCustomTruefoundry.ts b/src/api/types/FlyteTaskCustomTruefoundry.ts index 58ee8ba9..b1e2a670 100644 --- a/src/api/types/FlyteTaskCustomTruefoundry.ts +++ b/src/api/types/FlyteTaskCustomTruefoundry.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +discriminator=type */ -export type FlyteTaskCustomTruefoundry = +export type FlyteTaskCustomTruefoundry = | TrueFoundry.PythonTaskConfig | TrueFoundry.ContainerTaskConfig | TrueFoundry.PySparkTaskConfig diff --git a/src/api/types/FlyteTaskTemplate.ts b/src/api/types/FlyteTaskTemplate.ts index 222bbc3a..530249d7 100644 --- a/src/api/types/FlyteTaskTemplate.ts +++ b/src/api/types/FlyteTaskTemplate.ts @@ -1,7 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; -export type FlyteTaskTemplate = - | TrueFoundry.TruefoundryFlyteTaskTemplate - | TrueFoundry.NativeSnowflakeFlyteTaskTemplate; +export type FlyteTaskTemplate = TrueFoundry.TruefoundryFlyteTaskTemplate | TrueFoundry.NativeSnowflakeFlyteTaskTemplate; diff --git a/src/api/types/FlyteWorkflow.ts b/src/api/types/FlyteWorkflow.ts index 2cb937c8..0beced1a 100644 --- a/src/api/types/FlyteWorkflow.ts +++ b/src/api/types/FlyteWorkflow.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface FlyteWorkflow { template: TrueFoundry.FlyteWorkflowTemplate; diff --git a/src/api/types/FlyteWorkflowTemplate.ts b/src/api/types/FlyteWorkflowTemplate.ts index b6be1f54..ab605611 100644 --- a/src/api/types/FlyteWorkflowTemplate.ts +++ b/src/api/types/FlyteWorkflowTemplate.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface FlyteWorkflowTemplate { id: TrueFoundry.FlyteWorkflowId; diff --git a/src/api/types/GatewayBudget.ts b/src/api/types/GatewayBudget.ts new file mode 100644 index 00000000..11970b60 --- /dev/null +++ b/src/api/types/GatewayBudget.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +export interface GatewayBudget { + /** System-generated Budget ID. */ + id?: string | null; + /** Tenant the budget belongs to. */ + tenantName: string; + /** Budget name (unique per tenant). */ + name: string; + /** Budget type (tenant-budget-config | team-budget-config). */ + type: string; + /** The budget manifest. */ + manifest: TrueFoundry.GatewayBudgetManifest; + /** Principal that created or last updated this budget. */ + createdBySubject: TrueFoundry.Subject; + /** Creation timestamp. */ + createdAt?: Date | null; + /** Last-update timestamp. */ + updatedAt?: Date | null; +} diff --git a/src/api/types/GatewayBudgetManifest.ts b/src/api/types/GatewayBudgetManifest.ts new file mode 100644 index 00000000..345e8002 --- /dev/null +++ b/src/api/types/GatewayBudgetManifest.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +/** + * The budget manifest. + */ +export type GatewayBudgetManifest = TrueFoundry.TenantBudgetConfig | TrueFoundry.TeamBudgetConfig; diff --git a/src/api/types/GatewayConfig.ts b/src/api/types/GatewayConfig.ts index da0dc3f4..a5f502f0 100644 --- a/src/api/types/GatewayConfig.ts +++ b/src/api/types/GatewayConfig.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +discriminator=type */ -export type GatewayConfig = +export type GatewayConfig = | TrueFoundry.RateLimitConfig | TrueFoundry.LoadBalancingConfig | TrueFoundry.GuardrailsConfig @@ -14,7 +14,7 @@ export type GatewayConfig = | TrueFoundry.TeamBudgetConfig | TrueFoundry.GatewayOtelConfig | TrueFoundry.GatewayMetadataConfig - | TrueFoundry.GatewayLoggingConfig | TrueFoundry.GlobalSettings | TrueFoundry.GatewayDataAccessConfig - | TrueFoundry.GatewayDataRoutingConfig; + | TrueFoundry.GatewayDataRoutingConfig + | TrueFoundry.GatewayLoggingConfig; diff --git a/src/api/types/GatewayConfiguration.ts b/src/api/types/GatewayConfiguration.ts index b03d9df9..8440da0d 100644 --- a/src/api/types/GatewayConfiguration.ts +++ b/src/api/types/GatewayConfiguration.ts @@ -1,10 +1,10 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GatewayConfiguration { /** System-generated Configuration ID. */ - id?: string; + id?: string | null; /** Tenant the gateway configuration belongs to. */ tenantName: string; /** Configuration type. */ @@ -14,7 +14,7 @@ export interface GatewayConfiguration { /** Principal (user or service account) that created or last updated this configuration. */ createdBySubject: TrueFoundry.Subject; /** Creation timestamp. */ - createdAt?: Date; + createdAt?: Date | null; /** Last-update timestamp. */ - updatedAt?: Date; + updatedAt?: Date | null; } diff --git a/src/api/types/GatewayDataAccessConfig.ts b/src/api/types/GatewayDataAccessConfig.ts index 867756ce..ac629771 100644 --- a/src/api/types/GatewayDataAccessConfig.ts +++ b/src/api/types/GatewayDataAccessConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Gateway Data Access Configuration diff --git a/src/api/types/GatewayDataCreatedByFilter.ts b/src/api/types/GatewayDataCreatedByFilter.ts index b2829a84..5022d866 100644 --- a/src/api/types/GatewayDataCreatedByFilter.ts +++ b/src/api/types/GatewayDataCreatedByFilter.ts @@ -1,5 +1,7 @@ // This file was auto-generated by Fern from our API Definition. +import type * as TrueFoundry from "../index.js"; + /** * Created By Filter */ @@ -7,7 +9,7 @@ export interface GatewayDataCreatedByFilter { /** Filter type */ field: "created_by"; /** Comparison operator */ - operator: "IN"; + operator: TrueFoundry.GatewayDataCreatedByFilterOperator; /** List of subjects (users, virtual accounts, teams) to filter by */ value: string[]; } diff --git a/src/api/types/GatewayDataCreatedByFilterOperator.ts b/src/api/types/GatewayDataCreatedByFilterOperator.ts new file mode 100644 index 00000000..6e0458d3 --- /dev/null +++ b/src/api/types/GatewayDataCreatedByFilterOperator.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +/** Comparison operator */ +export const GatewayDataCreatedByFilterOperator = { + In: "IN", + NotIn: "NOT_IN", +} as const; +export type GatewayDataCreatedByFilterOperator = + (typeof GatewayDataCreatedByFilterOperator)[keyof typeof GatewayDataCreatedByFilterOperator]; diff --git a/src/api/types/GatewayDataMetadataFilter.ts b/src/api/types/GatewayDataMetadataFilter.ts index df3f704d..14e846e8 100644 --- a/src/api/types/GatewayDataMetadataFilter.ts +++ b/src/api/types/GatewayDataMetadataFilter.ts @@ -1,5 +1,7 @@ // This file was auto-generated by Fern from our API Definition. +import type * as TrueFoundry from "../index.js"; + /** * Metadata Filter */ @@ -9,7 +11,7 @@ export interface GatewayDataMetadataFilter { /** Metadata key to filter on */ key: string; /** Comparison operator */ - operator: "IN"; + operator: TrueFoundry.GatewayDataMetadataFilterOperator; /** Values to match against */ value: string[]; } diff --git a/src/api/types/GatewayDataMetadataFilterOperator.ts b/src/api/types/GatewayDataMetadataFilterOperator.ts new file mode 100644 index 00000000..11fdf135 --- /dev/null +++ b/src/api/types/GatewayDataMetadataFilterOperator.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +/** Comparison operator */ +export const GatewayDataMetadataFilterOperator = { + In: "IN", + NotIn: "NOT_IN", +} as const; +export type GatewayDataMetadataFilterOperator = + (typeof GatewayDataMetadataFilterOperator)[keyof typeof GatewayDataMetadataFilterOperator]; diff --git a/src/api/types/GatewayDataRoutingConfig.ts b/src/api/types/GatewayDataRoutingConfig.ts index c7bec2b9..8ab1e212 100644 --- a/src/api/types/GatewayDataRoutingConfig.ts +++ b/src/api/types/GatewayDataRoutingConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Configuration for gateway data routing with destinations and default settings. @@ -10,5 +10,5 @@ export interface GatewayDataRoutingConfig { type: "gateway-data-routing-config"; /** List of conditional routing destinations */ destinations?: TrueFoundry.GatewayDataRoutingConfigDestination[]; - "default": TrueFoundry.GatewayDataRoutingConfigDestinationStorage; + default: TrueFoundry.GatewayDataRoutingConfigDestinationStorage; } diff --git a/src/api/types/GatewayDataRoutingConfigDestination.ts b/src/api/types/GatewayDataRoutingConfigDestination.ts index 4a5f661c..84eb58af 100644 --- a/src/api/types/GatewayDataRoutingConfigDestination.ts +++ b/src/api/types/GatewayDataRoutingConfigDestination.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Destination for data routing based on conditions. diff --git a/src/api/types/GatewayDataRoutingConfigDestinationCondition.ts b/src/api/types/GatewayDataRoutingConfigDestinationCondition.ts index 85a80be5..c732ab32 100644 --- a/src/api/types/GatewayDataRoutingConfigDestinationCondition.ts +++ b/src/api/types/GatewayDataRoutingConfigDestinationCondition.ts @@ -1,10 +1,10 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +discriminator=field */ -export type GatewayDataRoutingConfigDestinationCondition = +export type GatewayDataRoutingConfigDestinationCondition = | TrueFoundry.GatewayDataRoutingConfigDestinationMetadataCondition | TrueFoundry.GatewayDataRoutingConfigDestinationCreatedByCondition; diff --git a/src/api/types/GatewayDataRoutingConfigDestinationControlPlaneManagedStorage.ts b/src/api/types/GatewayDataRoutingConfigDestinationControlPlaneManagedStorage.ts index 52ed3e2f..32da6c92 100644 --- a/src/api/types/GatewayDataRoutingConfigDestinationControlPlaneManagedStorage.ts +++ b/src/api/types/GatewayDataRoutingConfigDestinationControlPlaneManagedStorage.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Managed Storage in Control-Plane. diff --git a/src/api/types/GatewayDataRoutingConfigDestinationControlPlaneManagedStorageRegion.ts b/src/api/types/GatewayDataRoutingConfigDestinationControlPlaneManagedStorageRegion.ts index b5c824a6..e04894aa 100644 --- a/src/api/types/GatewayDataRoutingConfigDestinationControlPlaneManagedStorageRegion.ts +++ b/src/api/types/GatewayDataRoutingConfigDestinationControlPlaneManagedStorageRegion.ts @@ -2,8 +2,9 @@ /** Specifies the region where control plane–managed storage is located. */ export const GatewayDataRoutingConfigDestinationControlPlaneManagedStorageRegion = { - Us: "us", - Australia: "australia", - India: "india" - } as const; -export type GatewayDataRoutingConfigDestinationControlPlaneManagedStorageRegion = typeof GatewayDataRoutingConfigDestinationControlPlaneManagedStorageRegion[keyof typeof GatewayDataRoutingConfigDestinationControlPlaneManagedStorageRegion]; + Us: "us", + Australia: "australia", + India: "india", +} as const; +export type GatewayDataRoutingConfigDestinationControlPlaneManagedStorageRegion = + (typeof GatewayDataRoutingConfigDestinationControlPlaneManagedStorageRegion)[keyof typeof GatewayDataRoutingConfigDestinationControlPlaneManagedStorageRegion]; diff --git a/src/api/types/GatewayDataRoutingConfigDestinationStorage.ts b/src/api/types/GatewayDataRoutingConfigDestinationStorage.ts index 296f10d9..d28a6269 100644 --- a/src/api/types/GatewayDataRoutingConfigDestinationStorage.ts +++ b/src/api/types/GatewayDataRoutingConfigDestinationStorage.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GatewayDataRoutingConfigDestinationStorage { /** Storage configuration for traces and spans */ diff --git a/src/api/types/GatewayDataRoutingConfigDestinationStorageStorage.ts b/src/api/types/GatewayDataRoutingConfigDestinationStorageStorage.ts index 3b936543..71036715 100644 --- a/src/api/types/GatewayDataRoutingConfigDestinationStorageStorage.ts +++ b/src/api/types/GatewayDataRoutingConfigDestinationStorageStorage.ts @@ -1,10 +1,10 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Storage configuration for traces and spans */ -export type GatewayDataRoutingConfigDestinationStorageStorage = +export type GatewayDataRoutingConfigDestinationStorageStorage = | TrueFoundry.GatewayDataRoutingConfigDestinationControlPlaneManagedStorage | TrueFoundry.GatewayDataRoutingConfigDestinationCustomerManagedStorage; diff --git a/src/api/types/GatewayDataType.ts b/src/api/types/GatewayDataType.ts index f1cc6e09..801ba12f 100644 --- a/src/api/types/GatewayDataType.ts +++ b/src/api/types/GatewayDataType.ts @@ -1,7 +1,7 @@ // This file was auto-generated by Fern from our API Definition. export const GatewayDataType = { - Traces: "traces", - Metrics: "metrics" - } as const; -export type GatewayDataType = typeof GatewayDataType[keyof typeof GatewayDataType]; + Traces: "traces", + Metrics: "metrics", +} as const; +export type GatewayDataType = (typeof GatewayDataType)[keyof typeof GatewayDataType]; diff --git a/src/api/types/GatewayInstallation.ts b/src/api/types/GatewayInstallation.ts new file mode 100644 index 00000000..8dd0e397 --- /dev/null +++ b/src/api/types/GatewayInstallation.ts @@ -0,0 +1,17 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +export interface GatewayInstallation { + /** System-generated gateway installation ID. */ + id: string; + serviceAccountId?: string | null; + manifest: Record; + enabled: boolean; + tenantName: string; + createdBySubject?: TrueFoundry.Subject | null; + createdAt: Date; + updatedAt: Date; + isDefault: boolean; + createdBy?: string | null; +} diff --git a/src/api/types/GatewayLoggingConfig.ts b/src/api/types/GatewayLoggingConfig.ts index c5d85a8e..a261d812 100644 --- a/src/api/types/GatewayLoggingConfig.ts +++ b/src/api/types/GatewayLoggingConfig.ts @@ -1,18 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Logging Configuration */ export interface GatewayLoggingConfig { - /** Name of the logging configuration */ - name: string; /** * +value=gateway-logging-config - * +sort=2 + * +sort=1 */ type: "gateway-logging-config"; - /** List of logging rules */ - rules: TrueFoundry.GatewayLoggingRule[]; + /** Unique name for this logging configuration */ + name: string; + when?: TrueFoundry.LoggingWhen; + /** Whether requests matched by this config should be logged. */ + log: boolean; + redactWith?: TrueFoundry.Redaction; } diff --git a/src/api/types/GatewayLoggingRule.ts b/src/api/types/GatewayLoggingRule.ts deleted file mode 100644 index 39c178e2..00000000 --- a/src/api/types/GatewayLoggingRule.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as TrueFoundry from "../index.js"; - -/** - * Logging Rule - */ -export interface GatewayLoggingRule { - /** Unique identifier for the rule */ - id: string; - when: TrueFoundry.GatewayLoggingWhen; - /** FQN of the tracing project to send logs to */ - tracingProjectFqn: string; -} diff --git a/src/api/types/GatewayLoggingWhen.ts b/src/api/types/GatewayLoggingWhen.ts deleted file mode 100644 index f5b22bc3..00000000 --- a/src/api/types/GatewayLoggingWhen.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Rule Conditions - */ -export interface GatewayLoggingWhen { - /** List of subjects that this rule applies to */ - subjects?: string[]; -} diff --git a/src/api/types/GatewayMetadataConfig.ts b/src/api/types/GatewayMetadataConfig.ts index 18f3268c..043ff592 100644 --- a/src/api/types/GatewayMetadataConfig.ts +++ b/src/api/types/GatewayMetadataConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Metadata Configuration diff --git a/src/api/types/GatewayMetadataRule.ts b/src/api/types/GatewayMetadataRule.ts index 5f0eb93f..55f87b25 100644 --- a/src/api/types/GatewayMetadataRule.ts +++ b/src/api/types/GatewayMetadataRule.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Metadata Rule diff --git a/src/api/types/GatewayOtelConfig.ts b/src/api/types/GatewayOtelConfig.ts index 7cf5e4f7..66688040 100644 --- a/src/api/types/GatewayOtelConfig.ts +++ b/src/api/types/GatewayOtelConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GatewayOtelConfig { /** diff --git a/src/api/types/GatewayOtelConfigOtelMetricsExporterConfig.ts b/src/api/types/GatewayOtelConfigOtelMetricsExporterConfig.ts index afc46f4d..8c6e953a 100644 --- a/src/api/types/GatewayOtelConfigOtelMetricsExporterConfig.ts +++ b/src/api/types/GatewayOtelConfigOtelMetricsExporterConfig.ts @@ -1,10 +1,10 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Set this configuration to export LLM gateway OTEL metrics to an external platform. Note that we only export OTEL metrics via this configuration. */ -export type GatewayOtelConfigOtelMetricsExporterConfig = +export type GatewayOtelConfigOtelMetricsExporterConfig = | TrueFoundry.OtelMetricsExporterHttpConfig | TrueFoundry.OtelMetricsExporterGrpcConfig; diff --git a/src/api/types/GatewayOtelConfigOtelTracesExporterConfig.ts b/src/api/types/GatewayOtelConfigOtelTracesExporterConfig.ts index 43a4e99c..f917589f 100644 --- a/src/api/types/GatewayOtelConfigOtelTracesExporterConfig.ts +++ b/src/api/types/GatewayOtelConfigOtelTracesExporterConfig.ts @@ -1,10 +1,10 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Set this configuration to export LLM gateway OTEL traces to an external platform. Note that we only export OTEL traces via this configuration. */ -export type GatewayOtelConfigOtelTracesExporterConfig = +export type GatewayOtelConfigOtelTracesExporterConfig = | TrueFoundry.OtelTracesExporterHttpConfig | TrueFoundry.OtelTracesExporterGrpcConfig; diff --git a/src/api/types/GatewayRequestMetadataFilter.ts b/src/api/types/GatewayRequestMetadataFilter.ts index 64a61f5b..62f8f6d3 100644 --- a/src/api/types/GatewayRequestMetadataFilter.ts +++ b/src/api/types/GatewayRequestMetadataFilter.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GatewayRequestMetadataFilter { gatewayRequestMetadataKey: string; diff --git a/src/api/types/GatewayRequestMetadataFilterOperator.ts b/src/api/types/GatewayRequestMetadataFilterOperator.ts index 6258dd9a..068e4a72 100644 --- a/src/api/types/GatewayRequestMetadataFilterOperator.ts +++ b/src/api/types/GatewayRequestMetadataFilterOperator.ts @@ -1,24 +1,25 @@ // This file was auto-generated by Fern from our API Definition. export const GatewayRequestMetadataFilterOperator = { - Equal: "EQUAL", - NotEqual: "NOT_EQUAL", - GreaterThan: "GREATER_THAN", - LessThan: "LESS_THAN", - GreaterThanEqual: "GREATER_THAN_EQUAL", - LessThanEqual: "LESS_THAN_EQUAL", - Between: "BETWEEN", - In: "IN", - NotIn: "NOT_IN", - StringContains: "STRING_CONTAINS", - StringNotContains: "STRING_NOT_CONTAINS", - StringStartsWith: "STRING_STARTS_WITH", - StringNotStartsWith: "STRING_NOT_STARTS_WITH", - StringEndsWith: "STRING_ENDS_WITH", - StringNotEndsWith: "STRING_NOT_ENDS_WITH", - ArrayHasAny: "ARRAY_HAS_ANY", - ArrayHasNone: "ARRAY_HAS_NONE", - Present: "PRESENT", - IsNull: "IS_NULL" - } as const; -export type GatewayRequestMetadataFilterOperator = typeof GatewayRequestMetadataFilterOperator[keyof typeof GatewayRequestMetadataFilterOperator]; + Equal: "EQUAL", + NotEqual: "NOT_EQUAL", + GreaterThan: "GREATER_THAN", + LessThan: "LESS_THAN", + GreaterThanEqual: "GREATER_THAN_EQUAL", + LessThanEqual: "LESS_THAN_EQUAL", + Between: "BETWEEN", + In: "IN", + NotIn: "NOT_IN", + StringContains: "STRING_CONTAINS", + StringNotContains: "STRING_NOT_CONTAINS", + StringStartsWith: "STRING_STARTS_WITH", + StringNotStartsWith: "STRING_NOT_STARTS_WITH", + StringEndsWith: "STRING_ENDS_WITH", + StringNotEndsWith: "STRING_NOT_ENDS_WITH", + ArrayHasAny: "ARRAY_HAS_ANY", + ArrayHasNone: "ARRAY_HAS_NONE", + Present: "PRESENT", + IsNull: "IS_NULL", +} as const; +export type GatewayRequestMetadataFilterOperator = + (typeof GatewayRequestMetadataFilterOperator)[keyof typeof GatewayRequestMetadataFilterOperator]; diff --git a/src/api/types/GatewayRequestMetadataFilterValue.ts b/src/api/types/GatewayRequestMetadataFilterValue.ts index 04bd4aff..2db26fd3 100644 --- a/src/api/types/GatewayRequestMetadataFilterValue.ts +++ b/src/api/types/GatewayRequestMetadataFilterValue.ts @@ -1,5 +1,3 @@ // This file was auto-generated by Fern from our API Definition. -export type GatewayRequestMetadataFilterValue = - | string - | string[]; +export type GatewayRequestMetadataFilterValue = string | string[]; diff --git a/src/api/types/GcpGcr.ts b/src/api/types/GcpGcr.ts index 56417a71..a7d26005 100644 --- a/src/api/types/GcpGcr.ts +++ b/src/api/types/GcpGcr.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * GCP GCR diff --git a/src/api/types/GcpGcs.ts b/src/api/types/GcpGcs.ts index c05ca664..1a38a9f0 100644 --- a/src/api/types/GcpGcs.ts +++ b/src/api/types/GcpGcs.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * GCP GCS diff --git a/src/api/types/GcpGkeIntegration.ts b/src/api/types/GcpGkeIntegration.ts index ce5a9747..440f2c1d 100644 --- a/src/api/types/GcpGkeIntegration.ts +++ b/src/api/types/GcpGkeIntegration.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * GCP GKE @@ -10,7 +10,8 @@ export interface GcpGkeIntegration { type: "integration/cluster/gcp/gke-standard"; /** The name of the integration that will be displayed in the TrueFoundry UI. */ name: string; - location: TrueFoundry.GcpRegion; + /** The location of the cluster. */ + location: TrueFoundry.GcpGkeIntegrationLocation; /** Name of the cluster given in the cloud account. */ clusterName: string; authData?: TrueFoundry.GcpKeyFileAuth; diff --git a/src/api/types/GcpGkeIntegrationLocation.ts b/src/api/types/GcpGkeIntegrationLocation.ts new file mode 100644 index 00000000..370b22b8 --- /dev/null +++ b/src/api/types/GcpGkeIntegrationLocation.ts @@ -0,0 +1,180 @@ +// This file was auto-generated by Fern from our API Definition. + +/** The location of the cluster. */ +export const GcpGkeIntegrationLocation = { + Global: "global", + AfricaSouth1: "africa-south1", + AsiaEast1: "asia-east1", + AsiaEast2: "asia-east2", + AsiaNortheast1: "asia-northeast1", + AsiaNortheast2: "asia-northeast2", + AsiaNortheast3: "asia-northeast3", + AsiaSouth1: "asia-south1", + AsiaSouth2: "asia-south2", + AsiaSoutheast1: "asia-southeast1", + AsiaSoutheast2: "asia-southeast2", + AsiaSoutheast3: "asia-southeast3", + AustraliaSoutheast1: "australia-southeast1", + AustraliaSoutheast2: "australia-southeast2", + EuropeCentral2: "europe-central2", + EuropeNorth1: "europe-north1", + EuropeNorth2: "europe-north2", + EuropeSouthwest1: "europe-southwest1", + EuropeWest1: "europe-west1", + EuropeWest2: "europe-west2", + EuropeWest3: "europe-west3", + EuropeWest4: "europe-west4", + EuropeWest6: "europe-west6", + EuropeWest8: "europe-west8", + EuropeWest9: "europe-west9", + EuropeWest10: "europe-west10", + EuropeWest12: "europe-west12", + MeCentral1: "me-central1", + MeCentral2: "me-central2", + MeWest1: "me-west1", + NorthamericaNortheast1: "northamerica-northeast1", + NorthamericaNortheast2: "northamerica-northeast2", + NorthamericaSouth1: "northamerica-south1", + SouthamericaEast1: "southamerica-east1", + SouthamericaWest1: "southamerica-west1", + UsCentral1: "us-central1", + UsEast1: "us-east1", + UsEast4: "us-east4", + UsEast5: "us-east5", + UsSouth1: "us-south1", + UsWest1: "us-west1", + UsWest2: "us-west2", + UsWest3: "us-west3", + UsWest4: "us-west4", + AfricaSouth1A: "africa-south1-a", + AfricaSouth1B: "africa-south1-b", + AfricaSouth1C: "africa-south1-c", + AsiaEast1A: "asia-east1-a", + AsiaEast1B: "asia-east1-b", + AsiaEast1C: "asia-east1-c", + AsiaEast2A: "asia-east2-a", + AsiaEast2B: "asia-east2-b", + AsiaEast2C: "asia-east2-c", + AsiaNortheast1A: "asia-northeast1-a", + AsiaNortheast1B: "asia-northeast1-b", + AsiaNortheast1C: "asia-northeast1-c", + AsiaNortheast2A: "asia-northeast2-a", + AsiaNortheast2B: "asia-northeast2-b", + AsiaNortheast2C: "asia-northeast2-c", + AsiaNortheast3A: "asia-northeast3-a", + AsiaNortheast3B: "asia-northeast3-b", + AsiaNortheast3C: "asia-northeast3-c", + AsiaSouth1A: "asia-south1-a", + AsiaSouth1B: "asia-south1-b", + AsiaSouth1C: "asia-south1-c", + AsiaSouth2A: "asia-south2-a", + AsiaSouth2B: "asia-south2-b", + AsiaSouth2C: "asia-south2-c", + AsiaSoutheast1A: "asia-southeast1-a", + AsiaSoutheast1B: "asia-southeast1-b", + AsiaSoutheast1C: "asia-southeast1-c", + AsiaSoutheast2A: "asia-southeast2-a", + AsiaSoutheast2B: "asia-southeast2-b", + AsiaSoutheast2C: "asia-southeast2-c", + AsiaSoutheast3A: "asia-southeast3-a", + AsiaSoutheast3B: "asia-southeast3-b", + AsiaSoutheast3C: "asia-southeast3-c", + AustraliaSoutheast1A: "australia-southeast1-a", + AustraliaSoutheast1B: "australia-southeast1-b", + AustraliaSoutheast1C: "australia-southeast1-c", + AustraliaSoutheast2A: "australia-southeast2-a", + AustraliaSoutheast2B: "australia-southeast2-b", + AustraliaSoutheast2C: "australia-southeast2-c", + EuropeCentral2A: "europe-central2-a", + EuropeCentral2B: "europe-central2-b", + EuropeCentral2C: "europe-central2-c", + EuropeNorth1A: "europe-north1-a", + EuropeNorth1B: "europe-north1-b", + EuropeNorth1C: "europe-north1-c", + EuropeNorth2A: "europe-north2-a", + EuropeNorth2B: "europe-north2-b", + EuropeNorth2C: "europe-north2-c", + EuropeSouthwest1A: "europe-southwest1-a", + EuropeSouthwest1B: "europe-southwest1-b", + EuropeSouthwest1C: "europe-southwest1-c", + EuropeWest1B: "europe-west1-b", + EuropeWest1C: "europe-west1-c", + EuropeWest1D: "europe-west1-d", + EuropeWest2A: "europe-west2-a", + EuropeWest2B: "europe-west2-b", + EuropeWest2C: "europe-west2-c", + EuropeWest3A: "europe-west3-a", + EuropeWest3B: "europe-west3-b", + EuropeWest3C: "europe-west3-c", + EuropeWest4A: "europe-west4-a", + EuropeWest4B: "europe-west4-b", + EuropeWest4C: "europe-west4-c", + EuropeWest6A: "europe-west6-a", + EuropeWest6B: "europe-west6-b", + EuropeWest6C: "europe-west6-c", + EuropeWest8A: "europe-west8-a", + EuropeWest8B: "europe-west8-b", + EuropeWest8C: "europe-west8-c", + EuropeWest9A: "europe-west9-a", + EuropeWest9B: "europe-west9-b", + EuropeWest9C: "europe-west9-c", + EuropeWest10A: "europe-west10-a", + EuropeWest10B: "europe-west10-b", + EuropeWest10C: "europe-west10-c", + EuropeWest12A: "europe-west12-a", + EuropeWest12B: "europe-west12-b", + EuropeWest12C: "europe-west12-c", + MeCentral1A: "me-central1-a", + MeCentral1B: "me-central1-b", + MeCentral1C: "me-central1-c", + MeCentral2A: "me-central2-a", + MeCentral2B: "me-central2-b", + MeCentral2C: "me-central2-c", + MeWest1A: "me-west1-a", + MeWest1B: "me-west1-b", + MeWest1C: "me-west1-c", + NorthamericaNortheast1A: "northamerica-northeast1-a", + NorthamericaNortheast1B: "northamerica-northeast1-b", + NorthamericaNortheast1C: "northamerica-northeast1-c", + NorthamericaNortheast2A: "northamerica-northeast2-a", + NorthamericaNortheast2B: "northamerica-northeast2-b", + NorthamericaNortheast2C: "northamerica-northeast2-c", + NorthamericaSouth1A: "northamerica-south1-a", + NorthamericaSouth1B: "northamerica-south1-b", + NorthamericaSouth1C: "northamerica-south1-c", + SouthamericaEast1A: "southamerica-east1-a", + SouthamericaEast1B: "southamerica-east1-b", + SouthamericaEast1C: "southamerica-east1-c", + SouthamericaWest1A: "southamerica-west1-a", + SouthamericaWest1B: "southamerica-west1-b", + SouthamericaWest1C: "southamerica-west1-c", + UsCentral1A: "us-central1-a", + UsCentral1B: "us-central1-b", + UsCentral1C: "us-central1-c", + UsCentral1F: "us-central1-f", + UsEast1B: "us-east1-b", + UsEast1C: "us-east1-c", + UsEast1D: "us-east1-d", + UsEast4A: "us-east4-a", + UsEast4B: "us-east4-b", + UsEast4C: "us-east4-c", + UsEast5A: "us-east5-a", + UsEast5B: "us-east5-b", + UsEast5C: "us-east5-c", + UsSouth1A: "us-south1-a", + UsSouth1B: "us-south1-b", + UsSouth1C: "us-south1-c", + UsWest1A: "us-west1-a", + UsWest1B: "us-west1-b", + UsWest1C: "us-west1-c", + UsWest2A: "us-west2-a", + UsWest2B: "us-west2-b", + UsWest2C: "us-west2-c", + UsWest3A: "us-west3-a", + UsWest3B: "us-west3-b", + UsWest3C: "us-west3-c", + UsWest4A: "us-west4-a", + UsWest4B: "us-west4-b", + UsWest4C: "us-west4-c", +} as const; +export type GcpGkeIntegrationLocation = (typeof GcpGkeIntegrationLocation)[keyof typeof GcpGkeIntegrationLocation]; diff --git a/src/api/types/GcpGsm.ts b/src/api/types/GcpGsm.ts index 979a5793..b52f6973 100644 --- a/src/api/types/GcpGsm.ts +++ b/src/api/types/GcpGsm.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * GCP GSM diff --git a/src/api/types/GcpIntegrations.ts b/src/api/types/GcpIntegrations.ts index 76ec3428..61e6ea7e 100644 --- a/src/api/types/GcpIntegrations.ts +++ b/src/api/types/GcpIntegrations.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +discriminator=type */ -export type GcpIntegrations = +export type GcpIntegrations = | TrueFoundry.GcpGcr | TrueFoundry.GcpGcs | TrueFoundry.GcpGsm diff --git a/src/api/types/GcpKeyFileAuth.ts b/src/api/types/GcpKeyFileAuth.ts index 5fe8f3fa..0e700a98 100644 --- a/src/api/types/GcpKeyFileAuth.ts +++ b/src/api/types/GcpKeyFileAuth.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * GCP Key File Auth diff --git a/src/api/types/GcpKeyFileAuthKeyFileContent.ts b/src/api/types/GcpKeyFileAuthKeyFileContent.ts index d1a83186..e293da56 100644 --- a/src/api/types/GcpKeyFileAuthKeyFileContent.ts +++ b/src/api/types/GcpKeyFileAuthKeyFileContent.ts @@ -3,6 +3,4 @@ /** * Key File Content - Key file content must be valid JSON */ -export type GcpKeyFileAuthKeyFileContent = - | string - | Record; +export type GcpKeyFileAuthKeyFileContent = string | Record; diff --git a/src/api/types/GcpProviderAccount.ts b/src/api/types/GcpProviderAccount.ts index faee15c0..30e42402 100644 --- a/src/api/types/GcpProviderAccount.ts +++ b/src/api/types/GcpProviderAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * GCP diff --git a/src/api/types/GcpRegion.ts b/src/api/types/GcpRegion.ts index 97df4d60..f351514f 100644 --- a/src/api/types/GcpRegion.ts +++ b/src/api/types/GcpRegion.ts @@ -1,42 +1,49 @@ // This file was auto-generated by Fern from our API Definition. export const GcpRegion = { - Global: "global", - NorthamericaNortheast1: "northamerica-northeast1", - NorthamericaNortheast2: "northamerica-northeast2", - SouthamericaEast1: "southamerica-east1", - UsCentral1: "us-central1", - UsEast1: "us-east1", - UsEast4: "us-east4", - UsEast5: "us-east5", - UsSouth1: "us-south1", - UsWest1: "us-west1", - UsWest2: "us-west2", - UsWest3: "us-west3", - UsWest4: "us-west4", - AsiaEast1: "asia-east1", - AsiaEast2: "asia-east2", - AsiaNortheast1: "asia-northeast1", - AsiaNortheast2: "asia-northeast2", - AsiaNortheast3: "asia-northeast3", - AsiaSouth1: "asia-south1", - AsiaSouth2: "asia-south2", - AsiaSoutheast1: "asia-southeast1", - AsiaSoutheast2: "asia-southeast2", - AustraliaSoutheast1: "australia-southeast1", - AustraliaSoutheast2: "australia-southeast2", - EuropeCentral2: "europe-central2", - EuropeNorth1: "europe-north1", - EuropeSouthwest1: "europe-southwest1", - EuropeWest1: "europe-west1", - EuropeWest2: "europe-west2", - EuropeWest3: "europe-west3", - EuropeWest4: "europe-west4", - EuropeWest6: "europe-west6", - EuropeWest8: "europe-west8", - EuropeWest9: "europe-west9", - MeCentral1: "me-central1", - MeCentral2: "me-central2", - MeWest1: "me-west1" - } as const; -export type GcpRegion = typeof GcpRegion[keyof typeof GcpRegion]; + Global: "global", + AfricaSouth1: "africa-south1", + AsiaEast1: "asia-east1", + AsiaEast2: "asia-east2", + AsiaNortheast1: "asia-northeast1", + AsiaNortheast2: "asia-northeast2", + AsiaNortheast3: "asia-northeast3", + AsiaSouth1: "asia-south1", + AsiaSouth2: "asia-south2", + AsiaSoutheast1: "asia-southeast1", + AsiaSoutheast2: "asia-southeast2", + AsiaSoutheast3: "asia-southeast3", + AustraliaSoutheast1: "australia-southeast1", + AustraliaSoutheast2: "australia-southeast2", + EuropeCentral2: "europe-central2", + EuropeNorth1: "europe-north1", + EuropeNorth2: "europe-north2", + EuropeSouthwest1: "europe-southwest1", + EuropeWest1: "europe-west1", + EuropeWest2: "europe-west2", + EuropeWest3: "europe-west3", + EuropeWest4: "europe-west4", + EuropeWest6: "europe-west6", + EuropeWest8: "europe-west8", + EuropeWest9: "europe-west9", + EuropeWest10: "europe-west10", + EuropeWest12: "europe-west12", + MeCentral1: "me-central1", + MeCentral2: "me-central2", + MeWest1: "me-west1", + NorthamericaNortheast1: "northamerica-northeast1", + NorthamericaNortheast2: "northamerica-northeast2", + NorthamericaSouth1: "northamerica-south1", + SouthamericaEast1: "southamerica-east1", + SouthamericaWest1: "southamerica-west1", + UsCentral1: "us-central1", + UsEast1: "us-east1", + UsEast4: "us-east4", + UsEast5: "us-east5", + UsSouth1: "us-south1", + UsWest1: "us-west1", + UsWest2: "us-west2", + UsWest3: "us-west3", + UsWest4: "us-west4", +} as const; +export type GcpRegion = (typeof GcpRegion)[keyof typeof GcpRegion]; diff --git a/src/api/types/GeminiModel.ts b/src/api/types/GeminiModel.ts index 2806557b..fb52ad3d 100644 --- a/src/api/types/GeminiModel.ts +++ b/src/api/types/GeminiModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Gemini Model diff --git a/src/api/types/GenericSecretStoreIntegration.ts b/src/api/types/GenericSecretStoreIntegration.ts index 60d39305..faa1cc57 100644 --- a/src/api/types/GenericSecretStoreIntegration.ts +++ b/src/api/types/GenericSecretStoreIntegration.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Generic Secret Store diff --git a/src/api/types/GetAgentIdentityTokenResponse.ts b/src/api/types/GetAgentIdentityTokenResponse.ts new file mode 100644 index 00000000..b18f7438 --- /dev/null +++ b/src/api/types/GetAgentIdentityTokenResponse.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface GetAgentIdentityTokenResponse { + /** The TrueFoundry-backed agent identity token. */ + token: string; +} diff --git a/src/api/types/GetAgentResponse.ts b/src/api/types/GetAgentResponse.ts index b486b667..a31eb0f2 100644 --- a/src/api/types/GetAgentResponse.ts +++ b/src/api/types/GetAgentResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetAgentResponse { /** Agent */ diff --git a/src/api/types/GetAgentSkillResponse.ts b/src/api/types/GetAgentSkillResponse.ts index e3100d86..71e03992 100644 --- a/src/api/types/GetAgentSkillResponse.ts +++ b/src/api/types/GetAgentSkillResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetAgentSkillResponse { /** The agent skill matching the query. */ diff --git a/src/api/types/GetAgentSkillVersionResponse.ts b/src/api/types/GetAgentSkillVersionResponse.ts index 925935f2..e493b8b5 100644 --- a/src/api/types/GetAgentSkillVersionResponse.ts +++ b/src/api/types/GetAgentSkillVersionResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetAgentSkillVersionResponse { /** The agent skill version matching the query. */ diff --git a/src/api/types/GetAgentVersionResponse.ts b/src/api/types/GetAgentVersionResponse.ts index 2897ca5d..06cc1f71 100644 --- a/src/api/types/GetAgentVersionResponse.ts +++ b/src/api/types/GetAgentVersionResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetAgentVersionResponse { /** Agent Version */ diff --git a/src/api/types/GetAlertsResponse.ts b/src/api/types/GetAlertsResponse.ts index aa4f1333..b6629651 100644 --- a/src/api/types/GetAlertsResponse.ts +++ b/src/api/types/GetAlertsResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetAlertsResponse { /** Alerts grouped by alert name. */ diff --git a/src/api/types/GetApplicationDeploymentResponse.ts b/src/api/types/GetApplicationDeploymentResponse.ts index 7baf871b..005e2a08 100644 --- a/src/api/types/GetApplicationDeploymentResponse.ts +++ b/src/api/types/GetApplicationDeploymentResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetApplicationDeploymentResponse { /** Deployment details */ diff --git a/src/api/types/GetApplicationResponse.ts b/src/api/types/GetApplicationResponse.ts index 20686497..bcefafd4 100644 --- a/src/api/types/GetApplicationResponse.ts +++ b/src/api/types/GetApplicationResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetApplicationResponse { /** Application details */ diff --git a/src/api/types/GetArtifactResponse.ts b/src/api/types/GetArtifactResponse.ts index e7dac270..8abd8130 100644 --- a/src/api/types/GetArtifactResponse.ts +++ b/src/api/types/GetArtifactResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetArtifactResponse { /** The requested artifact. */ diff --git a/src/api/types/GetArtifactVersionResponse.ts b/src/api/types/GetArtifactVersionResponse.ts index b047da7a..ebb55017 100644 --- a/src/api/types/GetArtifactVersionResponse.ts +++ b/src/api/types/GetArtifactVersionResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetArtifactVersionResponse { /** The requested artifact version. */ diff --git a/src/api/types/GetAutoProvisioningStateResponse.ts b/src/api/types/GetAutoProvisioningStateResponse.ts index 71501c79..f482bd6a 100644 --- a/src/api/types/GetAutoProvisioningStateResponse.ts +++ b/src/api/types/GetAutoProvisioningStateResponse.ts @@ -2,5 +2,5 @@ export interface GetAutoProvisioningStateResponse { /** State of auto-provisioning for the cluster. */ - state?: Record; + state?: Record | null; } diff --git a/src/api/types/GetChartsResponse.ts b/src/api/types/GetChartsResponse.ts index 93f3f21e..4bd983ab 100644 --- a/src/api/types/GetChartsResponse.ts +++ b/src/api/types/GetChartsResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetChartsResponse { /** Prometheus duration string for the query step size applied to the returned charts. */ diff --git a/src/api/types/GetClusterResponse.ts b/src/api/types/GetClusterResponse.ts index daf667bc..8b7e6f3f 100644 --- a/src/api/types/GetClusterResponse.ts +++ b/src/api/types/GetClusterResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetClusterResponse { /** The cluster object. */ diff --git a/src/api/types/GetDataDirectoryResponse.ts b/src/api/types/GetDataDirectoryResponse.ts index ed45d1d0..6e249581 100644 --- a/src/api/types/GetDataDirectoryResponse.ts +++ b/src/api/types/GetDataDirectoryResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetDataDirectoryResponse { /** The data directory matching the query. */ diff --git a/src/api/types/GetEnvironmentResponse.ts b/src/api/types/GetEnvironmentResponse.ts index 056ffbc2..8ce6fbb6 100644 --- a/src/api/types/GetEnvironmentResponse.ts +++ b/src/api/types/GetEnvironmentResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetEnvironmentResponse { /** The environment object. */ diff --git a/src/api/types/GetEventsResponse.ts b/src/api/types/GetEventsResponse.ts index 38c3cba2..f9b68d5e 100644 --- a/src/api/types/GetEventsResponse.ts +++ b/src/api/types/GetEventsResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetEventsResponse { data: TrueFoundry.Event[]; diff --git a/src/api/types/GetJobRunResponse.ts b/src/api/types/GetJobRunResponse.ts index ba850e96..e20a59df 100644 --- a/src/api/types/GetJobRunResponse.ts +++ b/src/api/types/GetJobRunResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetJobRunResponse { /** JobRun */ diff --git a/src/api/types/GetLogsResponse.ts b/src/api/types/GetLogsResponse.ts index 8f72d175..3f1f642f 100644 --- a/src/api/types/GetLogsResponse.ts +++ b/src/api/types/GetLogsResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetLogsResponse { /** List of logs */ diff --git a/src/api/types/GetMetricHistoryResponse.ts b/src/api/types/GetMetricHistoryResponse.ts index 8f97a2f7..b9a13168 100644 --- a/src/api/types/GetMetricHistoryResponse.ts +++ b/src/api/types/GetMetricHistoryResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetMetricHistoryResponse { /** Time-series history for the requested metric. */ diff --git a/src/api/types/GetMlRepoResponse.ts b/src/api/types/GetMlRepoResponse.ts index 572304c9..b551d5d8 100644 --- a/src/api/types/GetMlRepoResponse.ts +++ b/src/api/types/GetMlRepoResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetMlRepoResponse { /** ML Repo */ diff --git a/src/api/types/GetModelResponse.ts b/src/api/types/GetModelResponse.ts index 332c0b33..7aea2e83 100644 --- a/src/api/types/GetModelResponse.ts +++ b/src/api/types/GetModelResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetModelResponse { /** The requested model. */ diff --git a/src/api/types/GetModelVersionResponse.ts b/src/api/types/GetModelVersionResponse.ts index d371904f..094eaa89 100644 --- a/src/api/types/GetModelVersionResponse.ts +++ b/src/api/types/GetModelVersionResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetModelVersionResponse { /** The requested model version. */ diff --git a/src/api/types/GetOrCreatePersonalAccessTokenResponse.ts b/src/api/types/GetOrCreatePersonalAccessTokenResponse.ts index b95be68e..f77eca21 100644 --- a/src/api/types/GetOrCreatePersonalAccessTokenResponse.ts +++ b/src/api/types/GetOrCreatePersonalAccessTokenResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetOrCreatePersonalAccessTokenResponse { /** The personal access token data. */ diff --git a/src/api/types/GetPromptResponse.ts b/src/api/types/GetPromptResponse.ts index 8893655a..8f0e4fdd 100644 --- a/src/api/types/GetPromptResponse.ts +++ b/src/api/types/GetPromptResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetPromptResponse { /** The requested prompt. */ diff --git a/src/api/types/GetPromptVersionResponse.ts b/src/api/types/GetPromptVersionResponse.ts index f0624ba6..a34f3b0a 100644 --- a/src/api/types/GetPromptVersionResponse.ts +++ b/src/api/types/GetPromptVersionResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetPromptVersionResponse { /** The requested prompt version. */ diff --git a/src/api/types/GetRunResponse.ts b/src/api/types/GetRunResponse.ts index a8703738..e144db5e 100644 --- a/src/api/types/GetRunResponse.ts +++ b/src/api/types/GetRunResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetRunResponse { /** The requested run. */ diff --git a/src/api/types/GetSecretGroupResponse.ts b/src/api/types/GetSecretGroupResponse.ts index e45bf5b7..f26c8534 100644 --- a/src/api/types/GetSecretGroupResponse.ts +++ b/src/api/types/GetSecretGroupResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetSecretGroupResponse { /** Secret Group */ diff --git a/src/api/types/GetSecretResponse.ts b/src/api/types/GetSecretResponse.ts index 741267d1..97123d0f 100644 --- a/src/api/types/GetSecretResponse.ts +++ b/src/api/types/GetSecretResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetSecretResponse { /** Secret */ diff --git a/src/api/types/GetSignedUrLsRequest.ts b/src/api/types/GetSignedUrLsRequest.ts index 247f1cde..8939e352 100644 --- a/src/api/types/GetSignedUrLsRequest.ts +++ b/src/api/types/GetSignedUrLsRequest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetSignedUrLsRequest { /** Identifier of the artifact version to generate signed URLs for. */ diff --git a/src/api/types/GetSignedUrLsResponse.ts b/src/api/types/GetSignedUrLsResponse.ts index bd786324..00a7bd11 100644 --- a/src/api/types/GetSignedUrLsResponse.ts +++ b/src/api/types/GetSignedUrLsResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetSignedUrLsResponse { /** List of generated signed URLs. */ diff --git a/src/api/types/GetSuggestedDeploymentEndpointResponse.ts b/src/api/types/GetSuggestedDeploymentEndpointResponse.ts index 60e669f7..b2a24781 100644 --- a/src/api/types/GetSuggestedDeploymentEndpointResponse.ts +++ b/src/api/types/GetSuggestedDeploymentEndpointResponse.ts @@ -1,12 +1,12 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetSuggestedDeploymentEndpointResponse { /** Host name */ host: string; /** Path */ - path?: string; + path?: string | null; /** Gateway configuration */ - gateway?: TrueFoundry.ClusterGateway; + gateway?: TrueFoundry.ClusterGateway | null; } diff --git a/src/api/types/GetTeamPermissionsResponse.ts b/src/api/types/GetTeamPermissionsResponse.ts index be849878..b19394ad 100644 --- a/src/api/types/GetTeamPermissionsResponse.ts +++ b/src/api/types/GetTeamPermissionsResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetTeamPermissionsResponse { /** Role bindings associated with the team. */ diff --git a/src/api/types/GetTeamResponse.ts b/src/api/types/GetTeamResponse.ts index e9c32ba5..cb1dae7b 100644 --- a/src/api/types/GetTeamResponse.ts +++ b/src/api/types/GetTeamResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetTeamResponse { /** The requested team. */ diff --git a/src/api/types/GetUserPermissionsResponse.ts b/src/api/types/GetUserPermissionsResponse.ts index 3695e65d..cb2f9a7c 100644 --- a/src/api/types/GetUserPermissionsResponse.ts +++ b/src/api/types/GetUserPermissionsResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetUserPermissionsResponse { /** Role bindings for the user (including team-inherited) */ diff --git a/src/api/types/GetUserResourcesResponse.ts b/src/api/types/GetUserResourcesResponse.ts index 73ca08bb..286a9279 100644 --- a/src/api/types/GetUserResourcesResponse.ts +++ b/src/api/types/GetUserResourcesResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetUserResourcesResponse { /** Resources where user is a collaborator */ diff --git a/src/api/types/GetUserResponse.ts b/src/api/types/GetUserResponse.ts index 4af674e7..afc830a5 100644 --- a/src/api/types/GetUserResponse.ts +++ b/src/api/types/GetUserResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetUserResponse { /** The requested user. */ diff --git a/src/api/types/GetUserTeamsResponse.ts b/src/api/types/GetUserTeamsResponse.ts index ff215726..de41eef7 100644 --- a/src/api/types/GetUserTeamsResponse.ts +++ b/src/api/types/GetUserTeamsResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetUserTeamsResponse { /** Teams where user is a member, with their role */ diff --git a/src/api/types/GetVirtualAccountResponse.ts b/src/api/types/GetVirtualAccountResponse.ts index 918a55eb..34e1e9e1 100644 --- a/src/api/types/GetVirtualAccountResponse.ts +++ b/src/api/types/GetVirtualAccountResponse.ts @@ -1,10 +1,10 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetVirtualAccountResponse { /** The requested virtual account. */ data: TrueFoundry.VirtualAccount; /** Authentication token for the virtual account. Present only on creation. */ - token?: string; + token?: string | null; } diff --git a/src/api/types/GetWorkspaceResponse.ts b/src/api/types/GetWorkspaceResponse.ts index fd063af1..c6a8439c 100644 --- a/src/api/types/GetWorkspaceResponse.ts +++ b/src/api/types/GetWorkspaceResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GetWorkspaceResponse { /** The workspace object. */ diff --git a/src/api/types/GitRepositoryExistsResponse.ts b/src/api/types/GitRepositoryExistsResponse.ts index ee241e9c..55ccdcd2 100644 --- a/src/api/types/GitRepositoryExistsResponse.ts +++ b/src/api/types/GitRepositoryExistsResponse.ts @@ -4,5 +4,5 @@ export interface GitRepositoryExistsResponse { /** The flag if repository exists or not */ exists: boolean; /** The integration id of the repository */ - id?: string; + id?: string | null; } diff --git a/src/api/types/GithubIntegration.ts b/src/api/types/GithubIntegration.ts index bde95420..13847085 100644 --- a/src/api/types/GithubIntegration.ts +++ b/src/api/types/GithubIntegration.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Github diff --git a/src/api/types/GithubIntegrationAuthData.ts b/src/api/types/GithubIntegrationAuthData.ts index 9cd094ff..a974e577 100644 --- a/src/api/types/GithubIntegrationAuthData.ts +++ b/src/api/types/GithubIntegrationAuthData.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Auth */ -export type GithubIntegrationAuthData = - | TrueFoundry.VcsoAuthAuthData - | TrueFoundry.VcsTokenAuthData; +export type GithubIntegrationAuthData = TrueFoundry.VcsoAuthAuthData | TrueFoundry.VcsTokenAuthData; diff --git a/src/api/types/GithubProviderAccount.ts b/src/api/types/GithubProviderAccount.ts index 6957b871..986d3eb5 100644 --- a/src/api/types/GithubProviderAccount.ts +++ b/src/api/types/GithubProviderAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Github diff --git a/src/api/types/GitlabIntegration.ts b/src/api/types/GitlabIntegration.ts index 98468bbd..44555adb 100644 --- a/src/api/types/GitlabIntegration.ts +++ b/src/api/types/GitlabIntegration.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Gitlab diff --git a/src/api/types/GitlabIntegrationAuthData.ts b/src/api/types/GitlabIntegrationAuthData.ts index 74948b10..5b4ad961 100644 --- a/src/api/types/GitlabIntegrationAuthData.ts +++ b/src/api/types/GitlabIntegrationAuthData.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Auth */ -export type GitlabIntegrationAuthData = - | TrueFoundry.VcsoAuthAuthData - | TrueFoundry.VcsTokenAuthData; +export type GitlabIntegrationAuthData = TrueFoundry.VcsoAuthAuthData | TrueFoundry.VcsTokenAuthData; diff --git a/src/api/types/GitlabProviderAccount.ts b/src/api/types/GitlabProviderAccount.ts index 9c805983..71f540d7 100644 --- a/src/api/types/GitlabProviderAccount.ts +++ b/src/api/types/GitlabProviderAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Gitlab diff --git a/src/api/types/GlobalSettings.ts b/src/api/types/GlobalSettings.ts index 516b0c06..85ab92fb 100644 --- a/src/api/types/GlobalSettings.ts +++ b/src/api/types/GlobalSettings.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Configure global gateway settings that apply to all requests processed by the gateway. These settings establish default behaviors for retry logic, guardrail enforcement, and request logging that can be overridden by route-specific configurations or request headers. Use these settings to define baseline policies for reliability, security, and observability across your entire gateway deployment. diff --git a/src/api/types/GoogleGeminiProviderAccount.ts b/src/api/types/GoogleGeminiProviderAccount.ts index 10b57cd4..c6965ccc 100644 --- a/src/api/types/GoogleGeminiProviderAccount.ts +++ b/src/api/types/GoogleGeminiProviderAccount.ts @@ -1,21 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** - * Google Gemini Provider Account + * Google Gemini Model Account */ export interface GoogleGeminiProviderAccount { /** +value=provider-account/google-gemini */ type: "provider-account/google-gemini"; - /** The name of the Google Gemini provider account */ + /** The name of the Google Gemini model account */ name: string; authData: TrueFoundry.GcpApiKeyAuth; - /** List of integrations that are associated with the Google Gemini provider account */ + /** List of integrations that are associated with the Google Gemini model account */ integrations: TrueFoundry.GeminiModel[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/GoogleModelArmorGuardrailConfig.ts b/src/api/types/GoogleModelArmorGuardrailConfig.ts index 5d526680..b7f6393e 100644 --- a/src/api/types/GoogleModelArmorGuardrailConfig.ts +++ b/src/api/types/GoogleModelArmorGuardrailConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Google Model Armor diff --git a/src/api/types/GoogleModelArmorGuardrailConfigAuthData.ts b/src/api/types/GoogleModelArmorGuardrailConfigAuthData.ts index acfdbcad..9ccc4e60 100644 --- a/src/api/types/GoogleModelArmorGuardrailConfigAuthData.ts +++ b/src/api/types/GoogleModelArmorGuardrailConfigAuthData.ts @@ -1,10 +1,10 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Authentication credentials for Google Cloud Model Armor */ -export type GoogleModelArmorGuardrailConfigAuthData = +export type GoogleModelArmorGuardrailConfigAuthData = | TrueFoundry.GoogleModelArmorApiKeyAuth | TrueFoundry.GoogleModelArmorKeyFileAuth; diff --git a/src/api/types/GoogleModelArmorGuardrailConfigConfig.ts b/src/api/types/GoogleModelArmorGuardrailConfigConfig.ts index 832f3aca..00befdee 100644 --- a/src/api/types/GoogleModelArmorGuardrailConfigConfig.ts +++ b/src/api/types/GoogleModelArmorGuardrailConfigConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +uiType=Ignore diff --git a/src/api/types/GoogleModelArmorGuardrailConfigOperation.ts b/src/api/types/GoogleModelArmorGuardrailConfigOperation.ts index 2071bbdf..bb97edb9 100644 --- a/src/api/types/GoogleModelArmorGuardrailConfigOperation.ts +++ b/src/api/types/GoogleModelArmorGuardrailConfigOperation.ts @@ -2,7 +2,8 @@ /** The operation type to use for the Guardrail. Validate guardrails are used to validate requests and mutate can validate as well as mutate requests. */ export const GoogleModelArmorGuardrailConfigOperation = { - Validate: "validate", - Mutate: "mutate" - } as const; -export type GoogleModelArmorGuardrailConfigOperation = typeof GoogleModelArmorGuardrailConfigOperation[keyof typeof GoogleModelArmorGuardrailConfigOperation]; + Validate: "validate", + Mutate: "mutate", +} as const; +export type GoogleModelArmorGuardrailConfigOperation = + (typeof GoogleModelArmorGuardrailConfigOperation)[keyof typeof GoogleModelArmorGuardrailConfigOperation]; diff --git a/src/api/types/GoogleModelArmorKeyFileAuth.ts b/src/api/types/GoogleModelArmorKeyFileAuth.ts index bc322129..8c48c0c9 100644 --- a/src/api/types/GoogleModelArmorKeyFileAuth.ts +++ b/src/api/types/GoogleModelArmorKeyFileAuth.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Authentication method using a Google Cloud service account key file diff --git a/src/api/types/GoogleModelArmorKeyFileAuthKeyFileContent.ts b/src/api/types/GoogleModelArmorKeyFileAuthKeyFileContent.ts index 16120065..5c36b626 100644 --- a/src/api/types/GoogleModelArmorKeyFileAuthKeyFileContent.ts +++ b/src/api/types/GoogleModelArmorKeyFileAuthKeyFileContent.ts @@ -3,6 +3,4 @@ /** * The JSON content of your Google Cloud service account key file with Model Armor permissions */ -export type GoogleModelArmorKeyFileAuthKeyFileContent = - | string - | Record; +export type GoogleModelArmorKeyFileAuthKeyFileContent = string | Record; diff --git a/src/api/types/GoogleVertexProviderAccount.ts b/src/api/types/GoogleVertexProviderAccount.ts index 387ea4ad..3f4ad33d 100644 --- a/src/api/types/GoogleVertexProviderAccount.ts +++ b/src/api/types/GoogleVertexProviderAccount.ts @@ -1,25 +1,27 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** - * Google Vertex Provider Account + * Google Vertex Model Account */ export interface GoogleVertexProviderAccount { /** +value=provider-account/google-vertex */ type: "provider-account/google-vertex"; - /** The name of the Google Vertex provider account */ + /** The name of the Google Vertex model account */ name: string; /** The Google Cloud project ID where Vertex AI is enabled */ projectId: string; region: TrueFoundry.VertexRegion; /** Service account key JSON, or Workload Identity Federation file (workload-identity-federation-file) with external_account JSON (e.g. create-cred-config). https://docs.truefoundry.com/gateway/google-vertex */ authData?: TrueFoundry.GoogleVertexProviderAccountAuthData; - /** List of integrations that are associated with the Google Vertex provider account */ + /** Optional custom base URL for the Vertex AI inference endpoint (e.g. a Private Service Connect / PSC endpoint for private connectivity). When set, chat/generate requests are routed here instead of the region-derived public host (-aiplatform.googleapis.com). Leave empty to use the public Vertex AI API. */ + baseUrl?: string; + /** List of integrations that are associated with the Google Vertex model account */ integrations: TrueFoundry.VertexModel[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/GoogleVertexProviderAccountAuthData.ts b/src/api/types/GoogleVertexProviderAccountAuthData.ts index 8123b61b..01286e17 100644 --- a/src/api/types/GoogleVertexProviderAccountAuthData.ts +++ b/src/api/types/GoogleVertexProviderAccountAuthData.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Service account key JSON, or Workload Identity Federation file (workload-identity-federation-file) with external_account JSON (e.g. create-cred-config). https://docs.truefoundry.com/gateway/google-vertex */ -export type GoogleVertexProviderAccountAuthData = - | TrueFoundry.VertexKeyFileAuth - | TrueFoundry.VertexWifFileAuth; +export type GoogleVertexProviderAccountAuthData = TrueFoundry.VertexKeyFileAuth | TrueFoundry.VertexWifFileAuth; diff --git a/src/api/types/Graph.ts b/src/api/types/Graph.ts index 4392bb31..6e681266 100644 --- a/src/api/types/Graph.ts +++ b/src/api/types/Graph.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface Graph { /** Chart display name. */ diff --git a/src/api/types/GraphChartType.ts b/src/api/types/GraphChartType.ts index 819c9721..1724bbea 100644 --- a/src/api/types/GraphChartType.ts +++ b/src/api/types/GraphChartType.ts @@ -2,14 +2,14 @@ /** Chart visualisation type. */ export const GraphChartType = { - Line: "line", - VerticalLine: "vertical_line", - StackedBar: "stacked_bar", - StackedArea: "stacked_area", - Bubble: "bubble", - HorizontalBar: "horizontal_bar", - HorizontalStackedBar: "horizontal_stacked_bar", - HorizontalBoxPlot: "horizontal_box_plot", - BarList: "bar_list" - } as const; -export type GraphChartType = typeof GraphChartType[keyof typeof GraphChartType]; + Line: "line", + VerticalLine: "vertical_line", + StackedBar: "stacked_bar", + StackedArea: "stacked_area", + Bubble: "bubble", + HorizontalBar: "horizontal_bar", + HorizontalStackedBar: "horizontal_stacked_bar", + HorizontalBoxPlot: "horizontal_box_plot", + BarList: "bar_list", +} as const; +export type GraphChartType = (typeof GraphChartType)[keyof typeof GraphChartType]; diff --git a/src/api/types/GraySwanCygnalGuardrailConfig.ts b/src/api/types/GraySwanCygnalGuardrailConfig.ts index 62505708..d9b48af1 100644 --- a/src/api/types/GraySwanCygnalGuardrailConfig.ts +++ b/src/api/types/GraySwanCygnalGuardrailConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * GraySwan Cygnal diff --git a/src/api/types/GraySwanCygnalGuardrailConfigConfig.ts b/src/api/types/GraySwanCygnalGuardrailConfigConfig.ts index a53209dc..ae5f6ed4 100644 --- a/src/api/types/GraySwanCygnalGuardrailConfigConfig.ts +++ b/src/api/types/GraySwanCygnalGuardrailConfigConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +uiType=Ignore diff --git a/src/api/types/GraySwanCygnalGuardrailConfigConfigReasoningMode.ts b/src/api/types/GraySwanCygnalGuardrailConfigConfigReasoningMode.ts index d93a0036..7eff182d 100644 --- a/src/api/types/GraySwanCygnalGuardrailConfigConfigReasoningMode.ts +++ b/src/api/types/GraySwanCygnalGuardrailConfigConfigReasoningMode.ts @@ -2,8 +2,9 @@ /** Controls whether Cygnal uses internal reasoning steps before determining if content violates policy. "off" is fastest, "hybrid" adds moderate reasoning, "thinking" performs guided reasoning for highest quality. */ export const GraySwanCygnalGuardrailConfigConfigReasoningMode = { - Off: "off", - Hybrid: "hybrid", - Thinking: "thinking" - } as const; -export type GraySwanCygnalGuardrailConfigConfigReasoningMode = typeof GraySwanCygnalGuardrailConfigConfigReasoningMode[keyof typeof GraySwanCygnalGuardrailConfigConfigReasoningMode]; + Off: "off", + Hybrid: "hybrid", + Thinking: "thinking", +} as const; +export type GraySwanCygnalGuardrailConfigConfigReasoningMode = + (typeof GraySwanCygnalGuardrailConfigConfigReasoningMode)[keyof typeof GraySwanCygnalGuardrailConfigConfigReasoningMode]; diff --git a/src/api/types/GroqIntegrations.ts b/src/api/types/GroqIntegrations.ts index e3a699be..bb1a67f0 100644 --- a/src/api/types/GroqIntegrations.ts +++ b/src/api/types/GroqIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type GroqIntegrations = TrueFoundry.GroqModel; diff --git a/src/api/types/GroqModel.ts b/src/api/types/GroqModel.ts index 3f0cea83..fd2f4a72 100644 --- a/src/api/types/GroqModel.ts +++ b/src/api/types/GroqModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Groq Model diff --git a/src/api/types/GroqProviderAccount.ts b/src/api/types/GroqProviderAccount.ts index 539ba6ca..9469a654 100644 --- a/src/api/types/GroqProviderAccount.ts +++ b/src/api/types/GroqProviderAccount.ts @@ -1,21 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** - * Groq Provider Account + * Groq Model Account */ export interface GroqProviderAccount { /** +value=provider-account/groq */ type: "provider-account/groq"; - /** The name of the Groq provider account */ + /** The name of the Groq model account */ name: string; authData: TrueFoundry.GroqKeyAuth; - /** List of integrations that are associated with the Groq provider account */ + /** List of integrations that are associated with the Groq model account */ integrations: TrueFoundry.GroqIntegrations[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/GuardrailConfigGroup.ts b/src/api/types/GuardrailConfigGroup.ts index 0dd3072b..b32a14d5 100644 --- a/src/api/types/GuardrailConfigGroup.ts +++ b/src/api/types/GuardrailConfigGroup.ts @@ -1,9 +1,9 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** - * Guardrail Configs Group + * Guardrail Group */ export interface GuardrailConfigGroup { /** diff --git a/src/api/types/GuardrailConfigIntegrations.ts b/src/api/types/GuardrailConfigIntegrations.ts index 70fd1d64..9e574e5c 100644 --- a/src/api/types/GuardrailConfigIntegrations.ts +++ b/src/api/types/GuardrailConfigIntegrations.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +discriminator=type */ -export type GuardrailConfigIntegrations = +export type GuardrailConfigIntegrations = | TrueFoundry.OpenAiModerationsGuardrailConfig | TrueFoundry.AwsBedrockGuardrailConfig | TrueFoundry.CustomGuardrailConfig @@ -15,6 +15,7 @@ export type GuardrailConfigIntegrations = | TrueFoundry.EnkryptAiGuardrailConfig | TrueFoundry.PaloAltoPrismaAirsGuardrailConfig | TrueFoundry.FiddlerGuardrailConfig + | TrueFoundry.CiscoAiDefenseGuardrailConfig | TrueFoundry.CrowdStrikeAidrGuardrailConfig | TrueFoundry.PatronusGuardrailConfig | TrueFoundry.SecretDetectionGuardrailConfig @@ -29,5 +30,7 @@ export type GuardrailConfigIntegrations = | TrueFoundry.OpaGuardrailConfig | TrueFoundry.GoogleModelArmorGuardrailConfig | TrueFoundry.GraySwanCygnalGuardrailConfig + | TrueFoundry.NomaSecurityGuardrailConfig + | TrueFoundry.CalypsoAiGuardrailConfig | TrueFoundry.AktoGuardrailConfig | TrueFoundry.TrojAiGuardrailConfig; diff --git a/src/api/types/GuardrailsConfig.ts b/src/api/types/GuardrailsConfig.ts index e404daba..ce0f387d 100644 --- a/src/api/types/GuardrailsConfig.ts +++ b/src/api/types/GuardrailsConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Guardrails Configuration diff --git a/src/api/types/GuardrailsRule.ts b/src/api/types/GuardrailsRule.ts index efc05512..47008068 100644 --- a/src/api/types/GuardrailsRule.ts +++ b/src/api/types/GuardrailsRule.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Guardrails Rule @@ -17,6 +17,6 @@ export interface GuardrailsRule { mcpToolPreInvokeGuardrails: string[]; /** Guardrail selectors of the guardrails to apply to the MCP tool post invoke (format: groupName/guardrailName) */ mcpToolPostInvokeGuardrails: string[]; - /** Optional message returned to the client when a guardrail in this rule blocks a request. Use {{guardrail_message}} to include the default guardrail failure message. */ + /** Optional message returned to the client when a guardrail in this rule blocks a request. Supported placeholders: {{guardrail_message}} (default guardrail failure detail), {{failed_guardrails}} (comma-separated list of the guardrails that failed). */ customErrorMessage?: string; } diff --git a/src/api/types/GuardrailsWhen.ts b/src/api/types/GuardrailsWhen.ts index 32262028..d4a2f0fc 100644 --- a/src/api/types/GuardrailsWhen.ts +++ b/src/api/types/GuardrailsWhen.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface GuardrailsWhen { target?: TrueFoundry.TargetConditionGroup; diff --git a/src/api/types/HashicorpAppRoleAuth.ts b/src/api/types/HashicorpAppRoleAuth.ts index c97019e2..9aa458a8 100644 --- a/src/api/types/HashicorpAppRoleAuth.ts +++ b/src/api/types/HashicorpAppRoleAuth.ts @@ -10,4 +10,6 @@ export interface HashicorpAppRoleAuth { roleId: string; /** AppRole secret ID for Vault authentication. */ secretId: string; + /** Optional app role path which is used to authenticate the app role. */ + rolePath?: string; } diff --git a/src/api/types/HashicorpIntegrations.ts b/src/api/types/HashicorpIntegrations.ts index 21cd07be..6274c4fe 100644 --- a/src/api/types/HashicorpIntegrations.ts +++ b/src/api/types/HashicorpIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type HashicorpIntegrations = TrueFoundry.HashicorpVaultIntegration; diff --git a/src/api/types/HashicorpProviderAccount.ts b/src/api/types/HashicorpProviderAccount.ts index 70153832..a464db62 100644 --- a/src/api/types/HashicorpProviderAccount.ts +++ b/src/api/types/HashicorpProviderAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * HashiCorp Vault diff --git a/src/api/types/HashicorpVaultIntegration.ts b/src/api/types/HashicorpVaultIntegration.ts index e67ce8bf..b852e4c7 100644 --- a/src/api/types/HashicorpVaultIntegration.ts +++ b/src/api/types/HashicorpVaultIntegration.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * HashiCorp Vault Integration diff --git a/src/api/types/HashicorpVaultIntegrationAuthData.ts b/src/api/types/HashicorpVaultIntegrationAuthData.ts index f379a00a..6b4c88c2 100644 --- a/src/api/types/HashicorpVaultIntegrationAuthData.ts +++ b/src/api/types/HashicorpVaultIntegrationAuthData.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Authentication data for the Vault integration. */ -export type HashicorpVaultIntegrationAuthData = - | TrueFoundry.HashicorpTokenAuth - | TrueFoundry.HashicorpAppRoleAuth; +export type HashicorpVaultIntegrationAuthData = TrueFoundry.HashicorpTokenAuth | TrueFoundry.HashicorpAppRoleAuth; diff --git a/src/api/types/HeaderRoutingConfig.ts b/src/api/types/HeaderRoutingConfig.ts index 590dcd51..3dd02507 100644 --- a/src/api/types/HeaderRoutingConfig.ts +++ b/src/api/types/HeaderRoutingConfig.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * this union is mainly for gateway to parse the load balancing config from request header * +discriminator=type */ -export type HeaderRoutingConfig = +export type HeaderRoutingConfig = | TrueFoundry.WeightBasedLoadBalancing | TrueFoundry.LatencyBasedLoadBalancing - | TrueFoundry.PriorityBasedLoadBalancing; + | TrueFoundry.PriorityBasedLoadBalancing + | TrueFoundry.ComplexityBasedLoadBalancing; diff --git a/src/api/types/HealthProbe.ts b/src/api/types/HealthProbe.ts index 15ac786d..e0ce641e 100644 --- a/src/api/types/HealthProbe.ts +++ b/src/api/types/HealthProbe.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Describes the configuration for the Health Probe's diff --git a/src/api/types/Helm.ts b/src/api/types/Helm.ts index dc8ba4a7..8fab76ae 100644 --- a/src/api/types/Helm.ts +++ b/src/api/types/Helm.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface Helm { /** +value=helm */ diff --git a/src/api/types/HelmSource.ts b/src/api/types/HelmSource.ts index 293afb46..7ae4758d 100644 --- a/src/api/types/HelmSource.ts +++ b/src/api/types/HelmSource.ts @@ -1,11 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Source helm repository */ -export type HelmSource = - | TrueFoundry.HelmRepo - | TrueFoundry.OciRepo - | TrueFoundry.GitHelmRepo; +export type HelmSource = TrueFoundry.HelmRepo | TrueFoundry.OciRepo | TrueFoundry.GitHelmRepo; diff --git a/src/api/types/HeuristicClassificationStrategy.ts b/src/api/types/HeuristicClassificationStrategy.ts new file mode 100644 index 00000000..06c7c8ce --- /dev/null +++ b/src/api/types/HeuristicClassificationStrategy.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Fast, in-process heuristic classifier. Runs with zero added latency and no classifier model. This is the default strategy. + */ +export interface HeuristicClassificationStrategy { + /** Strategy */ + type: "heuristic"; +} diff --git a/src/api/types/HeuristicFallbackStrategy.ts b/src/api/types/HeuristicFallbackStrategy.ts new file mode 100644 index 00000000..40d32f93 --- /dev/null +++ b/src/api/types/HeuristicFallbackStrategy.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * On classifier timeout or error, fall back to the built-in heuristic classifier. + */ +export interface HeuristicFallbackStrategy { + /** Fallback Type */ + type: "heuristic"; +} diff --git a/src/api/types/HttpError.ts b/src/api/types/HttpError.ts index 32cb3d8d..f36a5f36 100644 --- a/src/api/types/HttpError.ts +++ b/src/api/types/HttpError.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface HttpError { /** HTTP Status Code */ @@ -8,7 +8,7 @@ export interface HttpError { /** Error Message */ message: string; /** Error code */ - code?: TrueFoundry.HttpErrorCode; + code?: TrueFoundry.HttpErrorCode | null; /** Error details */ - details?: Record[]; + details?: Record[] | null; } diff --git a/src/api/types/HttpErrorCode.ts b/src/api/types/HttpErrorCode.ts index 519989b0..47f393ae 100644 --- a/src/api/types/HttpErrorCode.ts +++ b/src/api/types/HttpErrorCode.ts @@ -3,6 +3,4 @@ /** * Error code */ -export type HttpErrorCode = - | number - | string; +export type HttpErrorCode = number | string; diff --git a/src/api/types/IChange.ts b/src/api/types/IChange.ts index d789de91..6d4e9252 100644 --- a/src/api/types/IChange.ts +++ b/src/api/types/IChange.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface IChange { - type: TrueFoundry.IChangeOperation; + type: TrueFoundry.IChangeType; key: string; - value?: Record; - oldValue?: Record; - changes?: TrueFoundry.IChange[]; + value?: Record | null; + oldValue?: Record | null; + changes?: TrueFoundry.IChange[] | null; } diff --git a/src/api/types/IChangeOperation.ts b/src/api/types/IChangeOperation.ts deleted file mode 100644 index 27d3ab41..00000000 --- a/src/api/types/IChangeOperation.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const IChangeOperation = { - Remove: "REMOVE", - Add: "ADD", - Update: "UPDATE" - } as const; -export type IChangeOperation = typeof IChangeOperation[keyof typeof IChangeOperation]; diff --git a/src/api/types/IChangeType.ts b/src/api/types/IChangeType.ts new file mode 100644 index 00000000..3648fb34 --- /dev/null +++ b/src/api/types/IChangeType.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const IChangeType = { + Remove: "REMOVE", + Add: "ADD", + Update: "UPDATE", +} as const; +export type IChangeType = (typeof IChangeType)[keyof typeof IChangeType]; diff --git a/src/api/types/IdentityProviderBackedIdentity.ts b/src/api/types/IdentityProviderBackedIdentity.ts index de70ffe0..ad344c78 100644 --- a/src/api/types/IdentityProviderBackedIdentity.ts +++ b/src/api/types/IdentityProviderBackedIdentity.ts @@ -1,13 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Identity resolved from tokens issued by an external identity provider */ export interface IdentityProviderBackedIdentity { - /** +value=idp-backed */ - type: "idp-backed"; + /** +value=identity-provider-backed */ + type: "identity-provider-backed"; /** Mappings from external identity provider claim values to this agent identity */ identityProviderMapping: TrueFoundry.AgentIdentityProviderMapping[]; } diff --git a/src/api/types/IdentityProviderMapping.ts b/src/api/types/IdentityProviderMapping.ts index ecbd8ebc..bae2cc47 100644 --- a/src/api/types/IdentityProviderMapping.ts +++ b/src/api/types/IdentityProviderMapping.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. /** - * Configuration for mapping IdP claim values to this virtual account + * Map specific claim values from an external IdP token (e.g., Okta, Azure AD) to this agent identity. */ export interface IdentityProviderMapping { - /** Name of the external identity provider */ + /** Must already be configured under Platform → Identity Providers. Choosing a SPIRE provider means this agent's credential is an attested JWT-SVID from its runtime. */ identityProvider: string; - /** Claim value that should resolve to this virtual account */ + /** The value that must appear in the subject claim of the IdP token for this mapping to match. For example, a service account email or a group name. */ value: string; } diff --git a/src/api/types/Image.ts b/src/api/types/Image.ts index 59d75773..81ee71c2 100644 --- a/src/api/types/Image.ts +++ b/src/api/types/Image.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Describes that we are using a pre-built image stored in a Docker Image registry diff --git a/src/api/types/ImageCommand.ts b/src/api/types/ImageCommand.ts index ba264a32..c6528ffb 100644 --- a/src/api/types/ImageCommand.ts +++ b/src/api/types/ImageCommand.ts @@ -5,6 +5,4 @@ * When deploying a Job, the command can be templatized by defining `params` and referencing them in command * E.g. `python main.py --learning_rate {{learning_rate}}` */ -export type ImageCommand = - | string - | string[]; +export type ImageCommand = string | string[]; diff --git a/src/api/types/ImageContentPart.ts b/src/api/types/ImageContentPart.ts index e8cbd188..b282e5cb 100644 --- a/src/api/types/ImageContentPart.ts +++ b/src/api/types/ImageContentPart.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Image content for the message diff --git a/src/api/types/ImageContentPartImageUrl.ts b/src/api/types/ImageContentPartImageUrl.ts index d0c616ad..c50cea21 100644 --- a/src/api/types/ImageContentPartImageUrl.ts +++ b/src/api/types/ImageContentPartImageUrl.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Image URL linking to the image diff --git a/src/api/types/ImageContentPartImageUrlUrl.ts b/src/api/types/ImageContentPartImageUrlUrl.ts index 637ce8a4..302d4e92 100644 --- a/src/api/types/ImageContentPartImageUrlUrl.ts +++ b/src/api/types/ImageContentPartImageUrlUrl.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Image URL linking to the image */ -export type ImageContentPartImageUrlUrl = - | string - | TrueFoundry.BlobStorageReference; +export type ImageContentPartImageUrlUrl = string | TrueFoundry.BlobStorageReference; diff --git a/src/api/types/InNotIn.ts b/src/api/types/InNotIn.ts new file mode 100644 index 00000000..c65651d0 --- /dev/null +++ b/src/api/types/InNotIn.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * In/Not-In Filter + */ +export interface InNotIn { + /** Match when the value is present in this list. Absent or ["*"] means all. */ + in?: string[]; + /** Match when the value is NOT present in this list. A value listed here never matches. */ + notIn?: string[]; +} diff --git a/src/api/types/InNotInOperator.ts b/src/api/types/InNotInOperator.ts index a55e65b5..5d3d0b2c 100644 --- a/src/api/types/InNotInOperator.ts +++ b/src/api/types/InNotInOperator.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface InNotInOperator { condition: TrueFoundry.InNotInOperatorCondition; diff --git a/src/api/types/InNotInOperatorCondition.ts b/src/api/types/InNotInOperatorCondition.ts index 2b513bb3..42993193 100644 --- a/src/api/types/InNotInOperatorCondition.ts +++ b/src/api/types/InNotInOperatorCondition.ts @@ -1,7 +1,7 @@ // This file was auto-generated by Fern from our API Definition. export const InNotInOperatorCondition = { - In: "in", - NotIn: "not_in" - } as const; -export type InNotInOperatorCondition = typeof InNotInOperatorCondition[keyof typeof InNotInOperatorCondition]; + In: "in", + NotIn: "not_in", +} as const; +export type InNotInOperatorCondition = (typeof InNotInOperatorCondition)[keyof typeof InNotInOperatorCondition]; diff --git a/src/api/types/InferMethodName.ts b/src/api/types/InferMethodName.ts index 67efd614..76a4e342 100644 --- a/src/api/types/InferMethodName.ts +++ b/src/api/types/InferMethodName.ts @@ -2,7 +2,7 @@ /** Name of the method used for inference */ export const InferMethodName = { - Predict: "predict", - PredictProba: "predict_proba" - } as const; -export type InferMethodName = typeof InferMethodName[keyof typeof InferMethodName]; + Predict: "predict", + PredictProba: "predict_proba", +} as const; +export type InferMethodName = (typeof InferMethodName)[keyof typeof InferMethodName]; diff --git a/src/api/types/InfraProviderAccount.ts b/src/api/types/InfraProviderAccount.ts index 79ca51ed..0c4b7a9e 100644 --- a/src/api/types/InfraProviderAccount.ts +++ b/src/api/types/InfraProviderAccount.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; -export type InfraProviderAccount = +export type InfraProviderAccount = | TrueFoundry.AwsProviderAccount | TrueFoundry.AzureProviderAccount | TrueFoundry.GcpProviderAccount diff --git a/src/api/types/InlineSpecSource.ts b/src/api/types/InlineSpecSource.ts index 49781195..6fb90e3f 100644 --- a/src/api/types/InlineSpecSource.ts +++ b/src/api/types/InlineSpecSource.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Inline your OpenAPI specification directly. The spec will be stored securely. diff --git a/src/api/types/InlineSpecSourceOpenapiSpec.ts b/src/api/types/InlineSpecSourceOpenapiSpec.ts index aa0615be..0628ca12 100644 --- a/src/api/types/InlineSpecSourceOpenapiSpec.ts +++ b/src/api/types/InlineSpecSourceOpenapiSpec.ts @@ -3,6 +3,4 @@ /** * The OpenAPI specification as a JSON object or a JSON/YAML string. */ -export type InlineSpecSourceOpenapiSpec = - | Record - | string; +export type InlineSpecSourceOpenapiSpec = Record | string; diff --git a/src/api/types/InputOutputBasedCostMetricValue.ts b/src/api/types/InputOutputBasedCostMetricValue.ts index ee4bdd1b..a22b8d0f 100644 --- a/src/api/types/InputOutputBasedCostMetricValue.ts +++ b/src/api/types/InputOutputBasedCostMetricValue.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface InputOutputBasedCostMetricValue { input: TrueFoundry.NonNegativeFloat; diff --git a/src/api/types/Intercept.ts b/src/api/types/Intercept.ts index 2a79a7d2..ccf8cac1 100644 --- a/src/api/types/Intercept.ts +++ b/src/api/types/Intercept.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface Intercept { /** +value=intercept */ diff --git a/src/api/types/InterceptRulesItem.ts b/src/api/types/InterceptRulesItem.ts index 9ee853a1..aae59694 100644 --- a/src/api/types/InterceptRulesItem.ts +++ b/src/api/types/InterceptRulesItem.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface InterceptRulesItem { /** Port of service to be intercepted */ diff --git a/src/api/types/InterceptRulesItemAction.ts b/src/api/types/InterceptRulesItemAction.ts index 5c5443ef..ae72417d 100644 --- a/src/api/types/InterceptRulesItemAction.ts +++ b/src/api/types/InterceptRulesItemAction.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Action to take on succesful match */ -export type InterceptRulesItemAction = - | TrueFoundry.ForwardAction - | TrueFoundry.MirrorAction; +export type InterceptRulesItemAction = TrueFoundry.ForwardAction | TrueFoundry.MirrorAction; diff --git a/src/api/types/InternalArtifactVersion.ts b/src/api/types/InternalArtifactVersion.ts index c1407399..01a91411 100644 --- a/src/api/types/InternalArtifactVersion.ts +++ b/src/api/types/InternalArtifactVersion.ts @@ -1,12 +1,12 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface InternalArtifactVersion { /** Timestamp when the artifact version was created. */ - createdAt?: Date; + createdAt?: Date | null; /** Timestamp when the artifact version was last updated. */ - updatedAt?: Date; + updatedAt?: Date | null; /** Manifest describing the artifact version. */ manifest: TrueFoundry.ArtifactManifest; /** System-generated artifact version ID. */ @@ -18,17 +18,17 @@ export interface InternalArtifactVersion { /** Identifier of the ML Repo the artifact version belongs to. */ mlRepoId: string; /** Code snippet demonstrating how to use the artifact version. */ - usageCodeSnippet?: string; + usageCodeSnippet?: string | null; /** Tags associated with the artifact version. */ - tags?: string[]; + tags?: string[] | null; /** Identifier of the artifact this version belongs to. */ artifactId: string; /** Total size of the artifact version files in bytes. */ - artifactSize?: number; + artifactSize?: number | null; /** Fully qualified name of the parent artifact */ artifactFqn: string; /** User-defined metadata associated with the artifact version. */ - artifactMetadata?: Record; + artifactMetadata?: Record | null; /** Internal metadata associated with the artifact version. */ - internalMetadata?: Record; + internalMetadata?: Record | null; } diff --git a/src/api/types/InternalListArtifactVersionsResponse.ts b/src/api/types/InternalListArtifactVersionsResponse.ts index ecceacf6..aa3e3dd5 100644 --- a/src/api/types/InternalListArtifactVersionsResponse.ts +++ b/src/api/types/InternalListArtifactVersionsResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface InternalListArtifactVersionsResponse { /** List of artifact versions matching the query. */ diff --git a/src/api/types/InternalListArtifactVersionsResponseDataItem.ts b/src/api/types/InternalListArtifactVersionsResponseDataItem.ts index af84ccc3..dcde8a4c 100644 --- a/src/api/types/InternalListArtifactVersionsResponseDataItem.ts +++ b/src/api/types/InternalListArtifactVersionsResponseDataItem.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; -export type InternalListArtifactVersionsResponseDataItem = +export type InternalListArtifactVersionsResponseDataItem = | TrueFoundry.InternalArtifactVersion | TrueFoundry.InternalModelVersion | TrueFoundry.AgentSkillVersion diff --git a/src/api/types/InternalModelVersion.ts b/src/api/types/InternalModelVersion.ts index 024620c8..0c522012 100644 --- a/src/api/types/InternalModelVersion.ts +++ b/src/api/types/InternalModelVersion.ts @@ -1,12 +1,12 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface InternalModelVersion { /** Timestamp when the model version was created. */ - createdAt?: Date; + createdAt?: Date | null; /** Timestamp when the model version was last updated. */ - updatedAt?: Date; + updatedAt?: Date | null; /** Manifest describing the model version. */ manifest: TrueFoundry.ModelManifest; /** Unique identifier of the model version. */ @@ -18,17 +18,17 @@ export interface InternalModelVersion { /** Identifier of the ML Repo the model version belongs to. */ mlRepoId: string; /** Code snippet showing how to use the model version. */ - usageCodeSnippet?: string; + usageCodeSnippet?: string | null; /** Tags associated with the model version. */ tags?: string[]; /** Identifier of the model this version belongs to. */ modelId: string; /** Metrics logged for the model version. */ - metrics?: TrueFoundry.Metric[]; + metrics?: TrueFoundry.Metric[] | null; /** Whether the model version can be deployed. */ - deployable?: boolean; + deployable?: boolean | null; /** Size of the model version artifact in bytes. */ - artifactSize?: number; + artifactSize?: number | null; /** Fully qualified name of the parent model */ artifactFqn: string; } diff --git a/src/api/types/JFrogIntegrations.ts b/src/api/types/JFrogIntegrations.ts index 04cd6004..831a5579 100644 --- a/src/api/types/JFrogIntegrations.ts +++ b/src/api/types/JFrogIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type JFrogIntegrations = TrueFoundry.JfrogArtifactsRegistry; diff --git a/src/api/types/JfrogArtifactsRegistry.ts b/src/api/types/JfrogArtifactsRegistry.ts index 31cdc98f..64cd90e2 100644 --- a/src/api/types/JfrogArtifactsRegistry.ts +++ b/src/api/types/JfrogArtifactsRegistry.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Jfrog Artifacts Registry diff --git a/src/api/types/JfrogProviderAccount.ts b/src/api/types/JfrogProviderAccount.ts index a4b5b92d..45efa28f 100644 --- a/src/api/types/JfrogProviderAccount.ts +++ b/src/api/types/JfrogProviderAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Jfrog diff --git a/src/api/types/Job.ts b/src/api/types/Job.ts index 3d44acf8..31618f44 100644 --- a/src/api/types/Job.ts +++ b/src/api/types/Job.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Describes the configuration for the job @@ -19,7 +19,7 @@ export interface Job { /** Configure params and pass it to create different job runs */ params?: TrueFoundry.Param[]; /** Configure environment variables to be injected in the service either as plain text or secrets. [Docs](https://docs.truefoundry.com/docs/env-variables) */ - env?: Record; + env?: Record | null; resources?: TrueFoundry.Resources; /** Configure alerts to be sent when the job starts/fails/completes */ alerts?: TrueFoundry.JobAlert[]; diff --git a/src/api/types/JobAlert.ts b/src/api/types/JobAlert.ts index 2fe774a0..f095279c 100644 --- a/src/api/types/JobAlert.ts +++ b/src/api/types/JobAlert.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Describes the configuration for the job alerts diff --git a/src/api/types/JobImage.ts b/src/api/types/JobImage.ts index 65dbeda3..dc8b49c5 100644 --- a/src/api/types/JobImage.ts +++ b/src/api/types/JobImage.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Specify whether you want to deploy a Docker image or build and deploy from source code */ -export type JobImage = - | TrueFoundry.Build - | TrueFoundry.Image; +export type JobImage = TrueFoundry.Build | TrueFoundry.Image; diff --git a/src/api/types/JobMountsItem.ts b/src/api/types/JobMountsItem.ts index c7c008c0..32b859b9 100644 --- a/src/api/types/JobMountsItem.ts +++ b/src/api/types/JobMountsItem.ts @@ -1,8 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; -export type JobMountsItem = - | TrueFoundry.SecretMount - | TrueFoundry.StringDataMount - | TrueFoundry.VolumeMount; +export type JobMountsItem = TrueFoundry.SecretMount | TrueFoundry.StringDataMount | TrueFoundry.VolumeMount; diff --git a/src/api/types/JobRun.ts b/src/api/types/JobRun.ts index f7bd6025..07098649 100644 --- a/src/api/types/JobRun.ts +++ b/src/api/types/JobRun.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface JobRun { /** System-generated job run ID. */ @@ -14,29 +14,29 @@ export interface JobRun { /** Created At */ createdAt: number; /** End Time of JobRun */ - endTime?: number; + endTime?: number | null; /** Duration of JobRun */ - duration?: number; + duration?: number | null; /** Command */ command: string; /** Total Retries */ totalRetries: number; /** Error */ - error?: string; + error?: string | null; /** Status of JobRun */ status: TrueFoundry.JobRunStatus; /** Triggered By */ - triggeredBy?: string; + triggeredBy?: string | null; /** Triggered By Subject */ - triggeredBySubject?: TrueFoundry.Subject; + triggeredBySubject?: TrueFoundry.Subject | null; /** Exit Code */ - exitCode?: number; + exitCode?: number | null; /** Spark UI Url */ - sparkUi?: string; + sparkUi?: string | null; /** Application ID */ - applicationId?: string; + applicationId?: string | null; /** Deployment ID */ - deploymentId?: string; + deploymentId?: string | null; /** Tenant Name */ - tenantName?: string; + tenantName?: string | null; } diff --git a/src/api/types/JobRunStatus.ts b/src/api/types/JobRunStatus.ts index d35ad78e..cb0d1517 100644 --- a/src/api/types/JobRunStatus.ts +++ b/src/api/types/JobRunStatus.ts @@ -1,14 +1,15 @@ // This file was auto-generated by Fern from our API Definition. +/** Status of JobRun */ export const JobRunStatus = { - Created: "CREATED", - Scheduled: "SCHEDULED", - Running: "RUNNING", - Finished: "FINISHED", - Failed: "FAILED", - TerminationRequested: "TERMINATION_REQUESTED", - Terminating: "TERMINATING", - Terminated: "TERMINATED", - Unknown: "UNKNOWN" - } as const; -export type JobRunStatus = typeof JobRunStatus[keyof typeof JobRunStatus]; + Created: "CREATED", + Scheduled: "SCHEDULED", + Running: "RUNNING", + Finished: "FINISHED", + Failed: "FAILED", + TerminationRequested: "TERMINATION_REQUESTED", + Terminating: "TERMINATING", + Terminated: "TERMINATED", + Unknown: "UNKNOWN", +} as const; +export type JobRunStatus = (typeof JobRunStatus)[keyof typeof JobRunStatus]; diff --git a/src/api/types/JobRunsSortBy.ts b/src/api/types/JobRunsSortBy.ts index f885a412..c07e5561 100644 --- a/src/api/types/JobRunsSortBy.ts +++ b/src/api/types/JobRunsSortBy.ts @@ -1,10 +1,10 @@ // This file was auto-generated by Fern from our API Definition. export const JobRunsSortBy = { - StartTime: "startTime", - Duration: "duration", - DeploymentVersion: "deploymentVersion", - TriggeredBy: "triggeredBy", - Status: "status" - } as const; -export type JobRunsSortBy = typeof JobRunsSortBy[keyof typeof JobRunsSortBy]; + StartTime: "startTime", + Duration: "duration", + DeploymentVersion: "deploymentVersion", + TriggeredBy: "triggeredBy", + Status: "status", +} as const; +export type JobRunsSortBy = (typeof JobRunsSortBy)[keyof typeof JobRunsSortBy]; diff --git a/src/api/types/JobTrigger.ts b/src/api/types/JobTrigger.ts index 5206b3bc..d766a089 100644 --- a/src/api/types/JobTrigger.ts +++ b/src/api/types/JobTrigger.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Specify the trigger */ -export type JobTrigger = - | TrueFoundry.Manual - | TrueFoundry.Schedule; +export type JobTrigger = TrueFoundry.Manual | TrueFoundry.Schedule; diff --git a/src/api/types/JobTriggerInput.ts b/src/api/types/JobTriggerInput.ts index 9142f46f..0069256e 100644 --- a/src/api/types/JobTriggerInput.ts +++ b/src/api/types/JobTriggerInput.ts @@ -1,10 +1,10 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface JobTriggerInput { /** Command */ - command?: TrueFoundry.JobTriggerInputCommand; + command?: TrueFoundry.JobTriggerInputCommand | null; /** Parameters used to populate template command */ - params?: Record; + params?: Record | null; } diff --git a/src/api/types/JobTriggerInputCommand.ts b/src/api/types/JobTriggerInputCommand.ts index e47ec594..db2667a9 100644 --- a/src/api/types/JobTriggerInputCommand.ts +++ b/src/api/types/JobTriggerInputCommand.ts @@ -3,6 +3,4 @@ /** * Command */ -export type JobTriggerInputCommand = - | string - | string[]; +export type JobTriggerInputCommand = string | string[]; diff --git a/src/api/types/JsonSchemaResponseFormat.ts b/src/api/types/JsonSchemaResponseFormat.ts index aa2b3a6e..4a5c6be6 100644 --- a/src/api/types/JsonSchemaResponseFormat.ts +++ b/src/api/types/JsonSchemaResponseFormat.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Structured JSON response format with schema validation diff --git a/src/api/types/Jwt.ts b/src/api/types/Jwt.ts index 9d2c1045..b80a5cb1 100644 --- a/src/api/types/Jwt.ts +++ b/src/api/types/Jwt.ts @@ -1,12 +1,12 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface Jwt { id: string; subjectType: string; subjectId: string; - metadata?: Record; + metadata?: Record | null; expiry: Date; tokenType: TrueFoundry.JwtTokenType; createdAt: Date; diff --git a/src/api/types/JwtAuthConfig.ts b/src/api/types/JwtAuthConfig.ts index 7d38aa6c..7929985f 100644 --- a/src/api/types/JwtAuthConfig.ts +++ b/src/api/types/JwtAuthConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Configure JWT-based authentication using JWKS diff --git a/src/api/types/JwtTokenType.ts b/src/api/types/JwtTokenType.ts index 172eb1e8..953de001 100644 --- a/src/api/types/JwtTokenType.ts +++ b/src/api/types/JwtTokenType.ts @@ -1,7 +1,7 @@ // This file was auto-generated by Fern from our API Definition. export const JwtTokenType = { - Jwt: "jwt", - Opaque: "opaque" - } as const; -export type JwtTokenType = typeof JwtTokenType[keyof typeof JwtTokenType]; + Jwt: "jwt", + Opaque: "opaque", +} as const; +export type JwtTokenType = (typeof JwtTokenType)[keyof typeof JwtTokenType]; diff --git a/src/api/types/KafkaInputConfig.ts b/src/api/types/KafkaInputConfig.ts index a0c180e7..2a232f99 100644 --- a/src/api/types/KafkaInputConfig.ts +++ b/src/api/types/KafkaInputConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Describes the configuration for the input Kafka worker diff --git a/src/api/types/KafkaOutputConfig.ts b/src/api/types/KafkaOutputConfig.ts index decc20dd..a7a820eb 100644 --- a/src/api/types/KafkaOutputConfig.ts +++ b/src/api/types/KafkaOutputConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Describes the configuration for the output Kafka worker diff --git a/src/api/types/KeySpec.ts b/src/api/types/KeySpec.ts index e0576e96..9ca62f9d 100644 --- a/src/api/types/KeySpec.ts +++ b/src/api/types/KeySpec.ts @@ -1,12 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Rule */ -export type KeySpec = +export type KeySpec = /** * Only the key is checked — any value will pass. Once configured, the key must be present in the metadata header. */ - | TrueFoundry.KeyPresenceSpec - | TrueFoundry.KeyValueSpec; + TrueFoundry.KeyPresenceSpec | TrueFoundry.KeyValueSpec; diff --git a/src/api/types/KeyValueSpec.ts b/src/api/types/KeyValueSpec.ts index 335860fc..50e179a8 100644 --- a/src/api/types/KeyValueSpec.ts +++ b/src/api/types/KeyValueSpec.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Validate the value against a regex or a fixed list. The key is optional unless Required is on. diff --git a/src/api/types/LatencyBasedLoadBalanceTarget.ts b/src/api/types/LatencyBasedLoadBalanceTarget.ts index 16446d5d..0422a9a3 100644 --- a/src/api/types/LatencyBasedLoadBalanceTarget.ts +++ b/src/api/types/LatencyBasedLoadBalanceTarget.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Latency-based Target diff --git a/src/api/types/LatencyBasedLoadBalancing.ts b/src/api/types/LatencyBasedLoadBalancing.ts index 660293c2..3da7c707 100644 --- a/src/api/types/LatencyBasedLoadBalancing.ts +++ b/src/api/types/LatencyBasedLoadBalancing.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Latency-based Load Balancing diff --git a/src/api/types/LatencyBasedLoadBalancingRule.ts b/src/api/types/LatencyBasedLoadBalancingRule.ts index 0440c575..f6457205 100644 --- a/src/api/types/LatencyBasedLoadBalancingRule.ts +++ b/src/api/types/LatencyBasedLoadBalancingRule.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Latency-based Load Balancing Rule diff --git a/src/api/types/LegacyAgentManifest.ts b/src/api/types/LegacyAgentManifest.ts index da9473fc..50c807e6 100644 --- a/src/api/types/LegacyAgentManifest.ts +++ b/src/api/types/LegacyAgentManifest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface LegacyAgentManifest { /** Type of the manifest */ diff --git a/src/api/types/LibraryName.ts b/src/api/types/LibraryName.ts index b7397bbd..eabe80ef 100644 --- a/src/api/types/LibraryName.ts +++ b/src/api/types/LibraryName.ts @@ -2,8 +2,8 @@ /** Name of the library for the framework */ export const LibraryName = { - Transformers: "transformers", - SentenceTransformers: "sentence-transformers", - Diffusers: "diffusers" - } as const; -export type LibraryName = typeof LibraryName[keyof typeof LibraryName]; + Transformers: "transformers", + SentenceTransformers: "sentence-transformers", + Diffusers: "diffusers", +} as const; +export type LibraryName = (typeof LibraryName)[keyof typeof LibraryName]; diff --git a/src/api/types/ListAgentSkillVersionsResponse.ts b/src/api/types/ListAgentSkillVersionsResponse.ts index d95dce99..733b0670 100644 --- a/src/api/types/ListAgentSkillVersionsResponse.ts +++ b/src/api/types/ListAgentSkillVersionsResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ListAgentSkillVersionsResponse { /** List of agent skill versions matching the query. */ diff --git a/src/api/types/ListAgentSkillsResponse.ts b/src/api/types/ListAgentSkillsResponse.ts index cdd1ecf7..df83271b 100644 --- a/src/api/types/ListAgentSkillsResponse.ts +++ b/src/api/types/ListAgentSkillsResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ListAgentSkillsResponse { /** List of agent skills matching the query. */ diff --git a/src/api/types/ListAgentVersionsResponse.ts b/src/api/types/ListAgentVersionsResponse.ts index a157262c..8fe8c872 100644 --- a/src/api/types/ListAgentVersionsResponse.ts +++ b/src/api/types/ListAgentVersionsResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ListAgentVersionsResponse { /** Array of Agent Versions */ diff --git a/src/api/types/ListAgentsResponse.ts b/src/api/types/ListAgentsResponse.ts index da1bae4a..ff599d2a 100644 --- a/src/api/types/ListAgentsResponse.ts +++ b/src/api/types/ListAgentsResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ListAgentsResponse { /** Array of Agents */ diff --git a/src/api/types/ListApplicationDeploymentsResponse.ts b/src/api/types/ListApplicationDeploymentsResponse.ts index 824991e5..7e3f6d78 100644 --- a/src/api/types/ListApplicationDeploymentsResponse.ts +++ b/src/api/types/ListApplicationDeploymentsResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ListApplicationDeploymentsResponse { /** List of deployments matching the query */ diff --git a/src/api/types/ListApplicationsResponse.ts b/src/api/types/ListApplicationsResponse.ts index 621bd97e..5c6a91e3 100644 --- a/src/api/types/ListApplicationsResponse.ts +++ b/src/api/types/ListApplicationsResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ListApplicationsResponse { /** List of applications matching the query */ diff --git a/src/api/types/ListArtifactVersionsResponse.ts b/src/api/types/ListArtifactVersionsResponse.ts index 1ee31a05..a9030fe9 100644 --- a/src/api/types/ListArtifactVersionsResponse.ts +++ b/src/api/types/ListArtifactVersionsResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ListArtifactVersionsResponse { /** List of artifact versions matching the query. */ diff --git a/src/api/types/ListArtifactsResponse.ts b/src/api/types/ListArtifactsResponse.ts index eaa1f368..0001b71b 100644 --- a/src/api/types/ListArtifactsResponse.ts +++ b/src/api/types/ListArtifactsResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ListArtifactsResponse { /** List of artifacts matching the query. */ diff --git a/src/api/types/ListBudgetsResponse.ts b/src/api/types/ListBudgetsResponse.ts new file mode 100644 index 00000000..a18d2573 --- /dev/null +++ b/src/api/types/ListBudgetsResponse.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +export interface ListBudgetsResponse { + /** Budgets matching the requested filters. */ + data: TrueFoundry.GatewayBudget[]; +} diff --git a/src/api/types/ListClusterAddonsResponse.ts b/src/api/types/ListClusterAddonsResponse.ts index 3771ca88..9beb4958 100644 --- a/src/api/types/ListClusterAddonsResponse.ts +++ b/src/api/types/ListClusterAddonsResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ListClusterAddonsResponse { /** List of addons installed on the cluster. */ diff --git a/src/api/types/ListClustersResponse.ts b/src/api/types/ListClustersResponse.ts index f736bb27..b4564a47 100644 --- a/src/api/types/ListClustersResponse.ts +++ b/src/api/types/ListClustersResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ListClustersResponse { /** List of clusters the caller has access to. */ diff --git a/src/api/types/ListDataDirectoriesResponse.ts b/src/api/types/ListDataDirectoriesResponse.ts index 1974cdea..6d851738 100644 --- a/src/api/types/ListDataDirectoriesResponse.ts +++ b/src/api/types/ListDataDirectoriesResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ListDataDirectoriesResponse { /** List of data directories matching the query. */ diff --git a/src/api/types/ListEnvironmentsResponse.ts b/src/api/types/ListEnvironmentsResponse.ts index 76dd2d57..2b3f22ec 100644 --- a/src/api/types/ListEnvironmentsResponse.ts +++ b/src/api/types/ListEnvironmentsResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ListEnvironmentsResponse { /** List of environments for the tenant. */ diff --git a/src/api/types/ListFilesRequest.ts b/src/api/types/ListFilesRequest.ts index 09f1eb9d..38027679 100644 --- a/src/api/types/ListFilesRequest.ts +++ b/src/api/types/ListFilesRequest.ts @@ -4,9 +4,9 @@ export interface ListFilesRequest { /** Identifier of the artifact version to list files for. */ id: string; /** Path within the artifact version to list files under. */ - path?: string; + path?: string | null; /** Maximum number of files to return. */ - limit?: number; + limit?: number | null; /** Token to retrieve the next page of results */ - pageToken?: string; + pageToken?: string | null; } diff --git a/src/api/types/ListFilesResponse.ts b/src/api/types/ListFilesResponse.ts index b84b83d8..f96028a1 100644 --- a/src/api/types/ListFilesResponse.ts +++ b/src/api/types/ListFilesResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ListFilesResponse { /** List of files and directories in the artifact version. */ diff --git a/src/api/types/ListJobRunResponse.ts b/src/api/types/ListJobRunResponse.ts index e993390a..e0d7d9f2 100644 --- a/src/api/types/ListJobRunResponse.ts +++ b/src/api/types/ListJobRunResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ListJobRunResponse { /** JobRun History */ diff --git a/src/api/types/ListMetricHistoryResponse.ts b/src/api/types/ListMetricHistoryResponse.ts index 452ed884..7d303389 100644 --- a/src/api/types/ListMetricHistoryResponse.ts +++ b/src/api/types/ListMetricHistoryResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ListMetricHistoryResponse { /** Metric histories grouped by key. */ diff --git a/src/api/types/ListMlReposResponse.ts b/src/api/types/ListMlReposResponse.ts index e815ac63..a8cea677 100644 --- a/src/api/types/ListMlReposResponse.ts +++ b/src/api/types/ListMlReposResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ListMlReposResponse { /** Array of ML Repos */ diff --git a/src/api/types/ListModelVersionsResponse.ts b/src/api/types/ListModelVersionsResponse.ts index df98ae18..b9cf0b8a 100644 --- a/src/api/types/ListModelVersionsResponse.ts +++ b/src/api/types/ListModelVersionsResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ListModelVersionsResponse { /** List of model versions matching the query. */ diff --git a/src/api/types/ListModelsResponse.ts b/src/api/types/ListModelsResponse.ts index a452dec6..41217eda 100644 --- a/src/api/types/ListModelsResponse.ts +++ b/src/api/types/ListModelsResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ListModelsResponse { /** List of models matching the query. */ diff --git a/src/api/types/ListPersonalAccessTokenResponse.ts b/src/api/types/ListPersonalAccessTokenResponse.ts index 9fccd779..d4aa1b21 100644 --- a/src/api/types/ListPersonalAccessTokenResponse.ts +++ b/src/api/types/ListPersonalAccessTokenResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ListPersonalAccessTokenResponse { /** Array of personal access tokens matching the query. */ diff --git a/src/api/types/ListPromptVersionsResponse.ts b/src/api/types/ListPromptVersionsResponse.ts index 361b95d9..a0e6f119 100644 --- a/src/api/types/ListPromptVersionsResponse.ts +++ b/src/api/types/ListPromptVersionsResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ListPromptVersionsResponse { /** List of prompt versions matching the query. */ diff --git a/src/api/types/ListPromptsResponse.ts b/src/api/types/ListPromptsResponse.ts index a01545b6..4fe6d947 100644 --- a/src/api/types/ListPromptsResponse.ts +++ b/src/api/types/ListPromptsResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ListPromptsResponse { /** List of prompts matching the query. */ diff --git a/src/api/types/ListSecretGroupResponse.ts b/src/api/types/ListSecretGroupResponse.ts index 69267704..7acda688 100644 --- a/src/api/types/ListSecretGroupResponse.ts +++ b/src/api/types/ListSecretGroupResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ListSecretGroupResponse { /** Array of Secret Groups */ diff --git a/src/api/types/ListSecretsResponse.ts b/src/api/types/ListSecretsResponse.ts index 45ca62c6..9ed978b6 100644 --- a/src/api/types/ListSecretsResponse.ts +++ b/src/api/types/ListSecretsResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ListSecretsResponse { /** Array of Secrets */ diff --git a/src/api/types/ListTeamManagersResponse.ts b/src/api/types/ListTeamManagersResponse.ts index f9cafc23..d0787e09 100644 --- a/src/api/types/ListTeamManagersResponse.ts +++ b/src/api/types/ListTeamManagersResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ListTeamManagersResponse { data: TrueFoundry.TeamSubjectRow[]; diff --git a/src/api/types/ListTeamMembersResponse.ts b/src/api/types/ListTeamMembersResponse.ts index d60cdea4..71224a47 100644 --- a/src/api/types/ListTeamMembersResponse.ts +++ b/src/api/types/ListTeamMembersResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ListTeamMembersResponse { data: TrueFoundry.TeamSubjectRow[]; diff --git a/src/api/types/ListTeamsResponse.ts b/src/api/types/ListTeamsResponse.ts index c2ce0ed8..25ca71fb 100644 --- a/src/api/types/ListTeamsResponse.ts +++ b/src/api/types/ListTeamsResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ListTeamsResponse { /** Array of teams matching the query. */ diff --git a/src/api/types/ListUsersResponse.ts b/src/api/types/ListUsersResponse.ts index 83132a08..68f771ba 100644 --- a/src/api/types/ListUsersResponse.ts +++ b/src/api/types/ListUsersResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ListUsersResponse { /** Array of users matching the query. */ diff --git a/src/api/types/ListVirtualAccountResponse.ts b/src/api/types/ListVirtualAccountResponse.ts index e5d699b9..51a10f3f 100644 --- a/src/api/types/ListVirtualAccountResponse.ts +++ b/src/api/types/ListVirtualAccountResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ListVirtualAccountResponse { /** Array of virtual accounts matching the query. */ diff --git a/src/api/types/ListWorkspacesResponse.ts b/src/api/types/ListWorkspacesResponse.ts index 256f7df4..ce0217b9 100644 --- a/src/api/types/ListWorkspacesResponse.ts +++ b/src/api/types/ListWorkspacesResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ListWorkspacesResponse { /** List of workspaces matching the query criteria. */ diff --git a/src/api/types/LlmClassificationStrategy.ts b/src/api/types/LlmClassificationStrategy.ts new file mode 100644 index 00000000..77099c39 --- /dev/null +++ b/src/api/types/LlmClassificationStrategy.ts @@ -0,0 +1,17 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +/** + * Classify each request by calling a fast chat model. On timeout or error the gateway applies the configured fallback strategy. + */ +export interface LlmClassificationStrategy { + /** Strategy */ + type: "llm-classifier"; + /** Catalog model FQN used to classify request complexity. Must be resolvable by this tenant, must be a catalog model (not a virtual model), and must be a chat model. */ + model: string; + /** Maximum time to wait for the classifier response in milliseconds before applying the fallback strategy. */ + timeoutMs?: number; + /** Fallback strategy applied when the classifier fails. Defaults to the heuristic classifier. */ + fallbackStrategy?: TrueFoundry.LlmClassificationStrategyFallbackStrategy; +} diff --git a/src/api/types/LlmClassificationStrategyFallbackStrategy.ts b/src/api/types/LlmClassificationStrategyFallbackStrategy.ts new file mode 100644 index 00000000..311674b1 --- /dev/null +++ b/src/api/types/LlmClassificationStrategyFallbackStrategy.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +/** + * Fallback strategy applied when the classifier fails. Defaults to the heuristic classifier. + */ +export type LlmClassificationStrategyFallbackStrategy = + | TrueFoundry.HeuristicFallbackStrategy + | TrueFoundry.StaticFallbackStrategy; diff --git a/src/api/types/LoadBalanceTarget.ts b/src/api/types/LoadBalanceTarget.ts index f9d5f23e..b1ce58be 100644 --- a/src/api/types/LoadBalanceTarget.ts +++ b/src/api/types/LoadBalanceTarget.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Weight-based Target diff --git a/src/api/types/LoadBalancingConfig.ts b/src/api/types/LoadBalancingConfig.ts index c7e0bb46..1074e626 100644 --- a/src/api/types/LoadBalancingConfig.ts +++ b/src/api/types/LoadBalancingConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Load Balancing Configuration diff --git a/src/api/types/LoadBalancingRule.ts b/src/api/types/LoadBalancingRule.ts index ffa8fb4c..656eb727 100644 --- a/src/api/types/LoadBalancingRule.ts +++ b/src/api/types/LoadBalancingRule.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +discriminator=type */ -export type LoadBalancingRule = +export type LoadBalancingRule = | TrueFoundry.WeightBasedLoadBalancingRule | TrueFoundry.LatencyBasedLoadBalancingRule | TrueFoundry.PriorityBasedLoadBalancingRule; diff --git a/src/api/types/LocalArtifactSource.ts b/src/api/types/LocalArtifactSource.ts index 20d1496d..60ad5a64 100644 --- a/src/api/types/LocalArtifactSource.ts +++ b/src/api/types/LocalArtifactSource.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface LocalArtifactSource { /** Type of the source */ diff --git a/src/api/types/Log.ts b/src/api/types/Log.ts index ac6705d6..6f7f38de 100644 --- a/src/api/types/Log.ts +++ b/src/api/types/Log.ts @@ -2,7 +2,7 @@ export interface Log { /** Name of the job. */ - jobName?: string; + jobName?: string | null; /** Log line content. */ log: string; /** Log stream name. */ @@ -10,5 +10,5 @@ export interface Log { /** Log timestamp in nanoseconds from the Unix epoch. */ time: string; /** Name of the container that emitted the log. */ - containerName?: string; + containerName?: string | null; } diff --git a/src/api/types/LoggingMode.ts b/src/api/types/LoggingMode.ts index dfb7b8e7..6d29a890 100644 --- a/src/api/types/LoggingMode.ts +++ b/src/api/types/LoggingMode.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Logging Mode */ -export type LoggingMode = +export type LoggingMode = | TrueFoundry.LoggingModeAlways | TrueFoundry.LoggingModeNever | TrueFoundry.LoggingModeHeaderControlled; diff --git a/src/api/types/LoggingWhen.ts b/src/api/types/LoggingWhen.ts new file mode 100644 index 00000000..6f6e2f2a --- /dev/null +++ b/src/api/types/LoggingWhen.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +/** + * Conditions + */ +export interface LoggingWhen { + subjects?: TrueFoundry.InNotIn; + models?: TrueFoundry.InNotIn; + /** Metadata key-value pairs this config applies to (exact match) */ + metadata?: Record; +} diff --git a/src/api/types/LogsResponse.ts b/src/api/types/LogsResponse.ts index a0051692..da95030a 100644 --- a/src/api/types/LogsResponse.ts +++ b/src/api/types/LogsResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface LogsResponse { /** List of logs */ diff --git a/src/api/types/LogsSearchFilterType.ts b/src/api/types/LogsSearchFilterType.ts index 5646e078..65347162 100644 --- a/src/api/types/LogsSearchFilterType.ts +++ b/src/api/types/LogsSearchFilterType.ts @@ -2,8 +2,8 @@ /** Query filter type for logs search */ export const LogsSearchFilterType = { - Regex: "regex", - Substring: "substring", - IgnoreCaseSubstring: "ignore_case_substring" - } as const; -export type LogsSearchFilterType = typeof LogsSearchFilterType[keyof typeof LogsSearchFilterType]; + Regex: "regex", + Substring: "substring", + IgnoreCaseSubstring: "ignore_case_substring", +} as const; +export type LogsSearchFilterType = (typeof LogsSearchFilterType)[keyof typeof LogsSearchFilterType]; diff --git a/src/api/types/LogsSearchOperatorType.ts b/src/api/types/LogsSearchOperatorType.ts index 6a727d88..2f6f627b 100644 --- a/src/api/types/LogsSearchOperatorType.ts +++ b/src/api/types/LogsSearchOperatorType.ts @@ -2,7 +2,7 @@ /** Comparison operator logs search */ export const LogsSearchOperatorType = { - Equal: "equal", - NotEqual: "not_equal" - } as const; -export type LogsSearchOperatorType = typeof LogsSearchOperatorType[keyof typeof LogsSearchOperatorType]; + Equal: "equal", + NotEqual: "not_equal", +} as const; +export type LogsSearchOperatorType = (typeof LogsSearchOperatorType)[keyof typeof LogsSearchOperatorType]; diff --git a/src/api/types/LogsSortingDirection.ts b/src/api/types/LogsSortingDirection.ts index 46c33b47..8fc712da 100644 --- a/src/api/types/LogsSortingDirection.ts +++ b/src/api/types/LogsSortingDirection.ts @@ -1,7 +1,7 @@ // This file was auto-generated by Fern from our API Definition. export const LogsSortingDirection = { - Asc: "asc", - Desc: "desc" - } as const; -export type LogsSortingDirection = typeof LogsSortingDirection[keyof typeof LogsSortingDirection]; + Asc: "asc", + Desc: "desc", +} as const; +export type LogsSortingDirection = (typeof LogsSortingDirection)[keyof typeof LogsSortingDirection]; diff --git a/src/api/types/McpServer.ts b/src/api/types/McpServer.ts new file mode 100644 index 00000000..455f8458 --- /dev/null +++ b/src/api/types/McpServer.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +export interface McpServer { + id?: string | null; + fqn: string; + manifest: Record; + createdBySubject: TrueFoundry.Subject; + accountId: string; + tools?: Record[] | null; + specEndpoints?: Record[] | null; + createdAt?: Date | null; + updatedAt?: Date | null; + /** Proxy URL for accessing the MCP server */ + proxyUrl?: string | null; + /** Authentication status for the MCP server */ + authStatus?: TrueFoundry.McpServerAuthStatusInfo | null; + isAuthOverrideSupported?: boolean | null; +} diff --git a/src/api/types/McpServerAuth.ts b/src/api/types/McpServerAuth.ts index 45814d45..3aaadd04 100644 --- a/src/api/types/McpServerAuth.ts +++ b/src/api/types/McpServerAuth.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; -export type McpServerAuth = +export type McpServerAuth = | TrueFoundry.McpServerHeaderAuth | TrueFoundry.McpServerOAuth2 | TrueFoundry.McpServerPassthrough; diff --git a/src/api/types/McpServerAuthStatusInfo.ts b/src/api/types/McpServerAuthStatusInfo.ts new file mode 100644 index 00000000..948b1977 --- /dev/null +++ b/src/api/types/McpServerAuthStatusInfo.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +export interface McpServerAuthStatusInfo { + /** Whether the user is authenticated or unauthenticated for this MCP server */ + status: TrueFoundry.McpServerAuthStatusInfoStatus; + /** Authentication method used (e.g. OAuth, auth-override) */ + method?: TrueFoundry.McpServerAuthStatusInfoMethod | null; + /** Human-readable message providing additional context about the authentication status */ + message?: string | null; +} diff --git a/src/api/types/McpServerAuthStatusInfoMethod.ts b/src/api/types/McpServerAuthStatusInfoMethod.ts new file mode 100644 index 00000000..c44a3bb6 --- /dev/null +++ b/src/api/types/McpServerAuthStatusInfoMethod.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +/** Authentication method used (e.g. OAuth, auth-override) */ +export const McpServerAuthStatusInfoMethod = { + Oauth: "oauth", + AuthOverride: "auth-override", +} as const; +export type McpServerAuthStatusInfoMethod = + (typeof McpServerAuthStatusInfoMethod)[keyof typeof McpServerAuthStatusInfoMethod]; diff --git a/src/api/types/McpServerAuthStatusInfoStatus.ts b/src/api/types/McpServerAuthStatusInfoStatus.ts new file mode 100644 index 00000000..2dc4da6f --- /dev/null +++ b/src/api/types/McpServerAuthStatusInfoStatus.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +/** Whether the user is authenticated or unauthenticated for this MCP server */ +export const McpServerAuthStatusInfoStatus = { + Authenticated: "authenticated", + Unauthenticated: "unauthenticated", +} as const; +export type McpServerAuthStatusInfoStatus = + (typeof McpServerAuthStatusInfoStatus)[keyof typeof McpServerAuthStatusInfoStatus]; diff --git a/src/api/types/McpServerEnvAuth.ts b/src/api/types/McpServerEnvAuth.ts index 5597bc30..977e232d 100644 --- a/src/api/types/McpServerEnvAuth.ts +++ b/src/api/types/McpServerEnvAuth.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Environment variable authentication for stdio MCP. For individual credentials, use a single {{placeholder}} name in values (same rules as header auth). diff --git a/src/api/types/McpServerEnvAuthAuthLevel.ts b/src/api/types/McpServerEnvAuthAuthLevel.ts index 938d02c7..177c1227 100644 --- a/src/api/types/McpServerEnvAuthAuthLevel.ts +++ b/src/api/types/McpServerEnvAuthAuthLevel.ts @@ -2,7 +2,7 @@ /** Level at which this authentication will be applied. Values: global (default), per_user */ export const McpServerEnvAuthAuthLevel = { - Global: "global", - PerUser: "per_user" - } as const; -export type McpServerEnvAuthAuthLevel = typeof McpServerEnvAuthAuthLevel[keyof typeof McpServerEnvAuthAuthLevel]; + Global: "global", + PerUser: "per_user", +} as const; +export type McpServerEnvAuthAuthLevel = (typeof McpServerEnvAuthAuthLevel)[keyof typeof McpServerEnvAuthAuthLevel]; diff --git a/src/api/types/McpServerHeaderAuth.ts b/src/api/types/McpServerHeaderAuth.ts index f14c62f1..6bc4c02f 100644 --- a/src/api/types/McpServerHeaderAuth.ts +++ b/src/api/types/McpServerHeaderAuth.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Authenticate using a static key or token sent as a request header. Choose shared vs individual credentials below. diff --git a/src/api/types/McpServerHeaderAuthAuthLevel.ts b/src/api/types/McpServerHeaderAuthAuthLevel.ts index fd980388..d8d20580 100644 --- a/src/api/types/McpServerHeaderAuthAuthLevel.ts +++ b/src/api/types/McpServerHeaderAuthAuthLevel.ts @@ -2,7 +2,8 @@ /** Level at which this authentication will be applied. Values: global (default), per_user */ export const McpServerHeaderAuthAuthLevel = { - Global: "global", - PerUser: "per_user" - } as const; -export type McpServerHeaderAuthAuthLevel = typeof McpServerHeaderAuthAuthLevel[keyof typeof McpServerHeaderAuthAuthLevel]; + Global: "global", + PerUser: "per_user", +} as const; +export type McpServerHeaderAuthAuthLevel = + (typeof McpServerHeaderAuthAuthLevel)[keyof typeof McpServerHeaderAuthAuthLevel]; diff --git a/src/api/types/McpServerIntegration.ts b/src/api/types/McpServerIntegration.ts index 491a091e..298bd7d8 100644 --- a/src/api/types/McpServerIntegration.ts +++ b/src/api/types/McpServerIntegration.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * MCP Server diff --git a/src/api/types/McpServerIntegrationTransport.ts b/src/api/types/McpServerIntegrationTransport.ts index 992dd8c5..ad13d27f 100644 --- a/src/api/types/McpServerIntegrationTransport.ts +++ b/src/api/types/McpServerIntegrationTransport.ts @@ -2,7 +2,8 @@ /** The transport protocol to use for communication with the MCP Server. */ export const McpServerIntegrationTransport = { - StreamableHttp: "streamable-http", - Sse: "sse" - } as const; -export type McpServerIntegrationTransport = typeof McpServerIntegrationTransport[keyof typeof McpServerIntegrationTransport]; + StreamableHttp: "streamable-http", + Sse: "sse", +} as const; +export type McpServerIntegrationTransport = + (typeof McpServerIntegrationTransport)[keyof typeof McpServerIntegrationTransport]; diff --git a/src/api/types/McpServerIntegrations.ts b/src/api/types/McpServerIntegrations.ts index 4919188c..931d3908 100644 --- a/src/api/types/McpServerIntegrations.ts +++ b/src/api/types/McpServerIntegrations.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +discriminator=type */ -export type McpServerIntegrations = - | TrueFoundry.McpServerIntegration - | TrueFoundry.VirtualMcpServerIntegration; +export type McpServerIntegrations = TrueFoundry.McpServerIntegration | TrueFoundry.VirtualMcpServerIntegration; diff --git a/src/api/types/McpServerManifest.ts b/src/api/types/McpServerManifest.ts index 4871005c..c3ee113e 100644 --- a/src/api/types/McpServerManifest.ts +++ b/src/api/types/McpServerManifest.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; -export type McpServerManifest = +export type McpServerManifest = | TrueFoundry.RemoteMcpServerManifest | TrueFoundry.VirtualMcpServerManifest | TrueFoundry.OpenApimcpServerManifest diff --git a/src/api/types/McpServerOAuth2.ts b/src/api/types/McpServerOAuth2.ts index 0bee084f..9bcdca7e 100644 --- a/src/api/types/McpServerOAuth2.ts +++ b/src/api/types/McpServerOAuth2.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * OAuth2 */ -export interface McpServerOAuth2 extends TrueFoundry.McpServerOAuth2ProviderAuth0Settings { +export interface McpServerOAuth2 + extends TrueFoundry.McpServerOAuth2ProviderAuth0Settings, + TrueFoundry.McpServerOAuth2ProviderOktaSettings, + TrueFoundry.McpServerOAuth2ProviderOktaIdJagSettings { /** OAuth2 authentication */ type: "oauth2"; /** The OAuth2 grant type to use for authentication. */ @@ -13,7 +16,7 @@ export interface McpServerOAuth2 extends TrueFoundry.McpServerOAuth2ProviderAuth /** URL for the authorization request */ authorizationUrl?: string; /** The endpoint to exchange auth code for tokens. */ - tokenUrl: string; + tokenUrl?: string; /** client ID for OAuth2 or the TrueFoundry secret FQN containing the client ID. */ clientId?: string; /** Client secret or the TrueFoundry secret FQN containing the client secret for OAuth2. */ @@ -22,14 +25,16 @@ export interface McpServerOAuth2 extends TrueFoundry.McpServerOAuth2ProviderAuth registrationUrl?: string; /** URL to fetch token expiry (RFC 7662) when the provider does not return expires_in (e.g. Salesforce). Requires client_id and client_secret. */ introspectionUrl?: string; + /** When enabled, the MCP server URL is sent as the resource parameter (RFC 8707) on both authorization and token endpoint requests. */ + includeResource?: boolean; /** Select the OAuth provider. Provider-specific configuration (e.g. Auth0 organization) is unlocked based on this value. */ provider: TrueFoundry.McpServerOAuth2Provider; /** List of supported PKCE code challenge methods (S256 only) */ codeChallengeMethodsSupported?: "S256"[]; /** Source of the JWT token to be used for verification. */ - jwtSource: TrueFoundry.McpServerOAuth2JwtSource; + jwtSource?: TrueFoundry.McpServerOAuth2JwtSource; /** List of scopes to request from the OAuth2 provider. */ scopes?: string[]; - /** Extra key/value pairs sent on every token endpoint request (e.g. Auth0 'audience'). */ + /** Extra key/value pairs sent on every token endpoint request (e.g. Auth0 'organization'). */ additionalTokenParams?: Record; } diff --git a/src/api/types/McpServerOAuth2GrantType.ts b/src/api/types/McpServerOAuth2GrantType.ts index fb3f6f53..bcb99439 100644 --- a/src/api/types/McpServerOAuth2GrantType.ts +++ b/src/api/types/McpServerOAuth2GrantType.ts @@ -2,7 +2,9 @@ /** The OAuth2 grant type to use for authentication. */ export const McpServerOAuth2GrantType = { - AuthorizationCode: "authorization_code", - ClientCredentials: "client_credentials" - } as const; -export type McpServerOAuth2GrantType = typeof McpServerOAuth2GrantType[keyof typeof McpServerOAuth2GrantType]; + AuthorizationCode: "authorization_code", + ClientCredentials: "client_credentials", + TokenExchange: "token_exchange", + IdJag: "id_jag", +} as const; +export type McpServerOAuth2GrantType = (typeof McpServerOAuth2GrantType)[keyof typeof McpServerOAuth2GrantType]; diff --git a/src/api/types/McpServerOAuth2JwtSource.ts b/src/api/types/McpServerOAuth2JwtSource.ts index 635db489..d5331fb5 100644 --- a/src/api/types/McpServerOAuth2JwtSource.ts +++ b/src/api/types/McpServerOAuth2JwtSource.ts @@ -2,7 +2,7 @@ /** Source of the JWT token to be used for verification. */ export const McpServerOAuth2JwtSource = { - AccessToken: "access_token", - IdToken: "id_token" - } as const; -export type McpServerOAuth2JwtSource = typeof McpServerOAuth2JwtSource[keyof typeof McpServerOAuth2JwtSource]; + AccessToken: "access_token", + IdToken: "id_token", +} as const; +export type McpServerOAuth2JwtSource = (typeof McpServerOAuth2JwtSource)[keyof typeof McpServerOAuth2JwtSource]; diff --git a/src/api/types/McpServerOAuth2Provider.ts b/src/api/types/McpServerOAuth2Provider.ts index 7351c97e..d6d97239 100644 --- a/src/api/types/McpServerOAuth2Provider.ts +++ b/src/api/types/McpServerOAuth2Provider.ts @@ -2,8 +2,8 @@ /** Select the OAuth provider. Provider-specific configuration (e.g. Auth0 organization) is unlocked based on this value. */ export const McpServerOAuth2Provider = { - Custom: "custom", - Auth0: "auth0", - Okta: "okta" - } as const; -export type McpServerOAuth2Provider = typeof McpServerOAuth2Provider[keyof typeof McpServerOAuth2Provider]; + Custom: "custom", + Auth0: "auth0", + Okta: "okta", +} as const; +export type McpServerOAuth2Provider = (typeof McpServerOAuth2Provider)[keyof typeof McpServerOAuth2Provider]; diff --git a/src/api/types/McpServerOAuth2ProviderOktaIdJagSettings.ts b/src/api/types/McpServerOAuth2ProviderOktaIdJagSettings.ts new file mode 100644 index 00000000..e3cd69ad --- /dev/null +++ b/src/api/types/McpServerOAuth2ProviderOktaIdJagSettings.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface McpServerOAuth2ProviderOktaIdJagSettings { + /** Issuer URI of the authorization server the ID-JAG token is issued for. Sent as the 'audience' parameter on the ID-JAG token exchange. */ + issuerUri?: string; +} diff --git a/src/api/types/McpServerOAuth2ProviderOktaSettings.ts b/src/api/types/McpServerOAuth2ProviderOktaSettings.ts new file mode 100644 index 00000000..3aedbd60 --- /dev/null +++ b/src/api/types/McpServerOAuth2ProviderOktaSettings.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface McpServerOAuth2ProviderOktaSettings { + /** Okta target audience (RFC 8693 'audience'). Required when the token_exchange grant type is used with the okta provider. */ + audience?: string; +} diff --git a/src/api/types/McpServerProviderAccount.ts b/src/api/types/McpServerProviderAccount.ts index f78a76de..4b4b4f59 100644 --- a/src/api/types/McpServerProviderAccount.ts +++ b/src/api/types/McpServerProviderAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * MCP Server Group diff --git a/src/api/types/McpServerSource.ts b/src/api/types/McpServerSource.ts index c16913c1..3bf9225f 100644 --- a/src/api/types/McpServerSource.ts +++ b/src/api/types/McpServerSource.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * MCP Server Source diff --git a/src/api/types/McpServerWithFqn.ts b/src/api/types/McpServerWithFqn.ts index d6531f42..36772946 100644 --- a/src/api/types/McpServerWithFqn.ts +++ b/src/api/types/McpServerWithFqn.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * MCP server with FQN diff --git a/src/api/types/McpServerWithUrl.ts b/src/api/types/McpServerWithUrl.ts index 8449381f..3fc628ea 100644 --- a/src/api/types/McpServerWithUrl.ts +++ b/src/api/types/McpServerWithUrl.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * MCP server with URL diff --git a/src/api/types/McpToolSetting.ts b/src/api/types/McpToolSetting.ts index a0bfc4cd..bdb946e1 100644 --- a/src/api/types/McpToolSetting.ts +++ b/src/api/types/McpToolSetting.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * MCP Tool Setting diff --git a/src/api/types/McpToolsOperator.ts b/src/api/types/McpToolsOperator.ts index 9e5533f8..d55c44f9 100644 --- a/src/api/types/McpToolsOperator.ts +++ b/src/api/types/McpToolsOperator.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface McpToolsOperator { condition: TrueFoundry.McpToolsOperatorCondition; diff --git a/src/api/types/McpToolsOperatorCondition.ts b/src/api/types/McpToolsOperatorCondition.ts index f3216a40..94d7e7c3 100644 --- a/src/api/types/McpToolsOperatorCondition.ts +++ b/src/api/types/McpToolsOperatorCondition.ts @@ -1,7 +1,7 @@ // This file was auto-generated by Fern from our API Definition. export const McpToolsOperatorCondition = { - In: "in", - NotIn: "not_in" - } as const; -export type McpToolsOperatorCondition = typeof McpToolsOperatorCondition[keyof typeof McpToolsOperatorCondition]; + In: "in", + NotIn: "not_in", +} as const; +export type McpToolsOperatorCondition = (typeof McpToolsOperatorCondition)[keyof typeof McpToolsOperatorCondition]; diff --git a/src/api/types/Metadata.ts b/src/api/types/Metadata.ts index 5e7a8630..29600e15 100644 --- a/src/api/types/Metadata.ts +++ b/src/api/types/Metadata.ts @@ -2,5 +2,5 @@ export interface Metadata { /** Job Run Name Alias */ - jobRunNameAlias?: string; + jobRunNameAlias?: string | null; } diff --git a/src/api/types/Metric.ts b/src/api/types/Metric.ts index c42d8b78..b6ea87eb 100644 --- a/src/api/types/Metric.ts +++ b/src/api/types/Metric.ts @@ -4,9 +4,9 @@ export interface Metric { /** Name of the metric. */ key: string; /** Numeric value of the metric. */ - value?: number; + value?: number | null; /** Unix timestamp in milliseconds when the metric was logged. */ - timestamp?: number; + timestamp?: number | null; /** Training step at which the metric was logged. */ - step?: number; + step?: number | null; } diff --git a/src/api/types/MetricCollection.ts b/src/api/types/MetricCollection.ts index bcb07cf2..743f859f 100644 --- a/src/api/types/MetricCollection.ts +++ b/src/api/types/MetricCollection.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface MetricCollection { /** Name of the metric. */ diff --git a/src/api/types/MimeType.ts b/src/api/types/MimeType.ts index 9aef7223..dc49026e 100644 --- a/src/api/types/MimeType.ts +++ b/src/api/types/MimeType.ts @@ -2,10 +2,10 @@ /** MIME type of the content */ export const MimeType = { - TextPlain: "text/plain", - ApplicationJson: "application/json", - ImagePng: "image/png", - ImageJpeg: "image/jpeg", - ApplicationXDirectory: "application/x-directory" - } as const; -export type MimeType = typeof MimeType[keyof typeof MimeType]; + TextPlain: "text/plain", + ApplicationJson: "application/json", + ImagePng: "image/png", + ImageJpeg: "image/jpeg", + ApplicationXDirectory: "application/x-directory", +} as const; +export type MimeType = (typeof MimeType)[keyof typeof MimeType]; diff --git a/src/api/types/MistralAiIntegrations.ts b/src/api/types/MistralAiIntegrations.ts index 9f59f7dd..863ef53c 100644 --- a/src/api/types/MistralAiIntegrations.ts +++ b/src/api/types/MistralAiIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type MistralAiIntegrations = TrueFoundry.MistralAiModel; diff --git a/src/api/types/MistralAiModel.ts b/src/api/types/MistralAiModel.ts index 44ad74b8..16ffb069 100644 --- a/src/api/types/MistralAiModel.ts +++ b/src/api/types/MistralAiModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Mistral AI Model diff --git a/src/api/types/MistralAiProviderAccount.ts b/src/api/types/MistralAiProviderAccount.ts index 8da6639b..3ae40077 100644 --- a/src/api/types/MistralAiProviderAccount.ts +++ b/src/api/types/MistralAiProviderAccount.ts @@ -1,21 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** - * Mistral AI Provider Account + * Mistral AI Model Account */ export interface MistralAiProviderAccount { /** +value=provider-account/mistral-ai */ type: "provider-account/mistral-ai"; - /** The name of the Mistral AI provider account */ + /** The name of the Mistral AI model account */ name: string; authData: TrueFoundry.MistralAiKeyAuth; - /** List of integrations that are associated with the Mistral AI provider account */ + /** List of integrations that are associated with the Mistral AI model account */ integrations: TrueFoundry.MistralAiIntegrations[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/MlRepo.ts b/src/api/types/MlRepo.ts index 5b9d4e50..cccf4c96 100644 --- a/src/api/types/MlRepo.ts +++ b/src/api/types/MlRepo.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface MlRepo { /** Tenant Name */ @@ -13,10 +13,10 @@ export interface MlRepo { /** Experiment Id */ id: string; /** Number of runs */ - numRuns?: number; - artifactTypeCounts?: Record; + numRuns?: number | null; + artifactTypeCounts?: Record | null; /** Number of datasets */ - datasetsCount?: number; + datasetsCount?: number | null; /** Total number of tracing projects in this ML Repo */ - tracingProjectsCount?: number; + tracingProjectsCount?: number | null; } diff --git a/src/api/types/MlRepoManifest.ts b/src/api/types/MlRepoManifest.ts index 8c2e8893..07e9f19a 100644 --- a/src/api/types/MlRepoManifest.ts +++ b/src/api/types/MlRepoManifest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * MLRepo is a repository ML training runs that log params, metrics, plots, images and versioned entities like artifacts, models, prompts, tools, agents diff --git a/src/api/types/Model.ts b/src/api/types/Model.ts index 09ffa94f..1cdfc44d 100644 --- a/src/api/types/Model.ts +++ b/src/api/types/Model.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface Model { /** Unique identifier of the model. */ @@ -16,11 +16,11 @@ export interface Model { /** Subject (user, team, or service account) that created the model. */ createdBySubject: TrueFoundry.Subject; /** Timestamp when the model was created. */ - createdAt?: Date; + createdAt?: Date | null; /** Timestamp when the model was last updated. */ - updatedAt?: Date; + updatedAt?: Date | null; /** Most recently created version of the model, if any exist. */ - latestVersion?: TrueFoundry.ModelVersion; + latestVersion?: TrueFoundry.ModelVersion | null; /** Run steps associated with the model. */ - runSteps?: number[]; + runSteps?: number[] | null; } diff --git a/src/api/types/ModelConfiguration.ts b/src/api/types/ModelConfiguration.ts index e9cd52c7..e85a0f4b 100644 --- a/src/api/types/ModelConfiguration.ts +++ b/src/api/types/ModelConfiguration.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Add a model from Gateway along with parameters to be used for chat completion diff --git a/src/api/types/ModelCostMetric.ts b/src/api/types/ModelCostMetric.ts index 92147642..a84c0895 100644 --- a/src/api/types/ModelCostMetric.ts +++ b/src/api/types/ModelCostMetric.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; -export type ModelCostMetric = +export type ModelCostMetric = | TrueFoundry.PerThousandTokensCostMetric | TrueFoundry.PerThousandEmbeddingTokensCostMetric | TrueFoundry.PerMillionCharactersCostMetric diff --git a/src/api/types/ModelManifest.ts b/src/api/types/ModelManifest.ts index 98c4ee5c..39b48a5a 100644 --- a/src/api/types/ModelManifest.ts +++ b/src/api/types/ModelManifest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Log a new Model Version containing model files and folders with metadata @@ -9,7 +9,7 @@ export interface ModelManifest extends TrueFoundry.BaseArtifactVersion { /** Model Version */ type: "model-version"; /** Description */ - description?: string; + description?: string | null; /** Version alias is alternate, ideally human readable, version string to reference an artifact version. It should start with `v` followed by alphanumeric and it can include `.` and `-` in between (e.g. `v1.0.0`, `v1-prod`, `v3-dev`, etc) */ versionAlias?: string; /** Model Source */ diff --git a/src/api/types/ModelManifestFramework.ts b/src/api/types/ModelManifestFramework.ts index 07fcbb9b..64a2921d 100644 --- a/src/api/types/ModelManifestFramework.ts +++ b/src/api/types/ModelManifestFramework.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Framework for the model version like Transformers, PyTorch, Sklearn, Xgboost etc with framework specific metadata. This will be used to infer model deployment configuration */ -export type ModelManifestFramework = +export type ModelManifestFramework = | TrueFoundry.TransformersFramework | TrueFoundry.TensorFlowFramework | TrueFoundry.SklearnFramework diff --git a/src/api/types/ModelManifestSource.ts b/src/api/types/ModelManifestSource.ts index f28686b8..554e1a2c 100644 --- a/src/api/types/ModelManifestSource.ts +++ b/src/api/types/ModelManifestSource.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Model Source */ -export type ModelManifestSource = +export type ModelManifestSource = | TrueFoundry.TrueFoundryManagedSource | TrueFoundry.ExternalBlobStorageSource | TrueFoundry.LocalModelSource; diff --git a/src/api/types/ModelProviderAccount.ts b/src/api/types/ModelProviderAccount.ts index 42b86aa9..ee094fbf 100644 --- a/src/api/types/ModelProviderAccount.ts +++ b/src/api/types/ModelProviderAccount.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; -export type ModelProviderAccount = +export type ModelProviderAccount = | TrueFoundry.AwsBedrockProviderAccount | TrueFoundry.GoogleVertexProviderAccount | TrueFoundry.GoogleGeminiProviderAccount diff --git a/src/api/types/ModelType.ts b/src/api/types/ModelType.ts index de7f659e..403e7fa7 100644 --- a/src/api/types/ModelType.ts +++ b/src/api/types/ModelType.ts @@ -2,17 +2,17 @@ /** Model Type */ export const ModelType = { - Chat: "chat", - Completion: "completion", - Embedding: "embedding", - Realtime: "realtime", - Rerank: "rerank", - AudioTranscription: "audio_transcription", - AudioTranslation: "audio_translation", - TextToSpeech: "text_to_speech", - Moderation: "moderation", - Image: "image", - Responses: "responses", - Ocr: "ocr" - } as const; -export type ModelType = typeof ModelType[keyof typeof ModelType]; + Chat: "chat", + Completion: "completion", + Embedding: "embedding", + Realtime: "realtime", + Rerank: "rerank", + AudioTranscription: "audio_transcription", + AudioTranslation: "audio_translation", + TextToSpeech: "text_to_speech", + Moderation: "moderation", + Image: "image", + Responses: "responses", + Ocr: "ocr", +} as const; +export type ModelType = (typeof ModelType)[keyof typeof ModelType]; diff --git a/src/api/types/ModelVersion.ts b/src/api/types/ModelVersion.ts index 086b95e6..ebd9d57f 100644 --- a/src/api/types/ModelVersion.ts +++ b/src/api/types/ModelVersion.ts @@ -1,12 +1,12 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ModelVersion { /** Timestamp when the model version was created. */ - createdAt?: Date; + createdAt?: Date | null; /** Timestamp when the model version was last updated. */ - updatedAt?: Date; + updatedAt?: Date | null; /** Manifest describing the model version. */ manifest: TrueFoundry.ModelManifest; /** Unique identifier of the model version. */ @@ -18,13 +18,13 @@ export interface ModelVersion { /** Identifier of the ML Repo the model version belongs to. */ mlRepoId: string; /** Code snippet showing how to use the model version. */ - usageCodeSnippet?: string; + usageCodeSnippet?: string | null; /** Tags associated with the model version. */ tags?: string[]; /** Identifier of the model this version belongs to. */ modelId: string; /** Metrics logged for the model version. */ - metrics?: TrueFoundry.Metric[]; + metrics?: TrueFoundry.Metric[] | null; /** Whether the model version can be deployed. */ - deployable?: boolean; + deployable?: boolean | null; } diff --git a/src/api/types/MsTeamsIntegrations.ts b/src/api/types/MsTeamsIntegrations.ts index 6a5f62ff..51429a4a 100644 --- a/src/api/types/MsTeamsIntegrations.ts +++ b/src/api/types/MsTeamsIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type MsTeamsIntegrations = TrueFoundry.MsTeamsWebhookIntegration; diff --git a/src/api/types/MsTeamsProviderAccount.ts b/src/api/types/MsTeamsProviderAccount.ts index ed379730..c5967a83 100644 --- a/src/api/types/MsTeamsProviderAccount.ts +++ b/src/api/types/MsTeamsProviderAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * MS Teams Provider Account diff --git a/src/api/types/MsTeamsWebhookIntegration.ts b/src/api/types/MsTeamsWebhookIntegration.ts index bd137e17..7898c654 100644 --- a/src/api/types/MsTeamsWebhookIntegration.ts +++ b/src/api/types/MsTeamsWebhookIntegration.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * MS Teams Webhook Integration diff --git a/src/api/types/MultiPartUpload.ts b/src/api/types/MultiPartUpload.ts index 394cc7f1..f9990436 100644 --- a/src/api/types/MultiPartUpload.ts +++ b/src/api/types/MultiPartUpload.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface MultiPartUpload { /** Storage provider backing the multipart upload. */ @@ -10,7 +10,7 @@ export interface MultiPartUpload { /** Signed URL used to finalize the multipart upload. */ finalizeSignedUrl: TrueFoundry.SignedUrl; /** Upload identifier for S3-compatible storage providers. */ - s3CompatibleUploadId?: string; + s3CompatibleUploadId?: string | null; /** Block identifiers used for Azure Blob storage uploads. */ - azureBlobBlockIds?: string[]; + azureBlobBlockIds?: string[] | null; } diff --git a/src/api/types/MultiPartUploadResponse.ts b/src/api/types/MultiPartUploadResponse.ts index c86bd00e..14026955 100644 --- a/src/api/types/MultiPartUploadResponse.ts +++ b/src/api/types/MultiPartUploadResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface MultiPartUploadResponse { /** Details of the created multipart upload. */ diff --git a/src/api/types/MultiPartUploadStorageProvider.ts b/src/api/types/MultiPartUploadStorageProvider.ts index 2c8ac691..8d856a7e 100644 --- a/src/api/types/MultiPartUploadStorageProvider.ts +++ b/src/api/types/MultiPartUploadStorageProvider.ts @@ -2,7 +2,8 @@ /** Storage provider backing the multipart upload. */ export const MultiPartUploadStorageProvider = { - S3Compatible: "S3_COMPATIBLE", - AzureBlob: "AZURE_BLOB" - } as const; -export type MultiPartUploadStorageProvider = typeof MultiPartUploadStorageProvider[keyof typeof MultiPartUploadStorageProvider]; + S3Compatible: "S3_COMPATIBLE", + AzureBlob: "AZURE_BLOB", +} as const; +export type MultiPartUploadStorageProvider = + (typeof MultiPartUploadStorageProvider)[keyof typeof MultiPartUploadStorageProvider]; diff --git a/src/api/types/NativeSnowflakeFlyteTaskTemplate.ts b/src/api/types/NativeSnowflakeFlyteTaskTemplate.ts index 61283f97..fe1490f5 100644 --- a/src/api/types/NativeSnowflakeFlyteTaskTemplate.ts +++ b/src/api/types/NativeSnowflakeFlyteTaskTemplate.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface NativeSnowflakeFlyteTaskTemplate { id: TrueFoundry.FlyteTaskId; diff --git a/src/api/types/NatsInputConfig.ts b/src/api/types/NatsInputConfig.ts index b60a33fd..72daeae6 100644 --- a/src/api/types/NatsInputConfig.ts +++ b/src/api/types/NatsInputConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Describes the configuration for the input NATS worker diff --git a/src/api/types/NatsOutputConfig.ts b/src/api/types/NatsOutputConfig.ts index b1e9310f..f467dfbb 100644 --- a/src/api/types/NatsOutputConfig.ts +++ b/src/api/types/NatsOutputConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Describes the configuration for the output NATS worker diff --git a/src/api/types/NodeSelector.ts b/src/api/types/NodeSelector.ts index 051d0eab..4d8ac30c 100644 --- a/src/api/types/NodeSelector.ts +++ b/src/api/types/NodeSelector.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Constraints to select a Node - Specific GPU / Instance Families, On-Demand/Spot. diff --git a/src/api/types/NodeSelectorCapacityType.ts b/src/api/types/NodeSelectorCapacityType.ts index 1eff0d07..404c80c6 100644 --- a/src/api/types/NodeSelectorCapacityType.ts +++ b/src/api/types/NodeSelectorCapacityType.ts @@ -7,8 +7,8 @@ * "on_demand" will strictly place the application on on-demand nodes. */ export const NodeSelectorCapacityType = { - SpotFallbackOnDemand: "spot_fallback_on_demand", - Spot: "spot", - OnDemand: "on_demand" - } as const; -export type NodeSelectorCapacityType = typeof NodeSelectorCapacityType[keyof typeof NodeSelectorCapacityType]; + SpotFallbackOnDemand: "spot_fallback_on_demand", + Spot: "spot", + OnDemand: "on_demand", +} as const; +export type NodeSelectorCapacityType = (typeof NodeSelectorCapacityType)[keyof typeof NodeSelectorCapacityType]; diff --git a/src/api/types/NomaSecurityApiKeyAuth.ts b/src/api/types/NomaSecurityApiKeyAuth.ts new file mode 100644 index 00000000..08a0bc9f --- /dev/null +++ b/src/api/types/NomaSecurityApiKeyAuth.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Noma Security API Key Auth + */ +export interface NomaSecurityApiKeyAuth { + /** +value=api-key */ + type: "api-key"; + /** Noma scoped access token with truefoundry_guardrail scope (sent as Bearer) */ + apiKey: string; +} diff --git a/src/api/types/NomaSecurityGuardrailConfig.ts b/src/api/types/NomaSecurityGuardrailConfig.ts new file mode 100644 index 00000000..20b05958 --- /dev/null +++ b/src/api/types/NomaSecurityGuardrailConfig.ts @@ -0,0 +1,32 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +/** + * Noma Security + */ +export interface NomaSecurityGuardrailConfig { + /** The name of the Guardrail Config. */ + name: string; + /** Optional description for this Guardrail Config. */ + description?: string; + /** + * +uiType=Hidden + * +value=integration/guardrail-config/noma-security + */ + type: "integration/guardrail-config/noma-security"; + authData: TrueFoundry.NomaSecurityApiKeyAuth; + /** + * Validate blocks policy denials. Mutate also applies complete masked request or response payloads returned by Noma. + * Validate guardrails are run in parallel while mutate guardrails are run sequentially. + */ + operation: TrueFoundry.NomaSecurityGuardrailConfigOperation; + /** Execution order for mutate guardrails. Lower values run first. Only applicable when operation is mutate. */ + priority?: number; + enforcingStrategy: TrueFoundry.EnforcingStrategy; + /** + * +uiType=Ignore + * +uiProps={"forwardJsonKey": true} + */ + config: TrueFoundry.NomaSecurityGuardrailConfigConfig; +} diff --git a/src/api/types/NomaSecurityGuardrailConfigConfig.ts b/src/api/types/NomaSecurityGuardrailConfigConfig.ts new file mode 100644 index 00000000..41c46470 --- /dev/null +++ b/src/api/types/NomaSecurityGuardrailConfigConfig.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * +uiType=Ignore + * +uiProps={"forwardJsonKey": true} + */ +export interface NomaSecurityGuardrailConfigConfig { + /** Optional override for the Noma API base URL. Defaults to https://api.noma.security if not provided. */ + baseUrl?: string; + /** Literal applicationId sent as config.config.applicationId and used to select the Noma Runtime Protection profile. Defaults to truefoundry. */ + applicationId?: string; + /** Fallback subjectId sent in context.user when no authenticated runtime subject is available. Defaults to gateway. */ + userIdMetadataKey?: string; +} diff --git a/src/api/types/NomaSecurityGuardrailConfigOperation.ts b/src/api/types/NomaSecurityGuardrailConfigOperation.ts new file mode 100644 index 00000000..36ddf53e --- /dev/null +++ b/src/api/types/NomaSecurityGuardrailConfigOperation.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Validate blocks policy denials. Mutate also applies complete masked request or response payloads returned by Noma. + * Validate guardrails are run in parallel while mutate guardrails are run sequentially. + */ +export const NomaSecurityGuardrailConfigOperation = { + Validate: "validate", + Mutate: "mutate", +} as const; +export type NomaSecurityGuardrailConfigOperation = + (typeof NomaSecurityGuardrailConfigOperation)[keyof typeof NomaSecurityGuardrailConfigOperation]; diff --git a/src/api/types/NomicIntegrations.ts b/src/api/types/NomicIntegrations.ts index e8e6fb07..382eb1b7 100644 --- a/src/api/types/NomicIntegrations.ts +++ b/src/api/types/NomicIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type NomicIntegrations = TrueFoundry.NomicModel; diff --git a/src/api/types/NomicModel.ts b/src/api/types/NomicModel.ts index fda2dac8..a853f9a3 100644 --- a/src/api/types/NomicModel.ts +++ b/src/api/types/NomicModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Nomic Model diff --git a/src/api/types/NomicProviderAccount.ts b/src/api/types/NomicProviderAccount.ts index 3d6f125d..b4d5bedd 100644 --- a/src/api/types/NomicProviderAccount.ts +++ b/src/api/types/NomicProviderAccount.ts @@ -1,21 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** - * Nomic Provider Account + * Nomic Model Account */ export interface NomicProviderAccount { /** +value=provider-account/nomic */ type: "provider-account/nomic"; - /** The name of the Nomic provider account */ + /** The name of the Nomic model account */ name: string; authData: TrueFoundry.NomicKeyAuth; - /** List of integrations that are associated with the Nomic provider account */ + /** List of integrations that are associated with the Nomic model account */ integrations: TrueFoundry.NomicIntegrations[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/Notebook.ts b/src/api/types/Notebook.ts index 36fc14d2..f8575501 100644 --- a/src/api/types/Notebook.ts +++ b/src/api/types/Notebook.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Describes the configuration for the service diff --git a/src/api/types/NotificationTarget.ts b/src/api/types/NotificationTarget.ts index 773fa61e..f39ba632 100644 --- a/src/api/types/NotificationTarget.ts +++ b/src/api/types/NotificationTarget.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +discriminator=type */ -export type NotificationTarget = +export type NotificationTarget = | TrueFoundry.Email | TrueFoundry.SlackWebhook | TrueFoundry.SlackBot diff --git a/src/api/types/NotificationTargetForAlertRule.ts b/src/api/types/NotificationTargetForAlertRule.ts index 51f0371f..f54c4b44 100644 --- a/src/api/types/NotificationTargetForAlertRule.ts +++ b/src/api/types/NotificationTargetForAlertRule.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +discriminator=type */ -export type NotificationTargetForAlertRule = +export type NotificationTargetForAlertRule = | TrueFoundry.Email | TrueFoundry.SlackWebhook | TrueFoundry.SlackBot diff --git a/src/api/types/NvidiaMiggpu.ts b/src/api/types/NvidiaMiggpu.ts index bd47c5bd..8ce52315 100644 --- a/src/api/types/NvidiaMiggpu.ts +++ b/src/api/types/NvidiaMiggpu.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface NvidiaMiggpu { /** +value=nvidia_mig_gpu */ diff --git a/src/api/types/NvidiaMiggpuProfile.ts b/src/api/types/NvidiaMiggpuProfile.ts index f765d935..dd63ca79 100644 --- a/src/api/types/NvidiaMiggpuProfile.ts +++ b/src/api/types/NvidiaMiggpuProfile.ts @@ -12,39 +12,39 @@ * B200 180 GB - [1g.23gb, 1g.45gb, 2g.45gb, 3g.90gb, 4g.90gb, 7g.180gb] */ export const NvidiaMiggpuProfile = { - OneG6Gb: "1g.6gb", - TwoG12Gb: "2g.12gb", - OneG5Gb: "1g.5gb", - OneG10Gb: "1g.10gb", - TwoG10Gb: "2g.10gb", - ThreeG20Gb: "3g.20gb", - FourG20Gb: "4g.20gb", - OneG20Gb: "1g.20gb", - TwoG20Gb: "2g.20gb", - ThreeG40Gb: "3g.40gb", - FourG40Gb: "4g.40gb", - OneG12Gb: "1g.12gb", - OneG24Gb: "1g.24gb", - TwoG24Gb: "2g.24gb", - ThreeG47Gb: "3g.47gb", - FourG47Gb: "4g.47gb", - ThreeG48Gb: "3g.48gb", - FourG48Gb: "4g.48gb", - OneG18Gb: "1g.18gb", - OneG35Gb: "1g.35gb", - TwoG35Gb: "2g.35gb", - ThreeG71Gb: "3g.71gb", - FourG71Gb: "4g.71gb", - OneG23Gb: "1g.23gb", - OneG45Gb: "1g.45gb", - TwoG45Gb: "2g.45gb", - ThreeG90Gb: "3g.90gb", - FourG90Gb: "4g.90gb", - FourG24Gb: "4g.24gb", - SevenG40Gb: "7g.40gb", - SevenG80Gb: "7g.80gb", - SevenG94Gb: "7g.94gb", - SevenG96Gb: "7g.96gb", - SevenG180Gb: "7g.180gb" - } as const; -export type NvidiaMiggpuProfile = typeof NvidiaMiggpuProfile[keyof typeof NvidiaMiggpuProfile]; + OneG6Gb: "1g.6gb", + TwoG12Gb: "2g.12gb", + OneG5Gb: "1g.5gb", + OneG10Gb: "1g.10gb", + TwoG10Gb: "2g.10gb", + ThreeG20Gb: "3g.20gb", + FourG20Gb: "4g.20gb", + OneG20Gb: "1g.20gb", + TwoG20Gb: "2g.20gb", + ThreeG40Gb: "3g.40gb", + FourG40Gb: "4g.40gb", + OneG12Gb: "1g.12gb", + OneG24Gb: "1g.24gb", + TwoG24Gb: "2g.24gb", + ThreeG47Gb: "3g.47gb", + FourG47Gb: "4g.47gb", + ThreeG48Gb: "3g.48gb", + FourG48Gb: "4g.48gb", + OneG18Gb: "1g.18gb", + OneG35Gb: "1g.35gb", + TwoG35Gb: "2g.35gb", + ThreeG71Gb: "3g.71gb", + FourG71Gb: "4g.71gb", + OneG23Gb: "1g.23gb", + OneG45Gb: "1g.45gb", + TwoG45Gb: "2g.45gb", + ThreeG90Gb: "3g.90gb", + FourG90Gb: "4g.90gb", + FourG24Gb: "4g.24gb", + SevenG40Gb: "7g.40gb", + SevenG80Gb: "7g.80gb", + SevenG94Gb: "7g.94gb", + SevenG96Gb: "7g.96gb", + SevenG180Gb: "7g.180gb", +} as const; +export type NvidiaMiggpuProfile = (typeof NvidiaMiggpuProfile)[keyof typeof NvidiaMiggpuProfile]; diff --git a/src/api/types/OAuth2LoginProvider.ts b/src/api/types/OAuth2LoginProvider.ts index 63805a5e..36401c48 100644 --- a/src/api/types/OAuth2LoginProvider.ts +++ b/src/api/types/OAuth2LoginProvider.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface OAuth2LoginProvider extends TrueFoundry.BaseOAuth2Login { /** +value=oauth2 */ diff --git a/src/api/types/OcrCostMetric.ts b/src/api/types/OcrCostMetric.ts index 116028be..8842442e 100644 --- a/src/api/types/OcrCostMetric.ts +++ b/src/api/types/OcrCostMetric.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface OcrCostMetric { /** +value=per_1000_pages */ diff --git a/src/api/types/OcrCostMetricValue.ts b/src/api/types/OcrCostMetricValue.ts index 54b47d40..a70aefb2 100644 --- a/src/api/types/OcrCostMetricValue.ts +++ b/src/api/types/OcrCostMetricValue.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface OcrCostMetricValue { pages: TrueFoundry.NonNegativeFloat; diff --git a/src/api/types/OllamaIntegrations.ts b/src/api/types/OllamaIntegrations.ts index 81b997e9..25c64365 100644 --- a/src/api/types/OllamaIntegrations.ts +++ b/src/api/types/OllamaIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type OllamaIntegrations = TrueFoundry.OllamaModel; diff --git a/src/api/types/OllamaModel.ts b/src/api/types/OllamaModel.ts index 357296ed..f29845cf 100644 --- a/src/api/types/OllamaModel.ts +++ b/src/api/types/OllamaModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Ollama Model diff --git a/src/api/types/OllamaProviderAccount.ts b/src/api/types/OllamaProviderAccount.ts index 279f57cc..5c999c2e 100644 --- a/src/api/types/OllamaProviderAccount.ts +++ b/src/api/types/OllamaProviderAccount.ts @@ -1,21 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** - * Ollama Provider Account + * Ollama Model Account */ export interface OllamaProviderAccount { /** +value=provider-account/ollama */ type: "provider-account/ollama"; - /** The name of the Ollama provider account */ + /** The name of the Ollama model account */ name: string; authData: TrueFoundry.OllamaKeyAuth; - /** List of integrations that are associated with the Ollama provider account */ + /** List of integrations that are associated with the Ollama model account */ integrations: TrueFoundry.OllamaIntegrations[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/OpaAuth.ts b/src/api/types/OpaAuth.ts index 1fc10342..48de3d22 100644 --- a/src/api/types/OpaAuth.ts +++ b/src/api/types/OpaAuth.ts @@ -1,7 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; -export type OpaAuth = - | TrueFoundry.OpaHeaderAuth - | TrueFoundry.OpaBearerAuth; +export type OpaAuth = TrueFoundry.OpaHeaderAuth | TrueFoundry.OpaBearerAuth; diff --git a/src/api/types/OpaGuardrailConfig.ts b/src/api/types/OpaGuardrailConfig.ts index 1f57c22c..2d07bd59 100644 --- a/src/api/types/OpaGuardrailConfig.ts +++ b/src/api/types/OpaGuardrailConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * OPA diff --git a/src/api/types/OpenAiIntegrations.ts b/src/api/types/OpenAiIntegrations.ts index 89b51d5c..c2426d0a 100644 --- a/src/api/types/OpenAiIntegrations.ts +++ b/src/api/types/OpenAiIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type OpenAiIntegrations = TrueFoundry.OpenAiModel; diff --git a/src/api/types/OpenAiModel.ts b/src/api/types/OpenAiModel.ts index e2f4881e..5c49e947 100644 --- a/src/api/types/OpenAiModel.ts +++ b/src/api/types/OpenAiModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * OpenAI Model diff --git a/src/api/types/OpenAiModerationsGuardrailConfig.ts b/src/api/types/OpenAiModerationsGuardrailConfig.ts index 8a0a87f5..22b195a5 100644 --- a/src/api/types/OpenAiModerationsGuardrailConfig.ts +++ b/src/api/types/OpenAiModerationsGuardrailConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * OpenAI Moderation diff --git a/src/api/types/OpenApiSpecSource.ts b/src/api/types/OpenApiSpecSource.ts index d278fb9a..53400a90 100644 --- a/src/api/types/OpenApiSpecSource.ts +++ b/src/api/types/OpenApiSpecSource.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; -export type OpenApiSpecSource = +export type OpenApiSpecSource = | TrueFoundry.RemoteSpecSource | TrueFoundry.UploadSpecSource | TrueFoundry.InlineSpecSource; diff --git a/src/api/types/OpenApimcpServerManifest.ts b/src/api/types/OpenApimcpServerManifest.ts index 2ce7dc06..8399b1ed 100644 --- a/src/api/types/OpenApimcpServerManifest.ts +++ b/src/api/types/OpenApimcpServerManifest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Connect to an external OpenAPI Server endpoint. @@ -10,6 +10,8 @@ export interface OpenApimcpServerManifest { type: "mcp-server/openapi"; /** The name of the OpenAPI MCP Server. */ name: string; + /** A human-readable label for the OpenAPI MCP Server in the UI. If omitted, the server name is shown. */ + displayName?: string; /** Provide a brief description of the purpose of this OpenAPI MCP Server. */ description: string; /** The base URL where API requests will be sent. This should be the root endpoint of your API server, without any path suffix. */ diff --git a/src/api/types/OpenApimcpToolSetting.ts b/src/api/types/OpenApimcpToolSetting.ts index fba563f1..5cfbebd6 100644 --- a/src/api/types/OpenApimcpToolSetting.ts +++ b/src/api/types/OpenApimcpToolSetting.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * OpenAPI MCP Tool Setting diff --git a/src/api/types/OpenApimcpToolSettingMethod.ts b/src/api/types/OpenApimcpToolSettingMethod.ts index 43ff65ec..3a1ff451 100644 --- a/src/api/types/OpenApimcpToolSettingMethod.ts +++ b/src/api/types/OpenApimcpToolSettingMethod.ts @@ -2,11 +2,12 @@ /** The HTTP method for this endpoint. */ export const OpenApimcpToolSettingMethod = { - Get: "get", - Post: "post", - Put: "put", - Patch: "patch", - Delete: "delete", - Head: "head" - } as const; -export type OpenApimcpToolSettingMethod = typeof OpenApimcpToolSettingMethod[keyof typeof OpenApimcpToolSettingMethod]; + Get: "get", + Post: "post", + Put: "put", + Patch: "patch", + Delete: "delete", + Head: "head", +} as const; +export type OpenApimcpToolSettingMethod = + (typeof OpenApimcpToolSettingMethod)[keyof typeof OpenApimcpToolSettingMethod]; diff --git a/src/api/types/OpenRouterIntegrations.ts b/src/api/types/OpenRouterIntegrations.ts index d7312b52..285f4760 100644 --- a/src/api/types/OpenRouterIntegrations.ts +++ b/src/api/types/OpenRouterIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type OpenRouterIntegrations = TrueFoundry.OpenRouterModel; diff --git a/src/api/types/OpenRouterModel.ts b/src/api/types/OpenRouterModel.ts index 53724d1a..3ac82f8e 100644 --- a/src/api/types/OpenRouterModel.ts +++ b/src/api/types/OpenRouterModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * OpenRouter Model diff --git a/src/api/types/OpenRouterProviderAccount.ts b/src/api/types/OpenRouterProviderAccount.ts index 1f0e26d5..f45e21b2 100644 --- a/src/api/types/OpenRouterProviderAccount.ts +++ b/src/api/types/OpenRouterProviderAccount.ts @@ -1,21 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** - * OpenRouter Provider Account + * OpenRouter Model Account */ export interface OpenRouterProviderAccount { /** +value=provider-account/openrouter */ type: "provider-account/openrouter"; - /** The name of the OpenRouter provider account */ + /** The name of the OpenRouter model account */ name: string; authData: TrueFoundry.OpenRouterApiKeyAuth; - /** List of integrations that are associated with the OpenRouter provider account */ + /** List of integrations that are associated with the OpenRouter model account */ integrations: TrueFoundry.OpenRouterIntegrations[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/OpenaiProviderAccount.ts b/src/api/types/OpenaiProviderAccount.ts index c99df2ff..e221d1a7 100644 --- a/src/api/types/OpenaiProviderAccount.ts +++ b/src/api/types/OpenaiProviderAccount.ts @@ -1,23 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** - * OpenAI Provider Account + * OpenAI Model Account */ export interface OpenaiProviderAccount { /** +value=provider-account/openai */ type: "provider-account/openai"; - /** The name of the OpenAI provider account */ + /** The name of the OpenAI model account */ name: string; authData?: TrueFoundry.OpenaiApiKeyAuth; /** Optional custom base URL for OpenAI API */ baseUrl?: string; - /** List of integrations that are associated with the OpenAI provider account */ + /** List of integrations that are associated with the OpenAI model account */ integrations: TrueFoundry.OpenAiIntegrations[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/Operation.ts b/src/api/types/Operation.ts index 34a25e37..183c80d9 100644 --- a/src/api/types/Operation.ts +++ b/src/api/types/Operation.ts @@ -2,7 +2,7 @@ /** Operation the signed URLs should permit (READ or WRITE). */ export const Operation = { - Read: "READ", - Write: "WRITE" - } as const; -export type Operation = typeof Operation[keyof typeof Operation]; + Read: "READ", + Write: "WRITE", +} as const; +export type Operation = (typeof Operation)[keyof typeof Operation]; diff --git a/src/api/types/OtelExporterHttpConfigBase.ts b/src/api/types/OtelExporterHttpConfigBase.ts index 455c36d7..a9cd3539 100644 --- a/src/api/types/OtelExporterHttpConfigBase.ts +++ b/src/api/types/OtelExporterHttpConfigBase.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Base HTTP exporter fields (without type discriminator) diff --git a/src/api/types/OtelExporterHttpConfigBaseEncoding.ts b/src/api/types/OtelExporterHttpConfigBaseEncoding.ts index e87b0de8..97d5197d 100644 --- a/src/api/types/OtelExporterHttpConfigBaseEncoding.ts +++ b/src/api/types/OtelExporterHttpConfigBaseEncoding.ts @@ -2,7 +2,8 @@ /** Encoding for OpenTelemetry data */ export const OtelExporterHttpConfigBaseEncoding = { - Proto: "proto", - Json: "json" - } as const; -export type OtelExporterHttpConfigBaseEncoding = typeof OtelExporterHttpConfigBaseEncoding[keyof typeof OtelExporterHttpConfigBaseEncoding]; + Proto: "proto", + Json: "json", +} as const; +export type OtelExporterHttpConfigBaseEncoding = + (typeof OtelExporterHttpConfigBaseEncoding)[keyof typeof OtelExporterHttpConfigBaseEncoding]; diff --git a/src/api/types/OtelMetricsExporterGrpcConfig.ts b/src/api/types/OtelMetricsExporterGrpcConfig.ts index 9556b75d..a0de5dd1 100644 --- a/src/api/types/OtelMetricsExporterGrpcConfig.ts +++ b/src/api/types/OtelMetricsExporterGrpcConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * gRPC Configuration diff --git a/src/api/types/OtelMetricsExporterHttpConfig.ts b/src/api/types/OtelMetricsExporterHttpConfig.ts index a29a7eb8..21f5e329 100644 --- a/src/api/types/OtelMetricsExporterHttpConfig.ts +++ b/src/api/types/OtelMetricsExporterHttpConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * HTTP Configuration diff --git a/src/api/types/OtelTracesExporterCommonConfig.ts b/src/api/types/OtelTracesExporterCommonConfig.ts index d4025848..1427e9ec 100644 --- a/src/api/types/OtelTracesExporterCommonConfig.ts +++ b/src/api/types/OtelTracesExporterCommonConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Common fields shared by HTTP and gRPC exporter configs diff --git a/src/api/types/OtelTracesExporterGrpcConfig.ts b/src/api/types/OtelTracesExporterGrpcConfig.ts index b7fecdc3..cdbbec30 100644 --- a/src/api/types/OtelTracesExporterGrpcConfig.ts +++ b/src/api/types/OtelTracesExporterGrpcConfig.ts @@ -1,11 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * gRPC Configuration */ -export interface OtelTracesExporterGrpcConfig extends TrueFoundry.OtelExporterGrpcConfigBase, TrueFoundry.OtelTracesExporterCommonConfig { +export interface OtelTracesExporterGrpcConfig + extends TrueFoundry.OtelExporterGrpcConfigBase, + TrueFoundry.OtelTracesExporterCommonConfig { /** Configuration type */ type: "grpc"; } diff --git a/src/api/types/OtelTracesExporterHttpConfig.ts b/src/api/types/OtelTracesExporterHttpConfig.ts index 2093ae4a..11f84206 100644 --- a/src/api/types/OtelTracesExporterHttpConfig.ts +++ b/src/api/types/OtelTracesExporterHttpConfig.ts @@ -1,11 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * HTTP Configuration */ -export interface OtelTracesExporterHttpConfig extends TrueFoundry.OtelExporterHttpConfigBase, TrueFoundry.OtelTracesExporterCommonConfig { +export interface OtelTracesExporterHttpConfig + extends TrueFoundry.OtelExporterHttpConfigBase, + TrueFoundry.OtelTracesExporterCommonConfig { /** Configuration type */ type: "http"; } diff --git a/src/api/types/OwnDataAccessRule.ts b/src/api/types/OwnDataAccessRule.ts index e3a2f4e7..225359cb 100644 --- a/src/api/types/OwnDataAccessRule.ts +++ b/src/api/types/OwnDataAccessRule.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Own Data diff --git a/src/api/types/PagerDutyIntegration.ts b/src/api/types/PagerDutyIntegration.ts index ba53363a..a7577199 100644 --- a/src/api/types/PagerDutyIntegration.ts +++ b/src/api/types/PagerDutyIntegration.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * PagerDuty Integration diff --git a/src/api/types/PagerDutyIntegrations.ts b/src/api/types/PagerDutyIntegrations.ts index c8e74ffc..d0f30312 100644 --- a/src/api/types/PagerDutyIntegrations.ts +++ b/src/api/types/PagerDutyIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type PagerDutyIntegrations = TrueFoundry.PagerDutyIntegration; diff --git a/src/api/types/PagerDutyProviderAccount.ts b/src/api/types/PagerDutyProviderAccount.ts index c3e79cea..92df8e3b 100644 --- a/src/api/types/PagerDutyProviderAccount.ts +++ b/src/api/types/PagerDutyProviderAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * PagerDuty Provider Account diff --git a/src/api/types/Pagination.ts b/src/api/types/Pagination.ts index e399153a..4b372fe1 100644 --- a/src/api/types/Pagination.ts +++ b/src/api/types/Pagination.ts @@ -4,7 +4,7 @@ export interface Pagination { /** Total number of items */ total: number; /** Number of items skipped */ - offset?: number; + offset?: number | null; /** Number of items per page */ - limit?: number; + limit?: number | null; } diff --git a/src/api/types/PalmIntegrations.ts b/src/api/types/PalmIntegrations.ts index 3f45db0d..4b5605da 100644 --- a/src/api/types/PalmIntegrations.ts +++ b/src/api/types/PalmIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type PalmIntegrations = TrueFoundry.PalmModel; diff --git a/src/api/types/PalmModel.ts b/src/api/types/PalmModel.ts index 8a2846f0..4c8c373d 100644 --- a/src/api/types/PalmModel.ts +++ b/src/api/types/PalmModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * PaLM Model diff --git a/src/api/types/PalmProviderAccount.ts b/src/api/types/PalmProviderAccount.ts index d53c32c7..051b8d5e 100644 --- a/src/api/types/PalmProviderAccount.ts +++ b/src/api/types/PalmProviderAccount.ts @@ -1,21 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** - * PaLM Provider Account + * PaLM Model Account */ export interface PalmProviderAccount { /** +value=provider-account/palm */ type: "provider-account/palm"; - /** The name of the PaLM provider account */ + /** The name of the PaLM model account */ name: string; authData: TrueFoundry.PalmKeyAuth; - /** List of integrations that are associated with the PaLM provider account */ + /** List of integrations that are associated with the PaLM model account */ integrations: TrueFoundry.PalmIntegrations[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/PaloAltoPrismaAirsGuardrailConfig.ts b/src/api/types/PaloAltoPrismaAirsGuardrailConfig.ts index ff950ce0..6916902a 100644 --- a/src/api/types/PaloAltoPrismaAirsGuardrailConfig.ts +++ b/src/api/types/PaloAltoPrismaAirsGuardrailConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Palo Alto Prisma AIRS diff --git a/src/api/types/PaloAltoPrismaAirsGuardrailConfigConfig.ts b/src/api/types/PaloAltoPrismaAirsGuardrailConfigConfig.ts index bb3d545c..511f470c 100644 --- a/src/api/types/PaloAltoPrismaAirsGuardrailConfigConfig.ts +++ b/src/api/types/PaloAltoPrismaAirsGuardrailConfigConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +uiType=Ignore diff --git a/src/api/types/PaloAltoPrismaAirsGuardrailConfigConfigMode.ts b/src/api/types/PaloAltoPrismaAirsGuardrailConfigConfigMode.ts index 927d54ee..0b9262df 100644 --- a/src/api/types/PaloAltoPrismaAirsGuardrailConfigConfigMode.ts +++ b/src/api/types/PaloAltoPrismaAirsGuardrailConfigConfigMode.ts @@ -2,7 +2,8 @@ /** Execution mode for the guardrail. Sync waits for the guardrail check to complete before proceeding. Async triggers the check without waiting. Defaults to sync. */ export const PaloAltoPrismaAirsGuardrailConfigConfigMode = { - Sync: "sync", - Async: "async" - } as const; -export type PaloAltoPrismaAirsGuardrailConfigConfigMode = typeof PaloAltoPrismaAirsGuardrailConfigConfigMode[keyof typeof PaloAltoPrismaAirsGuardrailConfigConfigMode]; + Sync: "sync", + Async: "async", +} as const; +export type PaloAltoPrismaAirsGuardrailConfigConfigMode = + (typeof PaloAltoPrismaAirsGuardrailConfigConfigMode)[keyof typeof PaloAltoPrismaAirsGuardrailConfigConfigMode]; diff --git a/src/api/types/Param.ts b/src/api/types/Param.ts index 51bf6a67..a5976cf5 100644 --- a/src/api/types/Param.ts +++ b/src/api/types/Param.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface Param { /** Name of the param */ @@ -8,6 +8,6 @@ export interface Param { /** Description of param */ description?: string; /** Default value or placeholder */ - "default"?: string; + default?: string; paramType?: TrueFoundry.ParamParamType; } diff --git a/src/api/types/ParamParamType.ts b/src/api/types/ParamParamType.ts index 72d5b9a0..f1727940 100644 --- a/src/api/types/ParamParamType.ts +++ b/src/api/types/ParamParamType.ts @@ -1,7 +1,7 @@ // This file was auto-generated by Fern from our API Definition. export const ParamParamType = { - String: "string", - MlRepo: "ml_repo" - } as const; -export type ParamParamType = typeof ParamParamType[keyof typeof ParamParamType]; + String: "string", + MlRepo: "ml_repo", +} as const; +export type ParamParamType = (typeof ParamParamType)[keyof typeof ParamParamType]; diff --git a/src/api/types/Parameters.ts b/src/api/types/Parameters.ts index 7a687a49..b23094dc 100644 --- a/src/api/types/Parameters.ts +++ b/src/api/types/Parameters.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Parameters to pass to the model when generating diff --git a/src/api/types/ParametersStop.ts b/src/api/types/ParametersStop.ts index 0aadabb1..00b584ca 100644 --- a/src/api/types/ParametersStop.ts +++ b/src/api/types/ParametersStop.ts @@ -1,5 +1,3 @@ // This file was auto-generated by Fern from our API Definition. -export type ParametersStop = - | string[] - | string; +export type ParametersStop = string[] | string; diff --git a/src/api/types/PatronusAnswerRelevanceEvaluator.ts b/src/api/types/PatronusAnswerRelevanceEvaluator.ts index c08af1c6..528df7a1 100644 --- a/src/api/types/PatronusAnswerRelevanceEvaluator.ts +++ b/src/api/types/PatronusAnswerRelevanceEvaluator.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface PatronusAnswerRelevanceEvaluator { /** The type of the evaluator to use for the Patronus Guardrail. */ diff --git a/src/api/types/PatronusEvaluator.ts b/src/api/types/PatronusEvaluator.ts index 31f93616..56722274 100644 --- a/src/api/types/PatronusEvaluator.ts +++ b/src/api/types/PatronusEvaluator.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Patronus Evaluators */ -export type PatronusEvaluator = +export type PatronusEvaluator = | TrueFoundry.PatronusAnswerRelevanceEvaluator | TrueFoundry.PatronusGliderEvaluator | TrueFoundry.PatronusJudgeEvaluator diff --git a/src/api/types/PatronusGliderCriteria.ts b/src/api/types/PatronusGliderCriteria.ts index 8e32389d..d7af4d24 100644 --- a/src/api/types/PatronusGliderCriteria.ts +++ b/src/api/types/PatronusGliderCriteria.ts @@ -1,10 +1,10 @@ // This file was auto-generated by Fern from our API Definition. export const PatronusGliderCriteria = { - PatronusIsCompliant: "patronus:is-compliant", - PatronusIsFactuallyConsistent: "patronus:is-factually-consistent", - PatronusIsGoodSummary: "patronus:is-good-summary", - PatronusIsHarmfulAdvice: "patronus:is-harmful-advice", - PatronusIsInformalTone: "patronus:is-informal-tone" - } as const; -export type PatronusGliderCriteria = typeof PatronusGliderCriteria[keyof typeof PatronusGliderCriteria]; + PatronusIsCompliant: "patronus:is-compliant", + PatronusIsFactuallyConsistent: "patronus:is-factually-consistent", + PatronusIsGoodSummary: "patronus:is-good-summary", + PatronusIsHarmfulAdvice: "patronus:is-harmful-advice", + PatronusIsInformalTone: "patronus:is-informal-tone", +} as const; +export type PatronusGliderCriteria = (typeof PatronusGliderCriteria)[keyof typeof PatronusGliderCriteria]; diff --git a/src/api/types/PatronusGliderEvaluator.ts b/src/api/types/PatronusGliderEvaluator.ts index ac7e967e..4c8f0b6a 100644 --- a/src/api/types/PatronusGliderEvaluator.ts +++ b/src/api/types/PatronusGliderEvaluator.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface PatronusGliderEvaluator { /** The type of the evaluator to use for the Patronus Guardrail. */ diff --git a/src/api/types/PatronusGuardrailConfig.ts b/src/api/types/PatronusGuardrailConfig.ts index f6aaf483..46376977 100644 --- a/src/api/types/PatronusGuardrailConfig.ts +++ b/src/api/types/PatronusGuardrailConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Patronus diff --git a/src/api/types/PatronusGuardrailConfigConfig.ts b/src/api/types/PatronusGuardrailConfigConfig.ts index 990f4506..2932f39b 100644 --- a/src/api/types/PatronusGuardrailConfigConfig.ts +++ b/src/api/types/PatronusGuardrailConfigConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +uiType=Ignore diff --git a/src/api/types/PatronusGuardrailConfigConfigTarget.ts b/src/api/types/PatronusGuardrailConfigConfigTarget.ts index 9462e6be..861376bb 100644 --- a/src/api/types/PatronusGuardrailConfigConfigTarget.ts +++ b/src/api/types/PatronusGuardrailConfigConfigTarget.ts @@ -2,7 +2,8 @@ /** Where to apply evaluation: request (evaluate user input) or response (evaluate model response) */ export const PatronusGuardrailConfigConfigTarget = { - Response: "response", - Request: "request" - } as const; -export type PatronusGuardrailConfigConfigTarget = typeof PatronusGuardrailConfigConfigTarget[keyof typeof PatronusGuardrailConfigConfigTarget]; + Response: "response", + Request: "request", +} as const; +export type PatronusGuardrailConfigConfigTarget = + (typeof PatronusGuardrailConfigConfigTarget)[keyof typeof PatronusGuardrailConfigConfigTarget]; diff --git a/src/api/types/PatronusJudgeCriteria.ts b/src/api/types/PatronusJudgeCriteria.ts index 9b5c22f9..ac75e208 100644 --- a/src/api/types/PatronusJudgeCriteria.ts +++ b/src/api/types/PatronusJudgeCriteria.ts @@ -1,20 +1,20 @@ // This file was auto-generated by Fern from our API Definition. export const PatronusJudgeCriteria = { - PatronusAnswerRefusal: "patronus:answer-refusal", - PatronusNoOpenaiReference: "patronus:no-openai-reference", - PatronusIsConcise: "patronus:is-concise", - PatronusNoApologies: "patronus:no-apologies", - PatronusIsPolite: "patronus:is-polite", - PatronusIsHelpful: "patronus:is-helpful", - PatronusClinicallyInappropriateTone: "patronus:clinically-inappropriate-tone", - PatronusNoHarmfulTherapeuticGuidance: "patronus:no-harmful-therapeutic-guidance", - PatronusIsCode: "patronus:is-code", - PatronusIsCsv: "patronus:is-csv", - PatronusIsJson: "patronus:is-json", - PatronusNoAgeBias: "patronus:no-age-bias", - PatronusNoGenderBias: "patronus:no-gender-bias", - PatronusNoRacialBias: "patronus:no-racial-bias", - PatronusPromptInjection: "patronus:prompt-injection" - } as const; -export type PatronusJudgeCriteria = typeof PatronusJudgeCriteria[keyof typeof PatronusJudgeCriteria]; + PatronusAnswerRefusal: "patronus:answer-refusal", + PatronusNoOpenaiReference: "patronus:no-openai-reference", + PatronusIsConcise: "patronus:is-concise", + PatronusNoApologies: "patronus:no-apologies", + PatronusIsPolite: "patronus:is-polite", + PatronusIsHelpful: "patronus:is-helpful", + PatronusClinicallyInappropriateTone: "patronus:clinically-inappropriate-tone", + PatronusNoHarmfulTherapeuticGuidance: "patronus:no-harmful-therapeutic-guidance", + PatronusIsCode: "patronus:is-code", + PatronusIsCsv: "patronus:is-csv", + PatronusIsJson: "patronus:is-json", + PatronusNoAgeBias: "patronus:no-age-bias", + PatronusNoGenderBias: "patronus:no-gender-bias", + PatronusNoRacialBias: "patronus:no-racial-bias", + PatronusPromptInjection: "patronus:prompt-injection", +} as const; +export type PatronusJudgeCriteria = (typeof PatronusJudgeCriteria)[keyof typeof PatronusJudgeCriteria]; diff --git a/src/api/types/PatronusJudgeEvaluator.ts b/src/api/types/PatronusJudgeEvaluator.ts index 97860a1a..dbfaf724 100644 --- a/src/api/types/PatronusJudgeEvaluator.ts +++ b/src/api/types/PatronusJudgeEvaluator.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface PatronusJudgeEvaluator { /** The type of the evaluator to use for the Patronus Guardrail. */ diff --git a/src/api/types/PatronusPhiEvaluator.ts b/src/api/types/PatronusPhiEvaluator.ts index 8ec5d002..bbbb9e7a 100644 --- a/src/api/types/PatronusPhiEvaluator.ts +++ b/src/api/types/PatronusPhiEvaluator.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface PatronusPhiEvaluator { /** The type of the evaluator to use for the Patronus Guardrail. */ diff --git a/src/api/types/PatronusPiiEvaluator.ts b/src/api/types/PatronusPiiEvaluator.ts index c163a54f..7fcdf97f 100644 --- a/src/api/types/PatronusPiiEvaluator.ts +++ b/src/api/types/PatronusPiiEvaluator.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface PatronusPiiEvaluator { /** The type of the evaluator to use for the Patronus Guardrail. */ diff --git a/src/api/types/PatronusToxicityEvaluator.ts b/src/api/types/PatronusToxicityEvaluator.ts index 2c94963a..816ae4d6 100644 --- a/src/api/types/PatronusToxicityEvaluator.ts +++ b/src/api/types/PatronusToxicityEvaluator.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface PatronusToxicityEvaluator { /** The type of the evaluator to use for the Patronus Guardrail. */ diff --git a/src/api/types/PerMillionCharactersCostMetric.ts b/src/api/types/PerMillionCharactersCostMetric.ts index 626ed958..4df39d46 100644 --- a/src/api/types/PerMillionCharactersCostMetric.ts +++ b/src/api/types/PerMillionCharactersCostMetric.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Private rate per million characters of input (Cloud TTS-style billing). diff --git a/src/api/types/PerMillionCharactersCostMetricValue.ts b/src/api/types/PerMillionCharactersCostMetricValue.ts index ba979e19..50e17048 100644 --- a/src/api/types/PerMillionCharactersCostMetricValue.ts +++ b/src/api/types/PerMillionCharactersCostMetricValue.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface PerMillionCharactersCostMetricValue { input: TrueFoundry.NonNegativeFloat; diff --git a/src/api/types/PerMinuteOfAudioCostMetric.ts b/src/api/types/PerMinuteOfAudioCostMetric.ts index 8ff62425..1368ff2d 100644 --- a/src/api/types/PerMinuteOfAudioCostMetric.ts +++ b/src/api/types/PerMinuteOfAudioCostMetric.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Private rate per minute of billed audio (Cloud STT-style billing). Admin enters $/minute from the provider pricing page. diff --git a/src/api/types/PerMinuteOfAudioCostMetricValue.ts b/src/api/types/PerMinuteOfAudioCostMetricValue.ts index 53c338a9..e0a7e95f 100644 --- a/src/api/types/PerMinuteOfAudioCostMetricValue.ts +++ b/src/api/types/PerMinuteOfAudioCostMetricValue.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface PerMinuteOfAudioCostMetricValue { input: TrueFoundry.NonNegativeFloat; diff --git a/src/api/types/PerThousandEmbeddingTokensCostMetric.ts b/src/api/types/PerThousandEmbeddingTokensCostMetric.ts index 4a66ab64..77caae78 100644 --- a/src/api/types/PerThousandEmbeddingTokensCostMetric.ts +++ b/src/api/types/PerThousandEmbeddingTokensCostMetric.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface PerThousandEmbeddingTokensCostMetric { /** +value=per_1000_embedding_tokens */ diff --git a/src/api/types/PerThousandTokensCostMetric.ts b/src/api/types/PerThousandTokensCostMetric.ts index 2d5f3d65..83e61c94 100644 --- a/src/api/types/PerThousandTokensCostMetric.ts +++ b/src/api/types/PerThousandTokensCostMetric.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface PerThousandTokensCostMetric { /** +value=per_1000_tokens */ diff --git a/src/api/types/PeriodUsage.ts b/src/api/types/PeriodUsage.ts new file mode 100644 index 00000000..cd597afc --- /dev/null +++ b/src/api/types/PeriodUsage.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface PeriodUsage { + /** Resolved (override-aware) cost limit for the period. */ + limit: number; + /** Cost used in the current window of the period. */ + used: number; + /** Usage as a percentage of the limit, capped at 100. */ + percentage: number; + /** Current window start, Unix epoch seconds (UTC). */ + start: number; + /** Current window end, Unix epoch seconds (UTC, inclusive). */ + end: number; +} diff --git a/src/api/types/PermissionSetV2.ts b/src/api/types/PermissionSetV2.ts new file mode 100644 index 00000000..b588bb2a --- /dev/null +++ b/src/api/types/PermissionSetV2.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +export interface PermissionSetV2 { + id?: string | null; + resourceType: TrueFoundry.PermissionSetV2ResourceType; + permissions: string[]; +} diff --git a/src/api/types/PermissionSetV2ResourceType.ts b/src/api/types/PermissionSetV2ResourceType.ts new file mode 100644 index 00000000..12757bcd --- /dev/null +++ b/src/api/types/PermissionSetV2ResourceType.ts @@ -0,0 +1,48 @@ +// This file was auto-generated by Fern from our API Definition. + +export const PermissionSetV2ResourceType = { + Role: "role", + Account: "account", + Cluster: "cluster", + Workspace: "workspace", + Environment: "environment", + SecretGroup: "secret-group", + Deployment: "deployment", + Application: "application", + Secret: "secret", + DockerRegistry: "docker-registry", + Tenant: "tenant", + VcsIntegration: "vcs-integration", + MlfProject: "mlf-project", + Repository: "repository", + ProviderIntegration: "provider-integration", + Team: "team", + ServiceAccount: "service-account", + LlmGateway: "llm-gateway", + Policy: "policy", + RoleBinding: "role-binding", + Settings: "settings", + ProviderAccount: "provider-account", + User: "user", + AlertConfig: "alert-config", + AlertRule: "alert-rule", + GatewayConfig: "gateway-config", + GatewayControls: "gateway-controls", + GatewayBudget: "gateway-budget", + GatewayPolicy: "gateway-policy", + GatewayApprovalRequest: "gateway-approval-request", + TracingProject: "tracing-project", + TracingApplication: "tracing-application", + Agent: "agent", + AgentApp: "agent-app", + AgentChannel: "agent-channel", + GatewayInstallation: "gateway-installation", + VirtualAccount: "virtual-account", + SsoBasedIdentity: "sso-based-identity", + ExternalIdentity: "external-identity", + McpServer: "mcp-server", + ExternalIdentityProvider: "external-identity-provider", + AgentIdentity: "agent-identity", +} as const; +export type PermissionSetV2ResourceType = + (typeof PermissionSetV2ResourceType)[keyof typeof PermissionSetV2ResourceType]; diff --git a/src/api/types/PerplexityAiModel.ts b/src/api/types/PerplexityAiModel.ts index 091e039a..46069705 100644 --- a/src/api/types/PerplexityAiModel.ts +++ b/src/api/types/PerplexityAiModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Perplexity AI Model diff --git a/src/api/types/PerplexityAiProviderAccount.ts b/src/api/types/PerplexityAiProviderAccount.ts index 9beda8c7..2aad6914 100644 --- a/src/api/types/PerplexityAiProviderAccount.ts +++ b/src/api/types/PerplexityAiProviderAccount.ts @@ -1,21 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** - * Perplexity AI Provider Account + * Perplexity AI Model Account */ export interface PerplexityAiProviderAccount { /** +value=provider-account/perplexity-ai */ type: "provider-account/perplexity-ai"; - /** The name of the Perplexity AI provider account */ + /** The name of the Perplexity AI model account */ name: string; authData: TrueFoundry.PerplexityAiKeyAuth; - /** List of integrations that are associated with the Perplexity AI provider account */ + /** List of integrations that are associated with the Perplexity AI model account */ integrations: TrueFoundry.PerplexityIntegrations[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/PerplexityIntegrations.ts b/src/api/types/PerplexityIntegrations.ts index 496a3461..36e81ad6 100644 --- a/src/api/types/PerplexityIntegrations.ts +++ b/src/api/types/PerplexityIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type PerplexityIntegrations = TrueFoundry.PerplexityAiModel; diff --git a/src/api/types/PersonalAccessTokenManifest.ts b/src/api/types/PersonalAccessTokenManifest.ts index c5fae4e2..d489e58a 100644 --- a/src/api/types/PersonalAccessTokenManifest.ts +++ b/src/api/types/PersonalAccessTokenManifest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface PersonalAccessTokenManifest { /** Personal Access Token Name */ diff --git a/src/api/types/PersonalAccessTokenManifestTokenType.ts b/src/api/types/PersonalAccessTokenManifestTokenType.ts index d1a49ecf..c355a63c 100644 --- a/src/api/types/PersonalAccessTokenManifestTokenType.ts +++ b/src/api/types/PersonalAccessTokenManifestTokenType.ts @@ -2,7 +2,8 @@ /** Format of the issued token. Leave empty to use the platform default. */ export const PersonalAccessTokenManifestTokenType = { - Jwt: "jwt", - Opaque: "opaque" - } as const; -export type PersonalAccessTokenManifestTokenType = typeof PersonalAccessTokenManifestTokenType[keyof typeof PersonalAccessTokenManifestTokenType]; + Jwt: "jwt", + Opaque: "opaque", +} as const; +export type PersonalAccessTokenManifestTokenType = + (typeof PersonalAccessTokenManifestTokenType)[keyof typeof PersonalAccessTokenManifestTokenType]; diff --git a/src/api/types/Policy.ts b/src/api/types/Policy.ts new file mode 100644 index 00000000..5fd6a261 --- /dev/null +++ b/src/api/types/Policy.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +export interface Policy { + id?: string | null; + name: string; + tenantName: string; + activeVersion: number; + activePolicyVersion?: TrueFoundry.PolicyVersion | null; + createdBySubject: TrueFoundry.Subject; + createdBy?: string | null; +} diff --git a/src/api/types/PolicyEntityTypes.ts b/src/api/types/PolicyEntityTypes.ts index 0a344a28..a60cbece 100644 --- a/src/api/types/PolicyEntityTypes.ts +++ b/src/api/types/PolicyEntityTypes.ts @@ -1,13 +1,13 @@ // This file was auto-generated by Fern from our API Definition. export const PolicyEntityTypes = { - Service: "service", - AsyncService: "async-service", - Job: "job", - Notebook: "notebook", - SshServer: "ssh-server", - Workflow: "workflow", - Helm: "helm", - Volume: "volume" - } as const; -export type PolicyEntityTypes = typeof PolicyEntityTypes[keyof typeof PolicyEntityTypes]; + Service: "service", + AsyncService: "async-service", + Job: "job", + Notebook: "notebook", + SshServer: "ssh-server", + Workflow: "workflow", + Helm: "helm", + Volume: "volume", +} as const; +export type PolicyEntityTypes = (typeof PolicyEntityTypes)[keyof typeof PolicyEntityTypes]; diff --git a/src/api/types/PolicyManifest.ts b/src/api/types/PolicyManifest.ts index b4ec14aa..73fbbf37 100644 --- a/src/api/types/PolicyManifest.ts +++ b/src/api/types/PolicyManifest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface PolicyManifest { /** +value=policy */ diff --git a/src/api/types/PolicyManifestMode.ts b/src/api/types/PolicyManifestMode.ts index ee8cef32..2e692bd5 100644 --- a/src/api/types/PolicyManifestMode.ts +++ b/src/api/types/PolicyManifestMode.ts @@ -2,8 +2,8 @@ /** Mode of the policy: `Audit` logs all policy evaluations without blocking deployments. `Enforce` blocks deployments if the policy fails. `Disabled` deactivates the policy. */ export const PolicyManifestMode = { - Audit: "audit", - Enforce: "enforce", - Disabled: "disabled" - } as const; -export type PolicyManifestMode = typeof PolicyManifestMode[keyof typeof PolicyManifestMode]; + Audit: "audit", + Enforce: "enforce", + Disabled: "disabled", +} as const; +export type PolicyManifestMode = (typeof PolicyManifestMode)[keyof typeof PolicyManifestMode]; diff --git a/src/api/types/PolicyManifestOperation.ts b/src/api/types/PolicyManifestOperation.ts index ace19c3e..c9555af7 100644 --- a/src/api/types/PolicyManifestOperation.ts +++ b/src/api/types/PolicyManifestOperation.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Defines if the policy validates or mutates resources. Validation policies check TrueFoundry manifests to ensure they meet conditions and can block deployments. Mutation policies modify Kubernetes manifests before they're applied to the cluster. See this [documentation](https://docs.truefoundry.com/docs/applying-custom-policies#applying-custom-policies) for more details. */ -export type PolicyManifestOperation = - | TrueFoundry.PolicyMutationOperation - | TrueFoundry.PolicyValidationOperation; +export type PolicyManifestOperation = TrueFoundry.PolicyMutationOperation | TrueFoundry.PolicyValidationOperation; diff --git a/src/api/types/PolicyVersion.ts b/src/api/types/PolicyVersion.ts new file mode 100644 index 00000000..d04a20e5 --- /dev/null +++ b/src/api/types/PolicyVersion.ts @@ -0,0 +1,11 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +export interface PolicyVersion { + id?: string | null; + policyId: string; + manifest: Record; + version: number; + createdBySubject?: TrueFoundry.Subject | null; +} diff --git a/src/api/types/Port.ts b/src/api/types/Port.ts index 951c8452..39ca70c3 100644 --- a/src/api/types/Port.ts +++ b/src/api/types/Port.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Describes the ports the service should be exposed to. diff --git a/src/api/types/PortAppProtocol.ts b/src/api/types/PortAppProtocol.ts index 4f749898..1bfb82ec 100644 --- a/src/api/types/PortAppProtocol.ts +++ b/src/api/types/PortAppProtocol.ts @@ -7,8 +7,8 @@ * This is only applicable if `expose=true`. */ export const PortAppProtocol = { - Http: "http", - Grpc: "grpc", - Tcp: "tcp" - } as const; -export type PortAppProtocol = typeof PortAppProtocol[keyof typeof PortAppProtocol]; + Http: "http", + Grpc: "grpc", + Tcp: "tcp", +} as const; +export type PortAppProtocol = (typeof PortAppProtocol)[keyof typeof PortAppProtocol]; diff --git a/src/api/types/PortAuth.ts b/src/api/types/PortAuth.ts index fbc19337..d0848359 100644 --- a/src/api/types/PortAuth.ts +++ b/src/api/types/PortAuth.ts @@ -1,11 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Authentication method for inbound traffic */ -export type PortAuth = - | TrueFoundry.BasicAuthCreds - | TrueFoundry.JwtAuthConfig - | TrueFoundry.TrueFoundryInteractiveLogin; +export type PortAuth = TrueFoundry.BasicAuthCreds | TrueFoundry.JwtAuthConfig | TrueFoundry.TrueFoundryInteractiveLogin; diff --git a/src/api/types/PortProtocol.ts b/src/api/types/PortProtocol.ts index 2e0cf149..5d46a5ea 100644 --- a/src/api/types/PortProtocol.ts +++ b/src/api/types/PortProtocol.ts @@ -2,7 +2,7 @@ /** Protocol for the port. */ export const PortProtocol = { - Tcp: "TCP", - Udp: "UDP" - } as const; -export type PortProtocol = typeof PortProtocol[keyof typeof PortProtocol]; + Tcp: "TCP", + Udp: "UDP", +} as const; +export type PortProtocol = (typeof PortProtocol)[keyof typeof PortProtocol]; diff --git a/src/api/types/PresetRegexPattern.ts b/src/api/types/PresetRegexPattern.ts index d005f802..5f530145 100644 --- a/src/api/types/PresetRegexPattern.ts +++ b/src/api/types/PresetRegexPattern.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Select one or more common regex patterns from the predefined list. diff --git a/src/api/types/PresetRegexPatternEnum.ts b/src/api/types/PresetRegexPatternEnum.ts index 4055b672..54751a39 100644 --- a/src/api/types/PresetRegexPatternEnum.ts +++ b/src/api/types/PresetRegexPatternEnum.ts @@ -1,48 +1,48 @@ // This file was auto-generated by Fern from our API Definition. export const PresetRegexPatternEnum = { - UsSsn: "us_ssn", - UsSsnNoDash: "us_ssn_no_dash", - Email: "email", - UsPhone: "us_phone", - Visa: "visa", - Mastercard: "mastercard", - Amex: "amex", - Discover: "discover", - CreditCard: "credit_card", - AwsAccessKey: "aws_access_key", - AwsSecretKey: "aws_secret_key", - GithubToken: "github_token", - SlackToken: "slack_token", - GenericApiKey: "generic_api_key", - Ipv4: "ipv4", - Ipv6: "ipv6", - Url: "url", - PassportUs: "passport_us", - PassportUk: "passport_uk", - PassportGermany: "passport_germany", - PassportFrance: "passport_france", - PassportNetherlands: "passport_netherlands", - PassportCanada: "passport_canada", - PassportIndia: "passport_india", - PassportAustralia: "passport_australia", - PassportChina: "passport_china", - PassportJapan: "passport_japan", - GenderSexualOrientation: "gender_sexual_orientation", - RaceEthnicityNationalOrigin: "race_ethnicity_national_origin", - Religion: "religion", - AgeDiscrimination: "age_discrimination", - Disability: "disability", - MaritalFamilyStatus: "marital_family_status", - MilitaryStatus: "military_status", - PublicAssistance: "public_assistance", - WeaponsFirearms: "weapons_firearms", - WeaponsOther: "weapons_other", - Explosives: "explosives", - ViolenceThreats: "violence_threats", - Terrorism: "terrorism", - SelfHarmSuicide: "self_harm_suicide", - IllegalActivities: "illegal_activities", - HarassmentHate: "harassment_hate" - } as const; -export type PresetRegexPatternEnum = typeof PresetRegexPatternEnum[keyof typeof PresetRegexPatternEnum]; + UsSsn: "us_ssn", + UsSsnNoDash: "us_ssn_no_dash", + Email: "email", + UsPhone: "us_phone", + Visa: "visa", + Mastercard: "mastercard", + Amex: "amex", + Discover: "discover", + CreditCard: "credit_card", + AwsAccessKey: "aws_access_key", + AwsSecretKey: "aws_secret_key", + GithubToken: "github_token", + SlackToken: "slack_token", + GenericApiKey: "generic_api_key", + Ipv4: "ipv4", + Ipv6: "ipv6", + Url: "url", + PassportUs: "passport_us", + PassportUk: "passport_uk", + PassportGermany: "passport_germany", + PassportFrance: "passport_france", + PassportNetherlands: "passport_netherlands", + PassportCanada: "passport_canada", + PassportIndia: "passport_india", + PassportAustralia: "passport_australia", + PassportChina: "passport_china", + PassportJapan: "passport_japan", + GenderSexualOrientation: "gender_sexual_orientation", + RaceEthnicityNationalOrigin: "race_ethnicity_national_origin", + Religion: "religion", + AgeDiscrimination: "age_discrimination", + Disability: "disability", + MaritalFamilyStatus: "marital_family_status", + MilitaryStatus: "military_status", + PublicAssistance: "public_assistance", + WeaponsFirearms: "weapons_firearms", + WeaponsOther: "weapons_other", + Explosives: "explosives", + ViolenceThreats: "violence_threats", + Terrorism: "terrorism", + SelfHarmSuicide: "self_harm_suicide", + IllegalActivities: "illegal_activities", + HarassmentHate: "harassment_hate", +} as const; +export type PresetRegexPatternEnum = (typeof PresetRegexPatternEnum)[keyof typeof PresetRegexPatternEnum]; diff --git a/src/api/types/PresignedUrlObject.ts b/src/api/types/PresignedUrlObject.ts index e935b7c2..26ba1f3f 100644 --- a/src/api/types/PresignedUrlObject.ts +++ b/src/api/types/PresignedUrlObject.ts @@ -3,5 +3,5 @@ export interface PresignedUrlObject { uri: string; url: string; - headers?: Record; + headers?: Record | null; } diff --git a/src/api/types/PriorityBasedLoadBalanceTarget.ts b/src/api/types/PriorityBasedLoadBalanceTarget.ts index 38307b40..7f91e88f 100644 --- a/src/api/types/PriorityBasedLoadBalanceTarget.ts +++ b/src/api/types/PriorityBasedLoadBalanceTarget.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface PriorityBasedLoadBalanceTarget { /** Target model or provider FQN */ diff --git a/src/api/types/PriorityBasedLoadBalancing.ts b/src/api/types/PriorityBasedLoadBalancing.ts index 454f5988..9849f143 100644 --- a/src/api/types/PriorityBasedLoadBalancing.ts +++ b/src/api/types/PriorityBasedLoadBalancing.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Priority-based Load Balancing diff --git a/src/api/types/PriorityBasedLoadBalancingRule.ts b/src/api/types/PriorityBasedLoadBalancingRule.ts index 0f21a090..5d7085dd 100644 --- a/src/api/types/PriorityBasedLoadBalancingRule.ts +++ b/src/api/types/PriorityBasedLoadBalancingRule.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Priority-based Load Balancing Rule diff --git a/src/api/types/PrivatePricingTier.ts b/src/api/types/PrivatePricingTier.ts index 46bfe3b3..4a4684c2 100644 --- a/src/api/types/PrivatePricingTier.ts +++ b/src/api/types/PrivatePricingTier.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Pricing tier for volume-based pricing (per 1000 tokens) diff --git a/src/api/types/PrometheusAlertRule.ts b/src/api/types/PrometheusAlertRule.ts index dfd1b87d..e64720bc 100644 --- a/src/api/types/PrometheusAlertRule.ts +++ b/src/api/types/PrometheusAlertRule.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Prometheus Alert Rule @@ -13,7 +13,7 @@ export interface PrometheusAlertRule { /** Enter a valid PromQL expression that defines the condition for triggering this alert. The alert will fire when this expression evaluates to true for the duration specified in the duration to trigger alert field. */ expression: string; /** The prometheus expression must remain true for this duration (in seconds) before the alert is triggered. If the condition becomes false before this time elapses, the alert will not fire. */ - "for": number; + for: number; severity: TrueFoundry.AlertSeverity; /** Description of the alert rule which will be displayed in the alert rule list. This can be used to provide more context about the alert rule. */ description?: string; diff --git a/src/api/types/Prompt.ts b/src/api/types/Prompt.ts index b5899238..456fd9ad 100644 --- a/src/api/types/Prompt.ts +++ b/src/api/types/Prompt.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface Prompt { /** Unique identifier of the prompt. */ @@ -16,11 +16,11 @@ export interface Prompt { /** Subject (user, team, or service account) that created the prompt. */ createdBySubject: TrueFoundry.Subject; /** Timestamp when the prompt was created. */ - createdAt?: Date; + createdAt?: Date | null; /** Timestamp when the prompt was last updated. */ - updatedAt?: Date; + updatedAt?: Date | null; /** Most recently created version of the prompt, if any exist. */ - latestVersion?: TrueFoundry.PromptVersion; + latestVersion?: TrueFoundry.PromptVersion | null; /** Run steps associated with the prompt. */ - runSteps?: number[]; + runSteps?: number[] | null; } diff --git a/src/api/types/PromptSource.ts b/src/api/types/PromptSource.ts index 946a29aa..d9a8135e 100644 --- a/src/api/types/PromptSource.ts +++ b/src/api/types/PromptSource.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Prompt diff --git a/src/api/types/PromptVersion.ts b/src/api/types/PromptVersion.ts index bae51680..c1254a3d 100644 --- a/src/api/types/PromptVersion.ts +++ b/src/api/types/PromptVersion.ts @@ -1,12 +1,12 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface PromptVersion { /** Timestamp when the prompt version was created. */ - createdAt?: Date; + createdAt?: Date | null; /** Timestamp when the prompt version was last updated. */ - updatedAt?: Date; + updatedAt?: Date | null; /** Manifest describing the prompt version. */ manifest: TrueFoundry.ChatPromptManifest; /** Unique identifier of the prompt version. */ @@ -18,7 +18,7 @@ export interface PromptVersion { /** Identifier of the ML Repo the prompt version belongs to. */ mlRepoId: string; /** Code snippet showing how to use the prompt version. */ - usageCodeSnippet?: string; + usageCodeSnippet?: string | null; /** Code snippets showing how to use the prompt version. */ usageCodeSnippets?: TrueFoundry.UsageCodeSnippet[]; /** Tags associated with the prompt version. */ diff --git a/src/api/types/ProviderAccount.ts b/src/api/types/ProviderAccount.ts new file mode 100644 index 00000000..bdf24561 --- /dev/null +++ b/src/api/types/ProviderAccount.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +export interface ProviderAccount { + /** System-generated provider account ID. */ + id?: string | null; + /** Human-readable Fully Qualified Name of the provider account. */ + fqn: string; + provider: TrueFoundry.ProviderAccountProvider; + manifest: Record; + /** List of Provider Integrations */ + integrations?: TrueFoundry.ProviderIntegration[] | null; + createdBySubject?: TrueFoundry.Subject | null; + accountId: string; + createdAt?: Date | null; + updatedAt?: Date | null; + createdBy?: string | null; +} diff --git a/src/api/types/ProviderAccountProvider.ts b/src/api/types/ProviderAccountProvider.ts new file mode 100644 index 00000000..c37ff974 --- /dev/null +++ b/src/api/types/ProviderAccountProvider.ts @@ -0,0 +1,62 @@ +// This file was auto-generated by Fern from our API Definition. + +export const ProviderAccountProvider = { + Aws: "aws", + Gcp: "gcp", + Azure: "azure", + Dockerhub: "dockerhub", + Openai: "openai", + Databricks: "databricks", + Truefoundry: "truefoundry", + Jfrog: "jfrog", + Ttl: "ttl", + Custom: "custom", + Quay: "quay", + Github: "github", + Gitlab: "gitlab", + Bitbucket: "bitbucket", + BitbucketDataCenter: "bitbucket_data_center", + Ai21: "ai21", + Cohere: "cohere", + Anthropic: "anthropic", + Anyscale: "anyscale", + Deepinfra: "deepinfra", + Groq: "groq", + MistralAi: "mistral-ai", + Nomic: "nomic", + Palm: "palm", + PerplexityAi: "perplexity-ai", + TogetherAi: "together-ai", + Ollama: "ollama", + Slack: "slack", + AwsBedrock: "aws-bedrock", + GoogleVertex: "google-vertex", + GoogleGemini: "google-gemini", + AzureOpenai: "azure-openai", + AzureFoundry: "azure-foundry", + SelfHostedModel: "self-hosted-model", + McpServerGroup: "mcp-server-group", + Pagerduty: "pagerduty", + MsTeams: "ms-teams", + ModelProviderAccounts: "model-provider-accounts", + GuardrailConfigGroup: "guardrail-config-group", + Openrouter: "openrouter", + Sambanova: "sambanova", + AwsSagemaker: "aws-sagemaker", + Cerebras: "cerebras", + Wafer: "wafer", + Hashicorp: "hashicorp", + SnowflakeCortex: "snowflake-cortex", + Cloudera: "cloudera", + Xai: "xai", + Baseten: "baseten", + VirtualModel: "virtual-model", + Elevenlabs: "elevenlabs", + Deepgram: "deepgram", + Cartesia: "cartesia", + CustomEndpoint: "custom-endpoint", + SmallestAi: "smallest-ai", + AwsClaudePlatform: "aws-claude-platform", + AwsBedrockMantle: "aws-bedrock-mantle", +} as const; +export type ProviderAccountProvider = (typeof ProviderAccountProvider)[keyof typeof ProviderAccountProvider]; diff --git a/src/api/types/ProviderAccounts.ts b/src/api/types/ProviderAccounts.ts index 35e2333c..4eb17504 100644 --- a/src/api/types/ProviderAccounts.ts +++ b/src/api/types/ProviderAccounts.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +discriminator=type */ -export type ProviderAccounts = +export type ProviderAccounts = | TrueFoundry.InfraProviderAccount | TrueFoundry.ModelProviderAccount | TrueFoundry.McpServerProviderAccount diff --git a/src/api/types/ProviderIntegration.ts b/src/api/types/ProviderIntegration.ts new file mode 100644 index 00000000..c6bb347a --- /dev/null +++ b/src/api/types/ProviderIntegration.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +export interface ProviderIntegration { + /** System-generated provider integration ID. */ + id: string; + name: string; + /** Human-readable Fully Qualified Name of the provider integration. */ + fqn: string; + type: TrueFoundry.ProviderIntegrationType; + manifest?: Record | null; + metadata?: Record | null; + providerAccountFqn: string; + tenantName: string; + providerAccount?: TrueFoundry.ProviderAccount | null; + createdBySubject: TrueFoundry.Subject; + createdAt?: Date | null; + updatedAt?: Date | null; + createdBy?: string | null; +} diff --git a/src/api/types/ProviderIntegrationType.ts b/src/api/types/ProviderIntegrationType.ts new file mode 100644 index 00000000..09b4fd0d --- /dev/null +++ b/src/api/types/ProviderIntegrationType.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +export const ProviderIntegrationType = { + BlobStorage: "blob-storage", + SecretStore: "secret-store", + DockerRegistry: "docker-registry", + Model: "model", + Vcs: "vcs", + Cluster: "cluster", + NotificationChannel: "notification-channel", + HelmRepo: "helm-repo", + JwtAuth: "jwt-auth", + McpServer: "mcp-server", + GuardrailConfig: "guardrail-config", +} as const; +export type ProviderIntegrationType = (typeof ProviderIntegrationType)[keyof typeof ProviderIntegrationType]; diff --git a/src/api/types/PySparkTaskConfig.ts b/src/api/types/PySparkTaskConfig.ts index 7a3b62eb..10459559 100644 --- a/src/api/types/PySparkTaskConfig.ts +++ b/src/api/types/PySparkTaskConfig.ts @@ -1,17 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface PySparkTaskConfig { /** +value=pyspark-task-config */ type: "pyspark-task-config"; - image: TrueFoundry.TaskPySparkBuild; + /** + * Specification for the image to be used for the task. Use TaskPySparkBuild to build an image, + * or TaskSparkImage to use a pre-built image that already contains all code and dependencies. + */ + image: TrueFoundry.PySparkTaskConfigImage; driverConfig: TrueFoundry.SparkDriverConfig; executorConfig: TrueFoundry.SparkExecutorConfig; /** Extra configuration properties to be passed to the spark job. [Docs](https://spark.apache.org/docs/latest/configuration.html) */ - sparkConf?: Record; + sparkConf?: Record | null; /** Configure environment variables to be injected in the task either as plain text or secrets. [Docs](https://docs.truefoundry.com/docs/env-variables) */ - env?: Record; + env?: Record | null; /** Configure data to be mounted to Workflow pod(s) as a volume. */ mounts?: TrueFoundry.VolumeMount[]; /** Service Account */ diff --git a/src/api/types/PySparkTaskConfigImage.ts b/src/api/types/PySparkTaskConfigImage.ts new file mode 100644 index 00000000..83af3eff --- /dev/null +++ b/src/api/types/PySparkTaskConfigImage.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +/** + * Specification for the image to be used for the task. Use TaskPySparkBuild to build an image, + * or TaskSparkImage to use a pre-built image that already contains all code and dependencies. + */ +export type PySparkTaskConfigImage = TrueFoundry.TaskPySparkBuild | TrueFoundry.TaskSparkImage; diff --git a/src/api/types/PythonBuild.ts b/src/api/types/PythonBuild.ts index 65804314..0349baaf 100644 --- a/src/api/types/PythonBuild.ts +++ b/src/api/types/PythonBuild.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Describes that we are using python to build a container image with a specific python version and pip packages installed. diff --git a/src/api/types/PythonBuildCommand.ts b/src/api/types/PythonBuildCommand.ts index dee6ee4f..f11898d3 100644 --- a/src/api/types/PythonBuildCommand.ts +++ b/src/api/types/PythonBuildCommand.ts @@ -6,6 +6,4 @@ * When deploying a Job, the command can be templatized by defining `params` and referencing them in command * E.g. `python main.py --learning_rate {{learning_rate}}` */ -export type PythonBuildCommand = - | string - | string[]; +export type PythonBuildCommand = string | string[]; diff --git a/src/api/types/PythonBuildPythonDependencies.ts b/src/api/types/PythonBuildPythonDependencies.ts index 2148bd56..e683c44b 100644 --- a/src/api/types/PythonBuildPythonDependencies.ts +++ b/src/api/types/PythonBuildPythonDependencies.ts @@ -1,11 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Python dependencies to install */ -export type PythonBuildPythonDependencies = - | TrueFoundry.Pip - | TrueFoundry.Uv - | TrueFoundry.Poetry; +export type PythonBuildPythonDependencies = TrueFoundry.Pip | TrueFoundry.Uv | TrueFoundry.Poetry; diff --git a/src/api/types/PythonTaskConfig.ts b/src/api/types/PythonTaskConfig.ts index 86df152c..f6f1b188 100644 --- a/src/api/types/PythonTaskConfig.ts +++ b/src/api/types/PythonTaskConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Describes the configuration for the python function task @@ -11,7 +11,7 @@ export interface PythonTaskConfig { /** Specify the image spec for the task */ image: TrueFoundry.PythonTaskConfigImage; /** Configure environment variables to be injected in the task either as plain text or secrets. [Docs](https://docs.truefoundry.com/docs/env-variables) */ - env?: Record; + env?: Record | null; resources?: TrueFoundry.Resources; /** Configure data to be mounted to Workflow pod(s) as a volume. */ mounts?: TrueFoundry.PythonTaskConfigMountsItem[]; diff --git a/src/api/types/PythonTaskConfigImage.ts b/src/api/types/PythonTaskConfigImage.ts index 55e7535e..30bfc93d 100644 --- a/src/api/types/PythonTaskConfigImage.ts +++ b/src/api/types/PythonTaskConfigImage.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Specify the image spec for the task */ -export type PythonTaskConfigImage = - | TrueFoundry.TaskPythonBuild - | TrueFoundry.TaskDockerFileBuild; +export type PythonTaskConfigImage = TrueFoundry.TaskPythonBuild | TrueFoundry.TaskDockerFileBuild; diff --git a/src/api/types/PythonTaskConfigMountsItem.ts b/src/api/types/PythonTaskConfigMountsItem.ts index 7b4231b2..dec57d81 100644 --- a/src/api/types/PythonTaskConfigMountsItem.ts +++ b/src/api/types/PythonTaskConfigMountsItem.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; -export type PythonTaskConfigMountsItem = +export type PythonTaskConfigMountsItem = | TrueFoundry.SecretMount | TrueFoundry.StringDataMount | TrueFoundry.VolumeMount; diff --git a/src/api/types/QuayArtifactsRegistry.ts b/src/api/types/QuayArtifactsRegistry.ts index 30298e48..013def7e 100644 --- a/src/api/types/QuayArtifactsRegistry.ts +++ b/src/api/types/QuayArtifactsRegistry.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Quay Artifacts Registry diff --git a/src/api/types/QuayIntegrations.ts b/src/api/types/QuayIntegrations.ts index 42cfc6fd..0b5cc9c9 100644 --- a/src/api/types/QuayIntegrations.ts +++ b/src/api/types/QuayIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type QuayIntegrations = TrueFoundry.QuayArtifactsRegistry; diff --git a/src/api/types/QuayProviderAccount.ts b/src/api/types/QuayProviderAccount.ts index 5b6b29bc..2b8041a3 100644 --- a/src/api/types/QuayProviderAccount.ts +++ b/src/api/types/QuayProviderAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Quay diff --git a/src/api/types/QuerySpansResponse.ts b/src/api/types/QuerySpansResponse.ts index 520056ad..1c4e6947 100644 --- a/src/api/types/QuerySpansResponse.ts +++ b/src/api/types/QuerySpansResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface QuerySpansResponse { /** Array of flat spans */ diff --git a/src/api/types/RStudio.ts b/src/api/types/RStudio.ts index f3230c1c..81576d9f 100644 --- a/src/api/types/RStudio.ts +++ b/src/api/types/RStudio.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Describes the configuration for the Rstudio server diff --git a/src/api/types/RateLimitConfig.ts b/src/api/types/RateLimitConfig.ts index ffe6e554..a825ef87 100644 --- a/src/api/types/RateLimitConfig.ts +++ b/src/api/types/RateLimitConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Rate Limit Configuration diff --git a/src/api/types/RateLimitRule.ts b/src/api/types/RateLimitRule.ts index 66720314..8fcb31a1 100644 --- a/src/api/types/RateLimitRule.ts +++ b/src/api/types/RateLimitRule.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Rate Limit Rule diff --git a/src/api/types/RateLimitUnit.ts b/src/api/types/RateLimitUnit.ts index bb262db5..7bb5aa07 100644 --- a/src/api/types/RateLimitUnit.ts +++ b/src/api/types/RateLimitUnit.ts @@ -2,11 +2,11 @@ /** Unit for rate limit calculation */ export const RateLimitUnit = { - RequestsPerDay: "requests_per_day", - TokensPerMinute: "tokens_per_minute", - RequestsPerMinute: "requests_per_minute", - TokensPerDay: "tokens_per_day", - RequestsPerHour: "requests_per_hour", - TokensPerHour: "tokens_per_hour" - } as const; -export type RateLimitUnit = typeof RateLimitUnit[keyof typeof RateLimitUnit]; + RequestsPerDay: "requests_per_day", + TokensPerMinute: "tokens_per_minute", + RequestsPerMinute: "requests_per_minute", + TokensPerDay: "tokens_per_day", + RequestsPerHour: "requests_per_hour", + TokensPerHour: "tokens_per_hour", +} as const; +export type RateLimitUnit = (typeof RateLimitUnit)[keyof typeof RateLimitUnit]; diff --git a/src/api/types/Recommendation.ts b/src/api/types/Recommendation.ts index ed0ec12e..fb297e06 100644 --- a/src/api/types/Recommendation.ts +++ b/src/api/types/Recommendation.ts @@ -1,15 +1,15 @@ // This file was auto-generated by Fern from our API Definition. export interface Recommendation { - id?: string; - clusterId?: string; - applicationId?: string; - deploymentId?: string; - applicationVersion?: number; + id?: string | null; + clusterId?: string | null; + applicationId?: string | null; + deploymentId?: string | null; + applicationVersion?: number | null; recommendationData: Record; recommendationType: string; - appliedDeploymentId?: string; + appliedDeploymentId?: string | null; expiryTimestamp: Date; - createdAt?: Date; - updatedAt?: Date; + createdAt?: Date | null; + updatedAt?: Date | null; } diff --git a/src/api/types/Redaction.ts b/src/api/types/Redaction.ts new file mode 100644 index 00000000..6eab6e9d --- /dev/null +++ b/src/api/types/Redaction.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +/** + * Redaction + */ +export interface Redaction { + /** Predefined patterns to redact from the logged copy. */ + presets?: TrueFoundry.PresetRegexPatternEnum[]; + /** Custom patterns to redact from the logged copy. */ + customPatterns?: TrueFoundry.CustomRegexPattern[]; +} diff --git a/src/api/types/RegexGuardrailConfig.ts b/src/api/types/RegexGuardrailConfig.ts index 4fa2f464..dd9a71fc 100644 --- a/src/api/types/RegexGuardrailConfig.ts +++ b/src/api/types/RegexGuardrailConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Regex Pattern Match diff --git a/src/api/types/RegexGuardrailConfigConfig.ts b/src/api/types/RegexGuardrailConfigConfig.ts index 4fb59407..153bb174 100644 --- a/src/api/types/RegexGuardrailConfigConfig.ts +++ b/src/api/types/RegexGuardrailConfigConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +uiType=Ignore diff --git a/src/api/types/RegexGuardrailConfigOperation.ts b/src/api/types/RegexGuardrailConfigOperation.ts index 7ce465bc..0674777b 100644 --- a/src/api/types/RegexGuardrailConfigOperation.ts +++ b/src/api/types/RegexGuardrailConfigOperation.ts @@ -2,7 +2,8 @@ /** Validate blocks when pattern matches. Mutate replaces matched text and continues. */ export const RegexGuardrailConfigOperation = { - Validate: "validate", - Mutate: "mutate" - } as const; -export type RegexGuardrailConfigOperation = typeof RegexGuardrailConfigOperation[keyof typeof RegexGuardrailConfigOperation]; + Validate: "validate", + Mutate: "mutate", +} as const; +export type RegexGuardrailConfigOperation = + (typeof RegexGuardrailConfigOperation)[keyof typeof RegexGuardrailConfigOperation]; diff --git a/src/api/types/RegisterUsersResponse.ts b/src/api/types/RegisterUsersResponse.ts index 303afee3..d0d0d341 100644 --- a/src/api/types/RegisterUsersResponse.ts +++ b/src/api/types/RegisterUsersResponse.ts @@ -1,4 +1,3 @@ // This file was auto-generated by Fern from our API Definition. -export interface RegisterUsersResponse { -} +export type RegisterUsersResponse = {}; diff --git a/src/api/types/RemoteAgent.ts b/src/api/types/RemoteAgent.ts index df760381..596f48da 100644 --- a/src/api/types/RemoteAgent.ts +++ b/src/api/types/RemoteAgent.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type RemoteAgent = TrueFoundry.SelfHostedAgent; diff --git a/src/api/types/RemoteMcpServerManifest.ts b/src/api/types/RemoteMcpServerManifest.ts index dcfb9f81..66efe2a3 100644 --- a/src/api/types/RemoteMcpServerManifest.ts +++ b/src/api/types/RemoteMcpServerManifest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Connect to an external MCP Server endpoint. @@ -10,6 +10,8 @@ export interface RemoteMcpServerManifest { type: "mcp-server/remote"; /** The name of the MCP Server. */ name: string; + /** A human-readable label for the MCP Server in the UI. If omitted, the server name is shown. */ + displayName?: string; /** Provide a brief description of the purpose of this MCP Server. */ description: string; /** The endpoint URL for the MCP Server. */ diff --git a/src/api/types/ResourceType.ts b/src/api/types/ResourceType.ts deleted file mode 100644 index dd37c9da..00000000 --- a/src/api/types/ResourceType.ts +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** Resource type scope for the role assignment. */ -export const ResourceType = { - Role: "role", - Account: "account", - Cluster: "cluster", - Workspace: "workspace", - Environment: "environment", - SecretGroup: "secret-group", - Deployment: "deployment", - Application: "application", - Secret: "secret", - DockerRegistry: "docker-registry", - Tenant: "tenant", - VcsIntegration: "vcs-integration", - MlfProject: "mlf-project", - Repository: "repository", - ProviderIntegration: "provider-integration", - Team: "team", - ServiceAccount: "service-account", - LlmGateway: "llm-gateway", - Policy: "policy", - RoleBinding: "role-binding", - Settings: "settings", - ProviderAccount: "provider-account", - User: "user", - AlertConfig: "alert-config", - AlertRule: "alert-rule", - GatewayConfig: "gateway-config", - GatewayControls: "gateway-controls", - GatewayBudget: "gateway-budget", - TracingProject: "tracing-project", - TracingApplication: "tracing-application", - Agent: "agent", - AgentApp: "agent-app", - GatewayInstallation: "gateway-installation", - VirtualAccount: "virtual-account", - SsoBasedIdentity: "sso-based-identity", - ExternalIdentity: "external-identity", - McpServer: "mcp-server", - ExternalIdentityProvider: "external-identity-provider", - AgentIdentity: "agent-identity" - } as const; -export type ResourceType = typeof ResourceType[keyof typeof ResourceType]; diff --git a/src/api/types/Resources.ts b/src/api/types/Resources.ts index c3ca2e94..c8a4bec8 100644 --- a/src/api/types/Resources.ts +++ b/src/api/types/Resources.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Configure resource allocations, specify node constraints and capacity types to improve performance and reduce expenses. [Docs](https://www.truefoundry.com/docs/resources-cpu-memory-storage) diff --git a/src/api/types/ResourcesDevicesItem.ts b/src/api/types/ResourcesDevicesItem.ts index dd6f59e6..4a692dd2 100644 --- a/src/api/types/ResourcesDevicesItem.ts +++ b/src/api/types/ResourcesDevicesItem.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; -export type ResourcesDevicesItem = +export type ResourcesDevicesItem = | TrueFoundry.NvidiaGpu | TrueFoundry.AwsInferentia | TrueFoundry.NvidiaMiggpu diff --git a/src/api/types/ResourcesNode.ts b/src/api/types/ResourcesNode.ts index f1f29153..1eefd67d 100644 --- a/src/api/types/ResourcesNode.ts +++ b/src/api/types/ResourcesNode.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * This field determines how the underlying node resource is to be utilized */ -export type ResourcesNode = - | TrueFoundry.NodeSelector - | TrueFoundry.NodepoolSelector; +export type ResourcesNode = TrueFoundry.NodeSelector | TrueFoundry.NodepoolSelector; diff --git a/src/api/types/ResponseFormatJsonSchema.ts b/src/api/types/ResponseFormatJsonSchema.ts index d8d28c8d..867498c6 100644 --- a/src/api/types/ResponseFormatJsonSchema.ts +++ b/src/api/types/ResponseFormatJsonSchema.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ResponseFormatJsonSchema { type: "json_schema"; diff --git a/src/api/types/RevokeAllPersonalAccessTokenResponse.ts b/src/api/types/RevokeAllPersonalAccessTokenResponse.ts index 50651aa9..197ea3b1 100644 --- a/src/api/types/RevokeAllPersonalAccessTokenResponse.ts +++ b/src/api/types/RevokeAllPersonalAccessTokenResponse.ts @@ -1,4 +1,3 @@ // This file was auto-generated by Fern from our API Definition. -export interface RevokeAllPersonalAccessTokenResponse { -} +export type RevokeAllPersonalAccessTokenResponse = {}; diff --git a/src/api/types/Role.ts b/src/api/types/Role.ts new file mode 100644 index 00000000..f5a02b39 --- /dev/null +++ b/src/api/types/Role.ts @@ -0,0 +1,26 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +export interface Role { + /** System-generated role ID. */ + id: string; + /** Tenant the role belongs to. */ + tenantName: string; + /** System-generated ID of the account that owns the role. */ + accountId: string; + /** Resource type this role applies to (e.g. account, team). */ + resourceType: TrueFoundry.RoleResourceType; + /** The role manifest defining name, permissions, and metadata. */ + manifest: TrueFoundry.RoleManifest; + /** The subject (user or service account) that created this role. */ + createdBySubject: Record; + /** Permission sets defining the actions this role grants. */ + permissionSetsV2?: TrueFoundry.PermissionSetV2[] | null; + /** Whether this role can be edited. Default and system roles are non-editable. */ + isEditable: boolean; + /** Whether this is a built-in default role. */ + isDefault: boolean; + /** Whether this role name is reserved for internal use. */ + isReserved: boolean; +} diff --git a/src/api/types/RoleBinding.ts b/src/api/types/RoleBinding.ts new file mode 100644 index 00000000..976bdf11 --- /dev/null +++ b/src/api/types/RoleBinding.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +export interface RoleBinding { + id?: string | null; + name: string; + accountId: string; + /** Stored role binding manifest */ + manifest: TrueFoundry.RoleBindingManifest; + metadata?: Record | null; + createdBySubject: TrueFoundry.Subject; + createdAt?: Date | null; + updatedAt?: Date | null; +} diff --git a/src/api/types/RoleBindingManifest.ts b/src/api/types/RoleBindingManifest.ts index abfd4b18..67ec0f74 100644 --- a/src/api/types/RoleBindingManifest.ts +++ b/src/api/types/RoleBindingManifest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface RoleBindingManifest { /** +value=role-binding */ diff --git a/src/api/types/RoleBindingSubject.ts b/src/api/types/RoleBindingSubject.ts index a1e6a202..79de0b06 100644 --- a/src/api/types/RoleBindingSubject.ts +++ b/src/api/types/RoleBindingSubject.ts @@ -1,14 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Single row per principal: type selects how to interpret name (email vs names). * Field names mirror the manifest root (type + name) for consistency in the UI and YAML. */ export interface RoleBindingSubject { - /** Whether this row identifies a user (email), a team (name), a virtual account (name), or an external identity (name). */ + /** Whether this row identifies a user (email), a team (name), or a virtual account (name). */ type: TrueFoundry.RoleBindingSubjectType; - /** User email when type is user; team or virtual account name when type is team or virtualaccount; external identity name when type is external-identity. */ + /** User email when type is user; team or virtual account name when type is team or virtualaccount. */ name: string; } diff --git a/src/api/types/RoleBindingSubjectType.ts b/src/api/types/RoleBindingSubjectType.ts index 690867f7..9fd04241 100644 --- a/src/api/types/RoleBindingSubjectType.ts +++ b/src/api/types/RoleBindingSubjectType.ts @@ -1,10 +1,9 @@ // This file was auto-generated by Fern from our API Definition. -/** Whether this row identifies a user (email), a team (name), a virtual account (name), or an external identity (name). */ +/** Whether this row identifies a user (email), a team (name), or a virtual account (name). */ export const RoleBindingSubjectType = { - User: "user", - Team: "team", - Virtualaccount: "virtualaccount", - ExternalIdentity: "external-identity" - } as const; -export type RoleBindingSubjectType = typeof RoleBindingSubjectType[keyof typeof RoleBindingSubjectType]; + User: "user", + Team: "team", + Virtualaccount: "virtualaccount", +} as const; +export type RoleBindingSubjectType = (typeof RoleBindingSubjectType)[keyof typeof RoleBindingSubjectType]; diff --git a/src/api/types/RoleResourceType.ts b/src/api/types/RoleResourceType.ts new file mode 100644 index 00000000..dbd4ba83 --- /dev/null +++ b/src/api/types/RoleResourceType.ts @@ -0,0 +1,48 @@ +// This file was auto-generated by Fern from our API Definition. + +/** Resource type this role applies to (e.g. account, team). */ +export const RoleResourceType = { + Role: "role", + Account: "account", + Cluster: "cluster", + Workspace: "workspace", + Environment: "environment", + SecretGroup: "secret-group", + Deployment: "deployment", + Application: "application", + Secret: "secret", + DockerRegistry: "docker-registry", + Tenant: "tenant", + VcsIntegration: "vcs-integration", + MlfProject: "mlf-project", + Repository: "repository", + ProviderIntegration: "provider-integration", + Team: "team", + ServiceAccount: "service-account", + LlmGateway: "llm-gateway", + Policy: "policy", + RoleBinding: "role-binding", + Settings: "settings", + ProviderAccount: "provider-account", + User: "user", + AlertConfig: "alert-config", + AlertRule: "alert-rule", + GatewayConfig: "gateway-config", + GatewayControls: "gateway-controls", + GatewayBudget: "gateway-budget", + GatewayPolicy: "gateway-policy", + GatewayApprovalRequest: "gateway-approval-request", + TracingProject: "tracing-project", + TracingApplication: "tracing-application", + Agent: "agent", + AgentApp: "agent-app", + AgentChannel: "agent-channel", + GatewayInstallation: "gateway-installation", + VirtualAccount: "virtual-account", + SsoBasedIdentity: "sso-based-identity", + ExternalIdentity: "external-identity", + McpServer: "mcp-server", + ExternalIdentityProvider: "external-identity-provider", + AgentIdentity: "agent-identity", +} as const; +export type RoleResourceType = (typeof RoleResourceType)[keyof typeof RoleResourceType]; diff --git a/src/api/types/RoleWithResource.ts b/src/api/types/RoleWithResource.ts index 8b3fe228..c0a9bc78 100644 --- a/src/api/types/RoleWithResource.ts +++ b/src/api/types/RoleWithResource.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface RoleWithResource { roleId: string; diff --git a/src/api/types/RoleWithResourceResourceType.ts b/src/api/types/RoleWithResourceResourceType.ts index b720a626..7e9388bb 100644 --- a/src/api/types/RoleWithResourceResourceType.ts +++ b/src/api/types/RoleWithResourceResourceType.ts @@ -1,44 +1,48 @@ // This file was auto-generated by Fern from our API Definition. export const RoleWithResourceResourceType = { - Role: "role", - Account: "account", - Cluster: "cluster", - Workspace: "workspace", - Environment: "environment", - SecretGroup: "secret-group", - Deployment: "deployment", - Application: "application", - Secret: "secret", - DockerRegistry: "docker-registry", - Tenant: "tenant", - VcsIntegration: "vcs-integration", - MlfProject: "mlf-project", - Repository: "repository", - ProviderIntegration: "provider-integration", - Team: "team", - ServiceAccount: "service-account", - LlmGateway: "llm-gateway", - Policy: "policy", - RoleBinding: "role-binding", - Settings: "settings", - ProviderAccount: "provider-account", - User: "user", - AlertConfig: "alert-config", - AlertRule: "alert-rule", - GatewayConfig: "gateway-config", - GatewayControls: "gateway-controls", - GatewayBudget: "gateway-budget", - TracingProject: "tracing-project", - TracingApplication: "tracing-application", - Agent: "agent", - AgentApp: "agent-app", - GatewayInstallation: "gateway-installation", - VirtualAccount: "virtual-account", - SsoBasedIdentity: "sso-based-identity", - ExternalIdentity: "external-identity", - McpServer: "mcp-server", - ExternalIdentityProvider: "external-identity-provider", - AgentIdentity: "agent-identity" - } as const; -export type RoleWithResourceResourceType = typeof RoleWithResourceResourceType[keyof typeof RoleWithResourceResourceType]; + Role: "role", + Account: "account", + Cluster: "cluster", + Workspace: "workspace", + Environment: "environment", + SecretGroup: "secret-group", + Deployment: "deployment", + Application: "application", + Secret: "secret", + DockerRegistry: "docker-registry", + Tenant: "tenant", + VcsIntegration: "vcs-integration", + MlfProject: "mlf-project", + Repository: "repository", + ProviderIntegration: "provider-integration", + Team: "team", + ServiceAccount: "service-account", + LlmGateway: "llm-gateway", + Policy: "policy", + RoleBinding: "role-binding", + Settings: "settings", + ProviderAccount: "provider-account", + User: "user", + AlertConfig: "alert-config", + AlertRule: "alert-rule", + GatewayConfig: "gateway-config", + GatewayControls: "gateway-controls", + GatewayBudget: "gateway-budget", + GatewayPolicy: "gateway-policy", + GatewayApprovalRequest: "gateway-approval-request", + TracingProject: "tracing-project", + TracingApplication: "tracing-application", + Agent: "agent", + AgentApp: "agent-app", + AgentChannel: "agent-channel", + GatewayInstallation: "gateway-installation", + VirtualAccount: "virtual-account", + SsoBasedIdentity: "sso-based-identity", + ExternalIdentity: "external-identity", + McpServer: "mcp-server", + ExternalIdentityProvider: "external-identity-provider", + AgentIdentity: "agent-identity", +} as const; +export type RoleWithResourceResourceType = + (typeof RoleWithResourceResourceType)[keyof typeof RoleWithResourceResourceType]; diff --git a/src/api/types/Run.ts b/src/api/types/Run.ts index f37b0bbf..4244616f 100644 --- a/src/api/types/Run.ts +++ b/src/api/types/Run.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface Run { /** Run metadata. */ diff --git a/src/api/types/RunData.ts b/src/api/types/RunData.ts index 6d64f518..99b5e57a 100644 --- a/src/api/types/RunData.ts +++ b/src/api/types/RunData.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface RunData { /** Latest metrics logged for the run. */ diff --git a/src/api/types/RunInfo.ts b/src/api/types/RunInfo.ts index d1de8ac7..5339dcaa 100644 --- a/src/api/types/RunInfo.ts +++ b/src/api/types/RunInfo.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface RunInfo { /** System-generated unique identifier for the run. */ diff --git a/src/api/types/SagemakerAssumedRoleBasedAuth.ts b/src/api/types/SagemakerAssumedRoleBasedAuth.ts index 4a4aadee..d5e79d9c 100644 --- a/src/api/types/SagemakerAssumedRoleBasedAuth.ts +++ b/src/api/types/SagemakerAssumedRoleBasedAuth.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type SagemakerAssumedRoleBasedAuth = TrueFoundry.AwsBedrockAssumedRoleBasedAuth; diff --git a/src/api/types/SagemakerModel.ts b/src/api/types/SagemakerModel.ts index 428dc815..5d5cbbbd 100644 --- a/src/api/types/SagemakerModel.ts +++ b/src/api/types/SagemakerModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Sagemaker Model diff --git a/src/api/types/SambaNovaIntegrations.ts b/src/api/types/SambaNovaIntegrations.ts index f0db8ef1..a3318329 100644 --- a/src/api/types/SambaNovaIntegrations.ts +++ b/src/api/types/SambaNovaIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type SambaNovaIntegrations = TrueFoundry.SambaNovaModel; diff --git a/src/api/types/SambaNovaModel.ts b/src/api/types/SambaNovaModel.ts index f859a284..57566d29 100644 --- a/src/api/types/SambaNovaModel.ts +++ b/src/api/types/SambaNovaModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * SambaNova Model diff --git a/src/api/types/SambaNovaProviderAccount.ts b/src/api/types/SambaNovaProviderAccount.ts index 0078e1da..18b3e294 100644 --- a/src/api/types/SambaNovaProviderAccount.ts +++ b/src/api/types/SambaNovaProviderAccount.ts @@ -1,21 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** - * SambaNova Provider Account + * SambaNova Model Account */ export interface SambaNovaProviderAccount { /** +value=provider-account/sambanova */ type: "provider-account/sambanova"; - /** The name of the SambaNova provider account */ + /** The name of the SambaNova model account */ name: string; authData: TrueFoundry.SambaNovaKeyAuth; - /** List of integrations that are associated with the SambaNova provider account */ + /** List of integrations that are associated with the SambaNova model account */ integrations: TrueFoundry.SambaNovaIntegrations[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/Schedule.ts b/src/api/types/Schedule.ts index 289cd16c..74a9882c 100644 --- a/src/api/types/Schedule.ts +++ b/src/api/types/Schedule.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Run the job on a schedule. [Docs](https://docs.truefoundry.com/docs/deploy-a-cron-job) diff --git a/src/api/types/ScheduleConcurrencyPolicy.ts b/src/api/types/ScheduleConcurrencyPolicy.ts index d0b55ba9..645c17be 100644 --- a/src/api/types/ScheduleConcurrencyPolicy.ts +++ b/src/api/types/ScheduleConcurrencyPolicy.ts @@ -6,8 +6,8 @@ * Replace will terminate any currently running instance of the job and start a new one. */ export const ScheduleConcurrencyPolicy = { - Forbid: "Forbid", - Allow: "Allow", - Replace: "Replace" - } as const; -export type ScheduleConcurrencyPolicy = typeof ScheduleConcurrencyPolicy[keyof typeof ScheduleConcurrencyPolicy]; + Forbid: "Forbid", + Allow: "Allow", + Replace: "Replace", +} as const; +export type ScheduleConcurrencyPolicy = (typeof ScheduleConcurrencyPolicy)[keyof typeof ScheduleConcurrencyPolicy]; diff --git a/src/api/types/SearchRunsResponse.ts b/src/api/types/SearchRunsResponse.ts index 0c41da8f..f94e0878 100644 --- a/src/api/types/SearchRunsResponse.ts +++ b/src/api/types/SearchRunsResponse.ts @@ -1,12 +1,12 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface SearchRunsResponse { /** Runs matching the search criteria. */ runs: TrueFoundry.Run[]; /** Total number of matching runs. */ - total?: number; + total?: number | null; /** Token for fetching the next page of results. */ - nextPageToken?: string; + nextPageToken?: string | null; } diff --git a/src/api/types/Secret.ts b/src/api/types/Secret.ts index e62878f6..6363afe7 100644 --- a/src/api/types/Secret.ts +++ b/src/api/types/Secret.ts @@ -1,17 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface Secret { id: string; fqn: string; name: string; secretGroupId: string; - value?: string; - createdBySubject?: TrueFoundry.Subject; - createdAt?: Date; - updatedAt?: Date; - secretVersions?: TrueFoundry.SecretVersion[]; - activeDeploymentsCount?: number; - createdBy?: string; + value?: string | null; + createdBySubject?: TrueFoundry.Subject | null; + createdAt?: Date | null; + updatedAt?: Date | null; + secretVersions?: TrueFoundry.SecretVersion[] | null; + activeDeploymentsCount?: number | null; + createdBy?: string | null; } diff --git a/src/api/types/SecretDetectionGuardrailConfig.ts b/src/api/types/SecretDetectionGuardrailConfig.ts index eac8b3c9..ef6155b1 100644 --- a/src/api/types/SecretDetectionGuardrailConfig.ts +++ b/src/api/types/SecretDetectionGuardrailConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Secrets Detection diff --git a/src/api/types/SecretDetectionGuardrailConfigOperation.ts b/src/api/types/SecretDetectionGuardrailConfigOperation.ts index c5113390..b32fb07c 100644 --- a/src/api/types/SecretDetectionGuardrailConfigOperation.ts +++ b/src/api/types/SecretDetectionGuardrailConfigOperation.ts @@ -2,7 +2,8 @@ /** The operation type to use for the Guardrail. Validate guardrails are used to validate requests and mutate can validate as well as mutate requests. Validate guardrails are run in parallel while mutate guardrails are run sequentially. */ export const SecretDetectionGuardrailConfigOperation = { - Validate: "validate", - Mutate: "mutate" - } as const; -export type SecretDetectionGuardrailConfigOperation = typeof SecretDetectionGuardrailConfigOperation[keyof typeof SecretDetectionGuardrailConfigOperation]; + Validate: "validate", + Mutate: "mutate", +} as const; +export type SecretDetectionGuardrailConfigOperation = + (typeof SecretDetectionGuardrailConfigOperation)[keyof typeof SecretDetectionGuardrailConfigOperation]; diff --git a/src/api/types/SecretGroup.ts b/src/api/types/SecretGroup.ts index 298c986d..52ff66dd 100644 --- a/src/api/types/SecretGroup.ts +++ b/src/api/types/SecretGroup.ts @@ -1,17 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface SecretGroup { - id?: string; - fqn?: string; + id?: string | null; + fqn?: string | null; tenantName: string; createdBySubject: TrueFoundry.Subject; associatedSecrets: TrueFoundry.Secret[]; - integrationId?: string; - manifest?: Record; + integrationId?: string | null; + manifest?: Record | null; accountId: string; createdAt: Date; updatedAt: Date; - createdBy?: string; + createdBy?: string | null; } diff --git a/src/api/types/SecretGroupManifest.ts b/src/api/types/SecretGroupManifest.ts index b944093b..5e2ac9a0 100644 --- a/src/api/types/SecretGroupManifest.ts +++ b/src/api/types/SecretGroupManifest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface SecretGroupManifest { /** +value=secret-group */ diff --git a/src/api/types/SecretVersion.ts b/src/api/types/SecretVersion.ts index b030facc..5112c4b5 100644 --- a/src/api/types/SecretVersion.ts +++ b/src/api/types/SecretVersion.ts @@ -1,14 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface SecretVersion { id: string; fqn: string; - value?: string; - version?: number; - secret?: TrueFoundry.Secret; - secretId?: string; - createdAt?: Date; - updatedAt?: Date; + value?: string | null; + version?: number | null; + secret?: TrueFoundry.Secret | null; + secretId?: string | null; + createdAt?: Date | null; + updatedAt?: Date | null; } diff --git a/src/api/types/SelfHostedAgent.ts b/src/api/types/SelfHostedAgent.ts index 3b46e196..2a095084 100644 --- a/src/api/types/SelfHostedAgent.ts +++ b/src/api/types/SelfHostedAgent.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Self Hosted diff --git a/src/api/types/SelfHostedModel.ts b/src/api/types/SelfHostedModel.ts index f25ee3b9..33a15dc3 100644 --- a/src/api/types/SelfHostedModel.ts +++ b/src/api/types/SelfHostedModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Self Hosted Model Integration diff --git a/src/api/types/SelfHostedModelAuthData.ts b/src/api/types/SelfHostedModelAuthData.ts index c7788709..87825afd 100644 --- a/src/api/types/SelfHostedModelAuthData.ts +++ b/src/api/types/SelfHostedModelAuthData.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Self Hosted Model authentication data for the integration. */ -export type SelfHostedModelAuthData = - | TrueFoundry.CustomBasicAuth - | TrueFoundry.CustomBearerAuth; +export type SelfHostedModelAuthData = TrueFoundry.CustomBasicAuth | TrueFoundry.CustomBearerAuth; diff --git a/src/api/types/SelfHostedModelIntegrations.ts b/src/api/types/SelfHostedModelIntegrations.ts index 6f575904..4b83de5a 100644 --- a/src/api/types/SelfHostedModelIntegrations.ts +++ b/src/api/types/SelfHostedModelIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type SelfHostedModelIntegrations = TrueFoundry.SelfHostedModel; diff --git a/src/api/types/SelfHostedModelModelServer.ts b/src/api/types/SelfHostedModelModelServer.ts index f795c43f..161decd2 100644 --- a/src/api/types/SelfHostedModelModelServer.ts +++ b/src/api/types/SelfHostedModelModelServer.ts @@ -2,11 +2,11 @@ /** The type of model server being used */ export const SelfHostedModelModelServer = { - OpenaiCompatible: "openai-compatible", - CohereRerankV2: "cohere-rerank-v2", - NemoRetriever: "nemo-retriever", - Infinity: "infinity", - Tei: "tei", - VllmOpenai: "vllm-openai" - } as const; -export type SelfHostedModelModelServer = typeof SelfHostedModelModelServer[keyof typeof SelfHostedModelModelServer]; + OpenaiCompatible: "openai-compatible", + CohereRerankV2: "cohere-rerank-v2", + NemoRetriever: "nemo-retriever", + Infinity: "infinity", + Tei: "tei", + VllmOpenai: "vllm-openai", +} as const; +export type SelfHostedModelModelServer = (typeof SelfHostedModelModelServer)[keyof typeof SelfHostedModelModelServer]; diff --git a/src/api/types/SelfHostedModelProviderAccount.ts b/src/api/types/SelfHostedModelProviderAccount.ts index 7a922036..b1482045 100644 --- a/src/api/types/SelfHostedModelProviderAccount.ts +++ b/src/api/types/SelfHostedModelProviderAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Self Hosted @@ -8,13 +8,13 @@ import * as TrueFoundry from "../index.js"; export interface SelfHostedModelProviderAccount { /** +value=provider-account/self-hosted-model */ type: "provider-account/self-hosted-model"; - /** The name of the provider account. */ + /** The name of the model account. */ name: string; - /** List of integrations that are associated with the provider account. */ + /** List of integrations that are associated with the model account. */ integrations: TrueFoundry.SelfHostedModelIntegrations[]; /** Collaborators */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/Service.ts b/src/api/types/Service.ts index 82e0fce6..d0004a9a 100644 --- a/src/api/types/Service.ts +++ b/src/api/types/Service.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Describes the configuration for the service diff --git a/src/api/types/ServiceAutoscaling.ts b/src/api/types/ServiceAutoscaling.ts index afd6d46d..e935772c 100644 --- a/src/api/types/ServiceAutoscaling.ts +++ b/src/api/types/ServiceAutoscaling.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ServiceAutoscaling extends TrueFoundry.BaseAutoscaling { /** Metrics to use for the autoscaler */ diff --git a/src/api/types/ServiceAutoscalingMetrics.ts b/src/api/types/ServiceAutoscalingMetrics.ts index a1697e34..40e58c45 100644 --- a/src/api/types/ServiceAutoscalingMetrics.ts +++ b/src/api/types/ServiceAutoscalingMetrics.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Metrics to use for the autoscaler */ -export type ServiceAutoscalingMetrics = +export type ServiceAutoscalingMetrics = | TrueFoundry.CpuUtilizationMetric | TrueFoundry.RpsMetric | TrueFoundry.CronMetric; diff --git a/src/api/types/ServiceReplicas.ts b/src/api/types/ServiceReplicas.ts index f8494e07..0fa5159f 100644 --- a/src/api/types/ServiceReplicas.ts +++ b/src/api/types/ServiceReplicas.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Deploy multiple instances of your pods to distribute incoming traffic across them, ensuring effective load balancing. */ -export type ServiceReplicas = - | number - | TrueFoundry.ServiceAutoscaling; +export type ServiceReplicas = number | TrueFoundry.ServiceAutoscaling; diff --git a/src/api/types/ServiceRolloutStrategy.ts b/src/api/types/ServiceRolloutStrategy.ts index e8b57b4b..35fc401b 100644 --- a/src/api/types/ServiceRolloutStrategy.ts +++ b/src/api/types/ServiceRolloutStrategy.ts @@ -1,11 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Strategy to dictate how a rollout should happen when a new release for this service is made [Docs](https://docs.truefoundry.com/docs/rollout-strategy) */ -export type ServiceRolloutStrategy = - | TrueFoundry.Rolling - | TrueFoundry.Canary - | TrueFoundry.BlueGreen; +export type ServiceRolloutStrategy = TrueFoundry.Rolling | TrueFoundry.Canary | TrueFoundry.BlueGreen; diff --git a/src/api/types/Session.ts b/src/api/types/Session.ts index b3f45c9c..a4456d46 100644 --- a/src/api/types/Session.ts +++ b/src/api/types/Session.ts @@ -1,27 +1,27 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface Session { /** System-generated session ID. */ id: string; - userName?: string; + userName?: string | null; subjectSlug: string; - subjectControllerName?: string; - subjectPatName?: string; - subjectExternalIdentitySlug?: string; - email?: string; + subjectControllerName?: string | null; + subjectPatName?: string | null; + subjectExternalIdentitySlug?: string | null; + email?: string | null; subjectType: TrueFoundry.SubjectType; - tenantName?: string; + tenantName?: string | null; roles: string[]; teams: TrueFoundry.SessionTeam[]; accounts: TrueFoundry.SessionAccount[]; - metadata?: TrueFoundry.UserMetadata; - createdAt?: Date; - isBillingEnabled?: boolean; - actor?: TrueFoundry.SessionActor; - serviceAccountMetadata?: Record; - account?: TrueFoundry.Account; - rootAccount?: TrueFoundry.Account; + metadata?: TrueFoundry.UserMetadata | null; + createdAt?: Date | null; + isBillingEnabled?: boolean | null; + actor?: TrueFoundry.SessionActor | null; + serviceAccountMetadata?: Record | null; + account?: TrueFoundry.Account | null; + rootAccount?: TrueFoundry.Account | null; effectiveUserId: string; } diff --git a/src/api/types/SessionActor.ts b/src/api/types/SessionActor.ts index 8a7e6029..40e4e0e0 100644 --- a/src/api/types/SessionActor.ts +++ b/src/api/types/SessionActor.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. export interface SessionActor { - organization?: string; + organization?: string | null; } diff --git a/src/api/types/Settings.ts b/src/api/types/Settings.ts new file mode 100644 index 00000000..77fd945d --- /dev/null +++ b/src/api/types/Settings.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +export interface Settings { + id?: string | null; + tenantName: string; + type: string; + manifest: Record; + createdBySubject: TrueFoundry.Subject; + metadata?: Record | null; +} diff --git a/src/api/types/SklearnFramework.ts b/src/api/types/SklearnFramework.ts index 9f3d0b1e..d6228f38 100644 --- a/src/api/types/SklearnFramework.ts +++ b/src/api/types/SklearnFramework.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Sklearn diff --git a/src/api/types/SklearnModelSchema.ts b/src/api/types/SklearnModelSchema.ts index 6590dc68..9b66a89e 100644 --- a/src/api/types/SklearnModelSchema.ts +++ b/src/api/types/SklearnModelSchema.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Scikit Learn Model Schema diff --git a/src/api/types/SklearnSerializationFormat.ts b/src/api/types/SklearnSerializationFormat.ts index 835dddb6..37134023 100644 --- a/src/api/types/SklearnSerializationFormat.ts +++ b/src/api/types/SklearnSerializationFormat.ts @@ -2,8 +2,8 @@ /** Serialization format used to save the sklearn model */ export const SklearnSerializationFormat = { - Cloudpickle: "cloudpickle", - Joblib: "joblib", - Pickle: "pickle" - } as const; -export type SklearnSerializationFormat = typeof SklearnSerializationFormat[keyof typeof SklearnSerializationFormat]; + Cloudpickle: "cloudpickle", + Joblib: "joblib", + Pickle: "pickle", +} as const; +export type SklearnSerializationFormat = (typeof SklearnSerializationFormat)[keyof typeof SklearnSerializationFormat]; diff --git a/src/api/types/SlackBotIntegration.ts b/src/api/types/SlackBotIntegration.ts index 28ce3d3a..4fbf70e2 100644 --- a/src/api/types/SlackBotIntegration.ts +++ b/src/api/types/SlackBotIntegration.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Slack Bot Integration diff --git a/src/api/types/SlackIntegrations.ts b/src/api/types/SlackIntegrations.ts index fc08f17b..39f5aed5 100644 --- a/src/api/types/SlackIntegrations.ts +++ b/src/api/types/SlackIntegrations.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +discriminator=type */ -export type SlackIntegrations = - | TrueFoundry.SlackWebhookIntegration - | TrueFoundry.SlackBotIntegration; +export type SlackIntegrations = TrueFoundry.SlackWebhookIntegration | TrueFoundry.SlackBotIntegration; diff --git a/src/api/types/SlackProviderAccount.ts b/src/api/types/SlackProviderAccount.ts index a59ff207..d6692441 100644 --- a/src/api/types/SlackProviderAccount.ts +++ b/src/api/types/SlackProviderAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Slack Provider Account diff --git a/src/api/types/SlackWebhookIntegration.ts b/src/api/types/SlackWebhookIntegration.ts index 02b5e6c8..e649c3af 100644 --- a/src/api/types/SlackWebhookIntegration.ts +++ b/src/api/types/SlackWebhookIntegration.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Slack Webhook Integration diff --git a/src/api/types/SmallestAiModel.ts b/src/api/types/SmallestAiModel.ts index 39c9c402..e8b8100e 100644 --- a/src/api/types/SmallestAiModel.ts +++ b/src/api/types/SmallestAiModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Smallest AI Model diff --git a/src/api/types/SmallestAiProviderAccount.ts b/src/api/types/SmallestAiProviderAccount.ts index 21f94c0d..0434f711 100644 --- a/src/api/types/SmallestAiProviderAccount.ts +++ b/src/api/types/SmallestAiProviderAccount.ts @@ -1,23 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** - * Smallest AI Provider Account + * Smallest AI Model Account */ export interface SmallestAiProviderAccount { /** +value=provider-account/smallest-ai */ type: "provider-account/smallest-ai"; - /** The name of the Smallest AI provider account */ + /** The name of the Smallest AI model account */ name: string; authData: TrueFoundry.SmallestAiApiKeyAuth; /** Optional custom base URL for Smallest AI API */ baseUrl?: string; - /** List of integrations that are associated with the Smallest AI provider account */ + /** List of integrations that are associated with the Smallest AI model account */ integrations: TrueFoundry.SmallestAiModel[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/SnowflakeCortexIntegrations.ts b/src/api/types/SnowflakeCortexIntegrations.ts index 214f12f9..ccc039e7 100644 --- a/src/api/types/SnowflakeCortexIntegrations.ts +++ b/src/api/types/SnowflakeCortexIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type SnowflakeCortexIntegrations = TrueFoundry.SnowflakeCortexModel; diff --git a/src/api/types/SnowflakeCortexModel.ts b/src/api/types/SnowflakeCortexModel.ts index d2cea6ee..5d64959d 100644 --- a/src/api/types/SnowflakeCortexModel.ts +++ b/src/api/types/SnowflakeCortexModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface SnowflakeCortexModel { /** +value=integration/model/snowflake-cortex */ diff --git a/src/api/types/SnowflakeCortexProviderAccount.ts b/src/api/types/SnowflakeCortexProviderAccount.ts index 8db732c6..3082fffe 100644 --- a/src/api/types/SnowflakeCortexProviderAccount.ts +++ b/src/api/types/SnowflakeCortexProviderAccount.ts @@ -1,23 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** - * Snowflake Cortex Provider Account + * Snowflake Cortex Model Account */ export interface SnowflakeCortexProviderAccount { /** +value=provider-account/snowflake-cortex */ type: "provider-account/snowflake-cortex"; - /** The name of the Snowflake Cortex provider account */ + /** The name of the Snowflake Cortex model account */ name: string; authData: TrueFoundry.SnowflakeCortexPatTokenAuth; /** Snowflake account identifier. You can find it in the URL of your Snowflake account. Example: https://.snowflakecomputing.com. Insert the account identifier only, without the URL. */ accountIdentifier: string; - /** List of integrations that are associated with the Snowflake Cortex provider account */ + /** List of integrations that are associated with the Snowflake Cortex model account */ integrations: TrueFoundry.SnowflakeCortexIntegrations[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/SortDirection.ts b/src/api/types/SortDirection.ts index aa45edfa..1a7f0612 100644 --- a/src/api/types/SortDirection.ts +++ b/src/api/types/SortDirection.ts @@ -1,7 +1,7 @@ // This file was auto-generated by Fern from our API Definition. export const SortDirection = { - Asc: "asc", - Desc: "desc" - } as const; -export type SortDirection = typeof SortDirection[keyof typeof SortDirection]; + Asc: "asc", + Desc: "desc", +} as const; +export type SortDirection = (typeof SortDirection)[keyof typeof SortDirection]; diff --git a/src/api/types/SpanAttributeFilter.ts b/src/api/types/SpanAttributeFilter.ts index ad637918..333c1abc 100644 --- a/src/api/types/SpanAttributeFilter.ts +++ b/src/api/types/SpanAttributeFilter.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface SpanAttributeFilter { spanAttributeKey: string; diff --git a/src/api/types/SpanAttributeFilterOperator.ts b/src/api/types/SpanAttributeFilterOperator.ts index d89dda90..7361ca24 100644 --- a/src/api/types/SpanAttributeFilterOperator.ts +++ b/src/api/types/SpanAttributeFilterOperator.ts @@ -1,24 +1,25 @@ // This file was auto-generated by Fern from our API Definition. export const SpanAttributeFilterOperator = { - Equal: "EQUAL", - NotEqual: "NOT_EQUAL", - GreaterThan: "GREATER_THAN", - LessThan: "LESS_THAN", - GreaterThanEqual: "GREATER_THAN_EQUAL", - LessThanEqual: "LESS_THAN_EQUAL", - Between: "BETWEEN", - In: "IN", - NotIn: "NOT_IN", - StringContains: "STRING_CONTAINS", - StringNotContains: "STRING_NOT_CONTAINS", - StringStartsWith: "STRING_STARTS_WITH", - StringNotStartsWith: "STRING_NOT_STARTS_WITH", - StringEndsWith: "STRING_ENDS_WITH", - StringNotEndsWith: "STRING_NOT_ENDS_WITH", - ArrayHasAny: "ARRAY_HAS_ANY", - ArrayHasNone: "ARRAY_HAS_NONE", - Present: "PRESENT", - IsNull: "IS_NULL" - } as const; -export type SpanAttributeFilterOperator = typeof SpanAttributeFilterOperator[keyof typeof SpanAttributeFilterOperator]; + Equal: "EQUAL", + NotEqual: "NOT_EQUAL", + GreaterThan: "GREATER_THAN", + LessThan: "LESS_THAN", + GreaterThanEqual: "GREATER_THAN_EQUAL", + LessThanEqual: "LESS_THAN_EQUAL", + Between: "BETWEEN", + In: "IN", + NotIn: "NOT_IN", + StringContains: "STRING_CONTAINS", + StringNotContains: "STRING_NOT_CONTAINS", + StringStartsWith: "STRING_STARTS_WITH", + StringNotStartsWith: "STRING_NOT_STARTS_WITH", + StringEndsWith: "STRING_ENDS_WITH", + StringNotEndsWith: "STRING_NOT_ENDS_WITH", + ArrayHasAny: "ARRAY_HAS_ANY", + ArrayHasNone: "ARRAY_HAS_NONE", + Present: "PRESENT", + IsNull: "IS_NULL", +} as const; +export type SpanAttributeFilterOperator = + (typeof SpanAttributeFilterOperator)[keyof typeof SpanAttributeFilterOperator]; diff --git a/src/api/types/SpanAttributeFilterValue.ts b/src/api/types/SpanAttributeFilterValue.ts index f3668b03..70a5dece 100644 --- a/src/api/types/SpanAttributeFilterValue.ts +++ b/src/api/types/SpanAttributeFilterValue.ts @@ -1,9 +1,3 @@ // This file was auto-generated by Fern from our API Definition. -export type SpanAttributeFilterValue = - | string[] - | number[] - | boolean[] - | string - | number - | boolean; +export type SpanAttributeFilterValue = string[] | number[] | boolean[] | string | number | boolean; diff --git a/src/api/types/SpanFieldFilter.ts b/src/api/types/SpanFieldFilter.ts index fd88a391..b9c62cd6 100644 --- a/src/api/types/SpanFieldFilter.ts +++ b/src/api/types/SpanFieldFilter.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface SpanFieldFilter { spanFieldName: TrueFoundry.SpanFieldFilterSpanFieldName; diff --git a/src/api/types/SpanFieldFilterOperator.ts b/src/api/types/SpanFieldFilterOperator.ts index 6cce6898..c44ee2e7 100644 --- a/src/api/types/SpanFieldFilterOperator.ts +++ b/src/api/types/SpanFieldFilterOperator.ts @@ -1,24 +1,24 @@ // This file was auto-generated by Fern from our API Definition. export const SpanFieldFilterOperator = { - Equal: "EQUAL", - NotEqual: "NOT_EQUAL", - GreaterThan: "GREATER_THAN", - LessThan: "LESS_THAN", - GreaterThanEqual: "GREATER_THAN_EQUAL", - LessThanEqual: "LESS_THAN_EQUAL", - Between: "BETWEEN", - In: "IN", - NotIn: "NOT_IN", - StringContains: "STRING_CONTAINS", - StringNotContains: "STRING_NOT_CONTAINS", - StringStartsWith: "STRING_STARTS_WITH", - StringNotStartsWith: "STRING_NOT_STARTS_WITH", - StringEndsWith: "STRING_ENDS_WITH", - StringNotEndsWith: "STRING_NOT_ENDS_WITH", - ArrayHasAny: "ARRAY_HAS_ANY", - ArrayHasNone: "ARRAY_HAS_NONE", - Present: "PRESENT", - IsNull: "IS_NULL" - } as const; -export type SpanFieldFilterOperator = typeof SpanFieldFilterOperator[keyof typeof SpanFieldFilterOperator]; + Equal: "EQUAL", + NotEqual: "NOT_EQUAL", + GreaterThan: "GREATER_THAN", + LessThan: "LESS_THAN", + GreaterThanEqual: "GREATER_THAN_EQUAL", + LessThanEqual: "LESS_THAN_EQUAL", + Between: "BETWEEN", + In: "IN", + NotIn: "NOT_IN", + StringContains: "STRING_CONTAINS", + StringNotContains: "STRING_NOT_CONTAINS", + StringStartsWith: "STRING_STARTS_WITH", + StringNotStartsWith: "STRING_NOT_STARTS_WITH", + StringEndsWith: "STRING_ENDS_WITH", + StringNotEndsWith: "STRING_NOT_ENDS_WITH", + ArrayHasAny: "ARRAY_HAS_ANY", + ArrayHasNone: "ARRAY_HAS_NONE", + Present: "PRESENT", + IsNull: "IS_NULL", +} as const; +export type SpanFieldFilterOperator = (typeof SpanFieldFilterOperator)[keyof typeof SpanFieldFilterOperator]; diff --git a/src/api/types/SpanFieldFilterSpanFieldName.ts b/src/api/types/SpanFieldFilterSpanFieldName.ts index e0ba8384..ded3b881 100644 --- a/src/api/types/SpanFieldFilterSpanFieldName.ts +++ b/src/api/types/SpanFieldFilterSpanFieldName.ts @@ -1,19 +1,20 @@ // This file was auto-generated by Fern from our API Definition. export const SpanFieldFilterSpanFieldName = { - SpanName: "spanName", - SpanId: "spanId", - TraceId: "traceId", - ParentSpanId: "parentSpanId", - ApplicationName: "applicationName", - CreatedBySubjectSlug: "createdBySubjectSlug", - CreatedBySubjectType: "createdBySubjectType", - DurationInNs: "durationInNs", - DurationInMs: "durationInMs", - SpanStatusCode: "spanStatusCode", - Tag: "tag", - ScopeName: "scopeName", - Environment: "environment", - Feedbacks: "feedbacks" - } as const; -export type SpanFieldFilterSpanFieldName = typeof SpanFieldFilterSpanFieldName[keyof typeof SpanFieldFilterSpanFieldName]; + SpanName: "spanName", + SpanId: "spanId", + TraceId: "traceId", + ParentSpanId: "parentSpanId", + ApplicationName: "applicationName", + CreatedBySubjectSlug: "createdBySubjectSlug", + CreatedBySubjectType: "createdBySubjectType", + DurationInNs: "durationInNs", + DurationInMs: "durationInMs", + SpanStatusCode: "spanStatusCode", + Tag: "tag", + ScopeName: "scopeName", + Environment: "environment", + Feedbacks: "feedbacks", +} as const; +export type SpanFieldFilterSpanFieldName = + (typeof SpanFieldFilterSpanFieldName)[keyof typeof SpanFieldFilterSpanFieldName]; diff --git a/src/api/types/SpanFieldFilterValue.ts b/src/api/types/SpanFieldFilterValue.ts index bfe3a24d..fa950cce 100644 --- a/src/api/types/SpanFieldFilterValue.ts +++ b/src/api/types/SpanFieldFilterValue.ts @@ -1,8 +1,3 @@ // This file was auto-generated by Fern from our API Definition. -export type SpanFieldFilterValue = - | string - | number - | boolean - | string[] - | number[]; +export type SpanFieldFilterValue = string | number | boolean | string[] | number[]; diff --git a/src/api/types/SparkDriverConfig.ts b/src/api/types/SparkDriverConfig.ts index af58477d..1185bf4c 100644 --- a/src/api/types/SparkDriverConfig.ts +++ b/src/api/types/SparkDriverConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Driver Config diff --git a/src/api/types/SparkExecutorConfig.ts b/src/api/types/SparkExecutorConfig.ts index 4421a14c..84f45982 100644 --- a/src/api/types/SparkExecutorConfig.ts +++ b/src/api/types/SparkExecutorConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Executor Config diff --git a/src/api/types/SparkExecutorConfigInstances.ts b/src/api/types/SparkExecutorConfigInstances.ts index a5ac0680..a1f77991 100644 --- a/src/api/types/SparkExecutorConfigInstances.ts +++ b/src/api/types/SparkExecutorConfigInstances.ts @@ -1,10 +1,10 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Executor Instances */ -export type SparkExecutorConfigInstances = +export type SparkExecutorConfigInstances = | TrueFoundry.SparkExecutorFixedInstances | TrueFoundry.SparkExecutorDynamicScaling; diff --git a/src/api/types/SparkImageBuild.ts b/src/api/types/SparkImageBuild.ts index 6b849fea..00ffd539 100644 --- a/src/api/types/SparkImageBuild.ts +++ b/src/api/types/SparkImageBuild.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Describes that we are building a new image based on the spec diff --git a/src/api/types/SparkImageBuildBuildSource.ts b/src/api/types/SparkImageBuildBuildSource.ts index 49a985c7..30b2ac50 100644 --- a/src/api/types/SparkImageBuildBuildSource.ts +++ b/src/api/types/SparkImageBuildBuildSource.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Fetch source code */ -export type SparkImageBuildBuildSource = - | TrueFoundry.GitSource - | TrueFoundry.RemoteSource; +export type SparkImageBuildBuildSource = TrueFoundry.GitSource | TrueFoundry.RemoteSource; diff --git a/src/api/types/SparkJob.ts b/src/api/types/SparkJob.ts index b9b381d1..4f2e7b21 100644 --- a/src/api/types/SparkJob.ts +++ b/src/api/types/SparkJob.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface SparkJob { /** @@ -14,12 +14,14 @@ export interface SparkJob { image: TrueFoundry.SparkJobImage; /** Entrypoint */ entrypoint: TrueFoundry.SparkJobEntrypoint; + /** Specify the trigger */ + trigger?: TrueFoundry.SparkJobTrigger; driverConfig: TrueFoundry.SparkDriverConfig; executorConfig: TrueFoundry.SparkExecutorConfig; /** Configure environment variables to be injected in the service either as plain text. [Docs](https://docs.truefoundry.com/docs/env-variables) */ - env?: Record; + env?: Record | null; /** Extra configuration properties to be passed to the spark job. [Docs](https://spark.apache.org/docs/latest/configuration.html) */ - sparkConf?: Record; + sparkConf?: Record | null; /** Configure volumes to be mounted to driver and executors. [Docs](https://docs.truefoundry.com/docs/mounting-volumes-job) */ mounts?: TrueFoundry.VolumeMount[]; /** Specify the maximum number of attempts to retry a job before it is marked as failed. */ diff --git a/src/api/types/SparkJobEntrypoint.ts b/src/api/types/SparkJobEntrypoint.ts index 660c62ae..75ff7527 100644 --- a/src/api/types/SparkJobEntrypoint.ts +++ b/src/api/types/SparkJobEntrypoint.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Entrypoint */ -export type SparkJobEntrypoint = +export type SparkJobEntrypoint = | TrueFoundry.SparkJobPythonEntrypoint | TrueFoundry.SparkJobScalaEntrypoint | TrueFoundry.SparkJobJavaEntrypoint diff --git a/src/api/types/SparkJobImage.ts b/src/api/types/SparkJobImage.ts index a0f58c28..9876f87e 100644 --- a/src/api/types/SparkJobImage.ts +++ b/src/api/types/SparkJobImage.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * The image to use for driver and executors. Must have spark installed. Spark version must match the version in the image. */ -export type SparkJobImage = - | TrueFoundry.SparkImage - | TrueFoundry.SparkImageBuild; +export type SparkJobImage = TrueFoundry.SparkImage | TrueFoundry.SparkImageBuild; diff --git a/src/api/types/SparkJobTrigger.ts b/src/api/types/SparkJobTrigger.ts new file mode 100644 index 00000000..22a53021 --- /dev/null +++ b/src/api/types/SparkJobTrigger.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +/** + * Specify the trigger + */ +export type SparkJobTrigger = TrueFoundry.Manual | TrueFoundry.Schedule; diff --git a/src/api/types/SparkJobTriggerInput.ts b/src/api/types/SparkJobTriggerInput.ts index af7a46e0..2675dacc 100644 --- a/src/api/types/SparkJobTriggerInput.ts +++ b/src/api/types/SparkJobTriggerInput.ts @@ -2,9 +2,9 @@ export interface SparkJobTriggerInput { /** Main Class for Spark Job */ - mainClass?: string; + mainClass?: string | null; /** Main Application File for Spark Job */ - mainApplicationFile?: string; + mainApplicationFile?: string | null; /** Arguments to pass to the main application file */ - arguments?: string; + arguments?: string | null; } diff --git a/src/api/types/SqlSanitizerGuardrailConfig.ts b/src/api/types/SqlSanitizerGuardrailConfig.ts index 9a252b5b..eeeef127 100644 --- a/src/api/types/SqlSanitizerGuardrailConfig.ts +++ b/src/api/types/SqlSanitizerGuardrailConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * SQL Sanitizer diff --git a/src/api/types/SqlSanitizerGuardrailConfigOperation.ts b/src/api/types/SqlSanitizerGuardrailConfigOperation.ts index 67028c2d..d9e164e4 100644 --- a/src/api/types/SqlSanitizerGuardrailConfigOperation.ts +++ b/src/api/types/SqlSanitizerGuardrailConfigOperation.ts @@ -2,7 +2,8 @@ /** Validate (detect and block) or Mutate (detect, sanitize comments, and continue). */ export const SqlSanitizerGuardrailConfigOperation = { - Validate: "validate", - Mutate: "mutate" - } as const; -export type SqlSanitizerGuardrailConfigOperation = typeof SqlSanitizerGuardrailConfigOperation[keyof typeof SqlSanitizerGuardrailConfigOperation]; + Validate: "validate", + Mutate: "mutate", +} as const; +export type SqlSanitizerGuardrailConfigOperation = + (typeof SqlSanitizerGuardrailConfigOperation)[keyof typeof SqlSanitizerGuardrailConfigOperation]; diff --git a/src/api/types/SqsInputConfig.ts b/src/api/types/SqsInputConfig.ts index fc705901..075c0e5f 100644 --- a/src/api/types/SqsInputConfig.ts +++ b/src/api/types/SqsInputConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Describes the configuration for the input SQS worker diff --git a/src/api/types/SqsOutputConfig.ts b/src/api/types/SqsOutputConfig.ts index 5ddff659..0f0fa76e 100644 --- a/src/api/types/SqsOutputConfig.ts +++ b/src/api/types/SqsOutputConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Describes the configuration for the output SQS worker diff --git a/src/api/types/SqsQueueMetricConfig.ts b/src/api/types/SqsQueueMetricConfig.ts index 6ff3d1eb..71e4fa9a 100644 --- a/src/api/types/SqsQueueMetricConfig.ts +++ b/src/api/types/SqsQueueMetricConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface SqsQueueMetricConfig { /** +value=sqs */ diff --git a/src/api/types/SqsQueueMetricConfigAuth.ts b/src/api/types/SqsQueueMetricConfigAuth.ts index e4366490..e811f148 100644 --- a/src/api/types/SqsQueueMetricConfigAuth.ts +++ b/src/api/types/SqsQueueMetricConfigAuth.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Receive permissions on the SQS Queue */ -export type SqsQueueMetricConfigAuth = - | TrueFoundry.AwsSqsAccessKeyBasedAuth - | TrueFoundry.AwsSqsAssumedRoleBasedAuth; +export type SqsQueueMetricConfigAuth = TrueFoundry.AwsSqsAccessKeyBasedAuth | TrueFoundry.AwsSqsAssumedRoleBasedAuth; diff --git a/src/api/types/SshServer.ts b/src/api/types/SshServer.ts index 9baedff2..7d9eb50b 100644 --- a/src/api/types/SshServer.ts +++ b/src/api/types/SshServer.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Describes the configuration for the ssh server diff --git a/src/api/types/StaticFallbackStrategy.ts b/src/api/types/StaticFallbackStrategy.ts new file mode 100644 index 00000000..e11a3ba6 --- /dev/null +++ b/src/api/types/StaticFallbackStrategy.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +/** + * On classifier timeout or error, route to a fixed default tier. + */ +export interface StaticFallbackStrategy { + /** Fallback Type */ + type: "static"; + /** Tier applied when the classifier fails or when a request has no prompt text to classify (e.g. an empty prompt). */ + defaultTier: TrueFoundry.StaticFallbackStrategyDefaultTier; +} diff --git a/src/api/types/StaticFallbackStrategyDefaultTier.ts b/src/api/types/StaticFallbackStrategyDefaultTier.ts new file mode 100644 index 00000000..ecaaa000 --- /dev/null +++ b/src/api/types/StaticFallbackStrategyDefaultTier.ts @@ -0,0 +1,10 @@ +// This file was auto-generated by Fern from our API Definition. + +/** Tier applied when the classifier fails or when a request has no prompt text to classify (e.g. an empty prompt). */ +export const StaticFallbackStrategyDefaultTier = { + Medium: "medium", + Simple: "simple", + Complex: "complex", +} as const; +export type StaticFallbackStrategyDefaultTier = + (typeof StaticFallbackStrategyDefaultTier)[keyof typeof StaticFallbackStrategyDefaultTier]; diff --git a/src/api/types/StdioMcpServerManifest.ts b/src/api/types/StdioMcpServerManifest.ts index 2d96ae52..2d6dafa8 100644 --- a/src/api/types/StdioMcpServerManifest.ts +++ b/src/api/types/StdioMcpServerManifest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Stdio MCP server configuration. @@ -8,6 +8,8 @@ import * as TrueFoundry from "../index.js"; export interface StdioMcpServerManifest { /** The name of the MCP Server. */ name: string; + /** A human-readable label for the MCP Server in the UI. If omitted, the server name is shown. */ + displayName?: string; /** Provide a brief description of the purpose of this MCP Server. */ description: string; /** Users and Teams that have access to this MCP Server */ diff --git a/src/api/types/StickyRouting.ts b/src/api/types/StickyRouting.ts index fdfb2fd4..10d78443 100644 --- a/src/api/types/StickyRouting.ts +++ b/src/api/types/StickyRouting.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Sticky Routing diff --git a/src/api/types/StickySessionIdentifier.ts b/src/api/types/StickySessionIdentifier.ts index 14bef3b5..efaff366 100644 --- a/src/api/types/StickySessionIdentifier.ts +++ b/src/api/types/StickySessionIdentifier.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Sticky Session Identifier diff --git a/src/api/types/StickySessionIdentifierSource.ts b/src/api/types/StickySessionIdentifierSource.ts index 04cff7a2..60c6a21b 100644 --- a/src/api/types/StickySessionIdentifierSource.ts +++ b/src/api/types/StickySessionIdentifierSource.ts @@ -2,7 +2,8 @@ /** Source from which session identifier value will be extracted */ export const StickySessionIdentifierSource = { - Headers: "headers", - Metadata: "metadata" - } as const; -export type StickySessionIdentifierSource = typeof StickySessionIdentifierSource[keyof typeof StickySessionIdentifierSource]; + Headers: "headers", + Metadata: "metadata", +} as const; +export type StickySessionIdentifierSource = + (typeof StickySessionIdentifierSource)[keyof typeof StickySessionIdentifierSource]; diff --git a/src/api/types/Subject.ts b/src/api/types/Subject.ts index acdf106c..405fb8c4 100644 --- a/src/api/types/Subject.ts +++ b/src/api/types/Subject.ts @@ -1,19 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface Subject { /** Subject ID */ subjectId: string; /** Subject type */ - subjectType: TrueFoundry.SubjectType; + subjectType: TrueFoundry.SubjectSubjectType; /** Subject slug */ - subjectSlug?: string; + subjectSlug?: string | null; /** Subject display name */ - subjectDisplayName?: string; + subjectDisplayName?: string | null; /** Subject PAT name */ - subjectPatName?: string; - subjectControllerName?: string; + subjectPatName?: string | null; + subjectControllerName?: string | null; /** External identity slug (external_identity_id:sub:email) */ - subjectExternalIdentitySlug?: string; + subjectExternalIdentitySlug?: string | null; } diff --git a/src/api/types/SubjectClause.ts b/src/api/types/SubjectClause.ts index 7cd773c6..4ebb5867 100644 --- a/src/api/types/SubjectClause.ts +++ b/src/api/types/SubjectClause.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. export interface SubjectClause { - "in"?: string[]; + in?: string[]; notIn?: string[]; } diff --git a/src/api/types/SubjectConditionGroup.ts b/src/api/types/SubjectConditionGroup.ts index 1ae9ecde..62cfddb5 100644 --- a/src/api/types/SubjectConditionGroup.ts +++ b/src/api/types/SubjectConditionGroup.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface SubjectConditionGroup { operator: TrueFoundry.SubjectConditionGroupOperator; diff --git a/src/api/types/SubjectConditionGroupOperator.ts b/src/api/types/SubjectConditionGroupOperator.ts index 96ea2295..2a0db0dc 100644 --- a/src/api/types/SubjectConditionGroupOperator.ts +++ b/src/api/types/SubjectConditionGroupOperator.ts @@ -1,7 +1,8 @@ // This file was auto-generated by Fern from our API Definition. export const SubjectConditionGroupOperator = { - And: "and", - Or: "or" - } as const; -export type SubjectConditionGroupOperator = typeof SubjectConditionGroupOperator[keyof typeof SubjectConditionGroupOperator]; + And: "and", + Or: "or", +} as const; +export type SubjectConditionGroupOperator = + (typeof SubjectConditionGroupOperator)[keyof typeof SubjectConditionGroupOperator]; diff --git a/src/api/types/SubjectPermission.ts b/src/api/types/SubjectPermission.ts index c88c0839..a5816e1b 100644 --- a/src/api/types/SubjectPermission.ts +++ b/src/api/types/SubjectPermission.ts @@ -6,9 +6,9 @@ export interface SubjectPermission { /** Resource ID */ resourceId: string; /** Resource Name (if available) */ - resourceName?: string; + resourceName?: string | null; /** Resource FQN (if available) */ - resourceFqn?: string; + resourceFqn?: string | null; /** Role ID */ roleId: string; /** Role Name */ diff --git a/src/api/types/SubjectSubjectType.ts b/src/api/types/SubjectSubjectType.ts new file mode 100644 index 00000000..0e97ff11 --- /dev/null +++ b/src/api/types/SubjectSubjectType.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +/** Subject type */ +export const SubjectSubjectType = { + User: "user", + Team: "team", + Serviceaccount: "serviceaccount", + Virtualaccount: "virtualaccount", + AgentIdentity: "agent-identity", + Agent: "agent", + AgentChannelIdentity: "agent-channel-identity", + Role: "role", +} as const; +export type SubjectSubjectType = (typeof SubjectSubjectType)[keyof typeof SubjectSubjectType]; diff --git a/src/api/types/SubjectType.ts b/src/api/types/SubjectType.ts index caef9fea..7f4b239c 100644 --- a/src/api/types/SubjectType.ts +++ b/src/api/types/SubjectType.ts @@ -2,12 +2,13 @@ /** Type of the authenticated subject. "user" for human users, "serviceaccount" (also known as virtual account) for programmatic access. */ export const SubjectType = { - User: "user", - Team: "team", - Serviceaccount: "serviceaccount", - Virtualaccount: "virtualaccount", - ExternalIdentity: "external-identity", - AgentIdentity: "agent-identity", - Role: "role" - } as const; -export type SubjectType = typeof SubjectType[keyof typeof SubjectType]; + User: "user", + Team: "team", + Serviceaccount: "serviceaccount", + Virtualaccount: "virtualaccount", + AgentIdentity: "agent-identity", + Agent: "agent", + AgentChannelIdentity: "agent-channel-identity", + Role: "role", +} as const; +export type SubjectType = (typeof SubjectType)[keyof typeof SubjectType]; diff --git a/src/api/types/SyncTokenInSecretStoreInfo.ts b/src/api/types/SyncTokenInSecretStoreInfo.ts index 6295de1d..fff6cf5a 100644 --- a/src/api/types/SyncTokenInSecretStoreInfo.ts +++ b/src/api/types/SyncTokenInSecretStoreInfo.ts @@ -4,5 +4,5 @@ export interface SyncTokenInSecretStoreInfo { /** ISO timestamp of when the token was synced */ updatedAt: string; /** Error message if sync failed */ - error?: string; + error?: string | null; } diff --git a/src/api/types/SyncVirtualAccountTokenResponse.ts b/src/api/types/SyncVirtualAccountTokenResponse.ts index 34784abb..27e19040 100644 --- a/src/api/types/SyncVirtualAccountTokenResponse.ts +++ b/src/api/types/SyncVirtualAccountTokenResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface SyncVirtualAccountTokenResponse { /** Sync status including timestamp and error (if any) */ diff --git a/src/api/types/SystemMessage.ts b/src/api/types/SystemMessage.ts index d8fc00cd..7689025c 100644 --- a/src/api/types/SystemMessage.ts +++ b/src/api/types/SystemMessage.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * System message for the chat diff --git a/src/api/types/SystemMessageContent.ts b/src/api/types/SystemMessageContent.ts index b55cd891..ec4fd3e0 100644 --- a/src/api/types/SystemMessageContent.ts +++ b/src/api/types/SystemMessageContent.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Text content for the system message */ -export type SystemMessageContent = - | string - | TrueFoundry.BlobStorageReference; +export type SystemMessageContent = string | TrueFoundry.BlobStorageReference; diff --git a/src/api/types/TargetClause.ts b/src/api/types/TargetClause.ts index 8f318363..01d479e9 100644 --- a/src/api/types/TargetClause.ts +++ b/src/api/types/TargetClause.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface TargetClause { mcpServers?: TrueFoundry.InNotInOperator; diff --git a/src/api/types/TargetConditionGroup.ts b/src/api/types/TargetConditionGroup.ts index 209c558b..ba2e99ce 100644 --- a/src/api/types/TargetConditionGroup.ts +++ b/src/api/types/TargetConditionGroup.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface TargetConditionGroup { operator: "or"; diff --git a/src/api/types/TaskSparkImage.ts b/src/api/types/TaskSparkImage.ts new file mode 100644 index 00000000..b75c078d --- /dev/null +++ b/src/api/types/TaskSparkImage.ts @@ -0,0 +1,29 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Describes a pre-built Spark image for a task. Use this when your image already contains + * all workflow code, dependencies (including truefoundry[workflow,spark]), and required JARs. + * This skips the Docker build phase entirely. + */ +export interface TaskSparkImage { + /** + * +uiType=Hidden + * +value=task-spark-image + */ + type: "task-spark-image"; + /** Spark version should match the spark version installed in the image. */ + sparkVersion: string; + /** + * The container image URI of the pre-built Spark image. The image must contain: + * 1. All workflow source code at /app (or appropriate PYTHONPATH) + * 2. truefoundry[workflow,spark] package installed + * 3. PySpark matching the spark_version + * 4. Hadoop AWS/GCS/Azure JARs if using cloud storage + */ + containerImage: string; + /** + * FQN of the container registry. If you can't find your registry here, + * add it through the [Integrations](/integrations?tab=docker-registry) page + */ + dockerRegistry?: string; +} diff --git a/src/api/types/Team.ts b/src/api/types/Team.ts index 83d066dc..0b9421bc 100644 --- a/src/api/types/Team.ts +++ b/src/api/types/Team.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface Team { /** System-generated team ID. */ @@ -14,7 +14,7 @@ export interface Team { /** The subject (user or service account) that created the team. */ createdBySubject: TrueFoundry.Subject; /** Email addresses of team members. */ - members?: string[]; + members?: string[] | null; /** Timestamp when the team was created. */ createdAt: Date; /** Timestamp when the team was last updated. */ @@ -22,11 +22,11 @@ export interface Team { /** The team manifest defining name, members, managers, and ownership. */ manifest: TrueFoundry.TeamManifest; /** SCIM-related metadata for the team. */ - metadata?: TrueFoundry.TeamMetadata; + metadata?: TrueFoundry.TeamMetadata | null; /** Whether the team can be edited. SCIM-managed teams may be non-editable. */ isEditable: boolean; /** Role names assigned to the team. */ - roles?: string[]; + roles?: string[] | null; /** Up to 5 team member emails, sourced from cache. Absent when the cache is unavailable. */ topMembers?: string[]; /** Up to 5 team manager emails, sourced from cache. Absent when the cache is unavailable. */ diff --git a/src/api/types/TeamBudgetConfig.ts b/src/api/types/TeamBudgetConfig.ts index 24455eb8..220af63f 100644 --- a/src/api/types/TeamBudgetConfig.ts +++ b/src/api/types/TeamBudgetConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Team Budget Configuration @@ -15,10 +15,10 @@ export interface TeamBudgetConfig { teamName: string; /** Unique name for this budget */ name: string; - when: TrueFoundry.BudgetV2WhenTeamScoped; + when?: TrueFoundry.BudgetV2WhenTeamScoped; limits: TrueFoundry.BudgetV2Limits; appliesTo: TrueFoundry.BudgetV2AppliesTo; - /** `enforce` blocks breaching requests, `audit` only tracks them. */ + /** `enforce` blocks breaching requests, `audit` only tracks them, `soft_enforce` blocks only when no other matching budget allows the request. */ mode: TrueFoundry.TeamBudgetConfigMode; alerts?: TrueFoundry.BudgetV2Alert; } diff --git a/src/api/types/TeamBudgetConfigMode.ts b/src/api/types/TeamBudgetConfigMode.ts index 149e5118..af898ede 100644 --- a/src/api/types/TeamBudgetConfigMode.ts +++ b/src/api/types/TeamBudgetConfigMode.ts @@ -1,8 +1,9 @@ // This file was auto-generated by Fern from our API Definition. -/** `enforce` blocks breaching requests, `audit` only tracks them. */ +/** `enforce` blocks breaching requests, `audit` only tracks them, `soft_enforce` blocks only when no other matching budget allows the request. */ export const TeamBudgetConfigMode = { - Enforce: "enforce", - Audit: "audit" - } as const; -export type TeamBudgetConfigMode = typeof TeamBudgetConfigMode[keyof typeof TeamBudgetConfigMode]; + Enforce: "enforce", + Audit: "audit", + SoftEnforce: "soft_enforce", +} as const; +export type TeamBudgetConfigMode = (typeof TeamBudgetConfigMode)[keyof typeof TeamBudgetConfigMode]; diff --git a/src/api/types/TeamDataAccessRule.ts b/src/api/types/TeamDataAccessRule.ts index d6c47f84..b04b0f1c 100644 --- a/src/api/types/TeamDataAccessRule.ts +++ b/src/api/types/TeamDataAccessRule.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Team Data diff --git a/src/api/types/TeamManifest.ts b/src/api/types/TeamManifest.ts index 1f495582..ae9ea443 100644 --- a/src/api/types/TeamManifest.ts +++ b/src/api/types/TeamManifest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface TeamManifest { /** +value=team */ diff --git a/src/api/types/TeamMetadata.ts b/src/api/types/TeamMetadata.ts index 9dcb234a..e68236a2 100644 --- a/src/api/types/TeamMetadata.ts +++ b/src/api/types/TeamMetadata.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. export interface TeamMetadata { - createdByScim?: boolean; - scimExternalId?: string; + createdByScim?: boolean | null; + scimExternalId?: string | null; } diff --git a/src/api/types/TeamSubjectRow.ts b/src/api/types/TeamSubjectRow.ts index 786838d2..e56148ae 100644 --- a/src/api/types/TeamSubjectRow.ts +++ b/src/api/types/TeamSubjectRow.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface TeamSubjectRow { /** System-generated ID of the subject. */ diff --git a/src/api/types/TenantBudgetConfig.ts b/src/api/types/TenantBudgetConfig.ts index 2cfed75c..9d0af19d 100644 --- a/src/api/types/TenantBudgetConfig.ts +++ b/src/api/types/TenantBudgetConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Tenant Budget Configuration @@ -13,10 +13,10 @@ export interface TenantBudgetConfig { type: "tenant-budget-config"; /** Unique name for this budget */ name: string; - when: TrueFoundry.BudgetV2WhenTenantScoped; + when?: TrueFoundry.BudgetV2WhenTenantScoped; limits: TrueFoundry.BudgetV2Limits; appliesTo: TrueFoundry.BudgetV2AppliesTo; - /** `enforce` blocks breaching requests, `audit` only tracks them. */ + /** `enforce` blocks breaching requests, `audit` only tracks them, `soft_enforce` blocks only when no other matching budget allows the request. */ mode: TrueFoundry.TenantBudgetConfigMode; alerts?: TrueFoundry.BudgetV2Alert; } diff --git a/src/api/types/TenantBudgetConfigMode.ts b/src/api/types/TenantBudgetConfigMode.ts index f30b0cc2..47edf959 100644 --- a/src/api/types/TenantBudgetConfigMode.ts +++ b/src/api/types/TenantBudgetConfigMode.ts @@ -1,8 +1,9 @@ // This file was auto-generated by Fern from our API Definition. -/** `enforce` blocks breaching requests, `audit` only tracks them. */ +/** `enforce` blocks breaching requests, `audit` only tracks them, `soft_enforce` blocks only when no other matching budget allows the request. */ export const TenantBudgetConfigMode = { - Enforce: "enforce", - Audit: "audit" - } as const; -export type TenantBudgetConfigMode = typeof TenantBudgetConfigMode[keyof typeof TenantBudgetConfigMode]; + Enforce: "enforce", + Audit: "audit", + SoftEnforce: "soft_enforce", +} as const; +export type TenantBudgetConfigMode = (typeof TenantBudgetConfigMode)[keyof typeof TenantBudgetConfigMode]; diff --git a/src/api/types/TerminateJobResponse.ts b/src/api/types/TerminateJobResponse.ts index c6977ffa..d3680ceb 100644 --- a/src/api/types/TerminateJobResponse.ts +++ b/src/api/types/TerminateJobResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface TerminateJobResponse { /** Terminate Job Message */ diff --git a/src/api/types/TextContentPart.ts b/src/api/types/TextContentPart.ts index 43f48842..116e6624 100644 --- a/src/api/types/TextContentPart.ts +++ b/src/api/types/TextContentPart.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Text content for the message diff --git a/src/api/types/TextContentPartText.ts b/src/api/types/TextContentPartText.ts index e4c9be00..1acdbaca 100644 --- a/src/api/types/TextContentPartText.ts +++ b/src/api/types/TextContentPartText.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Text content for the message */ -export type TextContentPartText = - | string - | TrueFoundry.BlobStorageReference; +export type TextContentPartText = string | TrueFoundry.BlobStorageReference; diff --git a/src/api/types/TfyContentModerationGuardrailConfig.ts b/src/api/types/TfyContentModerationGuardrailConfig.ts index e40430f8..ec822745 100644 --- a/src/api/types/TfyContentModerationGuardrailConfig.ts +++ b/src/api/types/TfyContentModerationGuardrailConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Content Moderation diff --git a/src/api/types/TfyContentModerationGuardrailConfigConfig.ts b/src/api/types/TfyContentModerationGuardrailConfigConfig.ts index 8f178e7d..33c7e4bb 100644 --- a/src/api/types/TfyContentModerationGuardrailConfigConfig.ts +++ b/src/api/types/TfyContentModerationGuardrailConfigConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +uiType=Ignore diff --git a/src/api/types/TfyManagedMcpServerManifest.ts b/src/api/types/TfyManagedMcpServerManifest.ts index e7545657..8995c5a1 100644 --- a/src/api/types/TfyManagedMcpServerManifest.ts +++ b/src/api/types/TfyManagedMcpServerManifest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Connect to an external MCP Server endpoint. @@ -10,6 +10,8 @@ export interface TfyManagedMcpServerManifest { type: "mcp-server/tfy-managed"; /** The name of the MCP Server. */ name: string; + /** A human-readable label for the MCP Server in the UI. If omitted, the server name is shown. */ + displayName?: string; /** Provide a brief description of the purpose of this MCP Server. */ description: string; /** Catalog slug of the TrueFoundry-managed MCP server to connect to. Used to resolve the hosted endpoint and available tools. */ diff --git a/src/api/types/TfyMetadataGuardrailConfig.ts b/src/api/types/TfyMetadataGuardrailConfig.ts index 27403db6..f9507bf1 100644 --- a/src/api/types/TfyMetadataGuardrailConfig.ts +++ b/src/api/types/TfyMetadataGuardrailConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Request Metadata validation diff --git a/src/api/types/TfyMetadataGuardrailConfigConfig.ts b/src/api/types/TfyMetadataGuardrailConfigConfig.ts index 78cc6954..55289eb9 100644 --- a/src/api/types/TfyMetadataGuardrailConfigConfig.ts +++ b/src/api/types/TfyMetadataGuardrailConfigConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +uiType=Ignore diff --git a/src/api/types/TfyPiiGuardrailConfig.ts b/src/api/types/TfyPiiGuardrailConfig.ts index aade3211..0bf1857e 100644 --- a/src/api/types/TfyPiiGuardrailConfig.ts +++ b/src/api/types/TfyPiiGuardrailConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * PII/PHI diff --git a/src/api/types/TfyPiiGuardrailConfigConfig.ts b/src/api/types/TfyPiiGuardrailConfigConfig.ts index 3d85ae1c..a6ba4e14 100644 --- a/src/api/types/TfyPiiGuardrailConfigConfig.ts +++ b/src/api/types/TfyPiiGuardrailConfigConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * +uiType=Ignore diff --git a/src/api/types/TfyPiiGuardrailConfigOperation.ts b/src/api/types/TfyPiiGuardrailConfigOperation.ts index 3fb985b7..1081b76b 100644 --- a/src/api/types/TfyPiiGuardrailConfigOperation.ts +++ b/src/api/types/TfyPiiGuardrailConfigOperation.ts @@ -2,7 +2,8 @@ /** The operation type to use for the Guardrail. Validate guardrails are used to validate requests and mutate can validate as well as mutate requests. Validate guardrails are run in parallel while mutate guardrails are run sequentially. */ export const TfyPiiGuardrailConfigOperation = { - Mutate: "mutate", - Validate: "validate" - } as const; -export type TfyPiiGuardrailConfigOperation = typeof TfyPiiGuardrailConfigOperation[keyof typeof TfyPiiGuardrailConfigOperation]; + Mutate: "mutate", + Validate: "validate", +} as const; +export type TfyPiiGuardrailConfigOperation = + (typeof TfyPiiGuardrailConfigOperation)[keyof typeof TfyPiiGuardrailConfigOperation]; diff --git a/src/api/types/TfyPromptInjectionGuardrailConfig.ts b/src/api/types/TfyPromptInjectionGuardrailConfig.ts index 82a1f892..51acd9d8 100644 --- a/src/api/types/TfyPromptInjectionGuardrailConfig.ts +++ b/src/api/types/TfyPromptInjectionGuardrailConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Prompt Injection diff --git a/src/api/types/TogetherAiIntegrations.ts b/src/api/types/TogetherAiIntegrations.ts index 25301f67..146934ce 100644 --- a/src/api/types/TogetherAiIntegrations.ts +++ b/src/api/types/TogetherAiIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type TogetherAiIntegrations = TrueFoundry.TogetherAiModel; diff --git a/src/api/types/TogetherAiModel.ts b/src/api/types/TogetherAiModel.ts index 01a57934..f35d99e2 100644 --- a/src/api/types/TogetherAiModel.ts +++ b/src/api/types/TogetherAiModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Together AI Model diff --git a/src/api/types/TogetherAiProviderAccount.ts b/src/api/types/TogetherAiProviderAccount.ts index 22e45c31..8dfff745 100644 --- a/src/api/types/TogetherAiProviderAccount.ts +++ b/src/api/types/TogetherAiProviderAccount.ts @@ -1,21 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** - * Together AI Provider Account + * Together AI Model Account */ export interface TogetherAiProviderAccount { /** +value=provider-account/together-ai */ type: "provider-account/together-ai"; - /** The name of the Together AI provider account */ + /** The name of the Together AI model account */ name: string; authData: TrueFoundry.TogetherAiKeyAuth; - /** List of integrations that are associated with the Together AI provider account */ + /** List of integrations that are associated with the Together AI model account */ integrations: TrueFoundry.TogetherAiIntegrations[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/TokenPagination.ts b/src/api/types/TokenPagination.ts index ea1ff9c2..5c93760d 100644 --- a/src/api/types/TokenPagination.ts +++ b/src/api/types/TokenPagination.ts @@ -2,9 +2,9 @@ export interface TokenPagination { /** Number of items per page */ - limit?: number; + limit?: number | null; /** Base64 encoded token for the next page */ - nextPageToken?: string; + nextPageToken?: string | null; /** Base64 encoded token for the previous page */ - previousPageToken?: string; + previousPageToken?: string | null; } diff --git a/src/api/types/ToolCall.ts b/src/api/types/ToolCall.ts index 656d824a..f7a38f30 100644 --- a/src/api/types/ToolCall.ts +++ b/src/api/types/ToolCall.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface ToolCall { /** Type of the tool call */ type: "function"; /** Unique identifier for the tool call */ id: string; - "function": TrueFoundry.Function; + function: TrueFoundry.Function; } diff --git a/src/api/types/ToolMessage.ts b/src/api/types/ToolMessage.ts index a9d08239..899d7534 100644 --- a/src/api/types/ToolMessage.ts +++ b/src/api/types/ToolMessage.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Tool message for the chat diff --git a/src/api/types/ToolMessageContent.ts b/src/api/types/ToolMessageContent.ts index df1c9d64..5d57efc5 100644 --- a/src/api/types/ToolMessageContent.ts +++ b/src/api/types/ToolMessageContent.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Content of the tool call result */ -export type ToolMessageContent = - | string - | TrueFoundry.BlobStorageReference; +export type ToolMessageContent = string | TrueFoundry.BlobStorageReference; diff --git a/src/api/types/ToolSchema.ts b/src/api/types/ToolSchema.ts index 4f9fe299..c8e159c9 100644 --- a/src/api/types/ToolSchema.ts +++ b/src/api/types/ToolSchema.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Schema defining a tool for the chat prompt @@ -8,5 +8,5 @@ import * as TrueFoundry from "../index.js"; export interface ToolSchema { /** Type of the tool */ type: "function"; - "function": TrueFoundry.FunctionSchema; + function: TrueFoundry.FunctionSchema; } diff --git a/src/api/types/TraceSpan.ts b/src/api/types/TraceSpan.ts index f0850603..c0ccbf86 100644 --- a/src/api/types/TraceSpan.ts +++ b/src/api/types/TraceSpan.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface TraceSpan { /** Unique identifier for the span within the trace. */ @@ -34,5 +34,5 @@ export interface TraceSpan { /** Subject (user or virtualaccount) that created this span. */ createdBySubject: TrueFoundry.Subject; /** Gateway feedbacks associated with this span (if any). */ - feedbacks?: unknown[][]; + feedbacks?: unknown[][] | null; } diff --git a/src/api/types/TracingProject.ts b/src/api/types/TracingProject.ts new file mode 100644 index 00000000..a65104ff --- /dev/null +++ b/src/api/types/TracingProject.ts @@ -0,0 +1,17 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +export interface TracingProject { + id?: string | null; + fqn: string; + createdBySubject: TrueFoundry.Subject; + tenantName: string; + accountId: string; + manifest: Record; + createdAt?: Date | null; + updatedAt?: Date | null; + storageType: string; + storageRoot: string; + storageIntegrationId?: string | null; +} diff --git a/src/api/types/TracingProjectManifest.ts b/src/api/types/TracingProjectManifest.ts index bf02e270..55022342 100644 --- a/src/api/types/TracingProjectManifest.ts +++ b/src/api/types/TracingProjectManifest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Tracing Project is an entity that allows you to manage and monitor telemetry data. diff --git a/src/api/types/TracingProjectStorageConfig.ts b/src/api/types/TracingProjectStorageConfig.ts index 886d4876..95d521cb 100644 --- a/src/api/types/TracingProjectStorageConfig.ts +++ b/src/api/types/TracingProjectStorageConfig.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Storage configuration for tracing project * +discriminator=type */ -export type TracingProjectStorageConfig = +export type TracingProjectStorageConfig = | TrueFoundry.TracingProjectControlPlaneManagedStorage | TrueFoundry.TracingProjectCustomerManagedStorage; diff --git a/src/api/types/TransformersFramework.ts b/src/api/types/TransformersFramework.ts index 0aefb6e6..073c5e37 100644 --- a/src/api/types/TransformersFramework.ts +++ b/src/api/types/TransformersFramework.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Transformers @@ -8,9 +8,9 @@ import * as TrueFoundry from "../index.js"; export interface TransformersFramework { /** Type of the framework */ type: "transformers"; - libraryName?: TrueFoundry.LibraryName; + libraryName?: TrueFoundry.LibraryName | null; /** The `pipeline()` task this model can be used with e.g. `text-generation`. See [huggingface docs](https://huggingface.co/docs/transformers/main/en/main_classes/pipelines#transformers.pipeline.task) for all possible values */ - pipelineTag?: string; + pipelineTag?: string | null; /** Base model Id from HuggingFace Hub. If this is a finetuned model, this points to the base model id used for finetuning. */ - baseModel?: string; + baseModel?: string | null; } diff --git a/src/api/types/TriggerJobRunResponse.ts b/src/api/types/TriggerJobRunResponse.ts index 1881aa7e..cc973670 100644 --- a/src/api/types/TriggerJobRunResponse.ts +++ b/src/api/types/TriggerJobRunResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface TriggerJobRunResponse { /** Job triggered */ diff --git a/src/api/types/TrojAiGuardrailConfig.ts b/src/api/types/TrojAiGuardrailConfig.ts index 20890c64..40202974 100644 --- a/src/api/types/TrojAiGuardrailConfig.ts +++ b/src/api/types/TrojAiGuardrailConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * TrojAI diff --git a/src/api/types/TrojAiGuardrailConfigOperation.ts b/src/api/types/TrojAiGuardrailConfigOperation.ts index 43792009..e5b1d21d 100644 --- a/src/api/types/TrojAiGuardrailConfigOperation.ts +++ b/src/api/types/TrojAiGuardrailConfigOperation.ts @@ -5,7 +5,8 @@ * Validate guardrails are run in parallel while mutate guardrails are run sequentially. */ export const TrojAiGuardrailConfigOperation = { - Validate: "validate", - Mutate: "mutate" - } as const; -export type TrojAiGuardrailConfigOperation = typeof TrojAiGuardrailConfigOperation[keyof typeof TrojAiGuardrailConfigOperation]; + Validate: "validate", + Mutate: "mutate", +} as const; +export type TrojAiGuardrailConfigOperation = + (typeof TrojAiGuardrailConfigOperation)[keyof typeof TrojAiGuardrailConfigOperation]; diff --git a/src/api/types/TrueFoundryAgentConfig.ts b/src/api/types/TrueFoundryAgentConfig.ts index 30977ed5..b87e50aa 100644 --- a/src/api/types/TrueFoundryAgentConfig.ts +++ b/src/api/types/TrueFoundryAgentConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface TrueFoundryAgentConfig { /** Maximum number of iterations for the agent */ diff --git a/src/api/types/TrueFoundryAgentContextManagementConfig.ts b/src/api/types/TrueFoundryAgentContextManagementConfig.ts index ad5dd55e..ce1ca26f 100644 --- a/src/api/types/TrueFoundryAgentContextManagementConfig.ts +++ b/src/api/types/TrueFoundryAgentContextManagementConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface TrueFoundryAgentContextManagementConfig { compaction?: TrueFoundry.TrueFoundryAgentCompactionConfig; diff --git a/src/api/types/TrueFoundryAgentGitSourceSkill.ts b/src/api/types/TrueFoundryAgentGitSourceSkill.ts new file mode 100644 index 00000000..800cdf3b --- /dev/null +++ b/src/api/types/TrueFoundryAgentGitSourceSkill.ts @@ -0,0 +1,17 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Skill from a public Git repository. + */ +export interface TrueFoundryAgentGitSourceSkill { + /** Type */ + type: "git"; + /** Full HTTPS URL of a GitHub or GitLab repository. */ + url: string; + /** Path to the skill directory within the repository (e.g. skills/durable-objects). Omit to use the repository root. */ + path?: string; + /** Name for the skill, used as the directory name in the sandbox. */ + name: string; + /** Git ref — branch name, tag, or commit SHA. */ + ref: string; +} diff --git a/src/api/types/TrueFoundryAgentManifest.ts b/src/api/types/TrueFoundryAgentManifest.ts index 71204335..58879cd5 100644 --- a/src/api/types/TrueFoundryAgentManifest.ts +++ b/src/api/types/TrueFoundryAgentManifest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface TrueFoundryAgentManifest { /** Type of the manifest */ diff --git a/src/api/types/TrueFoundryAgentMcpServer.ts b/src/api/types/TrueFoundryAgentMcpServer.ts index 12ee5285..6c1c69ef 100644 --- a/src/api/types/TrueFoundryAgentMcpServer.ts +++ b/src/api/types/TrueFoundryAgentMcpServer.ts @@ -1,20 +1,10 @@ // This file was auto-generated by Fern from our API Definition. +import type * as TrueFoundry from "../index.js"; + /** - * A tool selector is either a literal tool name or one of the special tags: - * @all, @read-only, @write, @destructive. + * +discriminator=type */ -export interface TrueFoundryAgentMcpServer { - /** MCP server name */ - name: string; - /** When true, this server's tools are preloaded into context. When false (default), tools are discovered lazily and only preload_tools stay eager. */ - preload?: boolean; - /** Tools to enable. Supports tags @all, @read-only, @write, @destructive or literal tool names. */ - enableTools?: string[]; - /** Tools to disable (subtracted from enable_tools). */ - disableTools?: string[]; - /** When preload is false, tools to still preload into context. */ - preloadTools?: string[]; - /** Tools that require human approval before execution. Supports tags and literal tool names. */ - requireApprovalForTools?: string[]; -} +export type TrueFoundryAgentMcpServer = + | TrueFoundry.TrueFoundryAgentMcpServerRegistry + | TrueFoundry.TrueFoundryAgentMcpServerInline; diff --git a/src/api/types/TrueFoundryAgentMcpServerInline.ts b/src/api/types/TrueFoundryAgentMcpServerInline.ts new file mode 100644 index 00000000..e347697d --- /dev/null +++ b/src/api/types/TrueFoundryAgentMcpServerInline.ts @@ -0,0 +1,23 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * An MCP server connected directly by its url, defined inline in the agent (not registered on the TrueFoundry platform). + */ +export interface TrueFoundryAgentMcpServerInline { + /** Type */ + type: "inline"; + /** A name you choose to identify this inline server. */ + name: string; + /** The inline MCP server endpoint (streamable-http or SSE). Must be an http(s) URL. */ + url: string; + /** When true, this server's tools are preloaded into context. When false (default), tools are discovered lazily and only preload_tools stay eager. */ + preload?: boolean; + /** Tools to enable. Supports tags @all, @read-only, @write, @destructive or literal tool names. */ + enableTools?: string[]; + /** Tools to disable (subtracted from enable_tools). */ + disableTools?: string[]; + /** When preload is false, tools to still preload into context. */ + preloadTools?: string[]; + /** Tools that require human approval before execution. Supports tags and literal tool names. */ + requireApprovalForTools?: string[]; +} diff --git a/src/api/types/TrueFoundryAgentMcpServerRegistry.ts b/src/api/types/TrueFoundryAgentMcpServerRegistry.ts new file mode 100644 index 00000000..c3792ec9 --- /dev/null +++ b/src/api/types/TrueFoundryAgentMcpServerRegistry.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * An MCP server registered on the TrueFoundry platform, referenced by its registered name. + */ +export interface TrueFoundryAgentMcpServerRegistry { + /** Type */ + type: "truefoundry-mcp-registry"; + /** The registered name of the MCP server to connect. */ + name: string; + /** When true, this server's tools are preloaded into context. When false (default), tools are discovered lazily and only preload_tools stay eager. */ + preload?: boolean; + /** Tools to enable. Supports tags @all, @read-only, @write, @destructive or literal tool names. */ + enableTools?: string[]; + /** Tools to disable (subtracted from enable_tools). */ + disableTools?: string[]; + /** When preload is false, tools to still preload into context. */ + preloadTools?: string[]; + /** Tools that require human approval before execution. Supports tags and literal tool names. */ + requireApprovalForTools?: string[]; +} diff --git a/src/api/types/TrueFoundryAgentModel.ts b/src/api/types/TrueFoundryAgentModel.ts index 210a9d9c..7ca96f49 100644 --- a/src/api/types/TrueFoundryAgentModel.ts +++ b/src/api/types/TrueFoundryAgentModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface TrueFoundryAgentModel { /** Model name, e.g. openai-main/gpt-4o */ diff --git a/src/api/types/TrueFoundryAgentResponseFormat.ts b/src/api/types/TrueFoundryAgentResponseFormat.ts index e5b06b51..85b17f82 100644 --- a/src/api/types/TrueFoundryAgentResponseFormat.ts +++ b/src/api/types/TrueFoundryAgentResponseFormat.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; -export type TrueFoundryAgentResponseFormat = +export type TrueFoundryAgentResponseFormat = | TrueFoundry.ResponseFormatText | TrueFoundry.ResponseFormatJsonSchema | TrueFoundry.ResponseFormatJsonObject; diff --git a/src/api/types/TrueFoundryAgentSandboxAuthData.ts b/src/api/types/TrueFoundryAgentSandboxAuthData.ts new file mode 100644 index 00000000..f0f81311 --- /dev/null +++ b/src/api/types/TrueFoundryAgentSandboxAuthData.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +export type TrueFoundryAgentSandboxAuthData = TrueFoundry.TrueFoundryAgentSandboxBasicAuthData; diff --git a/src/api/types/TrueFoundryAgentSandboxAuthInject.ts b/src/api/types/TrueFoundryAgentSandboxAuthInject.ts new file mode 100644 index 00000000..04aa596c --- /dev/null +++ b/src/api/types/TrueFoundryAgentSandboxAuthInject.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +export type TrueFoundryAgentSandboxAuthInject = TrueFoundry.TrueFoundryAgentSandboxGitAuthInject; diff --git a/src/api/types/TrueFoundryAgentSandboxAuthInjectMatch.ts b/src/api/types/TrueFoundryAgentSandboxAuthInjectMatch.ts new file mode 100644 index 00000000..c604785c --- /dev/null +++ b/src/api/types/TrueFoundryAgentSandboxAuthInjectMatch.ts @@ -0,0 +1,6 @@ +// This file was auto-generated by Fern from our API Definition. + +export interface TrueFoundryAgentSandboxAuthInjectMatch { + /** Exact hostnames that this auth injection rule applies to (e.g. api.github.com). Wildcards are not allowed. */ + hosts: string[]; +} diff --git a/src/api/types/TrueFoundryAgentSandboxBasicAuthData.ts b/src/api/types/TrueFoundryAgentSandboxBasicAuthData.ts new file mode 100644 index 00000000..63f69c10 --- /dev/null +++ b/src/api/types/TrueFoundryAgentSandboxBasicAuthData.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Basic Auth + */ +export interface TrueFoundryAgentSandboxBasicAuthData { + /** +value=basic */ + type: "basic"; + /** Username for basic authentication. */ + username: string; + /** Password or token for basic authentication. Stored as a secret reference (tfy-secret://…). */ + password: string; +} diff --git a/src/api/types/TrueFoundryAgentSandboxConfig.ts b/src/api/types/TrueFoundryAgentSandboxConfig.ts index e4c41f2b..42368743 100644 --- a/src/api/types/TrueFoundryAgentSandboxConfig.ts +++ b/src/api/types/TrueFoundryAgentSandboxConfig.ts @@ -1,6 +1,9 @@ // This file was auto-generated by Fern from our API Definition. +import type * as TrueFoundry from "../index.js"; + export interface TrueFoundryAgentSandboxConfig { enabled: boolean; fileDownloads?: boolean; + networkPolicy?: TrueFoundry.TrueFoundryAgentSandboxNetworkPolicy; } diff --git a/src/api/types/TrueFoundryAgentSandboxGitAuthInject.ts b/src/api/types/TrueFoundryAgentSandboxGitAuthInject.ts new file mode 100644 index 00000000..a1732887 --- /dev/null +++ b/src/api/types/TrueFoundryAgentSandboxGitAuthInject.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +/** + * Git Auth Inject + */ +export interface TrueFoundryAgentSandboxGitAuthInject { + /** +value=git */ + type: "git"; + match: TrueFoundry.TrueFoundryAgentSandboxAuthInjectMatch; + authData: TrueFoundry.TrueFoundryAgentSandboxAuthData; +} diff --git a/src/api/types/TrueFoundryAgentSandboxNetworkPolicy.ts b/src/api/types/TrueFoundryAgentSandboxNetworkPolicy.ts new file mode 100644 index 00000000..42e5b95c --- /dev/null +++ b/src/api/types/TrueFoundryAgentSandboxNetworkPolicy.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +export interface TrueFoundryAgentSandboxNetworkPolicy { + /** Rules for injecting authentication into outbound network requests from the sandbox. */ + authInject?: TrueFoundry.TrueFoundryAgentSandboxAuthInject[]; +} diff --git a/src/api/types/TrueFoundryAgentSkill.ts b/src/api/types/TrueFoundryAgentSkill.ts index 88b0035c..08feaa19 100644 --- a/src/api/types/TrueFoundryAgentSkill.ts +++ b/src/api/types/TrueFoundryAgentSkill.ts @@ -1,8 +1,10 @@ // This file was auto-generated by Fern from our API Definition. -export interface TrueFoundryAgentSkill { - /** Fully qualified name of the agent skill */ - fqn: string; - /** If true, the SKILL.md content is injected into the agent context. */ - preload: boolean; -} +import type * as TrueFoundry from "../index.js"; + +/** + * +discriminator=type + */ +export type TrueFoundryAgentSkill = + | TrueFoundry.TrueFoundryAgentTrueFoundrySkill + | TrueFoundry.TrueFoundryAgentGitSourceSkill; diff --git a/src/api/types/TrueFoundryAgentTrueFoundrySkill.ts b/src/api/types/TrueFoundryAgentTrueFoundrySkill.ts new file mode 100644 index 00000000..b5da1275 --- /dev/null +++ b/src/api/types/TrueFoundryAgentTrueFoundrySkill.ts @@ -0,0 +1,13 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * Skill from the TrueFoundry skill registry, referenced by FQN. + */ +export interface TrueFoundryAgentTrueFoundrySkill { + /** Type */ + type: "truefoundry-skills-registry"; + /** Fully qualified name of the agent skill */ + fqn: string; + /** If true, the SKILL.md content is injected into the agent context. */ + preload: boolean; +} diff --git a/src/api/types/TrueFoundryAgentUserMessage.ts b/src/api/types/TrueFoundryAgentUserMessage.ts index 29417a6a..20f19c7e 100644 --- a/src/api/types/TrueFoundryAgentUserMessage.ts +++ b/src/api/types/TrueFoundryAgentUserMessage.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. export interface TrueFoundryAgentUserMessage { - /** Role of the message sender. */ - role: "user"; + /** Message type discriminator. */ + type: "user.message"; /** Content of the user message. Supports template variables like {{variable_name}}. */ content: string; } diff --git a/src/api/types/TrueFoundryApplyRequestManifest.ts b/src/api/types/TrueFoundryApplyRequestManifest.ts index ccb4c97f..06979bfa 100644 --- a/src/api/types/TrueFoundryApplyRequestManifest.ts +++ b/src/api/types/TrueFoundryApplyRequestManifest.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Manifest of the resource to be created or updated */ -export type TrueFoundryApplyRequestManifest = +export type TrueFoundryApplyRequestManifest = | TrueFoundry.MlRepoManifest | TrueFoundry.ArtifactManifest | TrueFoundry.ModelManifest @@ -39,4 +39,5 @@ export type TrueFoundryApplyRequestManifest = | TrueFoundry.TracingProjectManifest | TrueFoundry.McpServerManifest | TrueFoundry.RoleBindingManifest - | TrueFoundry.AgentIdentityManifest; + | TrueFoundry.AgentIdentityManifest + | TrueFoundry.AgentChannelManifest; diff --git a/src/api/types/TrueFoundryApplyResponse.ts b/src/api/types/TrueFoundryApplyResponse.ts index b37181f8..488c5b67 100644 --- a/src/api/types/TrueFoundryApplyResponse.ts +++ b/src/api/types/TrueFoundryApplyResponse.ts @@ -1,12 +1,12 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface TrueFoundryApplyResponse { /** The existing manifest of the resource */ - existingManifest?: TrueFoundry.TrueFoundryApplyResponseExistingManifest; + existingManifest?: TrueFoundry.TrueFoundryApplyResponseExistingManifest | null; /** The action performed: CREATE or UPDATE */ - action?: TrueFoundry.TrueFoundryApplyResponseAction; + action?: TrueFoundry.TrueFoundryApplyResponseAction | null; /** The created or updated resource */ - data?: Record; + data?: TrueFoundry.TrueFoundryApplyResponseData | null; } diff --git a/src/api/types/TrueFoundryApplyResponseAction.ts b/src/api/types/TrueFoundryApplyResponseAction.ts index f9f8d391..089f995a 100644 --- a/src/api/types/TrueFoundryApplyResponseAction.ts +++ b/src/api/types/TrueFoundryApplyResponseAction.ts @@ -2,7 +2,8 @@ /** The action performed: CREATE or UPDATE */ export const TrueFoundryApplyResponseAction = { - Create: "CREATE", - Update: "UPDATE" - } as const; -export type TrueFoundryApplyResponseAction = typeof TrueFoundryApplyResponseAction[keyof typeof TrueFoundryApplyResponseAction]; + Create: "CREATE", + Update: "UPDATE", +} as const; +export type TrueFoundryApplyResponseAction = + (typeof TrueFoundryApplyResponseAction)[keyof typeof TrueFoundryApplyResponseAction]; diff --git a/src/api/types/TrueFoundryApplyResponseData.ts b/src/api/types/TrueFoundryApplyResponseData.ts new file mode 100644 index 00000000..1f0cafbc --- /dev/null +++ b/src/api/types/TrueFoundryApplyResponseData.ts @@ -0,0 +1,36 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../index.js"; + +/** + * The created or updated resource + */ +export type TrueFoundryApplyResponseData = + | TrueFoundry.ProviderAccount + | TrueFoundry.Cluster + | TrueFoundry.Workspace + | TrueFoundry.MlRepo + | TrueFoundry.Deployment + | TrueFoundry.GatewayConfiguration + | TrueFoundry.Team + | TrueFoundry.Policy + | TrueFoundry.Role + | TrueFoundry.Settings + | TrueFoundry.AlertConfigEntity + | TrueFoundry.VirtualAccount + | TrueFoundry.Agent + | TrueFoundry.Environment + | TrueFoundry.TracingProject + | TrueFoundry.McpServer + | TrueFoundry.RoleBinding + | TrueFoundry.SecretGroup + | TrueFoundry.AgentIdentity + | TrueFoundry.ExternalIdentityProvider + | TrueFoundry.GatewayInstallation + | TrueFoundry.GatewayBudget + | TrueFoundry.ArtifactVersion + | TrueFoundry.ModelVersion + | TrueFoundry.PromptVersion + | TrueFoundry.AgentSkillVersion + | TrueFoundry.DataDirectory + | TrueFoundry.AgentChannel; diff --git a/src/api/types/TrueFoundryApplyResponseExistingManifest.ts b/src/api/types/TrueFoundryApplyResponseExistingManifest.ts index fbad72af..16540ac5 100644 --- a/src/api/types/TrueFoundryApplyResponseExistingManifest.ts +++ b/src/api/types/TrueFoundryApplyResponseExistingManifest.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * The existing manifest of the resource */ -export type TrueFoundryApplyResponseExistingManifest = +export type TrueFoundryApplyResponseExistingManifest = | TrueFoundry.MlRepoManifest | TrueFoundry.ArtifactManifest | TrueFoundry.ModelManifest @@ -39,4 +39,5 @@ export type TrueFoundryApplyResponseExistingManifest = | TrueFoundry.TracingProjectManifest | TrueFoundry.McpServerManifest | TrueFoundry.RoleBindingManifest - | TrueFoundry.AgentIdentityManifest; + | TrueFoundry.AgentIdentityManifest + | TrueFoundry.AgentChannelManifest; diff --git a/src/api/types/TrueFoundryDeleteRequestManifest.ts b/src/api/types/TrueFoundryDeleteRequestManifest.ts index 69e48e57..eaea76c8 100644 --- a/src/api/types/TrueFoundryDeleteRequestManifest.ts +++ b/src/api/types/TrueFoundryDeleteRequestManifest.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Manifest of the resource to be deleted */ -export type TrueFoundryDeleteRequestManifest = +export type TrueFoundryDeleteRequestManifest = | TrueFoundry.MlRepoManifest | TrueFoundry.ArtifactManifest | TrueFoundry.ModelManifest @@ -39,4 +39,5 @@ export type TrueFoundryDeleteRequestManifest = | TrueFoundry.TracingProjectManifest | TrueFoundry.McpServerManifest | TrueFoundry.RoleBindingManifest - | TrueFoundry.AgentIdentityManifest; + | TrueFoundry.AgentIdentityManifest + | TrueFoundry.AgentChannelManifest; diff --git a/src/api/types/TrueFoundryDeleteResponse.ts b/src/api/types/TrueFoundryDeleteResponse.ts index 7b3bb23a..f0c46bce 100644 --- a/src/api/types/TrueFoundryDeleteResponse.ts +++ b/src/api/types/TrueFoundryDeleteResponse.ts @@ -1,4 +1,3 @@ // This file was auto-generated by Fern from our API Definition. -export interface TrueFoundryDeleteResponse { -} +export type TrueFoundryDeleteResponse = {}; diff --git a/src/api/types/TrueFoundryIntegrations.ts b/src/api/types/TrueFoundryIntegrations.ts index e9e3cf63..eb51300f 100644 --- a/src/api/types/TrueFoundryIntegrations.ts +++ b/src/api/types/TrueFoundryIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type TrueFoundryIntegrations = TrueFoundry.TrueFoundryDbssm; diff --git a/src/api/types/TrueFoundryProviderAccount.ts b/src/api/types/TrueFoundryProviderAccount.ts index 71903cd2..7c3d821f 100644 --- a/src/api/types/TrueFoundryProviderAccount.ts +++ b/src/api/types/TrueFoundryProviderAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * TrueFoundry diff --git a/src/api/types/TruefoundryBackedIdentity.ts b/src/api/types/TruefoundryBackedIdentity.ts index d5f616c1..2abccb5a 100644 --- a/src/api/types/TruefoundryBackedIdentity.ts +++ b/src/api/types/TruefoundryBackedIdentity.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Identity backed by a TrueFoundry issued token diff --git a/src/api/types/TruefoundryFlyteTaskTemplate.ts b/src/api/types/TruefoundryFlyteTaskTemplate.ts index e80a1c1f..f65d3265 100644 --- a/src/api/types/TruefoundryFlyteTaskTemplate.ts +++ b/src/api/types/TruefoundryFlyteTaskTemplate.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface TruefoundryFlyteTaskTemplate { id: TrueFoundry.FlyteTaskId; diff --git a/src/api/types/TtlIntegrations.ts b/src/api/types/TtlIntegrations.ts index 5a4f0c4c..ddcb6f78 100644 --- a/src/api/types/TtlIntegrations.ts +++ b/src/api/types/TtlIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type TtlIntegrations = TrueFoundry.TtlRegistry; diff --git a/src/api/types/TtlProviderAccount.ts b/src/api/types/TtlProviderAccount.ts index e70ae66d..c1f7194e 100644 --- a/src/api/types/TtlProviderAccount.ts +++ b/src/api/types/TtlProviderAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * TTL diff --git a/src/api/types/UpdateRunResponse.ts b/src/api/types/UpdateRunResponse.ts index 3fb5aff7..dbda9ca6 100644 --- a/src/api/types/UpdateRunResponse.ts +++ b/src/api/types/UpdateRunResponse.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface UpdateRunResponse { /** Updated run metadata. */ diff --git a/src/api/types/UpdateSecretInput.ts b/src/api/types/UpdateSecretInput.ts index 63214e20..c97b12b4 100644 --- a/src/api/types/UpdateSecretInput.ts +++ b/src/api/types/UpdateSecretInput.ts @@ -4,5 +4,5 @@ export interface UpdateSecretInput { /** Key of the secret. */ key: string; /** Value of the secret. */ - value?: string; + value?: string | null; } diff --git a/src/api/types/UpdateUserRolesResponse.ts b/src/api/types/UpdateUserRolesResponse.ts index 8bf98ea4..b33ea3a2 100644 --- a/src/api/types/UpdateUserRolesResponse.ts +++ b/src/api/types/UpdateUserRolesResponse.ts @@ -1,4 +1,3 @@ // This file was auto-generated by Fern from our API Definition. -export interface UpdateUserRolesResponse { -} +export type UpdateUserRolesResponse = {}; diff --git a/src/api/types/UpgradeData.ts b/src/api/types/UpgradeData.ts index ddc6ec91..eeadba9e 100644 --- a/src/api/types/UpgradeData.ts +++ b/src/api/types/UpgradeData.ts @@ -1,12 +1,12 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface UpgradeData { - diff?: TrueFoundry.IChange[]; - currentManifest?: TrueFoundry.Helm; - desiredManifest?: TrueFoundry.Helm; - upgradePossible?: boolean; - conflictFields?: string[]; - hasConflict?: boolean; + diff?: TrueFoundry.IChange[] | null; + currentManifest?: TrueFoundry.Helm | null; + desiredManifest?: TrueFoundry.Helm | null; + upgradePossible?: boolean | null; + conflictFields?: string[] | null; + hasConflict?: boolean | null; } diff --git a/src/api/types/UsageCodeSnippet.ts b/src/api/types/UsageCodeSnippet.ts index caaaaf4e..d7bce6b0 100644 --- a/src/api/types/UsageCodeSnippet.ts +++ b/src/api/types/UsageCodeSnippet.ts @@ -6,9 +6,9 @@ export interface UsageCodeSnippet { /** Programming language of the usage code snippet. */ language: string; /** Libraries required to run the usage code snippet. */ - libraries?: string[]; + libraries?: string[] | null; /** Source code of the usage code snippet. */ code: string; /** Icon representing the usage code snippet. */ - icon?: string; + icon?: string | null; } diff --git a/src/api/types/User.ts b/src/api/types/User.ts index c7a4e4d0..7b0d1d9b 100644 --- a/src/api/types/User.ts +++ b/src/api/types/User.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface User { /** System-generated user ID. */ @@ -8,13 +8,13 @@ export interface User { email: string; tenantName: string; metadata: TrueFoundry.UserMetadata; - roles?: string[]; - rolesWithResource?: TrueFoundry.RoleWithResource[]; - accounts?: TrueFoundry.AccountInfo[]; + roles?: string[] | null; + rolesWithResource?: TrueFoundry.RoleWithResource[] | null; + accounts?: TrueFoundry.AccountInfo[] | null; active: boolean; isEditable: boolean; createdAt: Date; updatedAt: Date; /** Timestamp when the user last accessed the platform. */ - lastAccessedAt?: Date; + lastAccessedAt?: Date | null; } diff --git a/src/api/types/UserMessage.ts b/src/api/types/UserMessage.ts index b1803b5b..794a342c 100644 --- a/src/api/types/UserMessage.ts +++ b/src/api/types/UserMessage.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * User message turn diff --git a/src/api/types/UserMessageContent.ts b/src/api/types/UserMessageContent.ts index 4c6927ca..e98a91e6 100644 --- a/src/api/types/UserMessageContent.ts +++ b/src/api/types/UserMessageContent.ts @@ -1,11 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Content of the user message. can be a mix of text and images */ -export type UserMessageContent = - | string - | TrueFoundry.UserMessageContentOneItem[] - | TrueFoundry.BlobStorageReference; +export type UserMessageContent = string | TrueFoundry.UserMessageContentOneItem[] | TrueFoundry.BlobStorageReference; diff --git a/src/api/types/UserMessageContentOneItem.ts b/src/api/types/UserMessageContentOneItem.ts index 26ff8d91..d243c925 100644 --- a/src/api/types/UserMessageContentOneItem.ts +++ b/src/api/types/UserMessageContentOneItem.ts @@ -1,7 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; -export type UserMessageContentOneItem = - | TrueFoundry.TextContentPart - | TrueFoundry.ImageContentPart; +export type UserMessageContentOneItem = TrueFoundry.TextContentPart | TrueFoundry.ImageContentPart; diff --git a/src/api/types/UserMetadata.ts b/src/api/types/UserMetadata.ts index 12c8f104..4dd0beff 100644 --- a/src/api/types/UserMetadata.ts +++ b/src/api/types/UserMetadata.ts @@ -1,19 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface UserMetadata { - sub?: string; - imageUrl?: string; - pictureDownloadPath?: string; - displayName?: string; - userObject?: Record; - inviteAccepted?: boolean; - registeredInIdp?: boolean; - preference?: Record; - groups?: string[]; - tenantRoleManagedBy?: TrueFoundry.UserMetadataTenantRoleManagedBy; - ssoName?: string; - scimUserObject?: Record; - createdByScim?: boolean; + sub?: string | null; + imageUrl?: string | null; + pictureDownloadPath?: string | null; + displayName?: string | null; + userObject?: Record | null; + inviteAccepted?: boolean | null; + registeredInIdp?: boolean | null; + preference?: Record | null; + groups?: string[] | null; + tenantRoleManagedBy?: TrueFoundry.UserMetadataTenantRoleManagedBy | null; + ssoName?: string | null; + scimUserObject?: Record | null; + createdByScim?: boolean | null; } diff --git a/src/api/types/UserMetadataTenantRoleManagedBy.ts b/src/api/types/UserMetadataTenantRoleManagedBy.ts index 0b7d9c59..491b35cd 100644 --- a/src/api/types/UserMetadataTenantRoleManagedBy.ts +++ b/src/api/types/UserMetadataTenantRoleManagedBy.ts @@ -1,8 +1,9 @@ // This file was auto-generated by Fern from our API Definition. export const UserMetadataTenantRoleManagedBy = { - Manual: "manual", - Group: "group", - Initial: "initial" - } as const; -export type UserMetadataTenantRoleManagedBy = typeof UserMetadataTenantRoleManagedBy[keyof typeof UserMetadataTenantRoleManagedBy]; + Manual: "manual", + Group: "group", + Initial: "initial", +} as const; +export type UserMetadataTenantRoleManagedBy = + (typeof UserMetadataTenantRoleManagedBy)[keyof typeof UserMetadataTenantRoleManagedBy]; diff --git a/src/api/types/UserResource.ts b/src/api/types/UserResource.ts index 2fb203e2..99dfcd9f 100644 --- a/src/api/types/UserResource.ts +++ b/src/api/types/UserResource.ts @@ -8,5 +8,5 @@ export interface UserResource { /** Role ID */ roleId: string; /** Resource Name (if available) */ - resourceName?: string; + resourceName?: string | null; } diff --git a/src/api/types/ValueConstraint.ts b/src/api/types/ValueConstraint.ts index 14587467..00d3ca1c 100644 --- a/src/api/types/ValueConstraint.ts +++ b/src/api/types/ValueConstraint.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Pick how to validate the value. */ -export type ValueConstraint = - | TrueFoundry.RegexConstraint - | TrueFoundry.AllowedValuesConstraint; +export type ValueConstraint = TrueFoundry.RegexConstraint | TrueFoundry.AllowedValuesConstraint; diff --git a/src/api/types/VertexKeyFileAuth.ts b/src/api/types/VertexKeyFileAuth.ts index 2d285e99..e19bf027 100644 --- a/src/api/types/VertexKeyFileAuth.ts +++ b/src/api/types/VertexKeyFileAuth.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Service account key file diff --git a/src/api/types/VertexKeyFileAuthKeyFileContent.ts b/src/api/types/VertexKeyFileAuthKeyFileContent.ts index f5c2554a..b916d132 100644 --- a/src/api/types/VertexKeyFileAuthKeyFileContent.ts +++ b/src/api/types/VertexKeyFileAuthKeyFileContent.ts @@ -3,6 +3,4 @@ /** * JSON from a downloadable Google Cloud service account key (type service_account). Not for Workload Identity Federation; use authentication type Workload Identity Federation file (workload-identity-federation-file) for gcloud iam workload-identity-pools create-cred-config output. */ -export type VertexKeyFileAuthKeyFileContent = - | string - | Record; +export type VertexKeyFileAuthKeyFileContent = string | Record; diff --git a/src/api/types/VertexModel.ts b/src/api/types/VertexModel.ts index e434a4ef..13edab92 100644 --- a/src/api/types/VertexModel.ts +++ b/src/api/types/VertexModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Vertex Model diff --git a/src/api/types/VertexRegion.ts b/src/api/types/VertexRegion.ts index 6eaf17cd..c5c68915 100644 --- a/src/api/types/VertexRegion.ts +++ b/src/api/types/VertexRegion.ts @@ -1,44 +1,51 @@ // This file was auto-generated by Fern from our API Definition. export const VertexRegion = { - Global: "global", - NorthamericaNortheast1: "northamerica-northeast1", - NorthamericaNortheast2: "northamerica-northeast2", - SouthamericaEast1: "southamerica-east1", - UsCentral1: "us-central1", - UsEast1: "us-east1", - UsEast4: "us-east4", - UsEast5: "us-east5", - UsSouth1: "us-south1", - UsWest1: "us-west1", - UsWest2: "us-west2", - UsWest3: "us-west3", - UsWest4: "us-west4", - AsiaEast1: "asia-east1", - AsiaEast2: "asia-east2", - AsiaNortheast1: "asia-northeast1", - AsiaNortheast2: "asia-northeast2", - AsiaNortheast3: "asia-northeast3", - AsiaSouth1: "asia-south1", - AsiaSouth2: "asia-south2", - AsiaSoutheast1: "asia-southeast1", - AsiaSoutheast2: "asia-southeast2", - AustraliaSoutheast1: "australia-southeast1", - AustraliaSoutheast2: "australia-southeast2", - EuropeCentral2: "europe-central2", - EuropeNorth1: "europe-north1", - EuropeSouthwest1: "europe-southwest1", - EuropeWest1: "europe-west1", - EuropeWest2: "europe-west2", - EuropeWest3: "europe-west3", - EuropeWest4: "europe-west4", - EuropeWest6: "europe-west6", - EuropeWest8: "europe-west8", - EuropeWest9: "europe-west9", - MeCentral1: "me-central1", - MeCentral2: "me-central2", - MeWest1: "me-west1", - Eu: "eu", - Us: "us" - } as const; -export type VertexRegion = typeof VertexRegion[keyof typeof VertexRegion]; + Global: "global", + AfricaSouth1: "africa-south1", + AsiaEast1: "asia-east1", + AsiaEast2: "asia-east2", + AsiaNortheast1: "asia-northeast1", + AsiaNortheast2: "asia-northeast2", + AsiaNortheast3: "asia-northeast3", + AsiaSouth1: "asia-south1", + AsiaSouth2: "asia-south2", + AsiaSoutheast1: "asia-southeast1", + AsiaSoutheast2: "asia-southeast2", + AsiaSoutheast3: "asia-southeast3", + AustraliaSoutheast1: "australia-southeast1", + AustraliaSoutheast2: "australia-southeast2", + EuropeCentral2: "europe-central2", + EuropeNorth1: "europe-north1", + EuropeNorth2: "europe-north2", + EuropeSouthwest1: "europe-southwest1", + EuropeWest1: "europe-west1", + EuropeWest2: "europe-west2", + EuropeWest3: "europe-west3", + EuropeWest4: "europe-west4", + EuropeWest6: "europe-west6", + EuropeWest8: "europe-west8", + EuropeWest9: "europe-west9", + EuropeWest10: "europe-west10", + EuropeWest12: "europe-west12", + MeCentral1: "me-central1", + MeCentral2: "me-central2", + MeWest1: "me-west1", + NorthamericaNortheast1: "northamerica-northeast1", + NorthamericaNortheast2: "northamerica-northeast2", + NorthamericaSouth1: "northamerica-south1", + SouthamericaEast1: "southamerica-east1", + SouthamericaWest1: "southamerica-west1", + UsCentral1: "us-central1", + UsEast1: "us-east1", + UsEast4: "us-east4", + UsEast5: "us-east5", + UsSouth1: "us-south1", + UsWest1: "us-west1", + UsWest2: "us-west2", + UsWest3: "us-west3", + UsWest4: "us-west4", + Eu: "eu", + Us: "us", +} as const; +export type VertexRegion = (typeof VertexRegion)[keyof typeof VertexRegion]; diff --git a/src/api/types/VertexWifFileAuth.ts b/src/api/types/VertexWifFileAuth.ts index ec39a01b..0d513c0f 100644 --- a/src/api/types/VertexWifFileAuth.ts +++ b/src/api/types/VertexWifFileAuth.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Workload Identity Federation file diff --git a/src/api/types/VertexWifFileAuthKeyFileContent.ts b/src/api/types/VertexWifFileAuthKeyFileContent.ts index 60c43939..4a0b119e 100644 --- a/src/api/types/VertexWifFileAuthKeyFileContent.ts +++ b/src/api/types/VertexWifFileAuthKeyFileContent.ts @@ -3,6 +3,4 @@ /** * JSON credential configuration for Workload Identity Federation (ADC type external_account), for example from gcloud iam workload-identity-pools create-cred-config. This is not a service account private key. Same field name as key-file auth (key_file_content); use auth_data.type workload-identity-federation-file vs key-file to distinguish. */ -export type VertexWifFileAuthKeyFileContent = - | string - | Record; +export type VertexWifFileAuthKeyFileContent = string | Record; diff --git a/src/api/types/VirtualAccount.ts b/src/api/types/VirtualAccount.ts index db59873c..1a7e0348 100644 --- a/src/api/types/VirtualAccount.ts +++ b/src/api/types/VirtualAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface VirtualAccount { /** System-generated virtual account ID. */ @@ -10,9 +10,9 @@ export interface VirtualAccount { /** Tenant the virtual account belongs to. */ tenantName: string; /** The manifest defining name, permissions, ownership, and configuration. */ - manifest?: TrueFoundry.VirtualAccountManifest; + manifest?: TrueFoundry.VirtualAccountManifest | null; /** System-generated ID of the currently active JWT. */ - jwtId?: string; + jwtId?: string | null; /** The subject (user or service account) that created this virtual account. */ createdBySubject: TrueFoundry.Subject; /** Timestamp when the virtual account was created. */ @@ -20,19 +20,19 @@ export interface VirtualAccount { /** Timestamp when the virtual account was last updated. */ updatedAt: Date; /** Timestamp when the virtual account was last used to authenticate. */ - lastAccessedAt?: Date; + lastAccessedAt?: Date | null; /** Whether the virtual account token has expired. */ - isExpired?: boolean; + isExpired?: boolean | null; /** JWT tokens associated with this virtual account. */ - jwts?: TrueFoundry.Jwt[]; + jwts?: TrueFoundry.Jwt[] | null; /** ID of the account that owns this virtual account. */ accountId: string; /** Additional metadata for the virtual account. */ - metadata?: Record; + metadata?: Record | null; /** Role IDs assigned to this virtual account. */ - roleIds?: string[]; + roleIds?: string[] | null; /** Roles with their associated resources. */ - rolesWithResource?: TrueFoundry.RoleWithResource[]; - createdBy?: string; - nextScheduledRotation?: string; + rolesWithResource?: TrueFoundry.RoleWithResource[] | null; + createdBy?: string | null; + nextScheduledRotation?: string | null; } diff --git a/src/api/types/VirtualAccountManifest.ts b/src/api/types/VirtualAccountManifest.ts index 347dad04..5040e4b7 100644 --- a/src/api/types/VirtualAccountManifest.ts +++ b/src/api/types/VirtualAccountManifest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface VirtualAccountManifest { /** Virtual Account Name */ diff --git a/src/api/types/VirtualAccountManifestTokenType.ts b/src/api/types/VirtualAccountManifestTokenType.ts index 873e1cc3..2c8d3b66 100644 --- a/src/api/types/VirtualAccountManifestTokenType.ts +++ b/src/api/types/VirtualAccountManifestTokenType.ts @@ -2,7 +2,8 @@ /** Format of the issued token. Leave empty to use the platform default. */ export const VirtualAccountManifestTokenType = { - Jwt: "jwt", - Opaque: "opaque" - } as const; -export type VirtualAccountManifestTokenType = typeof VirtualAccountManifestTokenType[keyof typeof VirtualAccountManifestTokenType]; + Jwt: "jwt", + Opaque: "opaque", +} as const; +export type VirtualAccountManifestTokenType = + (typeof VirtualAccountManifestTokenType)[keyof typeof VirtualAccountManifestTokenType]; diff --git a/src/api/types/VirtualMcpServerIntegration.ts b/src/api/types/VirtualMcpServerIntegration.ts index 5837bec0..d430c80a 100644 --- a/src/api/types/VirtualMcpServerIntegration.ts +++ b/src/api/types/VirtualMcpServerIntegration.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Virtual MCP Server diff --git a/src/api/types/VirtualMcpServerManifest.ts b/src/api/types/VirtualMcpServerManifest.ts index 7239005e..ec693eea 100644 --- a/src/api/types/VirtualMcpServerManifest.ts +++ b/src/api/types/VirtualMcpServerManifest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * TrueFoundry-hosted MCP Server composed of other MCP servers. @@ -10,6 +10,8 @@ export interface VirtualMcpServerManifest { type: "mcp-server/virtual"; /** The name of the Virtual MCP Server. */ name: string; + /** A human-readable label for the Virtual MCP Server in the UI. If omitted, the server name is shown. */ + displayName?: string; /** Provide a brief description of the purpose of this Virtual MCP Server. */ description: string; /** List of source MCP servers to include in this virtual server. */ diff --git a/src/api/types/VirtualMcpServerSource.ts b/src/api/types/VirtualMcpServerSource.ts index c15c2130..96b34d3b 100644 --- a/src/api/types/VirtualMcpServerSource.ts +++ b/src/api/types/VirtualMcpServerSource.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Virtual MCP Server Source diff --git a/src/api/types/VirtualModel.ts b/src/api/types/VirtualModel.ts index 4fb01934..b3612290 100644 --- a/src/api/types/VirtualModel.ts +++ b/src/api/types/VirtualModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Virtual Model diff --git a/src/api/types/VirtualModelModelType.ts b/src/api/types/VirtualModelModelType.ts index b8fc6ca1..a13f9c5f 100644 --- a/src/api/types/VirtualModelModelType.ts +++ b/src/api/types/VirtualModelModelType.ts @@ -1,14 +1,15 @@ // This file was auto-generated by Fern from our API Definition. export const VirtualModelModelType = { - Chat: "chat", - Completion: "completion", - Embedding: "embedding", - Rerank: "rerank", - Moderation: "moderation", - AudioTranscription: "audio_transcription", - AudioTranslation: "audio_translation", - TextToSpeech: "text_to_speech", - Image: "image" - } as const; -export type VirtualModelModelType = typeof VirtualModelModelType[keyof typeof VirtualModelModelType]; + Chat: "chat", + Completion: "completion", + Embedding: "embedding", + Rerank: "rerank", + Moderation: "moderation", + AudioTranscription: "audio_transcription", + AudioTranslation: "audio_translation", + TextToSpeech: "text_to_speech", + Image: "image", + Responses: "responses", +} as const; +export type VirtualModelModelType = (typeof VirtualModelModelType)[keyof typeof VirtualModelModelType]; diff --git a/src/api/types/VirtualModelProviderAccount.ts b/src/api/types/VirtualModelProviderAccount.ts index b0a138b2..8571e788 100644 --- a/src/api/types/VirtualModelProviderAccount.ts +++ b/src/api/types/VirtualModelProviderAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Virtual Model Provider Group diff --git a/src/api/types/Volume.ts b/src/api/types/Volume.ts index e589d388..e7fd5118 100644 --- a/src/api/types/Volume.ts +++ b/src/api/types/Volume.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface Volume { /** +value=volume */ diff --git a/src/api/types/VolumeBrowser.ts b/src/api/types/VolumeBrowser.ts index f98dbe37..dd9767fe 100644 --- a/src/api/types/VolumeBrowser.ts +++ b/src/api/types/VolumeBrowser.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Volume Browser diff --git a/src/api/types/VolumeConfig.ts b/src/api/types/VolumeConfig.ts index b9f82c23..e6675f89 100644 --- a/src/api/types/VolumeConfig.ts +++ b/src/api/types/VolumeConfig.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Volume Config - Volume Configuration, can be either Dynamically provisioned or statically provisioned. */ -export type VolumeConfig = - | TrueFoundry.DynamicVolumeConfig - | TrueFoundry.StaticVolumeConfig; +export type VolumeConfig = TrueFoundry.DynamicVolumeConfig | TrueFoundry.StaticVolumeConfig; diff --git a/src/api/types/WaferIntegrations.ts b/src/api/types/WaferIntegrations.ts index 6564df1f..b169e11b 100644 --- a/src/api/types/WaferIntegrations.ts +++ b/src/api/types/WaferIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type WaferIntegrations = TrueFoundry.WaferModel; diff --git a/src/api/types/WaferModel.ts b/src/api/types/WaferModel.ts index 98077a46..17c9666b 100644 --- a/src/api/types/WaferModel.ts +++ b/src/api/types/WaferModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Wafer Model diff --git a/src/api/types/WaferProviderAccount.ts b/src/api/types/WaferProviderAccount.ts index a4dd7d29..db8390ff 100644 --- a/src/api/types/WaferProviderAccount.ts +++ b/src/api/types/WaferProviderAccount.ts @@ -1,25 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** - * Wafer Provider Account + * Wafer Model Account */ export interface WaferProviderAccount { /** +value=provider-account/wafer */ type: "provider-account/wafer"; - /** The name of the Wafer provider account */ + /** The name of the Wafer model account */ name: string; authData: TrueFoundry.WaferApiKeyAuth; /** Optional custom base URL for Wafer Serverless API (defaults to https://pass.wafer.ai/v1) */ baseUrl?: string; /** When enabled, sends the Wafer-ZDR: required header on API requests for request-scoped zero data retention */ zeroDataRetention?: boolean; - /** List of integrations that are associated with the Wafer provider account */ + /** List of integrations that are associated with the Wafer model account */ integrations?: TrueFoundry.WaferIntegrations[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/WebhookIntegration.ts b/src/api/types/WebhookIntegration.ts index b5db1e72..116534df 100644 --- a/src/api/types/WebhookIntegration.ts +++ b/src/api/types/WebhookIntegration.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Webhook Integration diff --git a/src/api/types/WebhookIntegrationAuthData.ts b/src/api/types/WebhookIntegrationAuthData.ts index 279e2ec0..15142d25 100644 --- a/src/api/types/WebhookIntegrationAuthData.ts +++ b/src/api/types/WebhookIntegrationAuthData.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Authentication configuration for the webhook */ -export type WebhookIntegrationAuthData = - | TrueFoundry.WebhookBasicAuth - | TrueFoundry.WebhookBearerAuth; +export type WebhookIntegrationAuthData = TrueFoundry.WebhookBasicAuth | TrueFoundry.WebhookBearerAuth; diff --git a/src/api/types/WebhookIntegrations.ts b/src/api/types/WebhookIntegrations.ts index 0b7667f9..31eff424 100644 --- a/src/api/types/WebhookIntegrations.ts +++ b/src/api/types/WebhookIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type WebhookIntegrations = TrueFoundry.WebhookIntegration; diff --git a/src/api/types/WebhookProviderAccount.ts b/src/api/types/WebhookProviderAccount.ts index b76cc573..bfad9b63 100644 --- a/src/api/types/WebhookProviderAccount.ts +++ b/src/api/types/WebhookProviderAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Webhook Provider Account diff --git a/src/api/types/WeightBasedLoadBalancing.ts b/src/api/types/WeightBasedLoadBalancing.ts index fc7cddb0..57ee5027 100644 --- a/src/api/types/WeightBasedLoadBalancing.ts +++ b/src/api/types/WeightBasedLoadBalancing.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Weight-based Load Balancing diff --git a/src/api/types/WeightBasedLoadBalancingRule.ts b/src/api/types/WeightBasedLoadBalancingRule.ts index ae369bf8..b405d89b 100644 --- a/src/api/types/WeightBasedLoadBalancingRule.ts +++ b/src/api/types/WeightBasedLoadBalancingRule.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Weight-based Load Balancing Rule diff --git a/src/api/types/WorkerConfig.ts b/src/api/types/WorkerConfig.ts index f4036e98..865181db 100644 --- a/src/api/types/WorkerConfig.ts +++ b/src/api/types/WorkerConfig.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface WorkerConfig { /** Input Config */ diff --git a/src/api/types/WorkerConfigInputConfig.ts b/src/api/types/WorkerConfigInputConfig.ts index d6a0fa9f..fcd7540c 100644 --- a/src/api/types/WorkerConfigInputConfig.ts +++ b/src/api/types/WorkerConfigInputConfig.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Input Config */ -export type WorkerConfigInputConfig = +export type WorkerConfigInputConfig = | TrueFoundry.SqsInputConfig | TrueFoundry.NatsInputConfig | TrueFoundry.KafkaInputConfig diff --git a/src/api/types/WorkerConfigOutputConfig.ts b/src/api/types/WorkerConfigOutputConfig.ts index 1462ae16..a1e8c622 100644 --- a/src/api/types/WorkerConfigOutputConfig.ts +++ b/src/api/types/WorkerConfigOutputConfig.ts @@ -1,11 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Output Config */ -export type WorkerConfigOutputConfig = +export type WorkerConfigOutputConfig = | TrueFoundry.SqsOutputConfig | TrueFoundry.NatsOutputConfig | TrueFoundry.CoreNatsOutputConfig diff --git a/src/api/types/Workflow.ts b/src/api/types/Workflow.ts index 86618004..a70c7724 100644 --- a/src/api/types/Workflow.ts +++ b/src/api/types/Workflow.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Describes the configuration for the worflow diff --git a/src/api/types/WorkflowAlert.ts b/src/api/types/WorkflowAlert.ts index 86c201c7..9106c446 100644 --- a/src/api/types/WorkflowAlert.ts +++ b/src/api/types/WorkflowAlert.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Describes the configuration for the workflow alerts diff --git a/src/api/types/WorkflowFlyteEntitiesItem.ts b/src/api/types/WorkflowFlyteEntitiesItem.ts index 09976d39..de7bdfc4 100644 --- a/src/api/types/WorkflowFlyteEntitiesItem.ts +++ b/src/api/types/WorkflowFlyteEntitiesItem.ts @@ -1,8 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; -export type WorkflowFlyteEntitiesItem = - | TrueFoundry.FlyteTask - | TrueFoundry.FlyteWorkflow - | TrueFoundry.FlyteLaunchPlan; +export type WorkflowFlyteEntitiesItem = TrueFoundry.FlyteTask | TrueFoundry.FlyteWorkflow | TrueFoundry.FlyteLaunchPlan; diff --git a/src/api/types/WorkflowSource.ts b/src/api/types/WorkflowSource.ts index fe99dc23..be76a910 100644 --- a/src/api/types/WorkflowSource.ts +++ b/src/api/types/WorkflowSource.ts @@ -1,10 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * Source Code for the workflow, either local or remote */ -export type WorkflowSource = - | TrueFoundry.LocalSource - | TrueFoundry.RemoteSource; +export type WorkflowSource = TrueFoundry.LocalSource | TrueFoundry.RemoteSource; diff --git a/src/api/types/Workspace.ts b/src/api/types/Workspace.ts index 1845e01a..2edc28ec 100644 --- a/src/api/types/Workspace.ts +++ b/src/api/types/Workspace.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface Workspace { /** System-generated workspace ID. */ @@ -14,10 +14,10 @@ export interface Workspace { createdAt: Date; updatedAt: Date; /** System-generated ID of the environment this workspace belongs to. */ - environmentId?: string; + environmentId?: string | null; manifest: TrueFoundry.WorkspaceManifest; /** System-generated ID of the account. */ accountId: string; - isSystemWs?: boolean; - createdBy?: string; + isSystemWs?: boolean | null; + createdBy?: string | null; } diff --git a/src/api/types/WorkspaceManifest.ts b/src/api/types/WorkspaceManifest.ts index 769c295f..7573fb6f 100644 --- a/src/api/types/WorkspaceManifest.ts +++ b/src/api/types/WorkspaceManifest.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export interface WorkspaceManifest { /** +value=workspace */ diff --git a/src/api/types/XaiIntegrations.ts b/src/api/types/XaiIntegrations.ts index 9a24f241..8ffc70bf 100644 --- a/src/api/types/XaiIntegrations.ts +++ b/src/api/types/XaiIntegrations.ts @@ -1,5 +1,5 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; export type XaiIntegrations = TrueFoundry.XaiModel; diff --git a/src/api/types/XaiModel.ts b/src/api/types/XaiModel.ts index e7d1053e..acdecc6d 100644 --- a/src/api/types/XaiModel.ts +++ b/src/api/types/XaiModel.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * xAI Model diff --git a/src/api/types/XaiProviderAccount.ts b/src/api/types/XaiProviderAccount.ts index f66bad6f..e5ad7342 100644 --- a/src/api/types/XaiProviderAccount.ts +++ b/src/api/types/XaiProviderAccount.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * xAI @@ -8,14 +8,14 @@ import * as TrueFoundry from "../index.js"; export interface XaiProviderAccount { /** +value=provider-account/xai */ type: "provider-account/xai"; - /** The name of the xAI provider account */ + /** The name of the xAI model account */ name: string; authData: TrueFoundry.XaiKeyAuth; - /** List of integrations that are associated with the xAI provider account */ + /** List of integrations that are associated with the xAI model account */ integrations?: TrueFoundry.XaiIntegrations[]; - /** List of users who have access to this provider account */ + /** List of users who have access to this model account */ collaborators?: TrueFoundry.Collaborator[]; ownedBy?: TrueFoundry.OwnedBy; - /** Discount % applied to upstream list price for this provider account. */ + /** Discount % applied to upstream list price for this model account. */ discountPercent?: number; } diff --git a/src/api/types/XgBoostFramework.ts b/src/api/types/XgBoostFramework.ts index 237259d8..c0645f13 100644 --- a/src/api/types/XgBoostFramework.ts +++ b/src/api/types/XgBoostFramework.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../index.js"; +import type * as TrueFoundry from "../index.js"; /** * XGBoost diff --git a/src/api/types/XgBoostSerializationFormat.ts b/src/api/types/XgBoostSerializationFormat.ts index 05ad67c5..53cb6a6d 100644 --- a/src/api/types/XgBoostSerializationFormat.ts +++ b/src/api/types/XgBoostSerializationFormat.ts @@ -2,9 +2,9 @@ /** Serialization format used to save the xgboost model */ export const XgBoostSerializationFormat = { - Cloudpickle: "cloudpickle", - Joblib: "joblib", - Pickle: "pickle", - Json: "json" - } as const; -export type XgBoostSerializationFormat = typeof XgBoostSerializationFormat[keyof typeof XgBoostSerializationFormat]; + Cloudpickle: "cloudpickle", + Joblib: "joblib", + Pickle: "pickle", + Json: "json", +} as const; +export type XgBoostSerializationFormat = (typeof XgBoostSerializationFormat)[keyof typeof XgBoostSerializationFormat]; diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 0f496fdc..4835c03e 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -3,12 +3,20 @@ export * from "./A2AFramework.js"; export * from "./Account.js"; export * from "./AccountInfo.js"; export * from "./ActivateUserResponse.js"; +export * from "./AddOnComponentSource.js"; export * from "./AddonComponent.js"; export * from "./AddonComponentName.js"; -export * from "./AddOnComponentSource.js"; export * from "./AddonComponentStatus.js"; export * from "./Agent.js"; +export * from "./AgentChannel.js"; +export * from "./AgentChannelAgent.js"; +export * from "./AgentChannelConfig.js"; +export * from "./AgentChannelManifest.js"; +export * from "./AgentChannelSlackAuth.js"; +export * from "./AgentChannelSlackBotTokenAuth.js"; +export * from "./AgentChannelSlackConfig.js"; export * from "./AgentFramework.js"; +export * from "./AgentIdentity.js"; export * from "./AgentIdentityAutoRotate.js"; export * from "./AgentIdentityConfig.js"; export * from "./AgentIdentityManifest.js"; @@ -36,6 +44,7 @@ export * from "./AktoGuardrailConfigConfig.js"; export * from "./AktoTokenAuth.js"; export * from "./Alert.js"; export * from "./AlertConfig.js"; +export * from "./AlertConfigEntity.js"; export * from "./AlertConfigResource.js"; export * from "./AlertConfigResourceType.js"; export * from "./AlertSeverity.js"; @@ -178,8 +187,13 @@ export * from "./BlobStorageReference.js"; export * from "./BlueGreen.js"; export * from "./BudgetAlert.js"; export * from "./BudgetConfig.js"; +export * from "./BudgetEntityUsage.js"; export * from "./BudgetLimitUnit.js"; export * from "./BudgetRule.js"; +export * from "./BudgetUsageEntry.js"; +export * from "./BudgetUsageEntryMode.js"; +export * from "./BudgetUsageEntryType.js"; +export * from "./BudgetUsageResponse.js"; export * from "./BudgetV2Alert.js"; export * from "./BudgetV2AppliesTo.js"; export * from "./BudgetV2AppliesToAggregate.js"; @@ -204,7 +218,10 @@ export * from "./BuildBuildSource.js"; export * from "./BuildBuildSpec.js"; export * from "./BuildInfo.js"; export * from "./BuildSecret.js"; -export * from "./BuildStatus.js"; +export * from "./CalypsoAiApiKeyAuth.js"; +export * from "./CalypsoAiGuardrailConfig.js"; +export * from "./CalypsoAiGuardrailConfigConfig.js"; +export * from "./CalypsoAiGuardrailConfigOperation.js"; export * from "./Canary.js"; export * from "./CanaryStep.js"; export * from "./CartesiaApiKeyAuth.js"; @@ -224,6 +241,10 @@ export * from "./ChatPromptManifestCacheConfig.js"; export * from "./ChatPromptManifestMcpServersItem.js"; export * from "./ChatPromptManifestResponseFormat.js"; export * from "./ChatPromptManifestRoutingConfig.js"; +export * from "./CiscoAiDefenseGuardrailConfig.js"; +export * from "./CiscoAiDefenseGuardrailConfigConfig.js"; +export * from "./CiscoAiDefenseGuardrailConfigConfigRegion.js"; +export * from "./CiscoAiDefenseKeyAuth.js"; export * from "./ClouderaIntegrations.js"; export * from "./ClouderaModel.js"; export * from "./ClouderaProviderAccount.js"; @@ -246,6 +267,11 @@ export * from "./CohereModel.js"; export * from "./CohereProviderAccount.js"; export * from "./Collaborator.js"; export * from "./CommonToolsSettings.js"; +export * from "./ComplexityBasedLoadBalanceTarget.js"; +export * from "./ComplexityBasedLoadBalanceTargetTier.js"; +export * from "./ComplexityBasedLoadBalancing.js"; +export * from "./ComplexityBasedLoadBalancingClassificationStrategy.js"; +export * from "./ComplexityStickyRouting.js"; export * from "./Config.js"; export * from "./ContainerTaskConfig.js"; export * from "./ContainerTaskConfigImage.js"; @@ -319,6 +345,7 @@ export * from "./DeleteVirtualAccountResponse.js"; export * from "./DeleteWorkspaceResponse.js"; export * from "./Deployment.js"; export * from "./DeploymentBuild.js"; +export * from "./DeploymentBuildStatus.js"; export * from "./DeploymentManifest.js"; export * from "./DeploymentStatus.js"; export * from "./DeploymentStatusValue.js"; @@ -354,6 +381,7 @@ export * from "./EventChartCategory.js"; export * from "./EventInvolvedObject.js"; export * from "./ExactMatchCacheConfig.js"; export * from "./ExternalBlobStorageSource.js"; +export * from "./ExternalIdentityProvider.js"; export * from "./FastAiFramework.js"; export * from "./FiddlerGuardrailConfig.js"; export * from "./FiddlerGuardrailConfigConfig.js"; @@ -374,11 +402,15 @@ export * from "./FlyteWorkflowTemplate.js"; export * from "./ForwardAction.js"; export * from "./Function.js"; export * from "./FunctionSchema.js"; +export * from "./GatewayBudget.js"; +export * from "./GatewayBudgetManifest.js"; export * from "./GatewayConfig.js"; export * from "./GatewayConfiguration.js"; export * from "./GatewayDataAccessConfig.js"; export * from "./GatewayDataCreatedByFilter.js"; +export * from "./GatewayDataCreatedByFilterOperator.js"; export * from "./GatewayDataMetadataFilter.js"; +export * from "./GatewayDataMetadataFilterOperator.js"; export * from "./GatewayDataRoutingConfig.js"; export * from "./GatewayDataRoutingConfigDestination.js"; export * from "./GatewayDataRoutingConfigDestinationCondition.js"; @@ -390,9 +422,8 @@ export * from "./GatewayDataRoutingConfigDestinationMetadataCondition.js"; export * from "./GatewayDataRoutingConfigDestinationStorage.js"; export * from "./GatewayDataRoutingConfigDestinationStorageStorage.js"; export * from "./GatewayDataType.js"; +export * from "./GatewayInstallation.js"; export * from "./GatewayLoggingConfig.js"; -export * from "./GatewayLoggingRule.js"; -export * from "./GatewayLoggingWhen.js"; export * from "./GatewayMetadataConfig.js"; export * from "./GatewayMetadataRule.js"; export * from "./GatewayMetadataWhen.js"; @@ -406,6 +437,7 @@ export * from "./GcpApiKeyAuth.js"; export * from "./GcpGcr.js"; export * from "./GcpGcs.js"; export * from "./GcpGkeIntegration.js"; +export * from "./GcpGkeIntegrationLocation.js"; export * from "./GcpGsm.js"; export * from "./GcpIntegrations.js"; export * from "./GcpKeyFileAuth.js"; @@ -415,6 +447,7 @@ export * from "./GcpRegion.js"; export * from "./GcpTpu.js"; export * from "./GeminiModel.js"; export * from "./GenericSecretStoreIntegration.js"; +export * from "./GetAgentIdentityTokenResponse.js"; export * from "./GetAgentResponse.js"; export * from "./GetAgentSkillResponse.js"; export * from "./GetAgentSkillVersionResponse.js"; @@ -489,9 +522,9 @@ export * from "./GroqModel.js"; export * from "./GroqProviderAccount.js"; export * from "./GuardrailConfigGroup.js"; export * from "./GuardrailConfigIntegrations.js"; +export * from "./GuardrailSettings.js"; export * from "./Guardrails.js"; export * from "./GuardrailsConfig.js"; -export * from "./GuardrailSettings.js"; export * from "./GuardrailsRule.js"; export * from "./GuardrailsWhen.js"; export * from "./H2OFramework.js"; @@ -508,13 +541,15 @@ export * from "./HealthProbe.js"; export * from "./Helm.js"; export * from "./HelmRepo.js"; export * from "./HelmSource.js"; +export * from "./HeuristicClassificationStrategy.js"; +export * from "./HeuristicFallbackStrategy.js"; export * from "./HostedA2AAgent.js"; export * from "./HttpError.js"; export * from "./HttpErrorCode.js"; export * from "./HttpProbe.js"; export * from "./HuggingfaceArtifactSource.js"; export * from "./IChange.js"; -export * from "./IChangeOperation.js"; +export * from "./IChangeType.js"; export * from "./IdentityProviderBackedIdentity.js"; export * from "./IdentityProviderMapping.js"; export * from "./Image.js"; @@ -527,6 +562,7 @@ export * from "./InfraProviderAccount.js"; export * from "./IngressControllerConfig.js"; export * from "./InlineSpecSource.js"; export * from "./InlineSpecSourceOpenapiSpec.js"; +export * from "./InNotIn.js"; export * from "./InNotInOperator.js"; export * from "./InNotInOperatorCondition.js"; export * from "./InputOutputBasedCostMetricValue.js"; @@ -539,17 +575,17 @@ export * from "./InternalListArtifactVersionsResponseDataItem.js"; export * from "./InternalModelVersion.js"; export * from "./InviteUserResponse.js"; export * from "./IsClusterConnectedResponse.js"; +export * from "./JFrogIntegrations.js"; export * from "./JfrogArtifactsRegistry.js"; export * from "./JfrogBasicAuth.js"; -export * from "./JFrogIntegrations.js"; export * from "./JfrogProviderAccount.js"; export * from "./Job.js"; export * from "./JobAlert.js"; export * from "./JobImage.js"; export * from "./JobMountsItem.js"; export * from "./JobRun.js"; -export * from "./JobRunsSortBy.js"; export * from "./JobRunStatus.js"; +export * from "./JobRunsSortBy.js"; export * from "./JobTrigger.js"; export * from "./JobTriggerInput.js"; export * from "./JobTriggerInputCommand.js"; @@ -583,6 +619,7 @@ export * from "./ListApplicationDeploymentsResponse.js"; export * from "./ListApplicationsResponse.js"; export * from "./ListArtifactsResponse.js"; export * from "./ListArtifactVersionsResponse.js"; +export * from "./ListBudgetsResponse.js"; export * from "./ListClusterAddonsResponse.js"; export * from "./ListClustersResponse.js"; export * from "./ListDataDirectoriesResponse.js"; @@ -605,6 +642,8 @@ export * from "./ListTeamsResponse.js"; export * from "./ListUsersResponse.js"; export * from "./ListVirtualAccountResponse.js"; export * from "./ListWorkspacesResponse.js"; +export * from "./LlmClassificationStrategy.js"; +export * from "./LlmClassificationStrategyFallbackStrategy.js"; export * from "./LoadBalanceTarget.js"; export * from "./LoadBalancingConfig.js"; export * from "./LoadBalancingRule.js"; @@ -618,12 +657,17 @@ export * from "./LoggingMode.js"; export * from "./LoggingModeAlways.js"; export * from "./LoggingModeHeaderControlled.js"; export * from "./LoggingModeNever.js"; +export * from "./LoggingWhen.js"; export * from "./LogsResponse.js"; export * from "./LogsSearchFilterType.js"; export * from "./LogsSearchOperatorType.js"; export * from "./LogsSortingDirection.js"; export * from "./Manual.js"; +export * from "./McpServer.js"; export * from "./McpServerAuth.js"; +export * from "./McpServerAuthStatusInfo.js"; +export * from "./McpServerAuthStatusInfoMethod.js"; +export * from "./McpServerAuthStatusInfoStatus.js"; export * from "./McpServerEnvAuth.js"; export * from "./McpServerEnvAuthAuthLevel.js"; export * from "./McpServerHeaderAuth.js"; @@ -638,6 +682,8 @@ export * from "./McpServerOAuth2GrantType.js"; export * from "./McpServerOAuth2JwtSource.js"; export * from "./McpServerOAuth2Provider.js"; export * from "./McpServerOAuth2ProviderAuth0Settings.js"; +export * from "./McpServerOAuth2ProviderOktaIdJagSettings.js"; +export * from "./McpServerOAuth2ProviderOktaSettings.js"; export * from "./McpServerPassthrough.js"; export * from "./McpServerProviderAccount.js"; export * from "./McpServerSource.js"; @@ -688,6 +734,10 @@ export * from "./Nodepool.js"; export * from "./NodepoolSelector.js"; export * from "./NodeSelector.js"; export * from "./NodeSelectorCapacityType.js"; +export * from "./NomaSecurityApiKeyAuth.js"; +export * from "./NomaSecurityGuardrailConfig.js"; +export * from "./NomaSecurityGuardrailConfigConfig.js"; +export * from "./NomaSecurityGuardrailConfigOperation.js"; export * from "./NomicIntegrations.js"; export * from "./NomicKeyAuth.js"; export * from "./NomicModel.js"; @@ -715,16 +765,16 @@ export * from "./OpaBearerAuth.js"; export * from "./OpaGuardrailConfig.js"; export * from "./OpaGuardrailConfigConfig.js"; export * from "./OpaHeaderAuth.js"; -export * from "./OpenaiApiKeyAuth.js"; export * from "./OpenAiIntegrations.js"; export * from "./OpenAiModel.js"; export * from "./OpenAiModerationsGuardrailConfig.js"; export * from "./OpenAiModerationsGuardrailConfigConfig.js"; -export * from "./OpenaiProviderAccount.js"; export * from "./OpenApimcpServerManifest.js"; export * from "./OpenApimcpToolSetting.js"; export * from "./OpenApimcpToolSettingMethod.js"; export * from "./OpenApiSpecSource.js"; +export * from "./OpenaiApiKeyAuth.js"; +export * from "./OpenaiProviderAccount.js"; export * from "./OpenRouterApiKeyAuth.js"; export * from "./OpenRouterIntegrations.js"; export * from "./OpenRouterModel.js"; @@ -777,10 +827,13 @@ export * from "./PatronusPiiCriteria.js"; export * from "./PatronusPiiEvaluator.js"; export * from "./PatronusToxicityCriteria.js"; export * from "./PatronusToxicityEvaluator.js"; +export * from "./PeriodUsage.js"; export * from "./PerMillionCharactersCostMetric.js"; export * from "./PerMillionCharactersCostMetricValue.js"; export * from "./PerMinuteOfAudioCostMetric.js"; export * from "./PerMinuteOfAudioCostMetricValue.js"; +export * from "./PermissionSetV2.js"; +export * from "./PermissionSetV2ResourceType.js"; export * from "./Permissions.js"; export * from "./PerplexityAiKeyAuth.js"; export * from "./PerplexityAiModel.js"; @@ -792,6 +845,7 @@ export * from "./PerThousandEmbeddingTokensCostMetric.js"; export * from "./PerThousandTokensCostMetric.js"; export * from "./Pip.js"; export * from "./Poetry.js"; +export * from "./Policy.js"; export * from "./PolicyActions.js"; export * from "./PolicyEntityTypes.js"; export * from "./PolicyFilters.js"; @@ -800,6 +854,7 @@ export * from "./PolicyManifestMode.js"; export * from "./PolicyManifestOperation.js"; export * from "./PolicyMutationOperation.js"; export * from "./PolicyValidationOperation.js"; +export * from "./PolicyVersion.js"; export * from "./Port.js"; export * from "./PortAppProtocol.js"; export * from "./PortAuth.js"; @@ -815,16 +870,21 @@ export * from "./PrometheusAlertRule.js"; export * from "./Prompt.js"; export * from "./PromptSource.js"; export * from "./PromptVersion.js"; +export * from "./ProviderAccount.js"; +export * from "./ProviderAccountProvider.js"; export * from "./ProviderAccounts.js"; +export * from "./ProviderIntegration.js"; +export * from "./ProviderIntegrationType.js"; export * from "./PublicCostMetric.js"; export * from "./PySparkTaskConfig.js"; +export * from "./PySparkTaskConfigImage.js"; +export * from "./PyTorchFramework.js"; export * from "./PythonBuild.js"; export * from "./PythonBuildCommand.js"; export * from "./PythonBuildPythonDependencies.js"; export * from "./PythonTaskConfig.js"; export * from "./PythonTaskConfigImage.js"; export * from "./PythonTaskConfigMountsItem.js"; -export * from "./PyTorchFramework.js"; export * from "./QuayArtifactsRegistry.js"; export * from "./QuayBasicAuth.js"; export * from "./QuayIntegrations.js"; @@ -835,6 +895,7 @@ export * from "./RateLimitRule.js"; export * from "./RateLimitUnit.js"; export * from "./RateLimitWhen.js"; export * from "./Recommendation.js"; +export * from "./Redaction.js"; export * from "./RefusalContentPart.js"; export * from "./RegexConstraint.js"; export * from "./RegexGuardrailConfig.js"; @@ -848,18 +909,20 @@ export * from "./RemoteSpecSource.js"; export * from "./Resources.js"; export * from "./ResourcesDevicesItem.js"; export * from "./ResourcesNode.js"; -export * from "./ResourceType.js"; export * from "./ResponseFormatJsonObject.js"; export * from "./ResponseFormatJsonSchema.js"; export * from "./ResponseFormatJsonSchemaJsonSchema.js"; export * from "./ResponseFormatText.js"; export * from "./RetryConfig.js"; export * from "./RevokeAllPersonalAccessTokenResponse.js"; +export * from "./Role.js"; +export * from "./RoleBinding.js"; export * from "./RoleBindingManifest.js"; export * from "./RoleBindingPermission.js"; export * from "./RoleBindingSubject.js"; export * from "./RoleBindingSubjectType.js"; export * from "./RoleManifest.js"; +export * from "./RoleResourceType.js"; export * from "./RoleWithResource.js"; export * from "./RoleWithResourceResourceType.js"; export * from "./Rolling.js"; @@ -908,10 +971,12 @@ export * from "./Session.js"; export * from "./SessionAccount.js"; export * from "./SessionActor.js"; export * from "./SessionTeam.js"; +export * from "./Settings.js"; export * from "./SignedUrl.js"; export * from "./SklearnFramework.js"; export * from "./SklearnModelSchema.js"; export * from "./SklearnSerializationFormat.js"; +export * from "./SlaCutoff.js"; export * from "./SlackBot.js"; export * from "./SlackBotAuth.js"; export * from "./SlackBotIntegration.js"; @@ -920,7 +985,6 @@ export * from "./SlackProviderAccount.js"; export * from "./SlackWebhook.js"; export * from "./SlackWebhookAuth.js"; export * from "./SlackWebhookIntegration.js"; -export * from "./SlaCutoff.js"; export * from "./SmallestAiApiKeyAuth.js"; export * from "./SmallestAiModel.js"; export * from "./SmallestAiProviderAccount.js"; @@ -959,6 +1023,7 @@ export * from "./SparkJobPythonEntrypoint.js"; export * from "./SparkJobPythonNotebookEntrypoint.js"; export * from "./SparkJobScalaEntrypoint.js"; export * from "./SparkJobScalaNotebookEntrypoint.js"; +export * from "./SparkJobTrigger.js"; export * from "./SparkJobTriggerInput.js"; export * from "./SqlSanitizerGuardrailConfig.js"; export * from "./SqlSanitizerGuardrailConfigConfig.js"; @@ -970,6 +1035,8 @@ export * from "./SqsQueueMetricConfigAuth.js"; export * from "./SshServer.js"; export * from "./SshServerConfig.js"; export * from "./StageArtifactResponse.js"; +export * from "./StaticFallbackStrategy.js"; +export * from "./StaticFallbackStrategyDefaultTier.js"; export * from "./StaticVolumeConfig.js"; export * from "./StatsModelsFramework.js"; export * from "./StdioMcpServerManifest.js"; @@ -983,6 +1050,7 @@ export * from "./SubjectClause.js"; export * from "./SubjectConditionGroup.js"; export * from "./SubjectConditionGroupOperator.js"; export * from "./SubjectPermission.js"; +export * from "./SubjectSubjectType.js"; export * from "./SubjectType.js"; export * from "./SyncTokenInSecretStoreInfo.js"; export * from "./SyncVirtualAccountTokenResponse.js"; @@ -993,6 +1061,7 @@ export * from "./TargetConditionGroup.js"; export * from "./TaskDockerFileBuild.js"; export * from "./TaskPySparkBuild.js"; export * from "./TaskPythonBuild.js"; +export * from "./TaskSparkImage.js"; export * from "./Team.js"; export * from "./TeamBudgetConfig.js"; export * from "./TeamBudgetConfigMode.js"; @@ -1027,6 +1096,7 @@ export * from "./ToolMessage.js"; export * from "./ToolMessageContent.js"; export * from "./ToolSchema.js"; export * from "./TraceSpan.js"; +export * from "./TracingProject.js"; export * from "./TracingProjectControlPlaneManagedStorage.js"; export * from "./TracingProjectCustomerManagedStorage.js"; export * from "./TracingProjectManifest.js"; @@ -1043,30 +1113,41 @@ export * from "./TrueFoundryAgentConfig.js"; export * from "./TrueFoundryAgentContextManagementConfig.js"; export * from "./TrueFoundryAgentDynamicSubAgentsConfig.js"; export * from "./TrueFoundryAgentGenerativeUiConfig.js"; +export * from "./TrueFoundryAgentGitSourceSkill.js"; export * from "./TrueFoundryAgentLargeToolResponseConfig.js"; export * from "./TrueFoundryAgentManifest.js"; export * from "./TrueFoundryAgentMcpServer.js"; +export * from "./TrueFoundryAgentMcpServerInline.js"; +export * from "./TrueFoundryAgentMcpServerRegistry.js"; export * from "./TrueFoundryAgentModel.js"; export * from "./TrueFoundryAgentModelParams.js"; export * from "./TrueFoundryAgentResponseFormat.js"; +export * from "./TrueFoundryAgentSandboxAuthData.js"; +export * from "./TrueFoundryAgentSandboxAuthInject.js"; +export * from "./TrueFoundryAgentSandboxAuthInjectMatch.js"; +export * from "./TrueFoundryAgentSandboxBasicAuthData.js"; export * from "./TrueFoundryAgentSandboxConfig.js"; +export * from "./TrueFoundryAgentSandboxGitAuthInject.js"; +export * from "./TrueFoundryAgentSandboxNetworkPolicy.js"; export * from "./TrueFoundryAgentSkill.js"; +export * from "./TrueFoundryAgentTrueFoundrySkill.js"; export * from "./TrueFoundryAgentUserMessage.js"; export * from "./TrueFoundryAgentVariable.js"; export * from "./TrueFoundryApplyRequestManifest.js"; export * from "./TrueFoundryApplyResponse.js"; export * from "./TrueFoundryApplyResponseAction.js"; +export * from "./TrueFoundryApplyResponseData.js"; export * from "./TrueFoundryApplyResponseExistingManifest.js"; export * from "./TrueFoundryArtifactSource.js"; -export * from "./TruefoundryBackedIdentity.js"; export * from "./TrueFoundryDbssm.js"; export * from "./TrueFoundryDeleteRequestManifest.js"; export * from "./TrueFoundryDeleteResponse.js"; -export * from "./TruefoundryFlyteTaskTemplate.js"; export * from "./TrueFoundryIntegrations.js"; export * from "./TrueFoundryInteractiveLogin.js"; export * from "./TrueFoundryManagedSource.js"; export * from "./TrueFoundryProviderAccount.js"; +export * from "./TruefoundryBackedIdentity.js"; +export * from "./TruefoundryFlyteTaskTemplate.js"; export * from "./TtlIntegrations.js"; export * from "./TtlProviderAccount.js"; export * from "./TtlRegistry.js"; diff --git a/src/auth/BearerAuthProvider.ts b/src/auth/BearerAuthProvider.ts index aa7c4fb9..1c6f6dde 100644 --- a/src/auth/BearerAuthProvider.ts +++ b/src/auth/BearerAuthProvider.ts @@ -17,29 +17,28 @@ export class BearerAuthProvider implements core.AuthProvider { return options?.[TOKEN_PARAM] != null || process.env?.[ENV_TOKEN] != null; } - public async getAuthRequest({ endpointMetadata }: { - endpointMetadata?: core.EndpointMetadata; - } = {}): Promise { - - const apiKey = - (await core.Supplier.get(this.options[TOKEN_PARAM])) ?? - process.env?.[ENV_TOKEN]; - if (apiKey == null) { - throw new errors.TrueFoundryError({ - message: BearerAuthProvider.AUTH_CONFIG_ERROR_MESSAGE, - }); - } - - return { - headers: { Authorization: `Bearer ${apiKey}` }, - }; - + public async getAuthRequest({ + endpointMetadata, + }: { + endpointMetadata?: core.EndpointMetadata; + } = {}): Promise { + const apiKey = (await core.Supplier.get(this.options[TOKEN_PARAM])) ?? process.env?.[ENV_TOKEN]; + if (apiKey == null) { + throw new errors.TrueFoundryError({ + message: BearerAuthProvider.AUTH_CONFIG_ERROR_MESSAGE, + }); + } + + return { + headers: { Authorization: `Bearer ${apiKey}` }, + }; } } export namespace BearerAuthProvider { export const AUTH_SCHEME = "APIKey" as const; - export const AUTH_CONFIG_ERROR_MESSAGE: string = `Please provide '${TOKEN_PARAM}' when initializing the client, or set the '${ENV_TOKEN}' environment variable` as const; + export const AUTH_CONFIG_ERROR_MESSAGE: string = + `Please provide '${TOKEN_PARAM}' when initializing the client, or set the '${ENV_TOKEN}' environment variable` as const; export type Options = AuthOptions; export type AuthOptions = { [TOKEN_PARAM]?: core.Supplier | undefined }; diff --git a/src/core/fetcher/Fetcher.ts b/src/core/fetcher/Fetcher.ts index 943ec1bf..cd5c5793 100644 --- a/src/core/fetcher/Fetcher.ts +++ b/src/core/fetcher/Fetcher.ts @@ -11,6 +11,7 @@ import { getResponseBody } from "./getResponseBody.js"; import { Headers } from "./Headers.js"; import { makeRequest } from "./makeRequest.js"; import { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.js"; +import { redactUrl, SENSITIVE_QUERY_PARAMS } from "./redactUrl.js"; import { requestWithRetries } from "./requestWithRetries.js"; export type FetchFunction = (args: Fetcher.Args) => Promise>; @@ -103,27 +104,6 @@ function redactHeaders(headers: Headers | Record): Record | undefined, ): Record | undefined { @@ -137,88 +117,6 @@ function redactQueryParameters( return redacted; } -function redactUrl(url: string): string { - const protocolIndex = url.indexOf("://"); - if (protocolIndex === -1) return url; - - const afterProtocol = protocolIndex + 3; - - // Find the first delimiter that marks the end of the authority section - const pathStart = url.indexOf("/", afterProtocol); - let queryStart = url.indexOf("?", afterProtocol); - let fragmentStart = url.indexOf("#", afterProtocol); - - const firstDelimiter = Math.min( - pathStart === -1 ? url.length : pathStart, - queryStart === -1 ? url.length : queryStart, - fragmentStart === -1 ? url.length : fragmentStart, - ); - - // Find the LAST @ before the delimiter (handles multiple @ in credentials) - let atIndex = -1; - for (let i = afterProtocol; i < firstDelimiter; i++) { - if (url[i] === "@") { - atIndex = i; - } - } - - if (atIndex !== -1) { - url = `${url.slice(0, afterProtocol)}[REDACTED]@${url.slice(atIndex + 1)}`; - } - - // Recalculate queryStart since url might have changed - queryStart = url.indexOf("?"); - if (queryStart === -1) return url; - - fragmentStart = url.indexOf("#", queryStart); - const queryEnd = fragmentStart !== -1 ? fragmentStart : url.length; - const queryString = url.slice(queryStart + 1, queryEnd); - - if (queryString.length === 0) return url; - - // FAST PATH: Quick check if any sensitive keywords present - // Using indexOf is faster than regex for simple substring matching - const lower = queryString.toLowerCase(); - const hasSensitive = - lower.includes("token") || - lower.includes("key") || - lower.includes("password") || - lower.includes("passwd") || - lower.includes("secret") || - lower.includes("session") || - lower.includes("auth"); - - if (!hasSensitive) { - return url; - } - - // SLOW PATH: Parse and redact - const redactedParams: string[] = []; - const params = queryString.split("&"); - - for (const param of params) { - const equalIndex = param.indexOf("="); - if (equalIndex === -1) { - redactedParams.push(param); - continue; - } - - const key = param.slice(0, equalIndex); - let shouldRedact = SENSITIVE_QUERY_PARAMS.has(key.toLowerCase()); - - if (!shouldRedact && key.includes("%")) { - try { - const decodedKey = decodeURIComponent(key); - shouldRedact = SENSITIVE_QUERY_PARAMS.has(decodedKey.toLowerCase()); - } catch {} - } - - redactedParams.push(shouldRedact ? `${key}=[REDACTED]` : param); - } - - return url.slice(0, queryStart + 1) + redactedParams.join("&") + url.slice(queryEnd); -} - async function getHeaders(args: Fetcher.Args): Promise { const newHeaders: Headers = new Headers(); diff --git a/src/core/fetcher/Headers.ts b/src/core/fetcher/Headers.ts index af841aa2..f02246c5 100644 --- a/src/core/fetcher/Headers.ts +++ b/src/core/fetcher/Headers.ts @@ -68,23 +68,23 @@ if (typeof globalThis.Headers !== "undefined") { return this.headers.get("set-cookie") || []; } - *entries(): HeadersIterator<[string, string]> { + *entries(): IterableIterator<[string, string]> { for (const [key, values] of this.headers.entries()) { yield [key, values.join(", ")]; } } - *keys(): HeadersIterator { + *keys(): IterableIterator { yield* this.headers.keys(); } - *values(): HeadersIterator { + *values(): IterableIterator { for (const values of this.headers.values()) { yield values.join(", "); } } - [Symbol.iterator](): HeadersIterator<[string, string]> { + [Symbol.iterator](): IterableIterator<[string, string]> { return this.entries(); } }; diff --git a/src/core/fetcher/createRequestUrl.ts b/src/core/fetcher/createRequestUrl.ts index 302bc330..88e13265 100644 --- a/src/core/fetcher/createRequestUrl.ts +++ b/src/core/fetcher/createRequestUrl.ts @@ -1,9 +1,6 @@ import { toQueryString } from "../url/qs.js"; -export function createRequestUrl( - baseUrl: string, - queryParameters?: Record, -): string { +export function createRequestUrl(baseUrl: string, queryParameters?: Record): string { const queryString = toQueryString(queryParameters, { arrayFormat: "repeat" }); return queryString ? `${baseUrl}?${queryString}` : baseUrl; } diff --git a/src/core/fetcher/getFetchFn.ts b/src/core/fetcher/getFetchFn.ts index 8d88fe84..9f845b95 100644 --- a/src/core/fetcher/getFetchFn.ts +++ b/src/core/fetcher/getFetchFn.ts @@ -1,5 +1,3 @@ - export async function getFetchFn(): Promise { return fetch; } - diff --git a/src/core/fetcher/getResponseBody.ts b/src/core/fetcher/getResponseBody.ts index 118af313..2e831e49 100644 --- a/src/core/fetcher/getResponseBody.ts +++ b/src/core/fetcher/getResponseBody.ts @@ -1,7 +1,6 @@ import { fromJson } from "../json.js"; import { getBinaryResponse } from "./BinaryResponse.js"; - // Pins the upstream Response so undici's FinalizationRegistry can't GC it and cancel the body stream. function retainResponse(target: object, response: Response): void { Object.defineProperty(target, "__fern_response_ref", { @@ -42,10 +41,10 @@ export async function getResponseBody(response: Response, responseType?: string) }, }; } - + retainResponse(response.body, response); return response.body; - + case "text": return await response.text(); } diff --git a/src/core/fetcher/makePassthroughRequest.ts b/src/core/fetcher/makePassthroughRequest.ts index f5ba7614..e8dceda9 100644 --- a/src/core/fetcher/makePassthroughRequest.ts +++ b/src/core/fetcher/makePassthroughRequest.ts @@ -3,6 +3,7 @@ import { join } from "../url/join.js"; import { EndpointSupplier } from "./EndpointSupplier.js"; import { getFetchFn } from "./getFetchFn.js"; import { makeRequest } from "./makeRequest.js"; +import { redactUrl } from "./redactUrl.js"; import { requestWithRetries } from "./requestWithRetries.js"; import { Supplier } from "./Supplier.js"; @@ -114,8 +115,10 @@ export async function makePassthroughRequest( } } - // Apply auth headers - if (clientOptions.getAuthHeaders != null) { + // Apply auth headers, but only when the resolved URL targets the configured base URL. + // This prevents the SDK's credentials from leaking to an unrelated host when a caller + // passes an absolute cross-origin URL into the passthrough fetch escape hatch. + if (clientOptions.getAuthHeaders != null && targetsBaseUrl(fullUrl, baseUrl)) { const authHeaders = await clientOptions.getAuthHeaders(); for (const [key, value] of Object.entries(authHeaders)) { mergedHeaders[key.toLowerCase()] = value; @@ -155,7 +158,7 @@ export async function makePassthroughRequest( if (logger.isDebug()) { logger.debug("Making passthrough HTTP request", { method, - url: fullUrl, + url: redactUrl(fullUrl), hasBody: body != null, }); } @@ -180,10 +183,29 @@ export async function makePassthroughRequest( if (logger.isDebug()) { logger.debug("Passthrough HTTP request completed", { method, - url: fullUrl, + url: redactUrl(fullUrl), statusCode: response.status, }); } return response; } + +/** + * Returns true when the resolved request URL points at the same origin as the + * configured base URL. Relative paths are always joined onto the base URL, so + * they resolve to the base origin and return true. Absolute URLs only match when + * their origin equals the base origin. When there is no base URL to compare + * against, or either value is not a parseable absolute URL, this returns false so + * auth headers are not attached. + */ +function targetsBaseUrl(fullUrl: string, baseUrl: string | undefined): boolean { + if (baseUrl == null) { + return false; + } + try { + return new URL(fullUrl).origin === new URL(baseUrl).origin; + } catch { + return false; + } +} diff --git a/src/core/fetcher/redactUrl.ts b/src/core/fetcher/redactUrl.ts new file mode 100644 index 00000000..3c2e897a --- /dev/null +++ b/src/core/fetcher/redactUrl.ts @@ -0,0 +1,102 @@ +export const SENSITIVE_QUERY_PARAMS: Set = new Set([ + "api_key", + "api-key", + "apikey", + "token", + "access_token", + "access-token", + "auth_token", + "auth-token", + "password", + "passwd", + "secret", + "api_secret", + "api-secret", + "apisecret", + "key", + "session", + "session_id", + "session-id", +]); + +export function redactUrl(url: string): string { + const protocolIndex = url.indexOf("://"); + if (protocolIndex === -1) return url; + + const afterProtocol = protocolIndex + 3; + + // Find the first delimiter that marks the end of the authority section + const pathStart = url.indexOf("/", afterProtocol); + let queryStart = url.indexOf("?", afterProtocol); + let fragmentStart = url.indexOf("#", afterProtocol); + + const firstDelimiter = Math.min( + pathStart === -1 ? url.length : pathStart, + queryStart === -1 ? url.length : queryStart, + fragmentStart === -1 ? url.length : fragmentStart, + ); + + // Find the LAST @ before the delimiter (handles multiple @ in credentials) + let atIndex = -1; + for (let i = afterProtocol; i < firstDelimiter; i++) { + if (url[i] === "@") { + atIndex = i; + } + } + + if (atIndex !== -1) { + url = `${url.slice(0, afterProtocol)}[REDACTED]@${url.slice(atIndex + 1)}`; + } + + // Recalculate queryStart since url might have changed + queryStart = url.indexOf("?"); + if (queryStart === -1) return url; + + fragmentStart = url.indexOf("#", queryStart); + const queryEnd = fragmentStart !== -1 ? fragmentStart : url.length; + const queryString = url.slice(queryStart + 1, queryEnd); + + if (queryString.length === 0) return url; + + // FAST PATH: Quick check if any sensitive keywords present + // Using indexOf is faster than regex for simple substring matching + const lower = queryString.toLowerCase(); + const hasSensitive = + lower.includes("token") || + lower.includes("key") || + lower.includes("password") || + lower.includes("passwd") || + lower.includes("secret") || + lower.includes("session") || + lower.includes("auth"); + + if (!hasSensitive) { + return url; + } + + // SLOW PATH: Parse and redact + const redactedParams: string[] = []; + const params = queryString.split("&"); + + for (const param of params) { + const equalIndex = param.indexOf("="); + if (equalIndex === -1) { + redactedParams.push(param); + continue; + } + + const key = param.slice(0, equalIndex); + let shouldRedact = SENSITIVE_QUERY_PARAMS.has(key.toLowerCase()); + + if (!shouldRedact && key.includes("%")) { + try { + const decodedKey = decodeURIComponent(key); + shouldRedact = SENSITIVE_QUERY_PARAMS.has(decodedKey.toLowerCase()); + } catch {} + } + + redactedParams.push(shouldRedact ? `${key}=[REDACTED]` : param); + } + + return url.slice(0, queryStart + 1) + redactedParams.join("&") + url.slice(queryEnd); +} diff --git a/src/core/fetcher/requestWithRetries.ts b/src/core/fetcher/requestWithRetries.ts index 2229effb..5e66b933 100644 --- a/src/core/fetcher/requestWithRetries.ts +++ b/src/core/fetcher/requestWithRetries.ts @@ -4,9 +4,7 @@ const DEFAULT_MAX_RETRIES = 2; const JITTER_FACTOR = 0.2; // 20% random jitter function isRetryableStatusCode(statusCode: number): boolean { - return [408, 429].includes(statusCode) || statusCode >= 500; - } function addPositiveJitter(delay: number): number { diff --git a/src/core/headers.ts b/src/core/headers.ts index cb327036..be45c455 100644 --- a/src/core/headers.ts +++ b/src/core/headers.ts @@ -1,6 +1,4 @@ -export function mergeHeaders( - ...headersArray: (Record | null | undefined)[] -): Record { +export function mergeHeaders(...headersArray: (Record | null | undefined)[]): Record { const result: Record = {}; for (const [key, value] of headersArray diff --git a/src/core/requestBody.ts b/src/core/requestBody.ts new file mode 100644 index 00000000..d58ef590 --- /dev/null +++ b/src/core/requestBody.ts @@ -0,0 +1,26 @@ +/** + * Spreads caller-supplied `additionalBodyParameters` (from `requestOptions.additionalBodyParameters`) + * on top of the request body. Caller-supplied properties win over the endpoint body. When no + * additional body parameters are provided, the original body is returned unchanged so serialization + * is unaffected. + * + * The merge only applies to plain-object (JSON object) bodies. When the body is `null`/`undefined` + * the additional parameters become the body; when the body is an array or a primitive JSON value it + * is returned unchanged, since object properties cannot be spread into it. This mirrors the Python + * SDK, which only merges additional body parameters into mapping bodies. + */ +export function mergeAdditionalBodyParameters( + body: unknown, + additionalBodyParameters: Record | undefined, +): unknown { + if (additionalBodyParameters == null) { + return body; + } + if (body == null) { + return { ...additionalBodyParameters }; + } + if (typeof body === "object" && !Array.isArray(body)) { + return { ...body, ...additionalBodyParameters }; + } + return body; +} diff --git a/src/core/runtime/index.ts b/src/core/runtime/index.ts index cfab23f9..85a32720 100644 --- a/src/core/runtime/index.ts +++ b/src/core/runtime/index.ts @@ -1 +1 @@ -export { RUNTIME } from "./runtime.js"; +export { getUserAgent, RUNTIME } from "./runtime.js"; diff --git a/src/core/runtime/runtime.ts b/src/core/runtime/runtime.ts index 69cad3f0..d367ce6b 100644 --- a/src/core/runtime/runtime.ts +++ b/src/core/runtime/runtime.ts @@ -2,6 +2,10 @@ interface DenoGlobal { version: { deno: string; }; + build?: { + os?: string; + arch?: string; + }; } interface BunGlobal { @@ -24,6 +28,18 @@ export interface Runtime { type: "browser" | "web-worker" | "deno" | "bun" | "node" | "react-native" | "unknown" | "workerd" | "edge-runtime"; version?: string; parsedVersion?: number; + /** + * The operating system the SDK is running on, when it can be determined + * (e.g. "linux", "darwin", "win32" on server runtimes). Undefined in + * environments where the OS is not observable (e.g. browsers). + */ + os?: string; + /** + * The CPU architecture the SDK is running on, when it can be determined + * (e.g. "x64", "arm64" on server runtimes). Undefined in environments where + * the architecture is not observable (e.g. browsers). + */ + arch?: string; } function evaluateRuntime(): Runtime { @@ -85,6 +101,8 @@ function evaluateRuntime(): Runtime { return { type: "deno", version: Deno.version.deno, + os: Deno.build?.os, + arch: Deno.build?.arch, }; } @@ -96,6 +114,8 @@ function evaluateRuntime(): Runtime { return { type: "bun", version: Bun.version, + os: typeof process !== "undefined" ? process.platform : undefined, + arch: typeof process !== "undefined" ? process.arch : undefined, }; } @@ -119,14 +139,14 @@ function evaluateRuntime(): Runtime { * Edge Runtime warns about Node.js APIs even when they are guarded). */ const _process = typeof process !== "undefined" ? process : undefined; - const isNode = - typeof _process !== "undefined" && - typeof _process.versions?.node === "string"; + const isNode = typeof _process !== "undefined" && typeof _process.versions?.node === "string"; if (isNode) { return { type: "node", version: _process.versions.node, parsedVersion: Number(_process.versions.node.split(".")[0]), + os: _process.platform, + arch: _process.arch, }; } @@ -134,3 +154,78 @@ function evaluateRuntime(): Runtime { type: "unknown", }; } + +/** + * Display names for the language runtimes whose version is meaningful to encode + * in a User-Agent. Environments where a version string is not useful (e.g. + * browsers, where `version` is the full navigator UA) are intentionally mapped + * to `undefined` so they are omitted from the User-Agent. + */ +const RUNTIME_DISPLAY_NAMES: Record = { + node: "Node", + deno: "Deno", + bun: "Bun", + browser: undefined, + "web-worker": undefined, + "react-native": undefined, + workerd: undefined, + "edge-runtime": undefined, + unknown: undefined, +}; + +/** + * CPU architecture aliases that all refer to 64-bit x86. They are normalized to + * the single canonical token `x86_64` so the User-Agent architecture label is + * consistent regardless of which runtime reports it (Node reports `x64`, others + * report `amd64` or `x86_64`). + */ +const X86_64_ARCH_ALIASES = new Set(["x64", "amd64", "x86_64"]); + +/** + * Normalizes a CPU architecture token, collapsing the 64-bit x86 aliases + * (`x64`, `amd64`, `x86_64`) to `x86_64`. Other architectures are returned + * unchanged. + */ +function normalizeArch(arch: string | undefined): string | undefined { + if (arch == null) { + return arch; + } + return X86_64_ARCH_ALIASES.has(arch.toLowerCase()) ? "x86_64" : arch; +} + +/** + * Percent-encodes the `@` and `/` characters in an npm package name so the + * User-Agent product token stays within the RFC 7230 token grammar. The + * original scoped package name can be recovered by URL-decoding (e.g. + * `@dummy/sdk` becomes `%40dummy%2Fsdk`). + */ +function encodeProductName(sdkName: string): string { + return sdkName.replace(/@/g, "%40").replace(/\//g, "%2F"); +} + +/** + * Builds a structured User-Agent string of the form + * `{sdkName}/{sdkVersion} ({os}; {arch}) {runtime}/{runtimeVersion}` + * where the platform group and runtime segment are omitted gracefully when the + * underlying values cannot be determined (e.g. in a browser). + */ +export function getUserAgent(sdkName: string, sdkVersion: string): string { + let userAgent = `${encodeProductName(sdkName)}/${sdkVersion}`; + + const platform = [RUNTIME.os, normalizeArch(RUNTIME.arch)].filter( + (part): part is string => part != null && part.length > 0, + ); + if (platform.length > 0) { + userAgent += ` (${platform.join("; ")})`; + } + + const runtimeName = RUNTIME_DISPLAY_NAMES[RUNTIME.type]; + if (runtimeName != null) { + userAgent += ` ${runtimeName}`; + if (RUNTIME.version != null && RUNTIME.version.length > 0) { + userAgent += `/${RUNTIME.version}`; + } + } + + return userAgent; +} diff --git a/src/core/schemas/builders/object-like/getObjectLikeUtils.ts b/src/core/schemas/builders/object-like/getObjectLikeUtils.ts index e5977257..5fdc8023 100644 --- a/src/core/schemas/builders/object-like/getObjectLikeUtils.ts +++ b/src/core/schemas/builders/object-like/getObjectLikeUtils.ts @@ -33,7 +33,8 @@ export function withParsedProperties( +export function partialRecord( keySchema: Schema, valueSchema: Schema, ): PartialRecordSchema { diff --git a/src/core/url/QueryStringBuilder.ts b/src/core/url/QueryStringBuilder.ts index b4052cce..b045221c 100644 --- a/src/core/url/QueryStringBuilder.ts +++ b/src/core/url/QueryStringBuilder.ts @@ -36,7 +36,7 @@ class QueryStringBuilder { } const serialized = toQueryString( { [key]: value }, - { arrayFormat: options?.style === "comma" ? "comma" : "repeat" } + { arrayFormat: options?.style === "comma" ? "comma" : "repeat" }, ); if (serialized.length > 0) { this.parts.set(key, serialized); diff --git a/src/core/url/index.ts b/src/core/url/index.ts index e47c3374..ca9d4fbd 100644 --- a/src/core/url/index.ts +++ b/src/core/url/index.ts @@ -1,4 +1,4 @@ export { encodePathParam } from "./encodePathParam.js"; export { join } from "./join.js"; -export { toQueryString } from "./qs.js"; export { queryBuilder } from "./QueryStringBuilder.js"; +export { toQueryString } from "./qs.js"; diff --git a/src/errors/TrueFoundryError.ts b/src/errors/TrueFoundryError.ts index 929b8d1f..c5b0f950 100644 --- a/src/errors/TrueFoundryError.ts +++ b/src/errors/TrueFoundryError.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as core from "../core/index.js"; +import type * as core from "../core/index.js"; import { toJson } from "../core/json.js"; export class TrueFoundryError extends Error { @@ -9,13 +9,19 @@ export class TrueFoundryError extends Error { public readonly rawResponse?: core.RawResponse; public readonly cause?: unknown; - constructor({ message, statusCode, body, rawResponse, cause }: { - message?: string; - statusCode?: number; - body?: unknown; - rawResponse?: core.RawResponse; - cause?: unknown; - }) { + constructor({ + message, + statusCode, + body, + rawResponse, + cause, + }: { + message?: string; + statusCode?: number; + body?: unknown; + rawResponse?: core.RawResponse; + cause?: unknown; + }) { super(buildMessage({ message, statusCode, body })); Object.setPrototypeOf(this, new.target.prototype); if (Error.captureStackTrace) { @@ -36,12 +42,16 @@ export class TrueFoundryError extends Error { } } -function buildMessage({ message, statusCode, body }: { - message: string | undefined; - statusCode: number | undefined; - body: unknown | undefined; - }): string { - let lines: string[] = []; +function buildMessage({ + message, + statusCode, + body, +}: { + message: string | undefined; + statusCode: number | undefined; + body: unknown | undefined; +}): string { + const lines: string[] = []; if (message != null) { lines.push(message); } diff --git a/src/errors/TrueFoundryTimeoutError.ts b/src/errors/TrueFoundryTimeoutError.ts index d84e1700..e2165725 100644 --- a/src/errors/TrueFoundryTimeoutError.ts +++ b/src/errors/TrueFoundryTimeoutError.ts @@ -6,7 +6,7 @@ export class TrueFoundryTimeoutError extends errors.TrueFoundryError { constructor(message: string, opts?: { cause?: unknown }) { super({ message: message, - cause: opts?.cause + cause: opts?.cause, }); Object.setPrototypeOf(this, new.target.prototype); if (Error.captureStackTrace) { diff --git a/src/errors/handleNonStatusCodeError.ts b/src/errors/handleNonStatusCodeError.ts index 5a32d400..4b8c1897 100644 --- a/src/errors/handleNonStatusCodeError.ts +++ b/src/errors/handleNonStatusCodeError.ts @@ -1,30 +1,40 @@ // This file was auto-generated by Fern from our API Definition. -import * as core from "../core/index.js"; +import type * as core from "../core/index.js"; import * as errors from "./index.js"; -export function handleNonStatusCodeError(error: core.Fetcher.Error, rawResponse: core.RawResponse, method: string, path: string): never { +export function handleNonStatusCodeError( + error: core.Fetcher.Error, + rawResponse: core.RawResponse, + method: string, + path: string, +): never { switch (error.reason) { - case "non-json": throw new errors.TrueFoundryError({ - statusCode: error.statusCode, - body: error.rawBody, - rawResponse: rawResponse - }); - case "body-is-null": throw new errors.TrueFoundryError({ - statusCode: error.statusCode, - rawResponse: rawResponse - }); - case "timeout": throw new errors.TrueFoundryTimeoutError(`Timeout exceeded when calling ${method} ${path}.`, { - cause: error.cause - }); - case "unknown": throw new errors.TrueFoundryError({ - message: error.errorMessage, - rawResponse: rawResponse, - cause: error.cause - }); - default: throw new errors.TrueFoundryError({ - message: "Unknown error", - rawResponse: rawResponse - }); + case "non-json": + throw new errors.TrueFoundryError({ + statusCode: error.statusCode, + body: error.rawBody, + rawResponse: rawResponse, + }); + case "body-is-null": + throw new errors.TrueFoundryError({ + statusCode: error.statusCode, + rawResponse: rawResponse, + }); + case "timeout": + throw new errors.TrueFoundryTimeoutError(`Timeout exceeded when calling ${method} ${path}.`, { + cause: error.cause, + }); + case "unknown": + throw new errors.TrueFoundryError({ + message: error.errorMessage, + rawResponse: rawResponse, + cause: error.cause, + }); + default: + throw new errors.TrueFoundryError({ + message: "Unknown error", + rawResponse: rawResponse, + }); } } diff --git a/src/serialization/client/requests/TrueFoundryApplyRequest.ts b/src/serialization/client/requests/TrueFoundryApplyRequest.ts index 9f218aa5..89dbdd26 100644 --- a/src/serialization/client/requests/TrueFoundryApplyRequest.ts +++ b/src/serialization/client/requests/TrueFoundryApplyRequest.ts @@ -1,18 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../api/index.js"; +import type * as TrueFoundry from "../../../api/index.js"; import * as core from "../../../core/index.js"; -import * as serializers from "../../index.js"; +import type * as serializers from "../../index.js"; import { TrueFoundryApplyRequestManifest } from "../../types/TrueFoundryApplyRequestManifest.js"; -export const TrueFoundryApplyRequest: core.serialization.Schema = core.serialization.object({ - "manifest": TrueFoundryApplyRequestManifest, - "dryRun": core.serialization.boolean().optional() - }); +export const TrueFoundryApplyRequest: core.serialization.Schema< + serializers.TrueFoundryApplyRequest.Raw, + TrueFoundry.TrueFoundryApplyRequest +> = core.serialization.object({ + manifest: TrueFoundryApplyRequestManifest, + dryRun: core.serialization.boolean().optionalNullable(), +}); export declare namespace TrueFoundryApplyRequest { export interface Raw { manifest: TrueFoundryApplyRequestManifest.Raw; - dryRun?: boolean | null; + dryRun?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/client/requests/TrueFoundryDeleteRequest.ts b/src/serialization/client/requests/TrueFoundryDeleteRequest.ts index ce6d4e61..a3a68346 100644 --- a/src/serialization/client/requests/TrueFoundryDeleteRequest.ts +++ b/src/serialization/client/requests/TrueFoundryDeleteRequest.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../api/index.js"; +import type * as TrueFoundry from "../../../api/index.js"; import * as core from "../../../core/index.js"; -import * as serializers from "../../index.js"; +import type * as serializers from "../../index.js"; import { TrueFoundryDeleteRequestManifest } from "../../types/TrueFoundryDeleteRequestManifest.js"; -export const TrueFoundryDeleteRequest: core.serialization.Schema = core.serialization.object({ - "manifest": TrueFoundryDeleteRequestManifest - }); +export const TrueFoundryDeleteRequest: core.serialization.Schema< + serializers.TrueFoundryDeleteRequest.Raw, + TrueFoundry.TrueFoundryDeleteRequest +> = core.serialization.object({ + manifest: TrueFoundryDeleteRequestManifest, +}); export declare namespace TrueFoundryDeleteRequest { export interface Raw { diff --git a/src/serialization/resources/agentSkills/client/requests/ApplyAgentSkillRequest.ts b/src/serialization/resources/agentSkills/client/requests/ApplyAgentSkillRequest.ts index d1dfccf1..e7ca03ea 100644 --- a/src/serialization/resources/agentSkills/client/requests/ApplyAgentSkillRequest.ts +++ b/src/serialization/resources/agentSkills/client/requests/ApplyAgentSkillRequest.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; import { AgentSkillManifest } from "../../../../types/AgentSkillManifest.js"; -export const ApplyAgentSkillRequest: core.serialization.Schema = core.serialization.object({ - "manifest": AgentSkillManifest - }); +export const ApplyAgentSkillRequest: core.serialization.Schema< + serializers.ApplyAgentSkillRequest.Raw, + TrueFoundry.ApplyAgentSkillRequest +> = core.serialization.object({ + manifest: AgentSkillManifest, +}); export declare namespace ApplyAgentSkillRequest { export interface Raw { diff --git a/src/serialization/resources/agents/client/requests/CreateOrUpdateAgentRequest.ts b/src/serialization/resources/agents/client/requests/CreateOrUpdateAgentRequest.ts index f69ba9f1..017bcbce 100644 --- a/src/serialization/resources/agents/client/requests/CreateOrUpdateAgentRequest.ts +++ b/src/serialization/resources/agents/client/requests/CreateOrUpdateAgentRequest.ts @@ -1,18 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; import { AgentManifest } from "../../../../types/AgentManifest.js"; -export const CreateOrUpdateAgentRequest: core.serialization.Schema = core.serialization.object({ - "manifest": AgentManifest, - "dryRun": core.serialization.boolean().optional() - }); +export const CreateOrUpdateAgentRequest: core.serialization.Schema< + serializers.CreateOrUpdateAgentRequest.Raw, + TrueFoundry.CreateOrUpdateAgentRequest +> = core.serialization.object({ + manifest: AgentManifest, + dryRun: core.serialization.boolean().optionalNullable(), +}); export declare namespace CreateOrUpdateAgentRequest { export interface Raw { manifest: AgentManifest.Raw; - dryRun?: boolean | null; + dryRun?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/resources/agents/types/AgentsListRequestType.ts b/src/serialization/resources/agents/types/AgentsListRequestType.ts deleted file mode 100644 index 6dfd97c6..00000000 --- a/src/serialization/resources/agents/types/AgentsListRequestType.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as TrueFoundry from "../../../../api/index.js"; -import * as core from "../../../../core/index.js"; -import * as serializers from "../../../index.js"; - -export const AgentsListRequestType: core.serialization.Schema = core.serialization.enum_(["remote-agent", "truefoundry-agent", "agent"]); - -export declare namespace AgentsListRequestType { - export type Raw = "remote-agent" | "truefoundry-agent" | "agent"; -} diff --git a/src/serialization/resources/agents/types/ListAgentsRequestType.ts b/src/serialization/resources/agents/types/ListAgentsRequestType.ts new file mode 100644 index 00000000..244f01ec --- /dev/null +++ b/src/serialization/resources/agents/types/ListAgentsRequestType.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../../../api/index.js"; +import * as core from "../../../../core/index.js"; +import type * as serializers from "../../../index.js"; + +export const ListAgentsRequestType: core.serialization.Schema< + serializers.ListAgentsRequestType.Raw, + TrueFoundry.ListAgentsRequestType +> = core.serialization.enum_(["remote-agent", "truefoundry-agent", "agent"]); + +export declare namespace ListAgentsRequestType { + export type Raw = "remote-agent" | "truefoundry-agent" | "agent"; +} diff --git a/src/serialization/resources/agents/types/index.ts b/src/serialization/resources/agents/types/index.ts index f9cb644c..51e547e5 100644 --- a/src/serialization/resources/agents/types/index.ts +++ b/src/serialization/resources/agents/types/index.ts @@ -1 +1 @@ -export * from "./AgentsListRequestType.js"; +export * from "./ListAgentsRequestType.js"; diff --git a/src/serialization/resources/applications/client/requests/CreateDeploymentRequest.ts b/src/serialization/resources/applications/client/requests/CreateDeploymentRequest.ts index f22d9e6b..ce2669b5 100644 --- a/src/serialization/resources/applications/client/requests/CreateDeploymentRequest.ts +++ b/src/serialization/resources/applications/client/requests/CreateDeploymentRequest.ts @@ -1,29 +1,32 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; -export const CreateDeploymentRequest: core.serialization.Schema = core.serialization.object({ - "manifest": core.serialization.record(core.serialization.string(), core.serialization.unknown()), - "dryRun": core.serialization.boolean().optional(), - "forceDeploy": core.serialization.boolean().optional(), - "triggerOnDeploy": core.serialization.boolean().optional(), - "workspaceId": core.serialization.string().optional(), - "applicationId": core.serialization.string().optional(), - "name": core.serialization.string().optional(), - "applicationSetId": core.serialization.string().optional() - }); +export const CreateDeploymentRequest: core.serialization.Schema< + serializers.CreateDeploymentRequest.Raw, + TrueFoundry.CreateDeploymentRequest +> = core.serialization.object({ + manifest: core.serialization.record(core.serialization.string(), core.serialization.unknown()), + dryRun: core.serialization.boolean().optionalNullable(), + forceDeploy: core.serialization.boolean().optionalNullable(), + triggerOnDeploy: core.serialization.boolean().optionalNullable(), + workspaceId: core.serialization.string().optionalNullable(), + applicationId: core.serialization.string().optionalNullable(), + name: core.serialization.string().optionalNullable(), + applicationSetId: core.serialization.string().optionalNullable(), +}); export declare namespace CreateDeploymentRequest { export interface Raw { manifest: Record; - dryRun?: boolean | null; - forceDeploy?: boolean | null; - triggerOnDeploy?: boolean | null; - workspaceId?: string | null; - applicationId?: string | null; - name?: string | null; - applicationSetId?: string | null; + dryRun?: (boolean | null | undefined) | null; + forceDeploy?: (boolean | null | undefined) | null; + triggerOnDeploy?: (boolean | null | undefined) | null; + workspaceId?: (string | null | undefined) | null; + applicationId?: (string | null | undefined) | null; + name?: (string | null | undefined) | null; + applicationSetId?: (string | null | undefined) | null; } } diff --git a/src/serialization/resources/applications/types/ApplicationsCancelDeploymentResponse.ts b/src/serialization/resources/applications/types/ApplicationsCancelDeploymentResponse.ts deleted file mode 100644 index 57bbe7bf..00000000 --- a/src/serialization/resources/applications/types/ApplicationsCancelDeploymentResponse.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as TrueFoundry from "../../../../api/index.js"; -import * as core from "../../../../core/index.js"; -import * as serializers from "../../../index.js"; - -export const ApplicationsCancelDeploymentResponse: core.serialization.ObjectSchema = core.serialization.object({ - "message": core.serialization.string().optional() - }); - -export declare namespace ApplicationsCancelDeploymentResponse { - export interface Raw { - message?: string | null; - } -} diff --git a/src/serialization/resources/applications/types/ApplicationsListRequestDeviceTypeFilter.ts b/src/serialization/resources/applications/types/ApplicationsListRequestDeviceTypeFilter.ts deleted file mode 100644 index 4359a75e..00000000 --- a/src/serialization/resources/applications/types/ApplicationsListRequestDeviceTypeFilter.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as TrueFoundry from "../../../../api/index.js"; -import * as core from "../../../../core/index.js"; -import * as serializers from "../../../index.js"; - -export const ApplicationsListRequestDeviceTypeFilter: core.serialization.Schema = core.serialization.enum_(["cpu", "nvidia_gpu", "aws_inferentia", "nvidia_mig_gpu", "nvidia_timeslicing_gpu", "gcp_tpu"]); - -export declare namespace ApplicationsListRequestDeviceTypeFilter { - export type Raw = "cpu" | "nvidia_gpu" | "aws_inferentia" | "nvidia_mig_gpu" | "nvidia_timeslicing_gpu" | "gcp_tpu"; -} diff --git a/src/serialization/resources/applications/types/ApplicationsListRequestLifecycleStage.ts b/src/serialization/resources/applications/types/ApplicationsListRequestLifecycleStage.ts deleted file mode 100644 index 0cca773c..00000000 --- a/src/serialization/resources/applications/types/ApplicationsListRequestLifecycleStage.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as TrueFoundry from "../../../../api/index.js"; -import * as core from "../../../../core/index.js"; -import * as serializers from "../../../index.js"; - -export const ApplicationsListRequestLifecycleStage: core.serialization.Schema = core.serialization.enum_(["active", "deleting", "deletion_failed"]); - -export declare namespace ApplicationsListRequestLifecycleStage { - export type Raw = "active" | "deleting" | "deletion_failed"; -} diff --git a/src/serialization/resources/applications/types/CancelDeploymentApplicationsResponse.ts b/src/serialization/resources/applications/types/CancelDeploymentApplicationsResponse.ts new file mode 100644 index 00000000..90b2989a --- /dev/null +++ b/src/serialization/resources/applications/types/CancelDeploymentApplicationsResponse.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../../../api/index.js"; +import * as core from "../../../../core/index.js"; +import type * as serializers from "../../../index.js"; + +export const CancelDeploymentApplicationsResponse: core.serialization.ObjectSchema< + serializers.CancelDeploymentApplicationsResponse.Raw, + TrueFoundry.CancelDeploymentApplicationsResponse +> = core.serialization.object({ + message: core.serialization.string().optional(), +}); + +export declare namespace CancelDeploymentApplicationsResponse { + export interface Raw { + message?: string | null; + } +} diff --git a/src/serialization/resources/applications/types/ListApplicationsRequestDeviceTypeFilter.ts b/src/serialization/resources/applications/types/ListApplicationsRequestDeviceTypeFilter.ts new file mode 100644 index 00000000..44249e32 --- /dev/null +++ b/src/serialization/resources/applications/types/ListApplicationsRequestDeviceTypeFilter.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../../../api/index.js"; +import * as core from "../../../../core/index.js"; +import type * as serializers from "../../../index.js"; + +export const ListApplicationsRequestDeviceTypeFilter: core.serialization.Schema< + serializers.ListApplicationsRequestDeviceTypeFilter.Raw, + TrueFoundry.ListApplicationsRequestDeviceTypeFilter +> = core.serialization.enum_([ + "cpu", + "nvidia_gpu", + "aws_inferentia", + "nvidia_mig_gpu", + "nvidia_timeslicing_gpu", + "gcp_tpu", +]); + +export declare namespace ListApplicationsRequestDeviceTypeFilter { + export type Raw = "cpu" | "nvidia_gpu" | "aws_inferentia" | "nvidia_mig_gpu" | "nvidia_timeslicing_gpu" | "gcp_tpu"; +} diff --git a/src/serialization/resources/applications/types/ListApplicationsRequestLifecycleStage.ts b/src/serialization/resources/applications/types/ListApplicationsRequestLifecycleStage.ts new file mode 100644 index 00000000..dcb760aa --- /dev/null +++ b/src/serialization/resources/applications/types/ListApplicationsRequestLifecycleStage.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../../../api/index.js"; +import * as core from "../../../../core/index.js"; +import type * as serializers from "../../../index.js"; + +export const ListApplicationsRequestLifecycleStage: core.serialization.Schema< + serializers.ListApplicationsRequestLifecycleStage.Raw, + TrueFoundry.ListApplicationsRequestLifecycleStage +> = core.serialization.enum_(["active", "deleting", "deletion_failed"]); + +export declare namespace ListApplicationsRequestLifecycleStage { + export type Raw = "active" | "deleting" | "deletion_failed"; +} diff --git a/src/serialization/resources/applications/types/index.ts b/src/serialization/resources/applications/types/index.ts index 758fdc1f..041c901a 100644 --- a/src/serialization/resources/applications/types/index.ts +++ b/src/serialization/resources/applications/types/index.ts @@ -1,3 +1,3 @@ -export * from "./ApplicationsCancelDeploymentResponse.js"; -export * from "./ApplicationsListRequestDeviceTypeFilter.js"; -export * from "./ApplicationsListRequestLifecycleStage.js"; +export * from "./CancelDeploymentApplicationsResponse.js"; +export * from "./ListApplicationsRequestDeviceTypeFilter.js"; +export * from "./ListApplicationsRequestLifecycleStage.js"; diff --git a/src/serialization/resources/artifactVersions/client/requests/ApplyArtifactVersionTagsRequest.ts b/src/serialization/resources/artifactVersions/client/requests/ApplyArtifactVersionTagsRequest.ts index 0c0542e4..4f0fffd4 100644 --- a/src/serialization/resources/artifactVersions/client/requests/ApplyArtifactVersionTagsRequest.ts +++ b/src/serialization/resources/artifactVersions/client/requests/ApplyArtifactVersionTagsRequest.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; -export const ApplyArtifactVersionTagsRequest: core.serialization.Schema = core.serialization.object({ - "artifactVersionId": core.serialization.property("artifact_version_id", core.serialization.string()), - "tags": core.serialization.list(core.serialization.string()), - "force": core.serialization.boolean().optional() - }); +export const ApplyArtifactVersionTagsRequest: core.serialization.Schema< + serializers.ApplyArtifactVersionTagsRequest.Raw, + TrueFoundry.ApplyArtifactVersionTagsRequest +> = core.serialization.object({ + artifactVersionId: core.serialization.property("artifact_version_id", core.serialization.string()), + tags: core.serialization.list(core.serialization.string()), + force: core.serialization.boolean().optional(), +}); export declare namespace ApplyArtifactVersionTagsRequest { export interface Raw { diff --git a/src/serialization/resources/artifactVersions/client/requests/MarkStageArtifactFailureRequest.ts b/src/serialization/resources/artifactVersions/client/requests/MarkStageArtifactFailureRequest.ts index 406fa5c5..c5389f93 100644 --- a/src/serialization/resources/artifactVersions/client/requests/MarkStageArtifactFailureRequest.ts +++ b/src/serialization/resources/artifactVersions/client/requests/MarkStageArtifactFailureRequest.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; -export const MarkStageArtifactFailureRequest: core.serialization.Schema = core.serialization.object({ - "id": core.serialization.string() - }); +export const MarkStageArtifactFailureRequest: core.serialization.Schema< + serializers.MarkStageArtifactFailureRequest.Raw, + TrueFoundry.MarkStageArtifactFailureRequest +> = core.serialization.object({ + id: core.serialization.string(), +}); export declare namespace MarkStageArtifactFailureRequest { export interface Raw { diff --git a/src/serialization/resources/artifactVersions/client/requests/StageArtifactRequest.ts b/src/serialization/resources/artifactVersions/client/requests/StageArtifactRequest.ts index 6c126048..fa8ae632 100644 --- a/src/serialization/resources/artifactVersions/client/requests/StageArtifactRequest.ts +++ b/src/serialization/resources/artifactVersions/client/requests/StageArtifactRequest.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; import { StageArtifactRequestManifest } from "../../types/StageArtifactRequestManifest.js"; -export const StageArtifactRequest: core.serialization.Schema = core.serialization.object({ - "manifest": StageArtifactRequestManifest - }); +export const StageArtifactRequest: core.serialization.Schema< + serializers.StageArtifactRequest.Raw, + TrueFoundry.StageArtifactRequest +> = core.serialization.object({ + manifest: StageArtifactRequestManifest, +}); export declare namespace StageArtifactRequest { export interface Raw { diff --git a/src/serialization/resources/artifactVersions/types/StageArtifactRequestManifest.ts b/src/serialization/resources/artifactVersions/types/StageArtifactRequestManifest.ts index ca1c9b5f..957df805 100644 --- a/src/serialization/resources/artifactVersions/types/StageArtifactRequestManifest.ts +++ b/src/serialization/resources/artifactVersions/types/StageArtifactRequestManifest.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../api/index.js"; +import type * as TrueFoundry from "../../../../api/index.js"; import * as core from "../../../../core/index.js"; -import * as serializers from "../../../index.js"; +import type * as serializers from "../../../index.js"; import { AgentSkillManifest } from "../../../types/AgentSkillManifest.js"; import { ArtifactManifest } from "../../../types/ArtifactManifest.js"; import { ModelManifest } from "../../../types/ModelManifest.js"; -export const StageArtifactRequestManifest: core.serialization.Schema = core.serialization.undiscriminatedUnion([ArtifactManifest, ModelManifest, AgentSkillManifest]); +export const StageArtifactRequestManifest: core.serialization.Schema< + serializers.StageArtifactRequestManifest.Raw, + TrueFoundry.StageArtifactRequestManifest +> = core.serialization.undiscriminatedUnion([ArtifactManifest, ModelManifest, AgentSkillManifest]); export declare namespace StageArtifactRequestManifest { export type Raw = ArtifactManifest.Raw | ModelManifest.Raw | AgentSkillManifest.Raw; diff --git a/src/serialization/resources/artifacts/client/requests/ApplyArtifactRequest.ts b/src/serialization/resources/artifacts/client/requests/ApplyArtifactRequest.ts index da866c64..53281601 100644 --- a/src/serialization/resources/artifacts/client/requests/ApplyArtifactRequest.ts +++ b/src/serialization/resources/artifacts/client/requests/ApplyArtifactRequest.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; import { ArtifactManifest } from "../../../../types/ArtifactManifest.js"; -export const ApplyArtifactRequest: core.serialization.Schema = core.serialization.object({ - "manifest": ArtifactManifest - }); +export const ApplyArtifactRequest: core.serialization.Schema< + serializers.ApplyArtifactRequest.Raw, + TrueFoundry.ApplyArtifactRequest +> = core.serialization.object({ + manifest: ArtifactManifest, +}); export declare namespace ApplyArtifactRequest { export interface Raw { diff --git a/src/serialization/resources/clusters/client/requests/CreateOrUpdateClusterRequest.ts b/src/serialization/resources/clusters/client/requests/CreateOrUpdateClusterRequest.ts index 13b3e890..5d0780b6 100644 --- a/src/serialization/resources/clusters/client/requests/CreateOrUpdateClusterRequest.ts +++ b/src/serialization/resources/clusters/client/requests/CreateOrUpdateClusterRequest.ts @@ -1,18 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; import { ClusterManifest } from "../../../../types/ClusterManifest.js"; -export const CreateOrUpdateClusterRequest: core.serialization.Schema = core.serialization.object({ - "manifest": ClusterManifest, - "dryRun": core.serialization.boolean().optional() - }); +export const CreateOrUpdateClusterRequest: core.serialization.Schema< + serializers.CreateOrUpdateClusterRequest.Raw, + TrueFoundry.CreateOrUpdateClusterRequest +> = core.serialization.object({ + manifest: ClusterManifest, + dryRun: core.serialization.boolean().optionalNullable(), +}); export declare namespace CreateOrUpdateClusterRequest { export interface Raw { manifest: ClusterManifest.Raw; - dryRun?: boolean | null; + dryRun?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/resources/dataDirectories/client/requests/ApplyDataDirectoryRequest.ts b/src/serialization/resources/dataDirectories/client/requests/ApplyDataDirectoryRequest.ts index cbe98eab..0e26515b 100644 --- a/src/serialization/resources/dataDirectories/client/requests/ApplyDataDirectoryRequest.ts +++ b/src/serialization/resources/dataDirectories/client/requests/ApplyDataDirectoryRequest.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; import { DataDirectoryManifest } from "../../../../types/DataDirectoryManifest.js"; -export const ApplyDataDirectoryRequest: core.serialization.Schema = core.serialization.object({ - "manifest": DataDirectoryManifest - }); +export const ApplyDataDirectoryRequest: core.serialization.Schema< + serializers.ApplyDataDirectoryRequest.Raw, + TrueFoundry.ApplyDataDirectoryRequest +> = core.serialization.object({ + manifest: DataDirectoryManifest, +}); export declare namespace ApplyDataDirectoryRequest { export interface Raw { diff --git a/src/serialization/resources/dataDirectories/client/requests/DeleteFilesRequest.ts b/src/serialization/resources/dataDirectories/client/requests/DeleteFilesRequest.ts index 9ba0a856..b610c097 100644 --- a/src/serialization/resources/dataDirectories/client/requests/DeleteFilesRequest.ts +++ b/src/serialization/resources/dataDirectories/client/requests/DeleteFilesRequest.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; -export const DeleteFilesRequest: core.serialization.Schema = core.serialization.object({ - "id": core.serialization.string(), - "paths": core.serialization.list(core.serialization.string()) - }); +export const DeleteFilesRequest: core.serialization.Schema< + serializers.DeleteFilesRequest.Raw, + TrueFoundry.DeleteFilesRequest +> = core.serialization.object({ + id: core.serialization.string(), + paths: core.serialization.list(core.serialization.string()), +}); export declare namespace DeleteFilesRequest { export interface Raw { diff --git a/src/serialization/resources/environments/client/delete.ts b/src/serialization/resources/environments/client/delete.ts index 0bc2824f..0e9fd541 100644 --- a/src/serialization/resources/environments/client/delete.ts +++ b/src/serialization/resources/environments/client/delete.ts @@ -1,12 +1,11 @@ // This file was auto-generated by Fern from our API Definition. import * as core from "../../../../core/index.js"; -import * as serializers from "../../../index.js"; +import type * as serializers from "../../../index.js"; -export const Response: core.serialization.Schema = core.serialization.boolean(); +export const Response: core.serialization.Schema = + core.serialization.boolean(); export declare namespace Response { export type Raw = boolean; } - - diff --git a/src/serialization/resources/environments/client/requests/CreateOrUpdateEnvironmentRequest.ts b/src/serialization/resources/environments/client/requests/CreateOrUpdateEnvironmentRequest.ts index eb0c0759..8cf6bd0d 100644 --- a/src/serialization/resources/environments/client/requests/CreateOrUpdateEnvironmentRequest.ts +++ b/src/serialization/resources/environments/client/requests/CreateOrUpdateEnvironmentRequest.ts @@ -1,18 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; import { EnvironmentManifest } from "../../../../types/EnvironmentManifest.js"; -export const CreateOrUpdateEnvironmentRequest: core.serialization.Schema = core.serialization.object({ - "manifest": EnvironmentManifest, - "dryRun": core.serialization.boolean().optional() - }); +export const CreateOrUpdateEnvironmentRequest: core.serialization.Schema< + serializers.CreateOrUpdateEnvironmentRequest.Raw, + TrueFoundry.CreateOrUpdateEnvironmentRequest +> = core.serialization.object({ + manifest: EnvironmentManifest, + dryRun: core.serialization.boolean().optionalNullable(), +}); export declare namespace CreateOrUpdateEnvironmentRequest { export interface Raw { manifest: EnvironmentManifest.Raw; - dryRun?: boolean | null; + dryRun?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/resources/gatewayBudgets/client/index.ts b/src/serialization/resources/gatewayBudgets/client/index.ts new file mode 100644 index 00000000..195f9aa8 --- /dev/null +++ b/src/serialization/resources/gatewayBudgets/client/index.ts @@ -0,0 +1 @@ +export * from "./requests/index.js"; diff --git a/src/serialization/resources/gatewayBudgets/client/requests/CreateOrUpdateBudgetRequest.ts b/src/serialization/resources/gatewayBudgets/client/requests/CreateOrUpdateBudgetRequest.ts new file mode 100644 index 00000000..80a2916e --- /dev/null +++ b/src/serialization/resources/gatewayBudgets/client/requests/CreateOrUpdateBudgetRequest.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../../../../api/index.js"; +import * as core from "../../../../../core/index.js"; +import type * as serializers from "../../../../index.js"; +import { CreateOrUpdateBudgetRequestManifest } from "../../types/CreateOrUpdateBudgetRequestManifest.js"; + +export const CreateOrUpdateBudgetRequest: core.serialization.Schema< + serializers.CreateOrUpdateBudgetRequest.Raw, + TrueFoundry.CreateOrUpdateBudgetRequest +> = core.serialization.object({ + manifest: CreateOrUpdateBudgetRequestManifest, + dryRun: core.serialization.boolean().optionalNullable(), +}); + +export declare namespace CreateOrUpdateBudgetRequest { + export interface Raw { + manifest: CreateOrUpdateBudgetRequestManifest.Raw; + dryRun?: (boolean | null | undefined) | null; + } +} diff --git a/src/serialization/resources/gatewayBudgets/client/requests/SimulateBudgetRequest.ts b/src/serialization/resources/gatewayBudgets/client/requests/SimulateBudgetRequest.ts new file mode 100644 index 00000000..35a76f7a --- /dev/null +++ b/src/serialization/resources/gatewayBudgets/client/requests/SimulateBudgetRequest.ts @@ -0,0 +1,28 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../../../../api/index.js"; +import * as core from "../../../../../core/index.js"; +import type * as serializers from "../../../../index.js"; + +export const SimulateBudgetRequest: core.serialization.Schema< + serializers.SimulateBudgetRequest.Raw, + TrueFoundry.SimulateBudgetRequest +> = core.serialization.object({ + user: core.serialization.string().optional(), + virtualAccount: core.serialization.property("virtual_account", core.serialization.string().optional()), + team: core.serialization.string().optional(), + teams: core.serialization.list(core.serialization.string()).optional(), + model: core.serialization.string().optional(), + metadata: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), +}); + +export declare namespace SimulateBudgetRequest { + export interface Raw { + user?: string | null; + virtual_account?: string | null; + team?: string | null; + teams?: string[] | null; + model?: string | null; + metadata?: Record | null; + } +} diff --git a/src/serialization/resources/gatewayBudgets/client/requests/index.ts b/src/serialization/resources/gatewayBudgets/client/requests/index.ts new file mode 100644 index 00000000..01eae8a7 --- /dev/null +++ b/src/serialization/resources/gatewayBudgets/client/requests/index.ts @@ -0,0 +1,2 @@ +export { CreateOrUpdateBudgetRequest } from "./CreateOrUpdateBudgetRequest.js"; +export { SimulateBudgetRequest } from "./SimulateBudgetRequest.js"; diff --git a/src/serialization/resources/gatewayBudgets/index.ts b/src/serialization/resources/gatewayBudgets/index.ts new file mode 100644 index 00000000..d9adb1af --- /dev/null +++ b/src/serialization/resources/gatewayBudgets/index.ts @@ -0,0 +1,2 @@ +export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/serialization/resources/gatewayBudgets/types/CreateOrUpdateBudgetRequestManifest.ts b/src/serialization/resources/gatewayBudgets/types/CreateOrUpdateBudgetRequestManifest.ts new file mode 100644 index 00000000..ace26e6f --- /dev/null +++ b/src/serialization/resources/gatewayBudgets/types/CreateOrUpdateBudgetRequestManifest.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../../../api/index.js"; +import * as core from "../../../../core/index.js"; +import type * as serializers from "../../../index.js"; +import { TeamBudgetConfig } from "../../../types/TeamBudgetConfig.js"; +import { TenantBudgetConfig } from "../../../types/TenantBudgetConfig.js"; + +export const CreateOrUpdateBudgetRequestManifest: core.serialization.Schema< + serializers.CreateOrUpdateBudgetRequestManifest.Raw, + TrueFoundry.CreateOrUpdateBudgetRequestManifest +> = core.serialization.undiscriminatedUnion([TenantBudgetConfig, TeamBudgetConfig]); + +export declare namespace CreateOrUpdateBudgetRequestManifest { + export type Raw = TenantBudgetConfig.Raw | TeamBudgetConfig.Raw; +} diff --git a/src/serialization/resources/gatewayBudgets/types/ListGatewayBudgetsRequestType.ts b/src/serialization/resources/gatewayBudgets/types/ListGatewayBudgetsRequestType.ts new file mode 100644 index 00000000..4df9ada2 --- /dev/null +++ b/src/serialization/resources/gatewayBudgets/types/ListGatewayBudgetsRequestType.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../../../api/index.js"; +import * as core from "../../../../core/index.js"; +import type * as serializers from "../../../index.js"; + +export const ListGatewayBudgetsRequestType: core.serialization.Schema< + serializers.ListGatewayBudgetsRequestType.Raw, + TrueFoundry.ListGatewayBudgetsRequestType +> = core.serialization.enum_(["tenant-budget-config", "team-budget-config"]); + +export declare namespace ListGatewayBudgetsRequestType { + export type Raw = "tenant-budget-config" | "team-budget-config"; +} diff --git a/src/serialization/resources/gatewayBudgets/types/index.ts b/src/serialization/resources/gatewayBudgets/types/index.ts new file mode 100644 index 00000000..36be3385 --- /dev/null +++ b/src/serialization/resources/gatewayBudgets/types/index.ts @@ -0,0 +1,2 @@ +export * from "./CreateOrUpdateBudgetRequestManifest.js"; +export * from "./ListGatewayBudgetsRequestType.js"; diff --git a/src/serialization/resources/index.ts b/src/serialization/resources/index.ts index 48bdb504..ef8ded4c 100644 --- a/src/serialization/resources/index.ts +++ b/src/serialization/resources/index.ts @@ -1,53 +1,57 @@ -export * as agents from "./agents/index.js"; +export * from "./agentSkills/client/requests/index.js"; +export * as agentSkills from "./agentSkills/index.js"; export * from "./agents/client/requests/index.js"; +export * as agents from "./agents/index.js"; export * from "./agents/types/index.js"; -export * as agentSkills from "./agentSkills/index.js"; -export * from "./agentSkills/client/requests/index.js"; -export * as applications from "./applications/index.js"; export * from "./applications/client/requests/index.js"; +export * as applications from "./applications/index.js"; export * from "./applications/types/index.js"; -export * as artifacts from "./artifacts/index.js"; export * from "./artifacts/client/requests/index.js"; -export * as artifactVersions from "./artifactVersions/index.js"; +export * as artifacts from "./artifacts/index.js"; export * from "./artifactVersions/client/requests/index.js"; +export * as artifactVersions from "./artifactVersions/index.js"; export * from "./artifactVersions/types/index.js"; -export * as clusters from "./clusters/index.js"; export * from "./clusters/client/requests/index.js"; -export * as dataDirectories from "./dataDirectories/index.js"; +export * as clusters from "./clusters/index.js"; export * from "./dataDirectories/client/requests/index.js"; -export * as environments from "./environments/index.js"; +export * as dataDirectories from "./dataDirectories/index.js"; export * from "./environments/client/requests/index.js"; +export * as environments from "./environments/index.js"; +export * from "./gatewayBudgets/client/requests/index.js"; +export * as gatewayBudgets from "./gatewayBudgets/index.js"; +export * from "./gatewayBudgets/types/index.js"; export * as internal from "./internal/index.js"; -export * as jobs from "./jobs/index.js"; export * from "./jobs/client/requests/index.js"; +export * as jobs from "./jobs/index.js"; export * from "./jobs/types/index.js"; -export * as mlRepos from "./mlRepos/index.js"; export * from "./mlRepos/client/requests/index.js"; -export * as models from "./models/index.js"; +export * as mlRepos from "./mlRepos/index.js"; export * from "./models/client/requests/index.js"; -export * as modelVersions from "./modelVersions/index.js"; +export * as models from "./models/index.js"; export * from "./modelVersions/client/requests/index.js"; -export * as personalAccessTokens from "./personalAccessTokens/index.js"; +export * as modelVersions from "./modelVersions/index.js"; export * from "./personalAccessTokens/client/requests/index.js"; +export * as personalAccessTokens from "./personalAccessTokens/index.js"; export * from "./personalAccessTokens/types/index.js"; -export * as prompts from "./prompts/index.js"; export * from "./prompts/client/requests/index.js"; -export * as promptVersions from "./promptVersions/index.js"; +export * as prompts from "./prompts/index.js"; export * from "./promptVersions/client/requests/index.js"; -export * as runs from "./runs/index.js"; +export * as promptVersions from "./promptVersions/index.js"; export * from "./runs/client/requests/index.js"; -export * as secretGroups from "./secretGroups/index.js"; +export * as runs from "./runs/index.js"; export * from "./secretGroups/client/requests/index.js"; -export * as secrets from "./secrets/index.js"; +export * as secretGroups from "./secretGroups/index.js"; export * from "./secrets/client/requests/index.js"; -export * as teams from "./teams/index.js"; +export * as secrets from "./secrets/index.js"; export * from "./teams/client/requests/index.js"; -export * as traces from "./traces/index.js"; +export * as teams from "./teams/index.js"; export * from "./traces/client/requests/index.js"; +export * as traces from "./traces/index.js"; export * from "./traces/types/index.js"; -export * as users from "./users/index.js"; export * from "./users/client/requests/index.js"; -export * as virtualAccounts from "./virtualAccounts/index.js"; +export * as users from "./users/index.js"; +export * from "./users/types/index.js"; export * from "./virtualAccounts/client/requests/index.js"; -export * as workspaces from "./workspaces/index.js"; +export * as virtualAccounts from "./virtualAccounts/index.js"; export * from "./workspaces/client/requests/index.js"; +export * as workspaces from "./workspaces/index.js"; diff --git a/src/serialization/resources/internal/client/getIdFromFqn.ts b/src/serialization/resources/internal/client/getIdFromFqn.ts index 9149bf04..8246f722 100644 --- a/src/serialization/resources/internal/client/getIdFromFqn.ts +++ b/src/serialization/resources/internal/client/getIdFromFqn.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. import * as core from "../../../../core/index.js"; -import * as serializers from "../../../index.js"; +import type * as serializers from "../../../index.js"; -export const Response: core.serialization.Schema> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); +export const Response: core.serialization.Schema< + serializers.internal.getIdFromFqn.Response.Raw, + Record +> = core.serialization.record(core.serialization.string(), core.serialization.unknown()); export declare namespace Response { export type Raw = Record; } - - diff --git a/src/serialization/resources/internal/resources/aiGateway/types/AiGatewayGetGatewayConfigRequestType.ts b/src/serialization/resources/internal/resources/aiGateway/types/AiGatewayGetGatewayConfigRequestType.ts deleted file mode 100644 index b8833fe4..00000000 --- a/src/serialization/resources/internal/resources/aiGateway/types/AiGatewayGetGatewayConfigRequestType.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as TrueFoundry from "../../../../../../api/index.js"; -import * as core from "../../../../../../core/index.js"; -import * as serializers from "../../../../../index.js"; - -export const AiGatewayGetGatewayConfigRequestType: core.serialization.Schema = core.serialization.enum_(["gateway-rate-limiting-config", "gateway-fallback-config", "gateway-load-balancing-config", "gateway-guardrails-config", "gateway-budget-config", "tenant-budget-config", "team-budget-config", "gateway-otel-config", "gateway-global-settings", "gateway-data-access-config", "gateway-data-routing-config"]); - -export declare namespace AiGatewayGetGatewayConfigRequestType { - export type Raw = "gateway-rate-limiting-config" | "gateway-fallback-config" | "gateway-load-balancing-config" | "gateway-guardrails-config" | "gateway-budget-config" | "tenant-budget-config" | "team-budget-config" | "gateway-otel-config" | "gateway-global-settings" | "gateway-data-access-config" | "gateway-data-routing-config"; -} diff --git a/src/serialization/resources/internal/resources/aiGateway/types/GetGatewayConfigAiGatewayRequestType.ts b/src/serialization/resources/internal/resources/aiGateway/types/GetGatewayConfigAiGatewayRequestType.ts new file mode 100644 index 00000000..155c745c --- /dev/null +++ b/src/serialization/resources/internal/resources/aiGateway/types/GetGatewayConfigAiGatewayRequestType.ts @@ -0,0 +1,39 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../../../../../api/index.js"; +import * as core from "../../../../../../core/index.js"; +import type * as serializers from "../../../../../index.js"; + +export const GetGatewayConfigAiGatewayRequestType: core.serialization.Schema< + serializers.internal.GetGatewayConfigAiGatewayRequestType.Raw, + TrueFoundry.internal.GetGatewayConfigAiGatewayRequestType +> = core.serialization.enum_([ + "gateway-rate-limiting-config", + "gateway-fallback-config", + "gateway-load-balancing-config", + "gateway-guardrails-config", + "gateway-budget-config", + "tenant-budget-config", + "team-budget-config", + "gateway-otel-config", + "gateway-global-settings", + "gateway-data-access-config", + "gateway-data-routing-config", + "gateway-logging-config", +]); + +export declare namespace GetGatewayConfigAiGatewayRequestType { + export type Raw = + | "gateway-rate-limiting-config" + | "gateway-fallback-config" + | "gateway-load-balancing-config" + | "gateway-guardrails-config" + | "gateway-budget-config" + | "tenant-budget-config" + | "team-budget-config" + | "gateway-otel-config" + | "gateway-global-settings" + | "gateway-data-access-config" + | "gateway-data-routing-config" + | "gateway-logging-config"; +} diff --git a/src/serialization/resources/internal/resources/aiGateway/types/index.ts b/src/serialization/resources/internal/resources/aiGateway/types/index.ts index 96bb6258..0ddbb570 100644 --- a/src/serialization/resources/internal/resources/aiGateway/types/index.ts +++ b/src/serialization/resources/internal/resources/aiGateway/types/index.ts @@ -1 +1 @@ -export * from "./AiGatewayGetGatewayConfigRequestType.js"; +export * from "./GetGatewayConfigAiGatewayRequestType.js"; diff --git a/src/serialization/resources/internal/resources/applications/client/getPodTemplateHashToDeploymentVersion.ts b/src/serialization/resources/internal/resources/applications/client/getPodTemplateHashToDeploymentVersion.ts index 54cfdc65..e8eb916d 100644 --- a/src/serialization/resources/internal/resources/applications/client/getPodTemplateHashToDeploymentVersion.ts +++ b/src/serialization/resources/internal/resources/applications/client/getPodTemplateHashToDeploymentVersion.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. import * as core from "../../../../../../core/index.js"; -import * as serializers from "../../../../../index.js"; +import type * as serializers from "../../../../../index.js"; -export const Response: core.serialization.Schema> = core.serialization.record(core.serialization.string(), core.serialization.number()); +export const Response: core.serialization.Schema< + serializers.internal.applications.getPodTemplateHashToDeploymentVersion.Response.Raw, + Record +> = core.serialization.record(core.serialization.string(), core.serialization.number()); export declare namespace Response { export type Raw = Record; } - - diff --git a/src/serialization/resources/internal/resources/deployments/client/getBuilds.ts b/src/serialization/resources/internal/resources/deployments/client/getBuilds.ts index fd245cf8..a554906b 100644 --- a/src/serialization/resources/internal/resources/deployments/client/getBuilds.ts +++ b/src/serialization/resources/internal/resources/deployments/client/getBuilds.ts @@ -1,14 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../../api/index.js"; import * as core from "../../../../../../core/index.js"; -import * as serializers from "../../../../../index.js"; +import type * as serializers from "../../../../../index.js"; import { DeploymentBuild } from "../../../../../types/DeploymentBuild.js"; -export const Response: core.serialization.Schema = core.serialization.list(DeploymentBuild); +export const Response: core.serialization.Schema< + serializers.internal.deployments.getBuilds.Response.Raw, + TrueFoundry.DeploymentBuild[] +> = core.serialization.list(DeploymentBuild); export declare namespace Response { export type Raw = DeploymentBuild.Raw[]; } - - diff --git a/src/serialization/resources/internal/resources/deployments/client/getDeploymentStatuses.ts b/src/serialization/resources/internal/resources/deployments/client/getDeploymentStatuses.ts index 7a31ad8d..c2d7a8c8 100644 --- a/src/serialization/resources/internal/resources/deployments/client/getDeploymentStatuses.ts +++ b/src/serialization/resources/internal/resources/deployments/client/getDeploymentStatuses.ts @@ -1,14 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../../api/index.js"; import * as core from "../../../../../../core/index.js"; -import * as serializers from "../../../../../index.js"; +import type * as serializers from "../../../../../index.js"; import { DeploymentStatus } from "../../../../../types/DeploymentStatus.js"; -export const Response: core.serialization.Schema = core.serialization.list(DeploymentStatus); +export const Response: core.serialization.Schema< + serializers.internal.deployments.getDeploymentStatuses.Response.Raw, + TrueFoundry.DeploymentStatus[] +> = core.serialization.list(DeploymentStatus); export declare namespace Response { export type Raw = DeploymentStatus.Raw[]; } - - diff --git a/src/serialization/resources/internal/resources/deployments/client/requests/GenerateCodeUploadPresignedUrlRequest.ts b/src/serialization/resources/internal/resources/deployments/client/requests/GenerateCodeUploadPresignedUrlRequest.ts index c4e55f09..d58a3917 100644 --- a/src/serialization/resources/internal/resources/deployments/client/requests/GenerateCodeUploadPresignedUrlRequest.ts +++ b/src/serialization/resources/internal/resources/deployments/client/requests/GenerateCodeUploadPresignedUrlRequest.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../../../api/index.js"; import * as core from "../../../../../../../core/index.js"; -import * as serializers from "../../../../../../index.js"; +import type * as serializers from "../../../../../../index.js"; -export const GenerateCodeUploadPresignedUrlRequest: core.serialization.Schema = core.serialization.object({ - "serviceName": core.serialization.string(), - "workspaceFqn": core.serialization.string() - }); +export const GenerateCodeUploadPresignedUrlRequest: core.serialization.Schema< + serializers.internal.GenerateCodeUploadPresignedUrlRequest.Raw, + TrueFoundry.internal.GenerateCodeUploadPresignedUrlRequest +> = core.serialization.object({ + serviceName: core.serialization.string(), + workspaceFqn: core.serialization.string(), +}); export declare namespace GenerateCodeUploadPresignedUrlRequest { export interface Raw { diff --git a/src/serialization/resources/internal/resources/dockerRegistries/client/requests/CreateDockerRepositoryRequest.ts b/src/serialization/resources/internal/resources/dockerRegistries/client/requests/CreateDockerRepositoryRequest.ts index ce4a7a09..e69f792a 100644 --- a/src/serialization/resources/internal/resources/dockerRegistries/client/requests/CreateDockerRepositoryRequest.ts +++ b/src/serialization/resources/internal/resources/dockerRegistries/client/requests/CreateDockerRepositoryRequest.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../../../api/index.js"; import * as core from "../../../../../../../core/index.js"; -import * as serializers from "../../../../../../index.js"; +import type * as serializers from "../../../../../../index.js"; -export const CreateDockerRepositoryRequest: core.serialization.Schema = core.serialization.object({ - "fqn": core.serialization.string(), - "applicationName": core.serialization.string(), - "workspaceFqn": core.serialization.string() - }); +export const CreateDockerRepositoryRequest: core.serialization.Schema< + serializers.internal.CreateDockerRepositoryRequest.Raw, + TrueFoundry.internal.CreateDockerRepositoryRequest +> = core.serialization.object({ + fqn: core.serialization.string(), + applicationName: core.serialization.string(), + workspaceFqn: core.serialization.string(), +}); export declare namespace CreateDockerRepositoryRequest { export interface Raw { diff --git a/src/serialization/resources/internal/resources/index.ts b/src/serialization/resources/internal/resources/index.ts index ddc74a7e..f3dc49b3 100644 --- a/src/serialization/resources/internal/resources/index.ts +++ b/src/serialization/resources/internal/resources/index.ts @@ -1,14 +1,14 @@ export * as aiGateway from "./aiGateway/index.js"; export * from "./aiGateway/types/index.js"; export * as applications from "./applications/index.js"; -export * as deployments from "./deployments/index.js"; export * from "./deployments/client/requests/index.js"; -export * as dockerRegistries from "./dockerRegistries/index.js"; +export * as deployments from "./deployments/index.js"; export * from "./dockerRegistries/client/requests/index.js"; +export * as dockerRegistries from "./dockerRegistries/index.js"; export * as metrics from "./metrics/index.js"; export * from "./metrics/types/index.js"; -export * as vcs from "./vcs/index.js"; export * from "./vcs/client/requests/index.js"; -export * as workflows from "./workflows/index.js"; +export * as vcs from "./vcs/index.js"; export * from "./workflows/client/requests/index.js"; +export * as workflows from "./workflows/index.js"; export * from "./workflows/types/index.js"; diff --git a/src/serialization/resources/internal/resources/metrics/types/GetChartsMetricsRequestFilterEntity.ts b/src/serialization/resources/internal/resources/metrics/types/GetChartsMetricsRequestFilterEntity.ts new file mode 100644 index 00000000..8256c0ac --- /dev/null +++ b/src/serialization/resources/internal/resources/metrics/types/GetChartsMetricsRequestFilterEntity.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../../../../../api/index.js"; +import * as core from "../../../../../../core/index.js"; +import type * as serializers from "../../../../../index.js"; + +export const GetChartsMetricsRequestFilterEntity: core.serialization.Schema< + serializers.internal.GetChartsMetricsRequestFilterEntity.Raw, + TrueFoundry.internal.GetChartsMetricsRequestFilterEntity +> = core.serialization.enum_(["application", "pod", "job-run", "event", "cluster"]); + +export declare namespace GetChartsMetricsRequestFilterEntity { + export type Raw = "application" | "pod" | "job-run" | "event" | "cluster"; +} diff --git a/src/serialization/resources/internal/resources/metrics/types/MetricsGetChartsRequestFilterEntity.ts b/src/serialization/resources/internal/resources/metrics/types/MetricsGetChartsRequestFilterEntity.ts deleted file mode 100644 index 0451d83b..00000000 --- a/src/serialization/resources/internal/resources/metrics/types/MetricsGetChartsRequestFilterEntity.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as TrueFoundry from "../../../../../../api/index.js"; -import * as core from "../../../../../../core/index.js"; -import * as serializers from "../../../../../index.js"; - -export const MetricsGetChartsRequestFilterEntity: core.serialization.Schema = core.serialization.enum_(["application", "pod", "job-run", "event", "cluster"]); - -export declare namespace MetricsGetChartsRequestFilterEntity { - export type Raw = "application" | "pod" | "job-run" | "event" | "cluster"; -} diff --git a/src/serialization/resources/internal/resources/metrics/types/index.ts b/src/serialization/resources/internal/resources/metrics/types/index.ts index ef539cc0..59abb756 100644 --- a/src/serialization/resources/internal/resources/metrics/types/index.ts +++ b/src/serialization/resources/internal/resources/metrics/types/index.ts @@ -1 +1 @@ -export * from "./MetricsGetChartsRequestFilterEntity.js"; +export * from "./GetChartsMetricsRequestFilterEntity.js"; diff --git a/src/serialization/resources/internal/resources/vcs/client/requests/GetAuthenticatedVcsurlRequest.ts b/src/serialization/resources/internal/resources/vcs/client/requests/GetAuthenticatedVcsurlRequest.ts index 3f2ef888..9c447639 100644 --- a/src/serialization/resources/internal/resources/vcs/client/requests/GetAuthenticatedVcsurlRequest.ts +++ b/src/serialization/resources/internal/resources/vcs/client/requests/GetAuthenticatedVcsurlRequest.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../../../api/index.js"; import * as core from "../../../../../../../core/index.js"; -import * as serializers from "../../../../../../index.js"; +import type * as serializers from "../../../../../../index.js"; -export const GetAuthenticatedVcsurlRequest: core.serialization.Schema = core.serialization.object({ - "repoUrl": core.serialization.property("repoURL", core.serialization.string()) - }); +export const GetAuthenticatedVcsurlRequest: core.serialization.Schema< + serializers.internal.GetAuthenticatedVcsurlRequest.Raw, + TrueFoundry.internal.GetAuthenticatedVcsurlRequest +> = core.serialization.object({ + repoUrl: core.serialization.property("repoURL", core.serialization.string()), +}); export declare namespace GetAuthenticatedVcsurlRequest { export interface Raw { diff --git a/src/serialization/resources/internal/resources/vcs/client/requests/GitRepositoryExistsRequest.ts b/src/serialization/resources/internal/resources/vcs/client/requests/GitRepositoryExistsRequest.ts index 84e292a9..3cbbec69 100644 --- a/src/serialization/resources/internal/resources/vcs/client/requests/GitRepositoryExistsRequest.ts +++ b/src/serialization/resources/internal/resources/vcs/client/requests/GitRepositoryExistsRequest.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../../../api/index.js"; import * as core from "../../../../../../../core/index.js"; -import * as serializers from "../../../../../../index.js"; +import type * as serializers from "../../../../../../index.js"; -export const GitRepositoryExistsRequest: core.serialization.Schema = core.serialization.object({ - "repoUrl": core.serialization.property("repoURL", core.serialization.string()), - "id": core.serialization.string().optional() - }); +export const GitRepositoryExistsRequest: core.serialization.Schema< + serializers.internal.GitRepositoryExistsRequest.Raw, + TrueFoundry.internal.GitRepositoryExistsRequest +> = core.serialization.object({ + repoUrl: core.serialization.property("repoURL", core.serialization.string()), + id: core.serialization.string().optionalNullable(), +}); export declare namespace GitRepositoryExistsRequest { export interface Raw { repoURL: string; - id?: string | null; + id?: (string | null | undefined) | null; } } diff --git a/src/serialization/resources/internal/resources/workflows/client/requests/ExecuteWorkflowRequest.ts b/src/serialization/resources/internal/resources/workflows/client/requests/ExecuteWorkflowRequest.ts index 97f4d7c1..a249301e 100644 --- a/src/serialization/resources/internal/resources/workflows/client/requests/ExecuteWorkflowRequest.ts +++ b/src/serialization/resources/internal/resources/workflows/client/requests/ExecuteWorkflowRequest.ts @@ -1,17 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../../../api/index.js"; import * as core from "../../../../../../../core/index.js"; -import * as serializers from "../../../../../../index.js"; +import type * as serializers from "../../../../../../index.js"; -export const ExecuteWorkflowRequest: core.serialization.Schema = core.serialization.object({ - "inputs": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - "inputsLiteralMap": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() - }); +export const ExecuteWorkflowRequest: core.serialization.Schema< + serializers.internal.ExecuteWorkflowRequest.Raw, + TrueFoundry.internal.ExecuteWorkflowRequest +> = core.serialization.object({ + inputs: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optionalNullable(), + inputsLiteralMap: core.serialization + .record(core.serialization.string(), core.serialization.unknown()) + .optionalNullable(), +}); export declare namespace ExecuteWorkflowRequest { export interface Raw { - inputs?: Record | null; - inputsLiteralMap?: Record | null; + inputs?: (Record | null | undefined) | null; + inputsLiteralMap?: (Record | null | undefined) | null; } } diff --git a/src/serialization/resources/internal/resources/workflows/types/ExecuteWorkflowWorkflowsResponse.ts b/src/serialization/resources/internal/resources/workflows/types/ExecuteWorkflowWorkflowsResponse.ts new file mode 100644 index 00000000..c1f9b53f --- /dev/null +++ b/src/serialization/resources/internal/resources/workflows/types/ExecuteWorkflowWorkflowsResponse.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../../../../../api/index.js"; +import * as core from "../../../../../../core/index.js"; +import type * as serializers from "../../../../../index.js"; + +export const ExecuteWorkflowWorkflowsResponse: core.serialization.ObjectSchema< + serializers.internal.ExecuteWorkflowWorkflowsResponse.Raw, + TrueFoundry.internal.ExecuteWorkflowWorkflowsResponse +> = core.serialization.object({ + executionName: core.serialization.string().optional(), +}); + +export declare namespace ExecuteWorkflowWorkflowsResponse { + export interface Raw { + executionName?: string | null; + } +} diff --git a/src/serialization/resources/internal/resources/workflows/types/WorkflowsExecuteWorkflowResponse.ts b/src/serialization/resources/internal/resources/workflows/types/WorkflowsExecuteWorkflowResponse.ts deleted file mode 100644 index d5eec81b..00000000 --- a/src/serialization/resources/internal/resources/workflows/types/WorkflowsExecuteWorkflowResponse.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as TrueFoundry from "../../../../../../api/index.js"; -import * as core from "../../../../../../core/index.js"; -import * as serializers from "../../../../../index.js"; - -export const WorkflowsExecuteWorkflowResponse: core.serialization.ObjectSchema = core.serialization.object({ - "executionName": core.serialization.string().optional() - }); - -export declare namespace WorkflowsExecuteWorkflowResponse { - export interface Raw { - executionName?: string | null; - } -} diff --git a/src/serialization/resources/internal/resources/workflows/types/index.ts b/src/serialization/resources/internal/resources/workflows/types/index.ts index 41105159..b22e14d6 100644 --- a/src/serialization/resources/internal/resources/workflows/types/index.ts +++ b/src/serialization/resources/internal/resources/workflows/types/index.ts @@ -1 +1 @@ -export * from "./WorkflowsExecuteWorkflowResponse.js"; +export * from "./ExecuteWorkflowWorkflowsResponse.js"; diff --git a/src/serialization/resources/jobs/client/requests/TriggerJobRequest.ts b/src/serialization/resources/jobs/client/requests/TriggerJobRequest.ts index ee34f856..be195494 100644 --- a/src/serialization/resources/jobs/client/requests/TriggerJobRequest.ts +++ b/src/serialization/resources/jobs/client/requests/TriggerJobRequest.ts @@ -1,23 +1,26 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; import { Metadata } from "../../../../types/Metadata.js"; import { TriggerJobRequestInput } from "../../types/TriggerJobRequestInput.js"; -export const TriggerJobRequest: core.serialization.Schema = core.serialization.object({ - "deploymentId": core.serialization.string().optional(), - "applicationId": core.serialization.string().optional(), - "input": TriggerJobRequestInput.optional(), - "metadata": Metadata.optional() - }); +export const TriggerJobRequest: core.serialization.Schema< + serializers.TriggerJobRequest.Raw, + TrueFoundry.TriggerJobRequest +> = core.serialization.object({ + deploymentId: core.serialization.string().optionalNullable(), + applicationId: core.serialization.string().optionalNullable(), + input: TriggerJobRequestInput.optionalNullable(), + metadata: Metadata.optionalNullable(), +}); export declare namespace TriggerJobRequest { export interface Raw { - deploymentId?: string | null; - applicationId?: string | null; - input?: TriggerJobRequestInput.Raw | null; - metadata?: Metadata.Raw | null; + deploymentId?: (string | null | undefined) | null; + applicationId?: (string | null | undefined) | null; + input?: (TriggerJobRequestInput.Raw | null | undefined) | null; + metadata?: (Metadata.Raw | null | undefined) | null; } } diff --git a/src/serialization/resources/jobs/types/TriggerJobRequestInput.ts b/src/serialization/resources/jobs/types/TriggerJobRequestInput.ts index f35084f0..82701770 100644 --- a/src/serialization/resources/jobs/types/TriggerJobRequestInput.ts +++ b/src/serialization/resources/jobs/types/TriggerJobRequestInput.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../api/index.js"; +import type * as TrueFoundry from "../../../../api/index.js"; import * as core from "../../../../core/index.js"; -import * as serializers from "../../../index.js"; +import type * as serializers from "../../../index.js"; import { JobTriggerInput } from "../../../types/JobTriggerInput.js"; import { SparkJobTriggerInput } from "../../../types/SparkJobTriggerInput.js"; -export const TriggerJobRequestInput: core.serialization.Schema = core.serialization.undiscriminatedUnion([JobTriggerInput, SparkJobTriggerInput]); +export const TriggerJobRequestInput: core.serialization.Schema< + serializers.TriggerJobRequestInput.Raw, + TrueFoundry.TriggerJobRequestInput +> = core.serialization.undiscriminatedUnion([JobTriggerInput, SparkJobTriggerInput]); export declare namespace TriggerJobRequestInput { export type Raw = JobTriggerInput.Raw | SparkJobTriggerInput.Raw; diff --git a/src/serialization/resources/mlRepos/client/requests/ApplyMlRepoRequest.ts b/src/serialization/resources/mlRepos/client/requests/ApplyMlRepoRequest.ts index d59677d6..f9fe79b0 100644 --- a/src/serialization/resources/mlRepos/client/requests/ApplyMlRepoRequest.ts +++ b/src/serialization/resources/mlRepos/client/requests/ApplyMlRepoRequest.ts @@ -1,18 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; import { MlRepoManifest } from "../../../../types/MlRepoManifest.js"; -export const ApplyMlRepoRequest: core.serialization.Schema = core.serialization.object({ - "manifest": MlRepoManifest, - "dryRun": core.serialization.boolean().optional() - }); +export const ApplyMlRepoRequest: core.serialization.Schema< + serializers.ApplyMlRepoRequest.Raw, + TrueFoundry.ApplyMlRepoRequest +> = core.serialization.object({ + manifest: MlRepoManifest, + dryRun: core.serialization.boolean().optionalNullable(), +}); export declare namespace ApplyMlRepoRequest { export interface Raw { manifest: MlRepoManifest.Raw; - dryRun?: boolean | null; + dryRun?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/resources/modelVersions/client/requests/ApplyModelVersionTagsRequest.ts b/src/serialization/resources/modelVersions/client/requests/ApplyModelVersionTagsRequest.ts index 376872b2..4272f97d 100644 --- a/src/serialization/resources/modelVersions/client/requests/ApplyModelVersionTagsRequest.ts +++ b/src/serialization/resources/modelVersions/client/requests/ApplyModelVersionTagsRequest.ts @@ -1,19 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; -export const ApplyModelVersionTagsRequest: core.serialization.Schema = core.serialization.object({ - "modelVersionId": core.serialization.property("model_version_id", core.serialization.string()), - "tags": core.serialization.list(core.serialization.string()), - "force": core.serialization.boolean().optional() - }); +export const ApplyModelVersionTagsRequest: core.serialization.Schema< + serializers.ApplyModelVersionTagsRequest.Raw, + TrueFoundry.ApplyModelVersionTagsRequest +> = core.serialization.object({ + modelVersionId: core.serialization.property("model_version_id", core.serialization.string()), + tags: core.serialization.list(core.serialization.string()), + force: core.serialization.boolean().optionalNullable(), +}); export declare namespace ApplyModelVersionTagsRequest { export interface Raw { model_version_id: string; tags: string[]; - force?: boolean | null; + force?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/resources/models/client/requests/ApplyModelRequest.ts b/src/serialization/resources/models/client/requests/ApplyModelRequest.ts index 5acaed72..47b5a51e 100644 --- a/src/serialization/resources/models/client/requests/ApplyModelRequest.ts +++ b/src/serialization/resources/models/client/requests/ApplyModelRequest.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; import { ModelManifest } from "../../../../types/ModelManifest.js"; -export const ApplyModelRequest: core.serialization.Schema = core.serialization.object({ - "manifest": ModelManifest - }); +export const ApplyModelRequest: core.serialization.Schema< + serializers.ApplyModelRequest.Raw, + TrueFoundry.ApplyModelRequest +> = core.serialization.object({ + manifest: ModelManifest, +}); export declare namespace ApplyModelRequest { export interface Raw { diff --git a/src/serialization/resources/personalAccessTokens/client/requests/CreatePersonalAccessTokenRequest.ts b/src/serialization/resources/personalAccessTokens/client/requests/CreatePersonalAccessTokenRequest.ts index 172e8af3..bfc3d13a 100644 --- a/src/serialization/resources/personalAccessTokens/client/requests/CreatePersonalAccessTokenRequest.ts +++ b/src/serialization/resources/personalAccessTokens/client/requests/CreatePersonalAccessTokenRequest.ts @@ -1,24 +1,27 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; import { CreatePersonalAccessTokenRequestTokenType } from "../../types/CreatePersonalAccessTokenRequestTokenType.js"; -export const CreatePersonalAccessTokenRequest: core.serialization.Schema = core.serialization.object({ - "name": core.serialization.string(), - "expirationDate": core.serialization.string().optional(), - "accountName": core.serialization.string().optional(), - "teamName": core.serialization.string().optional(), - "tokenType": CreatePersonalAccessTokenRequestTokenType.optional() - }); +export const CreatePersonalAccessTokenRequest: core.serialization.Schema< + serializers.CreatePersonalAccessTokenRequest.Raw, + TrueFoundry.CreatePersonalAccessTokenRequest +> = core.serialization.object({ + name: core.serialization.string(), + expirationDate: core.serialization.string().optionalNullable(), + accountName: core.serialization.string().optionalNullable(), + teamName: core.serialization.string().optionalNullable(), + tokenType: CreatePersonalAccessTokenRequestTokenType.optionalNullable(), +}); export declare namespace CreatePersonalAccessTokenRequest { export interface Raw { name: string; - expirationDate?: string | null; - accountName?: string | null; - teamName?: string | null; - tokenType?: CreatePersonalAccessTokenRequestTokenType.Raw | null; + expirationDate?: (string | null | undefined) | null; + accountName?: (string | null | undefined) | null; + teamName?: (string | null | undefined) | null; + tokenType?: (CreatePersonalAccessTokenRequestTokenType.Raw | null | undefined) | null; } } diff --git a/src/serialization/resources/personalAccessTokens/client/requests/RevokeAllPersonalAccessTokenRequest.ts b/src/serialization/resources/personalAccessTokens/client/requests/RevokeAllPersonalAccessTokenRequest.ts index 17d6ae81..6914385e 100644 --- a/src/serialization/resources/personalAccessTokens/client/requests/RevokeAllPersonalAccessTokenRequest.ts +++ b/src/serialization/resources/personalAccessTokens/client/requests/RevokeAllPersonalAccessTokenRequest.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; -export const RevokeAllPersonalAccessTokenRequest: core.serialization.Schema = core.serialization.object({ - "email": core.serialization.string() - }); +export const RevokeAllPersonalAccessTokenRequest: core.serialization.Schema< + serializers.RevokeAllPersonalAccessTokenRequest.Raw, + TrueFoundry.RevokeAllPersonalAccessTokenRequest +> = core.serialization.object({ + email: core.serialization.string(), +}); export declare namespace RevokeAllPersonalAccessTokenRequest { export interface Raw { diff --git a/src/serialization/resources/personalAccessTokens/types/CreatePersonalAccessTokenRequestTokenType.ts b/src/serialization/resources/personalAccessTokens/types/CreatePersonalAccessTokenRequestTokenType.ts index 3d54c989..04724bbf 100644 --- a/src/serialization/resources/personalAccessTokens/types/CreatePersonalAccessTokenRequestTokenType.ts +++ b/src/serialization/resources/personalAccessTokens/types/CreatePersonalAccessTokenRequestTokenType.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../api/index.js"; +import type * as TrueFoundry from "../../../../api/index.js"; import * as core from "../../../../core/index.js"; -import * as serializers from "../../../index.js"; +import type * as serializers from "../../../index.js"; -export const CreatePersonalAccessTokenRequestTokenType: core.serialization.Schema = core.serialization.enum_(["jwt", "opaque"]); +export const CreatePersonalAccessTokenRequestTokenType: core.serialization.Schema< + serializers.CreatePersonalAccessTokenRequestTokenType.Raw, + TrueFoundry.CreatePersonalAccessTokenRequestTokenType +> = core.serialization.enum_(["jwt", "opaque"]); export declare namespace CreatePersonalAccessTokenRequestTokenType { export type Raw = "jwt" | "opaque"; diff --git a/src/serialization/resources/promptVersions/client/requests/ApplyPromptVersionTagsRequest.ts b/src/serialization/resources/promptVersions/client/requests/ApplyPromptVersionTagsRequest.ts index 397f7354..572b4f15 100644 --- a/src/serialization/resources/promptVersions/client/requests/ApplyPromptVersionTagsRequest.ts +++ b/src/serialization/resources/promptVersions/client/requests/ApplyPromptVersionTagsRequest.ts @@ -1,19 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; -export const ApplyPromptVersionTagsRequest: core.serialization.Schema = core.serialization.object({ - "promptVersionId": core.serialization.property("prompt_version_id", core.serialization.string()), - "tags": core.serialization.list(core.serialization.string()), - "force": core.serialization.boolean().optional() - }); +export const ApplyPromptVersionTagsRequest: core.serialization.Schema< + serializers.ApplyPromptVersionTagsRequest.Raw, + TrueFoundry.ApplyPromptVersionTagsRequest +> = core.serialization.object({ + promptVersionId: core.serialization.property("prompt_version_id", core.serialization.string()), + tags: core.serialization.list(core.serialization.string()), + force: core.serialization.boolean().optionalNullable(), +}); export declare namespace ApplyPromptVersionTagsRequest { export interface Raw { prompt_version_id: string; tags: string[]; - force?: boolean | null; + force?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/resources/prompts/client/requests/ApplyPromptRequest.ts b/src/serialization/resources/prompts/client/requests/ApplyPromptRequest.ts index 9d16af80..7f0b636c 100644 --- a/src/serialization/resources/prompts/client/requests/ApplyPromptRequest.ts +++ b/src/serialization/resources/prompts/client/requests/ApplyPromptRequest.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; import { ChatPromptManifest } from "../../../../types/ChatPromptManifest.js"; -export const ApplyPromptRequest: core.serialization.Schema = core.serialization.object({ - "manifest": ChatPromptManifest - }); +export const ApplyPromptRequest: core.serialization.Schema< + serializers.ApplyPromptRequest.Raw, + TrueFoundry.ApplyPromptRequest +> = core.serialization.object({ + manifest: ChatPromptManifest, +}); export declare namespace ApplyPromptRequest { export interface Raw { diff --git a/src/serialization/resources/runs/client/requests/CreateRunRequest.ts b/src/serialization/resources/runs/client/requests/CreateRunRequest.ts index 1c823ebf..592c7329 100644 --- a/src/serialization/resources/runs/client/requests/CreateRunRequest.ts +++ b/src/serialization/resources/runs/client/requests/CreateRunRequest.ts @@ -1,24 +1,27 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; import { RunTagInput } from "../../../../types/RunTagInput.js"; -export const CreateRunRequest: core.serialization.Schema = core.serialization.object({ - "experimentId": core.serialization.property("experiment_id", core.serialization.string()), - "name": core.serialization.string(), - "startTime": core.serialization.property("start_time", core.serialization.number().optional()), - "tags": core.serialization.list(RunTagInput).optional(), - "description": core.serialization.string().optional() - }); +export const CreateRunRequest: core.serialization.Schema< + serializers.CreateRunRequest.Raw, + TrueFoundry.CreateRunRequest +> = core.serialization.object({ + experimentId: core.serialization.property("experiment_id", core.serialization.string()), + name: core.serialization.string(), + startTime: core.serialization.property("start_time", core.serialization.number().optionalNullable()), + tags: core.serialization.list(RunTagInput).optional(), + description: core.serialization.string().optionalNullable(), +}); export declare namespace CreateRunRequest { export interface Raw { experiment_id: string; name: string; - start_time?: number | null; + start_time?: (number | null | undefined) | null; tags?: RunTagInput.Raw[] | null; - description?: string | null; + description?: (string | null | undefined) | null; } } diff --git a/src/serialization/resources/runs/client/requests/DeleteTagRequest.ts b/src/serialization/resources/runs/client/requests/DeleteTagRequest.ts index d953e2a7..e120a0e2 100644 --- a/src/serialization/resources/runs/client/requests/DeleteTagRequest.ts +++ b/src/serialization/resources/runs/client/requests/DeleteTagRequest.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; -export const DeleteTagRequest: core.serialization.Schema = core.serialization.object({ - "key": core.serialization.string() - }); +export const DeleteTagRequest: core.serialization.Schema< + serializers.DeleteTagRequest.Raw, + TrueFoundry.DeleteTagRequest +> = core.serialization.object({ + key: core.serialization.string(), +}); export declare namespace DeleteTagRequest { export interface Raw { diff --git a/src/serialization/resources/runs/client/requests/ListMetricHistoryRequest.ts b/src/serialization/resources/runs/client/requests/ListMetricHistoryRequest.ts index 0aabe556..bc499a5f 100644 --- a/src/serialization/resources/runs/client/requests/ListMetricHistoryRequest.ts +++ b/src/serialization/resources/runs/client/requests/ListMetricHistoryRequest.ts @@ -1,17 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; -export const ListMetricHistoryRequest: core.serialization.Schema = core.serialization.object({ - "metricKeys": core.serialization.property("metric_keys", core.serialization.list(core.serialization.string()).optional()), - "step": core.serialization.number().optional() - }); +export const ListMetricHistoryRequest: core.serialization.Schema< + serializers.ListMetricHistoryRequest.Raw, + TrueFoundry.ListMetricHistoryRequest +> = core.serialization.object({ + metricKeys: core.serialization.property( + "metric_keys", + core.serialization.list(core.serialization.string()).optional(), + ), + step: core.serialization.number().optionalNullable(), +}); export declare namespace ListMetricHistoryRequest { export interface Raw { metric_keys?: string[] | null; - step?: number | null; + step?: (number | null | undefined) | null; } } diff --git a/src/serialization/resources/runs/client/requests/LogBatchRequest.ts b/src/serialization/resources/runs/client/requests/LogBatchRequest.ts index 6650b382..a4bd9b16 100644 --- a/src/serialization/resources/runs/client/requests/LogBatchRequest.ts +++ b/src/serialization/resources/runs/client/requests/LogBatchRequest.ts @@ -1,16 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; import { Metric } from "../../../../types/Metric.js"; import { RunParam } from "../../../../types/RunParam.js"; import { RunTag } from "../../../../types/RunTag.js"; -export const LogBatchRequest: core.serialization.Schema = core.serialization.object({ - "metrics": core.serialization.list(Metric).optional(), - "params": core.serialization.list(RunParam).optional(), - "tags": core.serialization.list(RunTag).optional() +export const LogBatchRequest: core.serialization.Schema = + core.serialization.object({ + metrics: core.serialization.list(Metric).optional(), + params: core.serialization.list(RunParam).optional(), + tags: core.serialization.list(RunTag).optional(), }); export declare namespace LogBatchRequest { diff --git a/src/serialization/resources/runs/client/requests/LogMetricRequest.ts b/src/serialization/resources/runs/client/requests/LogMetricRequest.ts index fc6dfdd2..2383183b 100644 --- a/src/serialization/resources/runs/client/requests/LogMetricRequest.ts +++ b/src/serialization/resources/runs/client/requests/LogMetricRequest.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; -export const LogMetricRequest: core.serialization.Schema = core.serialization.object({ - "key": core.serialization.string(), - "value": core.serialization.number(), - "timestamp": core.serialization.number(), - "step": core.serialization.number().optional() - }); +export const LogMetricRequest: core.serialization.Schema< + serializers.LogMetricRequest.Raw, + TrueFoundry.LogMetricRequest +> = core.serialization.object({ + key: core.serialization.string(), + value: core.serialization.number(), + timestamp: core.serialization.number(), + step: core.serialization.number().optional(), +}); export declare namespace LogMetricRequest { export interface Raw { diff --git a/src/serialization/resources/runs/client/requests/LogParamRequest.ts b/src/serialization/resources/runs/client/requests/LogParamRequest.ts index cf6bbf1b..ba94d429 100644 --- a/src/serialization/resources/runs/client/requests/LogParamRequest.ts +++ b/src/serialization/resources/runs/client/requests/LogParamRequest.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; -export const LogParamRequest: core.serialization.Schema = core.serialization.object({ - "key": core.serialization.string(), - "value": core.serialization.string() +export const LogParamRequest: core.serialization.Schema = + core.serialization.object({ + key: core.serialization.string(), + value: core.serialization.string(), }); export declare namespace LogParamRequest { diff --git a/src/serialization/resources/runs/client/requests/SearchRunsRequest.ts b/src/serialization/resources/runs/client/requests/SearchRunsRequest.ts index 6485d9ed..5b5550ab 100644 --- a/src/serialization/resources/runs/client/requests/SearchRunsRequest.ts +++ b/src/serialization/resources/runs/client/requests/SearchRunsRequest.ts @@ -1,35 +1,41 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; -export const SearchRunsRequest: core.serialization.Schema = core.serialization.object({ - "experimentIds": core.serialization.property("experiment_ids", core.serialization.list(core.serialization.string()).optional()), - "filter": core.serialization.string().optional(), - "runViewType": core.serialization.property("run_view_type", core.serialization.string().optional()), - "maxResults": core.serialization.property("max_results", core.serialization.number().optional()), - "orderBy": core.serialization.property("order_by", core.serialization.list(core.serialization.string()).optional()), - "pageToken": core.serialization.property("page_token", core.serialization.string().optional()), - "offset": core.serialization.number().optional(), - "fqn": core.serialization.string().optional(), - "name": core.serialization.string().optional(), - "experimentId": core.serialization.property("experiment_id", core.serialization.string().optional()), - "mlRepoName": core.serialization.property("ml_repo_name", core.serialization.string().optional()) - }); +export const SearchRunsRequest: core.serialization.Schema< + serializers.SearchRunsRequest.Raw, + TrueFoundry.SearchRunsRequest +> = core.serialization.object({ + experimentIds: core.serialization.property( + "experiment_ids", + core.serialization.list(core.serialization.string()).optional(), + ), + filter: core.serialization.string().optionalNullable(), + runViewType: core.serialization.property("run_view_type", core.serialization.string().optional()), + maxResults: core.serialization.property("max_results", core.serialization.number().optional()), + orderBy: core.serialization.property("order_by", core.serialization.list(core.serialization.string()).optional()), + pageToken: core.serialization.property("page_token", core.serialization.string().optionalNullable()), + offset: core.serialization.number().optionalNullable(), + fqn: core.serialization.string().optionalNullable(), + name: core.serialization.string().optionalNullable(), + experimentId: core.serialization.property("experiment_id", core.serialization.string().optionalNullable()), + mlRepoName: core.serialization.property("ml_repo_name", core.serialization.string().optionalNullable()), +}); export declare namespace SearchRunsRequest { export interface Raw { experiment_ids?: string[] | null; - filter?: string | null; + filter?: (string | null | undefined) | null; run_view_type?: string | null; max_results?: number | null; order_by?: string[] | null; - page_token?: string | null; - offset?: number | null; - fqn?: string | null; - name?: string | null; - experiment_id?: string | null; - ml_repo_name?: string | null; + page_token?: (string | null | undefined) | null; + offset?: (number | null | undefined) | null; + fqn?: (string | null | undefined) | null; + name?: (string | null | undefined) | null; + experiment_id?: (string | null | undefined) | null; + ml_repo_name?: (string | null | undefined) | null; } } diff --git a/src/serialization/resources/runs/client/requests/SetTagRequest.ts b/src/serialization/resources/runs/client/requests/SetTagRequest.ts index 61f2a557..5a6ed2f7 100644 --- a/src/serialization/resources/runs/client/requests/SetTagRequest.ts +++ b/src/serialization/resources/runs/client/requests/SetTagRequest.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; -export const SetTagRequest: core.serialization.Schema = core.serialization.object({ - "key": core.serialization.string(), - "value": core.serialization.string() +export const SetTagRequest: core.serialization.Schema = + core.serialization.object({ + key: core.serialization.string(), + value: core.serialization.string(), }); export declare namespace SetTagRequest { diff --git a/src/serialization/resources/runs/client/requests/UpdateRunRequest.ts b/src/serialization/resources/runs/client/requests/UpdateRunRequest.ts index cdcc91e1..f2cf2c2f 100644 --- a/src/serialization/resources/runs/client/requests/UpdateRunRequest.ts +++ b/src/serialization/resources/runs/client/requests/UpdateRunRequest.ts @@ -1,19 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; -export const UpdateRunRequest: core.serialization.Schema = core.serialization.object({ - "status": core.serialization.string().optional(), - "endTime": core.serialization.property("end_time", core.serialization.number().optional()), - "description": core.serialization.string().optional() - }); +export const UpdateRunRequest: core.serialization.Schema< + serializers.UpdateRunRequest.Raw, + TrueFoundry.UpdateRunRequest +> = core.serialization.object({ + status: core.serialization.string().optionalNullable(), + endTime: core.serialization.property("end_time", core.serialization.number().optionalNullable()), + description: core.serialization.string().optionalNullable(), +}); export declare namespace UpdateRunRequest { export interface Raw { - status?: string | null; - end_time?: number | null; - description?: string | null; + status?: (string | null | undefined) | null; + end_time?: (number | null | undefined) | null; + description?: (string | null | undefined) | null; } } diff --git a/src/serialization/resources/secretGroups/client/requests/CreateOrUpdateSecretGroupRequest.ts b/src/serialization/resources/secretGroups/client/requests/CreateOrUpdateSecretGroupRequest.ts index 1ec93d59..ecb592d4 100644 --- a/src/serialization/resources/secretGroups/client/requests/CreateOrUpdateSecretGroupRequest.ts +++ b/src/serialization/resources/secretGroups/client/requests/CreateOrUpdateSecretGroupRequest.ts @@ -1,18 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; import { SecretGroupManifest } from "../../../../types/SecretGroupManifest.js"; -export const CreateOrUpdateSecretGroupRequest: core.serialization.Schema = core.serialization.object({ - "manifest": SecretGroupManifest, - "dryRun": core.serialization.boolean().optional() - }); +export const CreateOrUpdateSecretGroupRequest: core.serialization.Schema< + serializers.CreateOrUpdateSecretGroupRequest.Raw, + TrueFoundry.CreateOrUpdateSecretGroupRequest +> = core.serialization.object({ + manifest: SecretGroupManifest, + dryRun: core.serialization.boolean().optionalNullable(), +}); export declare namespace CreateOrUpdateSecretGroupRequest { export interface Raw { manifest: SecretGroupManifest.Raw; - dryRun?: boolean | null; + dryRun?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/resources/secretGroups/client/requests/CreateSecretGroupRequest.ts b/src/serialization/resources/secretGroups/client/requests/CreateSecretGroupRequest.ts index 5306275a..6e7d0577 100644 --- a/src/serialization/resources/secretGroups/client/requests/CreateSecretGroupRequest.ts +++ b/src/serialization/resources/secretGroups/client/requests/CreateSecretGroupRequest.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; import { SecretInput } from "../../../../types/SecretInput.js"; -export const CreateSecretGroupRequest: core.serialization.Schema = core.serialization.object({ - "name": core.serialization.string(), - "integrationId": core.serialization.string(), - "secrets": core.serialization.list(SecretInput) - }); +export const CreateSecretGroupRequest: core.serialization.Schema< + serializers.CreateSecretGroupRequest.Raw, + TrueFoundry.CreateSecretGroupRequest +> = core.serialization.object({ + name: core.serialization.string(), + integrationId: core.serialization.string(), + secrets: core.serialization.list(SecretInput), +}); export declare namespace CreateSecretGroupRequest { export interface Raw { diff --git a/src/serialization/resources/secretGroups/client/requests/UpdateSecretGroupRequest.ts b/src/serialization/resources/secretGroups/client/requests/UpdateSecretGroupRequest.ts index 04a541f6..be0ca909 100644 --- a/src/serialization/resources/secretGroups/client/requests/UpdateSecretGroupRequest.ts +++ b/src/serialization/resources/secretGroups/client/requests/UpdateSecretGroupRequest.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; import { UpdateSecretInput } from "../../../../types/UpdateSecretInput.js"; -export const UpdateSecretGroupRequest: core.serialization.Schema = core.serialization.object({ - "secrets": core.serialization.list(UpdateSecretInput) - }); +export const UpdateSecretGroupRequest: core.serialization.Schema< + serializers.UpdateSecretGroupRequest.Raw, + TrueFoundry.UpdateSecretGroupRequest +> = core.serialization.object({ + secrets: core.serialization.list(UpdateSecretInput), +}); export declare namespace UpdateSecretGroupRequest { export interface Raw { diff --git a/src/serialization/resources/secrets/client/delete.ts b/src/serialization/resources/secrets/client/delete.ts index 170ab18b..236bea38 100644 --- a/src/serialization/resources/secrets/client/delete.ts +++ b/src/serialization/resources/secrets/client/delete.ts @@ -1,12 +1,11 @@ // This file was auto-generated by Fern from our API Definition. import * as core from "../../../../core/index.js"; -import * as serializers from "../../../index.js"; +import type * as serializers from "../../../index.js"; -export const Response: core.serialization.Schema = core.serialization.number(); +export const Response: core.serialization.Schema = + core.serialization.number(); export declare namespace Response { export type Raw = number; } - - diff --git a/src/serialization/resources/secrets/client/requests/ListSecretsRequest.ts b/src/serialization/resources/secrets/client/requests/ListSecretsRequest.ts index 8bdafe92..44a7efc7 100644 --- a/src/serialization/resources/secrets/client/requests/ListSecretsRequest.ts +++ b/src/serialization/resources/secrets/client/requests/ListSecretsRequest.ts @@ -1,23 +1,26 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; -export const ListSecretsRequest: core.serialization.Schema = core.serialization.object({ - "limit": core.serialization.number().optional(), - "offset": core.serialization.number().optional(), - "secretFqns": core.serialization.list(core.serialization.string()).optional(), - "secretGroupId": core.serialization.string().optional(), - "withValue": core.serialization.boolean().optional() - }); +export const ListSecretsRequest: core.serialization.Schema< + serializers.ListSecretsRequest.Raw, + TrueFoundry.ListSecretsRequest +> = core.serialization.object({ + limit: core.serialization.number().optionalNullable(), + offset: core.serialization.number().optionalNullable(), + secretFqns: core.serialization.list(core.serialization.string()).optionalNullable(), + secretGroupId: core.serialization.string().optionalNullable(), + withValue: core.serialization.boolean().optionalNullable(), +}); export declare namespace ListSecretsRequest { export interface Raw { - limit?: number | null; - offset?: number | null; - secretFqns?: string[] | null; - secretGroupId?: string | null; - withValue?: boolean | null; + limit?: (number | null | undefined) | null; + offset?: (number | null | undefined) | null; + secretFqns?: (string[] | null | undefined) | null; + secretGroupId?: (string | null | undefined) | null; + withValue?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/resources/teams/client/requests/ApplyTeamRequest.ts b/src/serialization/resources/teams/client/requests/ApplyTeamRequest.ts index 783242e8..9afb40cb 100644 --- a/src/serialization/resources/teams/client/requests/ApplyTeamRequest.ts +++ b/src/serialization/resources/teams/client/requests/ApplyTeamRequest.ts @@ -1,18 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; import { TeamManifest } from "../../../../types/TeamManifest.js"; -export const ApplyTeamRequest: core.serialization.Schema = core.serialization.object({ - "manifest": TeamManifest, - "dryRun": core.serialization.boolean().optional() - }); +export const ApplyTeamRequest: core.serialization.Schema< + serializers.ApplyTeamRequest.Raw, + TrueFoundry.ApplyTeamRequest +> = core.serialization.object({ + manifest: TeamManifest, + dryRun: core.serialization.boolean().optionalNullable(), +}); export declare namespace ApplyTeamRequest { export interface Raw { manifest: TeamManifest.Raw; - dryRun?: boolean | null; + dryRun?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/resources/traces/client/requests/QuerySpansRequest.ts b/src/serialization/resources/traces/client/requests/QuerySpansRequest.ts index d403a3cc..e5416358 100644 --- a/src/serialization/resources/traces/client/requests/QuerySpansRequest.ts +++ b/src/serialization/resources/traces/client/requests/QuerySpansRequest.ts @@ -1,46 +1,49 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; import { SortDirection } from "../../../../types/SortDirection.js"; import { SubjectType } from "../../../../types/SubjectType.js"; import { QuerySpansRequestFiltersItem } from "../../types/QuerySpansRequestFiltersItem.js"; -export const QuerySpansRequest: core.serialization.Schema = core.serialization.object({ - "startTime": core.serialization.string(), - "endTime": core.serialization.string().optional(), - "traceIds": core.serialization.list(core.serialization.string()).optional(), - "spanIds": core.serialization.list(core.serialization.string()).optional(), - "parentSpanIds": core.serialization.list(core.serialization.string()).optional(), - "createdBySubjectTypes": core.serialization.list(SubjectType).optional(), - "createdBySubjectSlugs": core.serialization.list(core.serialization.string()).optional(), - "applicationNames": core.serialization.list(core.serialization.string()).optional(), - "limit": core.serialization.number().optional(), - "sortDirection": SortDirection.optional(), - "pageToken": core.serialization.string().optional(), - "tracingProjectFqn": core.serialization.string().optional(), - "dataRoutingDestination": core.serialization.string().optional(), - "filters": core.serialization.list(QuerySpansRequestFiltersItem).optional(), - "includeFeedbacks": core.serialization.boolean().optional() - }); +export const QuerySpansRequest: core.serialization.Schema< + serializers.QuerySpansRequest.Raw, + TrueFoundry.QuerySpansRequest +> = core.serialization.object({ + startTime: core.serialization.string(), + endTime: core.serialization.string().optionalNullable(), + traceIds: core.serialization.list(core.serialization.string()).optionalNullable(), + spanIds: core.serialization.list(core.serialization.string()).optionalNullable(), + parentSpanIds: core.serialization.list(core.serialization.string()).optionalNullable(), + createdBySubjectTypes: core.serialization.list(SubjectType).optionalNullable(), + createdBySubjectSlugs: core.serialization.list(core.serialization.string()).optionalNullable(), + applicationNames: core.serialization.list(core.serialization.string()).optionalNullable(), + limit: core.serialization.number().optionalNullable(), + sortDirection: SortDirection.optionalNullable(), + pageToken: core.serialization.string().optionalNullable(), + tracingProjectFqn: core.serialization.string().optionalNullable(), + dataRoutingDestination: core.serialization.string().optionalNullable(), + filters: core.serialization.list(QuerySpansRequestFiltersItem).optionalNullable(), + includeFeedbacks: core.serialization.boolean().optionalNullable(), +}); export declare namespace QuerySpansRequest { export interface Raw { startTime: string; - endTime?: string | null; - traceIds?: string[] | null; - spanIds?: string[] | null; - parentSpanIds?: string[] | null; - createdBySubjectTypes?: SubjectType.Raw[] | null; - createdBySubjectSlugs?: string[] | null; - applicationNames?: string[] | null; - limit?: number | null; - sortDirection?: SortDirection.Raw | null; - pageToken?: string | null; - tracingProjectFqn?: string | null; - dataRoutingDestination?: string | null; - filters?: QuerySpansRequestFiltersItem.Raw[] | null; - includeFeedbacks?: boolean | null; + endTime?: (string | null | undefined) | null; + traceIds?: (string[] | null | undefined) | null; + spanIds?: (string[] | null | undefined) | null; + parentSpanIds?: (string[] | null | undefined) | null; + createdBySubjectTypes?: (SubjectType.Raw[] | null | undefined) | null; + createdBySubjectSlugs?: (string[] | null | undefined) | null; + applicationNames?: (string[] | null | undefined) | null; + limit?: (number | null | undefined) | null; + sortDirection?: (SortDirection.Raw | null | undefined) | null; + pageToken?: (string | null | undefined) | null; + tracingProjectFqn?: (string | null | undefined) | null; + dataRoutingDestination?: (string | null | undefined) | null; + filters?: (QuerySpansRequestFiltersItem.Raw[] | null | undefined) | null; + includeFeedbacks?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/resources/traces/types/QuerySpansRequestFiltersItem.ts b/src/serialization/resources/traces/types/QuerySpansRequestFiltersItem.ts index b384246c..f2d04657 100644 --- a/src/serialization/resources/traces/types/QuerySpansRequestFiltersItem.ts +++ b/src/serialization/resources/traces/types/QuerySpansRequestFiltersItem.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../api/index.js"; +import type * as TrueFoundry from "../../../../api/index.js"; import * as core from "../../../../core/index.js"; -import * as serializers from "../../../index.js"; +import type * as serializers from "../../../index.js"; import { GatewayRequestMetadataFilter } from "../../../types/GatewayRequestMetadataFilter.js"; import { SpanAttributeFilter } from "../../../types/SpanAttributeFilter.js"; import { SpanFieldFilter } from "../../../types/SpanFieldFilter.js"; -export const QuerySpansRequestFiltersItem: core.serialization.Schema = core.serialization.undiscriminatedUnion([SpanFieldFilter, SpanAttributeFilter, GatewayRequestMetadataFilter]); +export const QuerySpansRequestFiltersItem: core.serialization.Schema< + serializers.QuerySpansRequestFiltersItem.Raw, + TrueFoundry.QuerySpansRequestFiltersItem +> = core.serialization.undiscriminatedUnion([SpanFieldFilter, SpanAttributeFilter, GatewayRequestMetadataFilter]); export declare namespace QuerySpansRequestFiltersItem { export type Raw = SpanFieldFilter.Raw | SpanAttributeFilter.Raw | GatewayRequestMetadataFilter.Raw; diff --git a/src/serialization/resources/users/client/requests/ActivateUserRequest.ts b/src/serialization/resources/users/client/requests/ActivateUserRequest.ts index c8dad420..7bfa1827 100644 --- a/src/serialization/resources/users/client/requests/ActivateUserRequest.ts +++ b/src/serialization/resources/users/client/requests/ActivateUserRequest.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; -export const ActivateUserRequest: core.serialization.Schema = core.serialization.object({ - "email": core.serialization.string(), - "tenantName": core.serialization.string().optional() - }); +export const ActivateUserRequest: core.serialization.Schema< + serializers.ActivateUserRequest.Raw, + TrueFoundry.ActivateUserRequest +> = core.serialization.object({ + email: core.serialization.string(), + tenantName: core.serialization.string().optionalNullable(), +}); export declare namespace ActivateUserRequest { export interface Raw { email: string; - tenantName?: string | null; + tenantName?: (string | null | undefined) | null; } } diff --git a/src/serialization/resources/users/client/requests/ChangePasswordRequest.ts b/src/serialization/resources/users/client/requests/ChangePasswordRequest.ts index 34c949d6..2cb8b69b 100644 --- a/src/serialization/resources/users/client/requests/ChangePasswordRequest.ts +++ b/src/serialization/resources/users/client/requests/ChangePasswordRequest.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; -export const ChangePasswordRequest: core.serialization.Schema = core.serialization.object({ - "loginId": core.serialization.string(), - "newPassword": core.serialization.string(), - "oldPassword": core.serialization.string() - }); +export const ChangePasswordRequest: core.serialization.Schema< + serializers.ChangePasswordRequest.Raw, + TrueFoundry.ChangePasswordRequest +> = core.serialization.object({ + loginId: core.serialization.string(), + newPassword: core.serialization.string(), + oldPassword: core.serialization.string(), +}); export declare namespace ChangePasswordRequest { export interface Raw { diff --git a/src/serialization/resources/users/client/requests/DeactivateUserRequest.ts b/src/serialization/resources/users/client/requests/DeactivateUserRequest.ts index d6ff612d..3f2dfd3a 100644 --- a/src/serialization/resources/users/client/requests/DeactivateUserRequest.ts +++ b/src/serialization/resources/users/client/requests/DeactivateUserRequest.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; -export const DeactivateUserRequest: core.serialization.Schema = core.serialization.object({ - "email": core.serialization.string(), - "tenantName": core.serialization.string().optional() - }); +export const DeactivateUserRequest: core.serialization.Schema< + serializers.DeactivateUserRequest.Raw, + TrueFoundry.DeactivateUserRequest +> = core.serialization.object({ + email: core.serialization.string(), + tenantName: core.serialization.string().optionalNullable(), +}); export declare namespace DeactivateUserRequest { export interface Raw { email: string; - tenantName?: string | null; + tenantName?: (string | null | undefined) | null; } } diff --git a/src/serialization/resources/users/client/requests/InviteUserRequest.ts b/src/serialization/resources/users/client/requests/InviteUserRequest.ts index 96619841..3965cef4 100644 --- a/src/serialization/resources/users/client/requests/InviteUserRequest.ts +++ b/src/serialization/resources/users/client/requests/InviteUserRequest.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; -export const InviteUserRequest: core.serialization.Schema = core.serialization.object({ - "acceptInviteClientUrl": core.serialization.string(), - "email": core.serialization.string() - }); +export const InviteUserRequest: core.serialization.Schema< + serializers.InviteUserRequest.Raw, + TrueFoundry.InviteUserRequest +> = core.serialization.object({ + acceptInviteClientUrl: core.serialization.string(), + email: core.serialization.string(), +}); export declare namespace InviteUserRequest { export interface Raw { diff --git a/src/serialization/resources/users/client/requests/RegisterUsersRequest.ts b/src/serialization/resources/users/client/requests/RegisterUsersRequest.ts index 577d5321..0d9bd430 100644 --- a/src/serialization/resources/users/client/requests/RegisterUsersRequest.ts +++ b/src/serialization/resources/users/client/requests/RegisterUsersRequest.ts @@ -1,23 +1,29 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; -export const RegisterUsersRequest: core.serialization.Schema = core.serialization.object({ - "email": core.serialization.string(), - "sendInviteEmail": core.serialization.boolean().optional(), - "skipIfUserExists": core.serialization.boolean().optional(), - "dryRun": core.serialization.boolean().optional(), - "acceptInviteClientUrl": core.serialization.property("acceptInviteClientURL", core.serialization.string().optional()) - }); +export const RegisterUsersRequest: core.serialization.Schema< + serializers.RegisterUsersRequest.Raw, + TrueFoundry.RegisterUsersRequest +> = core.serialization.object({ + email: core.serialization.string(), + sendInviteEmail: core.serialization.boolean().optionalNullable(), + skipIfUserExists: core.serialization.boolean().optionalNullable(), + dryRun: core.serialization.boolean().optionalNullable(), + acceptInviteClientUrl: core.serialization.property( + "acceptInviteClientURL", + core.serialization.string().optionalNullable(), + ), +}); export declare namespace RegisterUsersRequest { export interface Raw { email: string; - sendInviteEmail?: boolean | null; - skipIfUserExists?: boolean | null; - dryRun?: boolean | null; - acceptInviteClientURL?: string | null; + sendInviteEmail?: (boolean | null | undefined) | null; + skipIfUserExists?: (boolean | null | undefined) | null; + dryRun?: (boolean | null | undefined) | null; + acceptInviteClientURL?: (string | null | undefined) | null; } } diff --git a/src/serialization/resources/users/client/requests/UpdateUserRolesRequest.ts b/src/serialization/resources/users/client/requests/UpdateUserRolesRequest.ts index afefaa14..9802624e 100644 --- a/src/serialization/resources/users/client/requests/UpdateUserRolesRequest.ts +++ b/src/serialization/resources/users/client/requests/UpdateUserRolesRequest.ts @@ -1,20 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; -import { ResourceType } from "../../../../types/ResourceType.js"; +import type * as serializers from "../../../../index.js"; +import { UpdateUserRolesRequestResourceType } from "../../types/UpdateUserRolesRequestResourceType.js"; -export const UpdateUserRolesRequest: core.serialization.Schema = core.serialization.object({ - "email": core.serialization.string(), - "roles": core.serialization.list(core.serialization.string()), - "resourceType": ResourceType.optional() - }); +export const UpdateUserRolesRequest: core.serialization.Schema< + serializers.UpdateUserRolesRequest.Raw, + TrueFoundry.UpdateUserRolesRequest +> = core.serialization.object({ + email: core.serialization.string(), + roles: core.serialization.list(core.serialization.string()), + resourceType: UpdateUserRolesRequestResourceType.optionalNullable(), +}); export declare namespace UpdateUserRolesRequest { export interface Raw { email: string; roles: string[]; - resourceType?: ResourceType.Raw | null; + resourceType?: (UpdateUserRolesRequestResourceType.Raw | null | undefined) | null; } } diff --git a/src/serialization/resources/users/index.ts b/src/serialization/resources/users/index.ts index 914b8c3c..d9adb1af 100644 --- a/src/serialization/resources/users/index.ts +++ b/src/serialization/resources/users/index.ts @@ -1 +1,2 @@ export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/serialization/resources/users/types/UpdateUserRolesRequestResourceType.ts b/src/serialization/resources/users/types/UpdateUserRolesRequestResourceType.ts new file mode 100644 index 00000000..dfd70078 --- /dev/null +++ b/src/serialization/resources/users/types/UpdateUserRolesRequestResourceType.ts @@ -0,0 +1,99 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../../../api/index.js"; +import * as core from "../../../../core/index.js"; +import type * as serializers from "../../../index.js"; + +export const UpdateUserRolesRequestResourceType: core.serialization.Schema< + serializers.UpdateUserRolesRequestResourceType.Raw, + TrueFoundry.UpdateUserRolesRequestResourceType +> = core.serialization.enum_([ + "role", + "account", + "cluster", + "workspace", + "environment", + "secret-group", + "deployment", + "application", + "secret", + "docker-registry", + "tenant", + "vcs-integration", + "mlf-project", + "repository", + "provider-integration", + "team", + "service-account", + "llm-gateway", + "policy", + "role-binding", + "settings", + "provider-account", + "user", + "alert-config", + "alert-rule", + "gateway-config", + "gateway-controls", + "gateway-budget", + "gateway-policy", + "gateway-approval-request", + "tracing-project", + "tracing-application", + "agent", + "agent-app", + "agent-channel", + "gateway-installation", + "virtual-account", + "sso-based-identity", + "external-identity", + "mcp-server", + "external-identity-provider", + "agent-identity", +]); + +export declare namespace UpdateUserRolesRequestResourceType { + export type Raw = + | "role" + | "account" + | "cluster" + | "workspace" + | "environment" + | "secret-group" + | "deployment" + | "application" + | "secret" + | "docker-registry" + | "tenant" + | "vcs-integration" + | "mlf-project" + | "repository" + | "provider-integration" + | "team" + | "service-account" + | "llm-gateway" + | "policy" + | "role-binding" + | "settings" + | "provider-account" + | "user" + | "alert-config" + | "alert-rule" + | "gateway-config" + | "gateway-controls" + | "gateway-budget" + | "gateway-policy" + | "gateway-approval-request" + | "tracing-project" + | "tracing-application" + | "agent" + | "agent-app" + | "agent-channel" + | "gateway-installation" + | "virtual-account" + | "sso-based-identity" + | "external-identity" + | "mcp-server" + | "external-identity-provider" + | "agent-identity"; +} diff --git a/src/serialization/resources/users/types/index.ts b/src/serialization/resources/users/types/index.ts new file mode 100644 index 00000000..d5c06e6e --- /dev/null +++ b/src/serialization/resources/users/types/index.ts @@ -0,0 +1 @@ +export * from "./UpdateUserRolesRequestResourceType.js"; diff --git a/src/serialization/resources/virtualAccounts/client/requests/ApplyVirtualAccountRequest.ts b/src/serialization/resources/virtualAccounts/client/requests/ApplyVirtualAccountRequest.ts index eeee18d7..bf9ca16c 100644 --- a/src/serialization/resources/virtualAccounts/client/requests/ApplyVirtualAccountRequest.ts +++ b/src/serialization/resources/virtualAccounts/client/requests/ApplyVirtualAccountRequest.ts @@ -1,18 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; import { VirtualAccountManifest } from "../../../../types/VirtualAccountManifest.js"; -export const ApplyVirtualAccountRequest: core.serialization.Schema = core.serialization.object({ - "manifest": VirtualAccountManifest, - "dryRun": core.serialization.boolean().optional() - }); +export const ApplyVirtualAccountRequest: core.serialization.Schema< + serializers.ApplyVirtualAccountRequest.Raw, + TrueFoundry.ApplyVirtualAccountRequest +> = core.serialization.object({ + manifest: VirtualAccountManifest, + dryRun: core.serialization.boolean().optionalNullable(), +}); export declare namespace ApplyVirtualAccountRequest { export interface Raw { manifest: VirtualAccountManifest.Raw; - dryRun?: boolean | null; + dryRun?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/resources/virtualAccounts/client/requests/RegenerateVirtualAccountTokenRequest.ts b/src/serialization/resources/virtualAccounts/client/requests/RegenerateVirtualAccountTokenRequest.ts index 09b9dfd2..0911ec47 100644 --- a/src/serialization/resources/virtualAccounts/client/requests/RegenerateVirtualAccountTokenRequest.ts +++ b/src/serialization/resources/virtualAccounts/client/requests/RegenerateVirtualAccountTokenRequest.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; -export const RegenerateVirtualAccountTokenRequest: core.serialization.Schema = core.serialization.object({ - "gracePeriodInDays": core.serialization.number() - }); +export const RegenerateVirtualAccountTokenRequest: core.serialization.Schema< + serializers.RegenerateVirtualAccountTokenRequest.Raw, + TrueFoundry.RegenerateVirtualAccountTokenRequest +> = core.serialization.object({ + gracePeriodInDays: core.serialization.number(), +}); export declare namespace RegenerateVirtualAccountTokenRequest { export interface Raw { diff --git a/src/serialization/resources/workspaces/client/requests/CreateOrUpdateWorkspaceRequest.ts b/src/serialization/resources/workspaces/client/requests/CreateOrUpdateWorkspaceRequest.ts index d15e11ab..33c5ae2e 100644 --- a/src/serialization/resources/workspaces/client/requests/CreateOrUpdateWorkspaceRequest.ts +++ b/src/serialization/resources/workspaces/client/requests/CreateOrUpdateWorkspaceRequest.ts @@ -1,18 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../../../../api/index.js"; +import type * as TrueFoundry from "../../../../../api/index.js"; import * as core from "../../../../../core/index.js"; -import * as serializers from "../../../../index.js"; +import type * as serializers from "../../../../index.js"; import { WorkspaceManifest } from "../../../../types/WorkspaceManifest.js"; -export const CreateOrUpdateWorkspaceRequest: core.serialization.Schema = core.serialization.object({ - "manifest": WorkspaceManifest, - "dryRun": core.serialization.boolean().optional() - }); +export const CreateOrUpdateWorkspaceRequest: core.serialization.Schema< + serializers.CreateOrUpdateWorkspaceRequest.Raw, + TrueFoundry.CreateOrUpdateWorkspaceRequest +> = core.serialization.object({ + manifest: WorkspaceManifest, + dryRun: core.serialization.boolean().optionalNullable(), +}); export declare namespace CreateOrUpdateWorkspaceRequest { export interface Raw { manifest: WorkspaceManifest.Raw; - dryRun?: boolean | null; + dryRun?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/types/A2AAgentSkill.ts b/src/serialization/types/A2AAgentSkill.ts index 83d4cc83..e8195c41 100644 --- a/src/serialization/types/A2AAgentSkill.ts +++ b/src/serialization/types/A2AAgentSkill.ts @@ -1,17 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const A2AAgentSkill: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string(), - "name": core.serialization.string(), - "description": core.serialization.string(), - "tags": core.serialization.list(core.serialization.string()).optional(), - "examples": core.serialization.list(core.serialization.string()).optional(), - "inputModes": core.serialization.list(core.serialization.string()).optional(), - "outputModes": core.serialization.list(core.serialization.string()).optional() +export const A2AAgentSkill: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string(), + name: core.serialization.string(), + description: core.serialization.string(), + tags: core.serialization.list(core.serialization.string()).optional(), + examples: core.serialization.list(core.serialization.string()).optional(), + inputModes: core.serialization.list(core.serialization.string()).optional(), + outputModes: core.serialization.list(core.serialization.string()).optional(), }); export declare namespace A2AAgentSkill { diff --git a/src/serialization/types/A2AFramework.ts b/src/serialization/types/A2AFramework.ts index be9198db..91e04780 100644 --- a/src/serialization/types/A2AFramework.ts +++ b/src/serialization/types/A2AFramework.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const A2AFramework: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("a2a"), - "agentCardPath": core.serialization.property("agent_card_path", core.serialization.string()) +export const A2AFramework: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("a2a"), + agentCardPath: core.serialization.property("agent_card_path", core.serialization.string()), }); export declare namespace A2AFramework { diff --git a/src/serialization/types/Account.ts b/src/serialization/types/Account.ts index 410af421..fa35fe58 100644 --- a/src/serialization/types/Account.ts +++ b/src/serialization/types/Account.ts @@ -1,30 +1,31 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Subject } from "./Subject.js"; -export const Account: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string().optional(), - "tenantName": core.serialization.string(), - "fqn": core.serialization.string(), - "manifest": core.serialization.record(core.serialization.string(), core.serialization.unknown()), - "createdBySubject": Subject, - "createdAt": core.serialization.date().optional(), - "updatedAt": core.serialization.date().optional(), - "isEditable": core.serialization.boolean() +export const Account: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string().optionalNullable(), + tenantName: core.serialization.string(), + fqn: core.serialization.string(), + manifest: core.serialization.record(core.serialization.string(), core.serialization.unknown()), + createdBySubject: Subject, + createdAt: core.serialization.date().optionalNullable(), + updatedAt: core.serialization.date().optionalNullable(), + isEditable: core.serialization.boolean(), }); export declare namespace Account { export interface Raw { - id?: string | null; + id?: (string | null | undefined) | null; tenantName: string; fqn: string; manifest: Record; createdBySubject: Subject.Raw; - createdAt?: string | null; - updatedAt?: string | null; + createdAt?: (string | null | undefined) | null; + updatedAt?: (string | null | undefined) | null; isEditable: boolean; } } diff --git a/src/serialization/types/AccountInfo.ts b/src/serialization/types/AccountInfo.ts index 4991a3c8..b9731d70 100644 --- a/src/serialization/types/AccountInfo.ts +++ b/src/serialization/types/AccountInfo.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AccountInfo: core.serialization.ObjectSchema = core.serialization.object({ - "accountId": core.serialization.string(), - "name": core.serialization.string() +export const AccountInfo: core.serialization.ObjectSchema = + core.serialization.object({ + accountId: core.serialization.string(), + name: core.serialization.string(), }); export declare namespace AccountInfo { diff --git a/src/serialization/types/ActivateUserResponse.ts b/src/serialization/types/ActivateUserResponse.ts index e950de74..ee709e8d 100644 --- a/src/serialization/types/ActivateUserResponse.ts +++ b/src/serialization/types/ActivateUserResponse.ts @@ -1,12 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const ActivateUserResponse: core.serialization.ObjectSchema = core.serialization.object({}); +export const ActivateUserResponse: core.serialization.ObjectSchema< + serializers.ActivateUserResponse.Raw, + TrueFoundry.ActivateUserResponse +> = core.serialization.object({}); export declare namespace ActivateUserResponse { - export interface Raw { - } + export type Raw = {}; } diff --git a/src/serialization/types/AddOnComponentSource.ts b/src/serialization/types/AddOnComponentSource.ts index 9583f686..bd8bf43e 100644 --- a/src/serialization/types/AddOnComponentSource.ts +++ b/src/serialization/types/AddOnComponentSource.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AddOnComponentSource: core.serialization.ObjectSchema = core.serialization.object({ - "repoUrl": core.serialization.property("repo_url", core.serialization.string()), - "chart": core.serialization.string() - }); +export const AddOnComponentSource: core.serialization.ObjectSchema< + serializers.AddOnComponentSource.Raw, + TrueFoundry.AddOnComponentSource +> = core.serialization.object({ + repoUrl: core.serialization.property("repo_url", core.serialization.string()), + chart: core.serialization.string(), +}); export declare namespace AddOnComponentSource { export interface Raw { diff --git a/src/serialization/types/AddonComponent.ts b/src/serialization/types/AddonComponent.ts index d64b6ea8..b2cbcad8 100644 --- a/src/serialization/types/AddonComponent.ts +++ b/src/serialization/types/AddonComponent.ts @@ -1,61 +1,67 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; -import { AddonComponentName } from "./AddonComponentName.js"; +import type * as serializers from "../index.js"; import { AddOnComponentSource } from "./AddOnComponentSource.js"; +import { AddonComponentName } from "./AddonComponentName.js"; import { AddonComponentStatus } from "./AddonComponentStatus.js"; import { ClusterType } from "./ClusterType.js"; import { Recommendation } from "./Recommendation.js"; import { UpgradeData } from "./UpgradeData.js"; -export const AddonComponent: core.serialization.ObjectSchema = core.serialization.object({ - "name": AddonComponentName, - "appName": core.serialization.string().optional(), - "namespace": core.serialization.string().optional(), - "applicationId": core.serialization.string().optional(), - "description": core.serialization.string().optional(), - "path": core.serialization.string().optional(), - "addonFolder": core.serialization.string().optional(), - "installed": core.serialization.boolean().optional(), - "status": AddonComponentStatus.optional(), - "version": core.serialization.string().optional(), - "manifest": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - "installationSource": core.serialization.string().optional(), - "unsupportedClusterTypes": core.serialization.list(ClusterType).optional(), - "required": core.serialization.boolean().optional(), - "knownCrDs": core.serialization.property("knownCRDs", core.serialization.list(core.serialization.string()).optional()), - "source": AddOnComponentSource.optional(), - "upgrades": UpgradeData.optional(), - "labels": core.serialization.list(core.serialization.string()).optional(), - "recommendations": core.serialization.list(Recommendation).optional(), - "workspaceId": core.serialization.string().optional(), - "metadata": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() - }); +export const AddonComponent: core.serialization.ObjectSchema< + serializers.AddonComponent.Raw, + TrueFoundry.AddonComponent +> = core.serialization.object({ + name: AddonComponentName, + appName: core.serialization.string().optionalNullable(), + namespace: core.serialization.string().optionalNullable(), + applicationId: core.serialization.string().optionalNullable(), + description: core.serialization.string().optionalNullable(), + path: core.serialization.string().optionalNullable(), + addonFolder: core.serialization.string().optionalNullable(), + installed: core.serialization.boolean().optionalNullable(), + status: AddonComponentStatus.optionalNullable(), + version: core.serialization.string().optionalNullable(), + manifest: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optionalNullable(), + installationSource: core.serialization.string().optionalNullable(), + unsupportedClusterTypes: core.serialization.list(ClusterType).optionalNullable(), + required: core.serialization.boolean().optionalNullable(), + knownCrDs: core.serialization.property( + "knownCRDs", + core.serialization.list(core.serialization.string()).optionalNullable(), + ), + source: AddOnComponentSource.optionalNullable(), + upgrades: UpgradeData.optionalNullable(), + labels: core.serialization.list(core.serialization.string()).optionalNullable(), + recommendations: core.serialization.list(Recommendation).optionalNullable(), + workspaceId: core.serialization.string().optionalNullable(), + metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optionalNullable(), +}); export declare namespace AddonComponent { export interface Raw { name: AddonComponentName.Raw; - appName?: string | null; - namespace?: string | null; - applicationId?: string | null; - description?: string | null; - path?: string | null; - addonFolder?: string | null; - installed?: boolean | null; - status?: AddonComponentStatus.Raw | null; - version?: string | null; - manifest?: Record | null; - installationSource?: string | null; - unsupportedClusterTypes?: ClusterType.Raw[] | null; - required?: boolean | null; - knownCRDs?: string[] | null; - source?: AddOnComponentSource.Raw | null; - upgrades?: UpgradeData.Raw | null; - labels?: string[] | null; - recommendations?: Recommendation.Raw[] | null; - workspaceId?: string | null; - metadata?: Record | null; + appName?: (string | null | undefined) | null; + namespace?: (string | null | undefined) | null; + applicationId?: (string | null | undefined) | null; + description?: (string | null | undefined) | null; + path?: (string | null | undefined) | null; + addonFolder?: (string | null | undefined) | null; + installed?: (boolean | null | undefined) | null; + status?: (AddonComponentStatus.Raw | null | undefined) | null; + version?: (string | null | undefined) | null; + manifest?: (Record | null | undefined) | null; + installationSource?: (string | null | undefined) | null; + unsupportedClusterTypes?: (ClusterType.Raw[] | null | undefined) | null; + required?: (boolean | null | undefined) | null; + knownCRDs?: (string[] | null | undefined) | null; + source?: (AddOnComponentSource.Raw | null | undefined) | null; + upgrades?: (UpgradeData.Raw | null | undefined) | null; + labels?: (string[] | null | undefined) | null; + recommendations?: (Recommendation.Raw[] | null | undefined) | null; + workspaceId?: (string | null | undefined) | null; + metadata?: (Record | null | undefined) | null; } } diff --git a/src/serialization/types/AddonComponentName.ts b/src/serialization/types/AddonComponentName.ts index aa19cd24..fd3d5463 100644 --- a/src/serialization/types/AddonComponentName.ts +++ b/src/serialization/types/AddonComponentName.ts @@ -1,11 +1,69 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AddonComponentName: core.serialization.Schema = core.serialization.enum_(["ARGOCD", "ARGO_ROLLOUT", "ARGO_WORKFLOW", "TFY_AGENT", "ISTIO_BASE", "ISTIO_DISCOVERY", "TFY_ISTIO_INGRESS", "AWS_LOAD_BALANCER_CONTROLLER", "CERT_MANAGER", "KARPENTER", "KARPENTER_CONFIG", "PROMETHEUS", "METRICS_SERVER", "KUBECOST", "KEDA", "AWS_EFS_CSI_DRIVER", "AWS_EBS_CSI_DRIVER", "TFY_GPU_OPERATOR", "TFY_INFERENTIA_OPERATOR", "ELASTI", "TFY_WORKFLOW_PROPELLER", "GRAFANA", "TRUEFOUNDRY", "TFY_PROMETHEUS_CONFIG", "SPARK_OPERATOR", "TFY_LOGS", "TFY_CERT_MANAGER_CONFIG"]); +export const AddonComponentName: core.serialization.Schema< + serializers.AddonComponentName.Raw, + TrueFoundry.AddonComponentName +> = core.serialization.enum_([ + "ARGOCD", + "ARGO_ROLLOUT", + "ARGO_WORKFLOW", + "TFY_AGENT", + "ISTIO_BASE", + "ISTIO_DISCOVERY", + "TFY_ISTIO_INGRESS", + "AWS_LOAD_BALANCER_CONTROLLER", + "CERT_MANAGER", + "KARPENTER", + "KARPENTER_CONFIG", + "PROMETHEUS", + "METRICS_SERVER", + "KUBECOST", + "KEDA", + "AWS_EFS_CSI_DRIVER", + "AWS_EBS_CSI_DRIVER", + "TFY_GPU_OPERATOR", + "TFY_INFERENTIA_OPERATOR", + "ELASTI", + "TFY_WORKFLOW_PROPELLER", + "GRAFANA", + "TRUEFOUNDRY", + "TFY_PROMETHEUS_CONFIG", + "SPARK_OPERATOR", + "TFY_LOGS", + "TFY_CERT_MANAGER_CONFIG", +]); export declare namespace AddonComponentName { - export type Raw = "ARGOCD" | "ARGO_ROLLOUT" | "ARGO_WORKFLOW" | "TFY_AGENT" | "ISTIO_BASE" | "ISTIO_DISCOVERY" | "TFY_ISTIO_INGRESS" | "AWS_LOAD_BALANCER_CONTROLLER" | "CERT_MANAGER" | "KARPENTER" | "KARPENTER_CONFIG" | "PROMETHEUS" | "METRICS_SERVER" | "KUBECOST" | "KEDA" | "AWS_EFS_CSI_DRIVER" | "AWS_EBS_CSI_DRIVER" | "TFY_GPU_OPERATOR" | "TFY_INFERENTIA_OPERATOR" | "ELASTI" | "TFY_WORKFLOW_PROPELLER" | "GRAFANA" | "TRUEFOUNDRY" | "TFY_PROMETHEUS_CONFIG" | "SPARK_OPERATOR" | "TFY_LOGS" | "TFY_CERT_MANAGER_CONFIG"; + export type Raw = + | "ARGOCD" + | "ARGO_ROLLOUT" + | "ARGO_WORKFLOW" + | "TFY_AGENT" + | "ISTIO_BASE" + | "ISTIO_DISCOVERY" + | "TFY_ISTIO_INGRESS" + | "AWS_LOAD_BALANCER_CONTROLLER" + | "CERT_MANAGER" + | "KARPENTER" + | "KARPENTER_CONFIG" + | "PROMETHEUS" + | "METRICS_SERVER" + | "KUBECOST" + | "KEDA" + | "AWS_EFS_CSI_DRIVER" + | "AWS_EBS_CSI_DRIVER" + | "TFY_GPU_OPERATOR" + | "TFY_INFERENTIA_OPERATOR" + | "ELASTI" + | "TFY_WORKFLOW_PROPELLER" + | "GRAFANA" + | "TRUEFOUNDRY" + | "TFY_PROMETHEUS_CONFIG" + | "SPARK_OPERATOR" + | "TFY_LOGS" + | "TFY_CERT_MANAGER_CONFIG"; } diff --git a/src/serialization/types/AddonComponentStatus.ts b/src/serialization/types/AddonComponentStatus.ts index 363f971c..21cc9c87 100644 --- a/src/serialization/types/AddonComponentStatus.ts +++ b/src/serialization/types/AddonComponentStatus.ts @@ -1,19 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AddonComponentStatus: core.serialization.ObjectSchema = core.serialization.object({ - "healthStatus": core.serialization.string().optional(), - "syncStatus": core.serialization.string().optional(), - "installed": core.serialization.boolean() - }); +export const AddonComponentStatus: core.serialization.ObjectSchema< + serializers.AddonComponentStatus.Raw, + TrueFoundry.AddonComponentStatus +> = core.serialization.object({ + healthStatus: core.serialization.string().optionalNullable(), + syncStatus: core.serialization.string().optionalNullable(), + installed: core.serialization.boolean(), +}); export declare namespace AddonComponentStatus { export interface Raw { - healthStatus?: string | null; - syncStatus?: string | null; + healthStatus?: (string | null | undefined) | null; + syncStatus?: (string | null | undefined) | null; installed: boolean; } } diff --git a/src/serialization/types/Agent.ts b/src/serialization/types/Agent.ts index 45478703..c9cc0ba8 100644 --- a/src/serialization/types/Agent.ts +++ b/src/serialization/types/Agent.ts @@ -1,35 +1,42 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AgentVersion } from "./AgentVersion.js"; import { Subject } from "./Subject.js"; -export const Agent: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string().optional(), - "name": core.serialization.string(), - "fqn": core.serialization.string(), - "tenantName": core.serialization.string(), - "accountId": core.serialization.string(), - "latestVersion": core.serialization.number(), - "type": core.serialization.string(), - "latestVersionDetails": AgentVersion.optional(), - "createdBySubject": Subject, - "createdBy": core.serialization.string().optional() +export const Agent: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string().optionalNullable(), + name: core.serialization.string(), + fqn: core.serialization.string(), + tenantName: core.serialization.string(), + accountId: core.serialization.string(), + latestVersion: core.serialization.number(), + type: core.serialization.string(), + latestVersionDetails: AgentVersion.optionalNullable(), + createdBySubject: Subject, + manifest: core.serialization + .record(core.serialization.string(), core.serialization.unknown()) + .optionalNullable(), + agentIdentityId: core.serialization.string().optionalNullable(), + createdBy: core.serialization.string().optionalNullable(), }); export declare namespace Agent { export interface Raw { - id?: string | null; + id?: (string | null | undefined) | null; name: string; fqn: string; tenantName: string; accountId: string; latestVersion: number; type: string; - latestVersionDetails?: AgentVersion.Raw | null; + latestVersionDetails?: (AgentVersion.Raw | null | undefined) | null; createdBySubject: Subject.Raw; - createdBy?: string | null; + manifest?: (Record | null | undefined) | null; + agentIdentityId?: (string | null | undefined) | null; + createdBy?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/AgentChannel.ts b/src/serialization/types/AgentChannel.ts new file mode 100644 index 00000000..cb4437a7 --- /dev/null +++ b/src/serialization/types/AgentChannel.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { Subject } from "./Subject.js"; + +export const AgentChannel: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string(), + manifest: core.serialization.record(core.serialization.string(), core.serialization.unknown()), + createdBySubject: Subject, + createdAt: core.serialization.date().optionalNullable(), + updatedAt: core.serialization.date().optionalNullable(), + }); + +export declare namespace AgentChannel { + export interface Raw { + id: string; + manifest: Record; + createdBySubject: Subject.Raw; + createdAt?: (string | null | undefined) | null; + updatedAt?: (string | null | undefined) | null; + } +} diff --git a/src/serialization/types/AgentChannelAgent.ts b/src/serialization/types/AgentChannelAgent.ts new file mode 100644 index 00000000..18c2c546 --- /dev/null +++ b/src/serialization/types/AgentChannelAgent.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentChannelAgent: core.serialization.ObjectSchema< + serializers.AgentChannelAgent.Raw, + TrueFoundry.AgentChannelAgent +> = core.serialization.object({ + name: core.serialization.string(), +}); + +export declare namespace AgentChannelAgent { + export interface Raw { + name: string; + } +} diff --git a/src/serialization/types/AgentChannelConfig.ts b/src/serialization/types/AgentChannelConfig.ts new file mode 100644 index 00000000..df3a0a52 --- /dev/null +++ b/src/serialization/types/AgentChannelConfig.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentChannelSlackConfig } from "./AgentChannelSlackConfig.js"; + +export const AgentChannelConfig: core.serialization.ObjectSchema< + serializers.AgentChannelConfig.Raw, + TrueFoundry.AgentChannelConfig +> = AgentChannelSlackConfig; + +export declare namespace AgentChannelConfig { + export type Raw = AgentChannelSlackConfig.Raw; +} diff --git a/src/serialization/types/AgentChannelManifest.ts b/src/serialization/types/AgentChannelManifest.ts new file mode 100644 index 00000000..d64f26b9 --- /dev/null +++ b/src/serialization/types/AgentChannelManifest.ts @@ -0,0 +1,26 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentChannelAgent } from "./AgentChannelAgent.js"; +import { AgentChannelConfig } from "./AgentChannelConfig.js"; + +export const AgentChannelManifest: core.serialization.ObjectSchema< + serializers.AgentChannelManifest.Raw, + TrueFoundry.AgentChannelManifest +> = core.serialization.object({ + type: core.serialization.stringLiteral("agent-channel"), + name: core.serialization.string(), + agent: AgentChannelAgent, + channel: AgentChannelConfig, +}); + +export declare namespace AgentChannelManifest { + export interface Raw { + type: "agent-channel"; + name: string; + agent: AgentChannelAgent.Raw; + channel: AgentChannelConfig.Raw; + } +} diff --git a/src/serialization/types/AgentChannelSlackAuth.ts b/src/serialization/types/AgentChannelSlackAuth.ts new file mode 100644 index 00000000..8eb14684 --- /dev/null +++ b/src/serialization/types/AgentChannelSlackAuth.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentChannelSlackBotTokenAuth } from "./AgentChannelSlackBotTokenAuth.js"; + +export const AgentChannelSlackAuth: core.serialization.ObjectSchema< + serializers.AgentChannelSlackAuth.Raw, + TrueFoundry.AgentChannelSlackAuth +> = AgentChannelSlackBotTokenAuth; + +export declare namespace AgentChannelSlackAuth { + export type Raw = AgentChannelSlackBotTokenAuth.Raw; +} diff --git a/src/serialization/types/AgentChannelSlackBotTokenAuth.ts b/src/serialization/types/AgentChannelSlackBotTokenAuth.ts new file mode 100644 index 00000000..47d76190 --- /dev/null +++ b/src/serialization/types/AgentChannelSlackBotTokenAuth.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AgentChannelSlackBotTokenAuth: core.serialization.ObjectSchema< + serializers.AgentChannelSlackBotTokenAuth.Raw, + TrueFoundry.AgentChannelSlackBotTokenAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("bot-token"), + botToken: core.serialization.property("bot_token", core.serialization.string()), +}); + +export declare namespace AgentChannelSlackBotTokenAuth { + export interface Raw { + type: "bot-token"; + bot_token: string; + } +} diff --git a/src/serialization/types/AgentChannelSlackConfig.ts b/src/serialization/types/AgentChannelSlackConfig.ts new file mode 100644 index 00000000..ac27c918 --- /dev/null +++ b/src/serialization/types/AgentChannelSlackConfig.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { AgentChannelSlackAuth } from "./AgentChannelSlackAuth.js"; + +export const AgentChannelSlackConfig: core.serialization.ObjectSchema< + serializers.AgentChannelSlackConfig.Raw, + TrueFoundry.AgentChannelSlackConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("slack"), + appId: core.serialization.property("app_id", core.serialization.string()), + signingSecret: core.serialization.property("signing_secret", core.serialization.string()), + auth: AgentChannelSlackAuth, +}); + +export declare namespace AgentChannelSlackConfig { + export interface Raw { + type: "slack"; + app_id: string; + signing_secret: string; + auth: AgentChannelSlackAuth.Raw; + } +} diff --git a/src/serialization/types/AgentFramework.ts b/src/serialization/types/AgentFramework.ts index 24eab9f4..02282d83 100644 --- a/src/serialization/types/AgentFramework.ts +++ b/src/serialization/types/AgentFramework.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { A2AFramework } from "./A2AFramework.js"; import { CustomFramework } from "./CustomFramework.js"; -export const AgentFramework: core.serialization.Schema = core.serialization.undiscriminatedUnion([A2AFramework, CustomFramework]); +export const AgentFramework: core.serialization.Schema = + core.serialization.undiscriminatedUnion([A2AFramework, CustomFramework]); export declare namespace AgentFramework { export type Raw = A2AFramework.Raw | CustomFramework.Raw; diff --git a/src/serialization/types/AgentIdentity.ts b/src/serialization/types/AgentIdentity.ts new file mode 100644 index 00000000..ed4ff03f --- /dev/null +++ b/src/serialization/types/AgentIdentity.ts @@ -0,0 +1,29 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { Subject } from "./Subject.js"; + +export const AgentIdentity: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string().optionalNullable(), + tenantName: core.serialization.string(), + manifest: core.serialization.record(core.serialization.string(), core.serialization.unknown()), + createdBySubject: Subject, + accountId: core.serialization.string(), + createdAt: core.serialization.date(), + updatedAt: core.serialization.date(), + }); + +export declare namespace AgentIdentity { + export interface Raw { + id?: (string | null | undefined) | null; + tenantName: string; + manifest: Record; + createdBySubject: Subject.Raw; + accountId: string; + createdAt: string; + updatedAt: string; + } +} diff --git a/src/serialization/types/AgentIdentityAutoRotate.ts b/src/serialization/types/AgentIdentityAutoRotate.ts index ac70dbd1..6513c70a 100644 --- a/src/serialization/types/AgentIdentityAutoRotate.ts +++ b/src/serialization/types/AgentIdentityAutoRotate.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AgentIdentityAutoRotate: core.serialization.ObjectSchema = core.serialization.object({ - "autoRotateInterval": core.serialization.property("auto_rotate_interval", core.serialization.number()), - "gracePeriod": core.serialization.property("grace_period", core.serialization.number()) - }); +export const AgentIdentityAutoRotate: core.serialization.ObjectSchema< + serializers.AgentIdentityAutoRotate.Raw, + TrueFoundry.AgentIdentityAutoRotate +> = core.serialization.object({ + autoRotateInterval: core.serialization.property("auto_rotate_interval", core.serialization.number()), + gracePeriod: core.serialization.property("grace_period", core.serialization.number()), +}); export declare namespace AgentIdentityAutoRotate { export interface Raw { diff --git a/src/serialization/types/AgentIdentityConfig.ts b/src/serialization/types/AgentIdentityConfig.ts index 49024c5b..f7b6d046 100644 --- a/src/serialization/types/AgentIdentityConfig.ts +++ b/src/serialization/types/AgentIdentityConfig.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { IdentityProviderBackedIdentity } from "./IdentityProviderBackedIdentity.js"; import { TruefoundryBackedIdentity } from "./TruefoundryBackedIdentity.js"; -export const AgentIdentityConfig: core.serialization.Schema = core.serialization.undiscriminatedUnion([TruefoundryBackedIdentity, IdentityProviderBackedIdentity]); +export const AgentIdentityConfig: core.serialization.Schema< + serializers.AgentIdentityConfig.Raw, + TrueFoundry.AgentIdentityConfig +> = core.serialization.undiscriminatedUnion([TruefoundryBackedIdentity, IdentityProviderBackedIdentity]); export declare namespace AgentIdentityConfig { export type Raw = TruefoundryBackedIdentity.Raw | IdentityProviderBackedIdentity.Raw; diff --git a/src/serialization/types/AgentIdentityManifest.ts b/src/serialization/types/AgentIdentityManifest.ts index c9a128ca..8ab7896b 100644 --- a/src/serialization/types/AgentIdentityManifest.ts +++ b/src/serialization/types/AgentIdentityManifest.ts @@ -1,18 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AgentIdentityConfig } from "./AgentIdentityConfig.js"; import { AgentIdentityOwnedBy } from "./AgentIdentityOwnedBy.js"; -export const AgentIdentityManifest: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "type": core.serialization.stringLiteral("agent-identity"), - "identity": AgentIdentityConfig, - "tags": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - "ownedBy": AgentIdentityOwnedBy - }); +export const AgentIdentityManifest: core.serialization.ObjectSchema< + serializers.AgentIdentityManifest.Raw, + TrueFoundry.AgentIdentityManifest +> = core.serialization.object({ + name: core.serialization.string(), + type: core.serialization.stringLiteral("agent-identity"), + identity: AgentIdentityConfig, + tags: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + ownedBy: AgentIdentityOwnedBy.optional(), +}); export declare namespace AgentIdentityManifest { export interface Raw { @@ -20,6 +23,6 @@ export declare namespace AgentIdentityManifest { type: "agent-identity"; identity: AgentIdentityConfig.Raw; tags?: Record | null; - ownedBy: AgentIdentityOwnedBy.Raw; + ownedBy?: AgentIdentityOwnedBy.Raw | null; } } diff --git a/src/serialization/types/AgentIdentityOwnedBy.ts b/src/serialization/types/AgentIdentityOwnedBy.ts index 21f21014..620d9a17 100644 --- a/src/serialization/types/AgentIdentityOwnedBy.ts +++ b/src/serialization/types/AgentIdentityOwnedBy.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AgentIdentityOwnedBy: core.serialization.ObjectSchema = core.serialization.object({ - "account": core.serialization.string().optional(), - "team": core.serialization.string() - }); +export const AgentIdentityOwnedBy: core.serialization.ObjectSchema< + serializers.AgentIdentityOwnedBy.Raw, + TrueFoundry.AgentIdentityOwnedBy +> = core.serialization.object({ + account: core.serialization.string().optional(), + team: core.serialization.string(), +}); export declare namespace AgentIdentityOwnedBy { export interface Raw { diff --git a/src/serialization/types/AgentIdentityProviderMapping.ts b/src/serialization/types/AgentIdentityProviderMapping.ts index 6c49a3ba..68e272cf 100644 --- a/src/serialization/types/AgentIdentityProviderMapping.ts +++ b/src/serialization/types/AgentIdentityProviderMapping.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AgentIdentityProviderMapping: core.serialization.ObjectSchema = core.serialization.object({ - "identityProvider": core.serialization.property("identity_provider", core.serialization.string()), - "value": core.serialization.string() - }); +export const AgentIdentityProviderMapping: core.serialization.ObjectSchema< + serializers.AgentIdentityProviderMapping.Raw, + TrueFoundry.AgentIdentityProviderMapping +> = core.serialization.object({ + identityProvider: core.serialization.property("identity_provider", core.serialization.string()), + value: core.serialization.string(), +}); export declare namespace AgentIdentityProviderMapping { export interface Raw { diff --git a/src/serialization/types/AgentIdentitySecretStoreConfig.ts b/src/serialization/types/AgentIdentitySecretStoreConfig.ts index c6f51924..0c0215bc 100644 --- a/src/serialization/types/AgentIdentitySecretStoreConfig.ts +++ b/src/serialization/types/AgentIdentitySecretStoreConfig.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AgentIdentitySecretStoreConfig: core.serialization.ObjectSchema = core.serialization.object({ - "integrationFqn": core.serialization.property("integration_fqn", core.serialization.string()), - "secretPath": core.serialization.property("secret_path", core.serialization.string()) - }); +export const AgentIdentitySecretStoreConfig: core.serialization.ObjectSchema< + serializers.AgentIdentitySecretStoreConfig.Raw, + TrueFoundry.AgentIdentitySecretStoreConfig +> = core.serialization.object({ + integrationFqn: core.serialization.property("integration_fqn", core.serialization.string()), + secretPath: core.serialization.property("secret_path", core.serialization.string()), +}); export declare namespace AgentIdentitySecretStoreConfig { export interface Raw { diff --git a/src/serialization/types/AgentManifest.ts b/src/serialization/types/AgentManifest.ts index aab624ef..c0903882 100644 --- a/src/serialization/types/AgentManifest.ts +++ b/src/serialization/types/AgentManifest.ts @@ -1,13 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { LegacyAgentManifest } from "./LegacyAgentManifest.js"; import { RemoteAgent } from "./RemoteAgent.js"; import { TrueFoundryAgentManifest } from "./TrueFoundryAgentManifest.js"; -export const AgentManifest: core.serialization.Schema = core.serialization.undiscriminatedUnion([TrueFoundryAgentManifest, RemoteAgent, LegacyAgentManifest]); +export const AgentManifest: core.serialization.Schema = + core.serialization.undiscriminatedUnion([TrueFoundryAgentManifest, RemoteAgent, LegacyAgentManifest]); export declare namespace AgentManifest { export type Raw = TrueFoundryAgentManifest.Raw | RemoteAgent.Raw | LegacyAgentManifest.Raw; diff --git a/src/serialization/types/AgentSkill.ts b/src/serialization/types/AgentSkill.ts index 3ffd0844..efefeb73 100644 --- a/src/serialization/types/AgentSkill.ts +++ b/src/serialization/types/AgentSkill.ts @@ -1,21 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AgentSkillVersion } from "./AgentSkillVersion.js"; import { Subject } from "./Subject.js"; -export const AgentSkill: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string(), - "mlRepoId": core.serialization.property("ml_repo_id", core.serialization.string()), - "type": core.serialization.stringLiteral("agent-skill").optional(), - "name": core.serialization.string(), - "fqn": core.serialization.string(), - "createdBySubject": core.serialization.property("created_by_subject", Subject), - "createdAt": core.serialization.property("created_at", core.serialization.date().optional()), - "updatedAt": core.serialization.property("updated_at", core.serialization.date().optional()), - "latestVersion": core.serialization.property("latest_version", AgentSkillVersion.optional()) +export const AgentSkill: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string(), + mlRepoId: core.serialization.property("ml_repo_id", core.serialization.string()), + type: core.serialization.stringLiteral("agent-skill").optional(), + name: core.serialization.string(), + fqn: core.serialization.string(), + createdBySubject: core.serialization.property("created_by_subject", Subject), + createdAt: core.serialization.property("created_at", core.serialization.date().optionalNullable()), + updatedAt: core.serialization.property("updated_at", core.serialization.date().optionalNullable()), + latestVersion: core.serialization.property("latest_version", AgentSkillVersion.optionalNullable()), }); export declare namespace AgentSkill { @@ -26,8 +27,8 @@ export declare namespace AgentSkill { name: string; fqn: string; created_by_subject: Subject.Raw; - created_at?: string | null; - updated_at?: string | null; - latest_version?: AgentSkillVersion.Raw | null; + created_at?: (string | null | undefined) | null; + updated_at?: (string | null | undefined) | null; + latest_version?: (AgentSkillVersion.Raw | null | undefined) | null; } } diff --git a/src/serialization/types/AgentSkillManifest.ts b/src/serialization/types/AgentSkillManifest.ts index 55eb8b28..c1269532 100644 --- a/src/serialization/types/AgentSkillManifest.ts +++ b/src/serialization/types/AgentSkillManifest.ts @@ -1,15 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AgentSkillManifestSource } from "./AgentSkillManifestSource.js"; import { BaseArtifactVersion } from "./BaseArtifactVersion.js"; -export const AgentSkillManifest: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("agent-skill"), - "source": AgentSkillManifestSource - }).extend(BaseArtifactVersion); +export const AgentSkillManifest: core.serialization.ObjectSchema< + serializers.AgentSkillManifest.Raw, + TrueFoundry.AgentSkillManifest +> = core.serialization + .object({ + type: core.serialization.stringLiteral("agent-skill"), + source: AgentSkillManifestSource, + }) + .extend(BaseArtifactVersion); export declare namespace AgentSkillManifest { export interface Raw extends BaseArtifactVersion.Raw { diff --git a/src/serialization/types/AgentSkillManifestSource.ts b/src/serialization/types/AgentSkillManifestSource.ts index 7cd83547..9cc00b0a 100644 --- a/src/serialization/types/AgentSkillManifestSource.ts +++ b/src/serialization/types/AgentSkillManifestSource.ts @@ -1,13 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AgentSkillSourceBlobStorage } from "./AgentSkillSourceBlobStorage.js"; import { AgentSkillSourceInline } from "./AgentSkillSourceInline.js"; import { AgentSkillSourceLocal } from "./AgentSkillSourceLocal.js"; -export const AgentSkillManifestSource: core.serialization.Schema = core.serialization.undiscriminatedUnion([AgentSkillSourceInline, AgentSkillSourceBlobStorage, AgentSkillSourceLocal]); +export const AgentSkillManifestSource: core.serialization.Schema< + serializers.AgentSkillManifestSource.Raw, + TrueFoundry.AgentSkillManifestSource +> = core.serialization.undiscriminatedUnion([ + AgentSkillSourceInline, + AgentSkillSourceBlobStorage, + AgentSkillSourceLocal, +]); export declare namespace AgentSkillManifestSource { export type Raw = AgentSkillSourceInline.Raw | AgentSkillSourceBlobStorage.Raw | AgentSkillSourceLocal.Raw; diff --git a/src/serialization/types/AgentSkillSourceBlobStorage.ts b/src/serialization/types/AgentSkillSourceBlobStorage.ts index b43bd2fd..495130c1 100644 --- a/src/serialization/types/AgentSkillSourceBlobStorage.ts +++ b/src/serialization/types/AgentSkillSourceBlobStorage.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AgentSkillSourceBlobStorage: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("blob-storage"), - "description": core.serialization.string(), - "uri": core.serialization.string() - }); +export const AgentSkillSourceBlobStorage: core.serialization.ObjectSchema< + serializers.AgentSkillSourceBlobStorage.Raw, + TrueFoundry.AgentSkillSourceBlobStorage +> = core.serialization.object({ + type: core.serialization.stringLiteral("blob-storage"), + description: core.serialization.string(), + uri: core.serialization.string(), +}); export declare namespace AgentSkillSourceBlobStorage { export interface Raw { diff --git a/src/serialization/types/AgentSkillSourceInline.ts b/src/serialization/types/AgentSkillSourceInline.ts index 7b86503d..47aad2d8 100644 --- a/src/serialization/types/AgentSkillSourceInline.ts +++ b/src/serialization/types/AgentSkillSourceInline.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AgentSkillSourceInline: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("inline"), - "skillMd": core.serialization.property("skill_md", core.serialization.string()) - }); +export const AgentSkillSourceInline: core.serialization.ObjectSchema< + serializers.AgentSkillSourceInline.Raw, + TrueFoundry.AgentSkillSourceInline +> = core.serialization.object({ + type: core.serialization.stringLiteral("inline"), + skillMd: core.serialization.property("skill_md", core.serialization.string()), +}); export declare namespace AgentSkillSourceInline { export interface Raw { diff --git a/src/serialization/types/AgentSkillSourceLocal.ts b/src/serialization/types/AgentSkillSourceLocal.ts index b618fd66..df5dda22 100644 --- a/src/serialization/types/AgentSkillSourceLocal.ts +++ b/src/serialization/types/AgentSkillSourceLocal.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AgentSkillSourceLocal: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("local"), - "skillDir": core.serialization.property("skill_dir", core.serialization.string()) - }); +export const AgentSkillSourceLocal: core.serialization.ObjectSchema< + serializers.AgentSkillSourceLocal.Raw, + TrueFoundry.AgentSkillSourceLocal +> = core.serialization.object({ + type: core.serialization.stringLiteral("local"), + skillDir: core.serialization.property("skill_dir", core.serialization.string()), +}); export declare namespace AgentSkillSourceLocal { export interface Raw { diff --git a/src/serialization/types/AgentSkillVersion.ts b/src/serialization/types/AgentSkillVersion.ts index 32d50b36..18ec05ca 100644 --- a/src/serialization/types/AgentSkillVersion.ts +++ b/src/serialization/types/AgentSkillVersion.ts @@ -1,28 +1,34 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AgentSkillManifest } from "./AgentSkillManifest.js"; import { Subject } from "./Subject.js"; import { UsageCodeSnippet } from "./UsageCodeSnippet.js"; -export const AgentSkillVersion: core.serialization.ObjectSchema = core.serialization.object({ - "createdAt": core.serialization.property("created_at", core.serialization.date().optional()), - "updatedAt": core.serialization.property("updated_at", core.serialization.date().optional()), - "manifest": AgentSkillManifest, - "id": core.serialization.string(), - "fqn": core.serialization.string(), - "createdBySubject": core.serialization.property("created_by_subject", Subject), - "mlRepoId": core.serialization.property("ml_repo_id", core.serialization.string()), - "agentSkillId": core.serialization.property("agent_skill_id", core.serialization.string()), - "usageCodeSnippets": core.serialization.property("usage_code_snippets", core.serialization.list(UsageCodeSnippet).optional()) - }); +export const AgentSkillVersion: core.serialization.ObjectSchema< + serializers.AgentSkillVersion.Raw, + TrueFoundry.AgentSkillVersion +> = core.serialization.object({ + createdAt: core.serialization.property("created_at", core.serialization.date().optionalNullable()), + updatedAt: core.serialization.property("updated_at", core.serialization.date().optionalNullable()), + manifest: AgentSkillManifest, + id: core.serialization.string(), + fqn: core.serialization.string(), + createdBySubject: core.serialization.property("created_by_subject", Subject), + mlRepoId: core.serialization.property("ml_repo_id", core.serialization.string()), + agentSkillId: core.serialization.property("agent_skill_id", core.serialization.string()), + usageCodeSnippets: core.serialization.property( + "usage_code_snippets", + core.serialization.list(UsageCodeSnippet).optional(), + ), +}); export declare namespace AgentSkillVersion { export interface Raw { - created_at?: string | null; - updated_at?: string | null; + created_at?: (string | null | undefined) | null; + updated_at?: (string | null | undefined) | null; manifest: AgentSkillManifest.Raw; id: string; fqn: string; diff --git a/src/serialization/types/AgentSource.ts b/src/serialization/types/AgentSource.ts index 0380d1cc..81cb8f7d 100644 --- a/src/serialization/types/AgentSource.ts +++ b/src/serialization/types/AgentSource.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { HostedA2AAgent } from "./HostedA2AAgent.js"; import { PromptSource } from "./PromptSource.js"; -export const AgentSource: core.serialization.Schema = core.serialization.undiscriminatedUnion([PromptSource, HostedA2AAgent]); +export const AgentSource: core.serialization.Schema = + core.serialization.undiscriminatedUnion([PromptSource, HostedA2AAgent]); export declare namespace AgentSource { export type Raw = PromptSource.Raw | HostedA2AAgent.Raw; diff --git a/src/serialization/types/AgentVersion.ts b/src/serialization/types/AgentVersion.ts index db222a10..261f264e 100644 --- a/src/serialization/types/AgentVersion.ts +++ b/src/serialization/types/AgentVersion.ts @@ -1,30 +1,31 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AgentManifest } from "./AgentManifest.js"; import { AgentVersionMetadata } from "./AgentVersionMetadata.js"; import { Subject } from "./Subject.js"; -export const AgentVersion: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string().optional(), - "agentId": core.serialization.string(), - "fqn": core.serialization.string(), - "manifest": AgentManifest, - "version": core.serialization.number(), - "metadata": AgentVersionMetadata.optional(), - "createdBySubject": Subject.optional() +export const AgentVersion: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string().optionalNullable(), + agentId: core.serialization.string(), + fqn: core.serialization.string(), + manifest: AgentManifest, + version: core.serialization.number(), + metadata: AgentVersionMetadata.optionalNullable(), + createdBySubject: Subject.optionalNullable(), }); export declare namespace AgentVersion { export interface Raw { - id?: string | null; + id?: (string | null | undefined) | null; agentId: string; fqn: string; manifest: AgentManifest.Raw; version: number; - metadata?: AgentVersionMetadata.Raw | null; - createdBySubject?: Subject.Raw | null; + metadata?: (AgentVersionMetadata.Raw | null | undefined) | null; + createdBySubject?: (Subject.Raw | null | undefined) | null; } } diff --git a/src/serialization/types/AgentVersionMetadata.ts b/src/serialization/types/AgentVersionMetadata.ts index a2a97a73..d9a31c9c 100644 --- a/src/serialization/types/AgentVersionMetadata.ts +++ b/src/serialization/types/AgentVersionMetadata.ts @@ -1,15 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AgentVersionMetadata: core.serialization.ObjectSchema = core.serialization.object({ - "promptVariables": core.serialization.record(core.serialization.string(), core.serialization.string()).optional() - }); +export const AgentVersionMetadata: core.serialization.ObjectSchema< + serializers.AgentVersionMetadata.Raw, + TrueFoundry.AgentVersionMetadata +> = core.serialization.object({ + promptVariables: core.serialization + .record(core.serialization.string(), core.serialization.string().nullable()) + .optionalNullable(), +}); export declare namespace AgentVersionMetadata { export interface Raw { - promptVariables?: Record | null; + promptVariables?: (Record | null | undefined) | null; } } diff --git a/src/serialization/types/Ai21Integrations.ts b/src/serialization/types/Ai21Integrations.ts index f431c2bc..25e8c4c9 100644 --- a/src/serialization/types/Ai21Integrations.ts +++ b/src/serialization/types/Ai21Integrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { Ai21Model } from "./Ai21Model.js"; -export const Ai21Integrations: core.serialization.ObjectSchema = Ai21Model; +export const Ai21Integrations: core.serialization.ObjectSchema< + serializers.Ai21Integrations.Raw, + TrueFoundry.Ai21Integrations +> = Ai21Model; export declare namespace Ai21Integrations { export type Raw = Ai21Model.Raw; diff --git a/src/serialization/types/Ai21KeyAuth.ts b/src/serialization/types/Ai21KeyAuth.ts index b2a8b5c3..5e081146 100644 --- a/src/serialization/types/Ai21KeyAuth.ts +++ b/src/serialization/types/Ai21KeyAuth.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const Ai21KeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) +export const Ai21KeyAuth: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), }); export declare namespace Ai21KeyAuth { diff --git a/src/serialization/types/Ai21Model.ts b/src/serialization/types/Ai21Model.ts index 631351fa..cfed6af0 100644 --- a/src/serialization/types/Ai21Model.ts +++ b/src/serialization/types/Ai21Model.ts @@ -1,18 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const Ai21Model: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/model/ai21"), - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) +export const Ai21Model: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("integration/model/ai21"), + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace Ai21Model { diff --git a/src/serialization/types/Ai21ProviderAccount.ts b/src/serialization/types/Ai21ProviderAccount.ts index 4d155fee..35276add 100644 --- a/src/serialization/types/Ai21ProviderAccount.ts +++ b/src/serialization/types/Ai21ProviderAccount.ts @@ -1,22 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Ai21Integrations } from "./Ai21Integrations.js"; import { Ai21KeyAuth } from "./Ai21KeyAuth.js"; import { Collaborator } from "./Collaborator.js"; import { OwnedBy } from "./OwnedBy.js"; -export const Ai21ProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/ai21"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", Ai21KeyAuth), - "integrations": core.serialization.list(Ai21Integrations).optional(), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const Ai21ProviderAccount: core.serialization.ObjectSchema< + serializers.Ai21ProviderAccount.Raw, + TrueFoundry.Ai21ProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/ai21"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", Ai21KeyAuth), + integrations: core.serialization.list(Ai21Integrations).optional(), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace Ai21ProviderAccount { export interface Raw { diff --git a/src/serialization/types/AiFeaturesSettings.ts b/src/serialization/types/AiFeaturesSettings.ts index 2d8d472a..fd6bd20d 100644 --- a/src/serialization/types/AiFeaturesSettings.ts +++ b/src/serialization/types/AiFeaturesSettings.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AiFeaturesSettings: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("settings/ai-features"), - "enabled": core.serialization.boolean(), - "aiProvider": core.serialization.property("ai_provider", core.serialization.stringLiteral("truefoundry")) - }); +export const AiFeaturesSettings: core.serialization.ObjectSchema< + serializers.AiFeaturesSettings.Raw, + TrueFoundry.AiFeaturesSettings +> = core.serialization.object({ + type: core.serialization.stringLiteral("settings/ai-features"), + enabled: core.serialization.boolean(), + aiProvider: core.serialization.property("ai_provider", core.serialization.stringLiteral("truefoundry")), +}); export declare namespace AiFeaturesSettings { export interface Raw { diff --git a/src/serialization/types/AktoGuardrailConfig.ts b/src/serialization/types/AktoGuardrailConfig.ts index c5adc99a..d96081a0 100644 --- a/src/serialization/types/AktoGuardrailConfig.ts +++ b/src/serialization/types/AktoGuardrailConfig.ts @@ -1,21 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AktoGuardrailConfigConfig } from "./AktoGuardrailConfigConfig.js"; import { AktoTokenAuth } from "./AktoTokenAuth.js"; import { EnforcingStrategy } from "./EnforcingStrategy.js"; -export const AktoGuardrailConfig: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string().optional(), - "type": core.serialization.stringLiteral("integration/guardrail-config/akto"), - "authData": core.serialization.property("auth_data", AktoTokenAuth), - "operation": core.serialization.stringLiteral("validate"), - "enforcingStrategy": core.serialization.property("enforcing_strategy", EnforcingStrategy), - "config": AktoGuardrailConfigConfig - }); +export const AktoGuardrailConfig: core.serialization.ObjectSchema< + serializers.AktoGuardrailConfig.Raw, + TrueFoundry.AktoGuardrailConfig +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + type: core.serialization.stringLiteral("integration/guardrail-config/akto"), + authData: core.serialization.property("auth_data", AktoTokenAuth), + operation: core.serialization.stringLiteral("validate"), + enforcingStrategy: core.serialization.property("enforcing_strategy", EnforcingStrategy), + config: AktoGuardrailConfigConfig, +}); export declare namespace AktoGuardrailConfig { export interface Raw { diff --git a/src/serialization/types/AktoGuardrailConfigConfig.ts b/src/serialization/types/AktoGuardrailConfigConfig.ts index 86fa48f6..24f68413 100644 --- a/src/serialization/types/AktoGuardrailConfigConfig.ts +++ b/src/serialization/types/AktoGuardrailConfigConfig.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AktoGuardrailConfigConfig: core.serialization.ObjectSchema = core.serialization.object({ - "baseUrl": core.serialization.property("base_url", core.serialization.string()) - }); +export const AktoGuardrailConfigConfig: core.serialization.ObjectSchema< + serializers.AktoGuardrailConfigConfig.Raw, + TrueFoundry.AktoGuardrailConfigConfig +> = core.serialization.object({ + baseUrl: core.serialization.property("base_url", core.serialization.string()), +}); export declare namespace AktoGuardrailConfigConfig { export interface Raw { diff --git a/src/serialization/types/AktoTokenAuth.ts b/src/serialization/types/AktoTokenAuth.ts index 7383c7a6..5e6af512 100644 --- a/src/serialization/types/AktoTokenAuth.ts +++ b/src/serialization/types/AktoTokenAuth.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AktoTokenAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("token"), - "token": core.serialization.string() +export const AktoTokenAuth: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("token"), + token: core.serialization.string(), }); export declare namespace AktoTokenAuth { diff --git a/src/serialization/types/Alert.ts b/src/serialization/types/Alert.ts index 9a726eba..fe28a2f6 100644 --- a/src/serialization/types/Alert.ts +++ b/src/serialization/types/Alert.ts @@ -1,37 +1,38 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const Alert: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string().optional(), - "name": core.serialization.string(), - "timestamps": core.serialization.list(core.serialization.date()), - "startTime": core.serialization.date(), - "resolvedTime": core.serialization.date().optional(), - "applicationId": core.serialization.string().optional(), - "clusterId": core.serialization.string(), - "tenantName": core.serialization.string().optional(), - "fingerprint": core.serialization.string(), - "updatedAt": core.serialization.string().optional(), - "createdAt": core.serialization.string().optional(), - "applicationDebugInfoId": core.serialization.string().optional() +export const Alert: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string().optionalNullable(), + name: core.serialization.string(), + timestamps: core.serialization.list(core.serialization.date()), + startTime: core.serialization.date(), + resolvedTime: core.serialization.date().optionalNullable(), + applicationId: core.serialization.string().optionalNullable(), + clusterId: core.serialization.string(), + tenantName: core.serialization.string().optionalNullable(), + fingerprint: core.serialization.string(), + updatedAt: core.serialization.string().optionalNullable(), + createdAt: core.serialization.string().optionalNullable(), + applicationDebugInfoId: core.serialization.string().optionalNullable(), }); export declare namespace Alert { export interface Raw { - id?: string | null; + id?: (string | null | undefined) | null; name: string; timestamps: string[]; startTime: string; - resolvedTime?: string | null; - applicationId?: string | null; + resolvedTime?: (string | null | undefined) | null; + applicationId?: (string | null | undefined) | null; clusterId: string; - tenantName?: string | null; + tenantName?: (string | null | undefined) | null; fingerprint: string; - updatedAt?: string | null; - createdAt?: string | null; - applicationDebugInfoId?: string | null; + updatedAt?: (string | null | undefined) | null; + createdAt?: (string | null | undefined) | null; + applicationDebugInfoId?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/AlertConfig.ts b/src/serialization/types/AlertConfig.ts index 704b2adf..eefc1245 100644 --- a/src/serialization/types/AlertConfig.ts +++ b/src/serialization/types/AlertConfig.ts @@ -1,18 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AlertConfigResource } from "./AlertConfigResource.js"; import { NotificationTargetForAlertRule } from "./NotificationTargetForAlertRule.js"; import { PrometheusAlertRule } from "./PrometheusAlertRule.js"; -export const AlertConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("alert-config"), - "name": core.serialization.string(), - "resource": AlertConfigResource, - "notificationTargets": core.serialization.property("notification_targets", core.serialization.list(NotificationTargetForAlertRule)), - "rules": core.serialization.list(PrometheusAlertRule) +export const AlertConfig: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("alert-config"), + name: core.serialization.string(), + resource: AlertConfigResource, + notificationTargets: core.serialization.property( + "notification_targets", + core.serialization.list(NotificationTargetForAlertRule), + ), + rules: core.serialization.list(PrometheusAlertRule), }); export declare namespace AlertConfig { diff --git a/src/serialization/types/AlertConfigEntity.ts b/src/serialization/types/AlertConfigEntity.ts new file mode 100644 index 00000000..fdebfe5b --- /dev/null +++ b/src/serialization/types/AlertConfigEntity.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const AlertConfigEntity: core.serialization.ObjectSchema< + serializers.AlertConfigEntity.Raw, + TrueFoundry.AlertConfigEntity +> = core.serialization.object({}); + +export declare namespace AlertConfigEntity { + export type Raw = {}; +} diff --git a/src/serialization/types/AlertConfigResource.ts b/src/serialization/types/AlertConfigResource.ts index bf1b5da8..e4a1c345 100644 --- a/src/serialization/types/AlertConfigResource.ts +++ b/src/serialization/types/AlertConfigResource.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AlertConfigResourceType } from "./AlertConfigResourceType.js"; -export const AlertConfigResource: core.serialization.ObjectSchema = core.serialization.object({ - "type": AlertConfigResourceType, - "fqn": core.serialization.string() - }); +export const AlertConfigResource: core.serialization.ObjectSchema< + serializers.AlertConfigResource.Raw, + TrueFoundry.AlertConfigResource +> = core.serialization.object({ + type: AlertConfigResourceType, + fqn: core.serialization.string(), +}); export declare namespace AlertConfigResource { export interface Raw { diff --git a/src/serialization/types/AlertConfigResourceType.ts b/src/serialization/types/AlertConfigResourceType.ts index de9092f3..0f3fd59b 100644 --- a/src/serialization/types/AlertConfigResourceType.ts +++ b/src/serialization/types/AlertConfigResourceType.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AlertConfigResourceType: core.serialization.Schema = core.serialization.enum_(["application", "cluster"]); +export const AlertConfigResourceType: core.serialization.Schema< + serializers.AlertConfigResourceType.Raw, + TrueFoundry.AlertConfigResourceType +> = core.serialization.enum_(["application", "cluster"]); export declare namespace AlertConfigResourceType { export type Raw = "application" | "cluster"; diff --git a/src/serialization/types/AlertSeverity.ts b/src/serialization/types/AlertSeverity.ts index ca052f39..3eb0b646 100644 --- a/src/serialization/types/AlertSeverity.ts +++ b/src/serialization/types/AlertSeverity.ts @@ -1,10 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AlertSeverity: core.serialization.Schema = core.serialization.enum_(["warning", "critical"]); +export const AlertSeverity: core.serialization.Schema = + core.serialization.enum_(["warning", "critical"]); export declare namespace AlertSeverity { export type Raw = "warning" | "critical"; diff --git a/src/serialization/types/AlertStatus.ts b/src/serialization/types/AlertStatus.ts index 799fac95..5ef30d7c 100644 --- a/src/serialization/types/AlertStatus.ts +++ b/src/serialization/types/AlertStatus.ts @@ -1,10 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AlertStatus: core.serialization.Schema = core.serialization.enum_(["firing", "resolved"]); +export const AlertStatus: core.serialization.Schema = + core.serialization.enum_(["firing", "resolved"]); export declare namespace AlertStatus { export type Raw = "firing" | "resolved"; diff --git a/src/serialization/types/AllDataAccessRule.ts b/src/serialization/types/AllDataAccessRule.ts index d018f33a..39ba6a4b 100644 --- a/src/serialization/types/AllDataAccessRule.ts +++ b/src/serialization/types/AllDataAccessRule.ts @@ -1,15 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AllDataAccessRuleFiltersItem } from "./AllDataAccessRuleFiltersItem.js"; import { DataAccessRuleBase } from "./DataAccessRuleBase.js"; -export const AllDataAccessRule: core.serialization.ObjectSchema = core.serialization.object({ - "scope": core.serialization.stringLiteral("all_data"), - "filters": core.serialization.list(AllDataAccessRuleFiltersItem).optional() - }).extend(DataAccessRuleBase); +export const AllDataAccessRule: core.serialization.ObjectSchema< + serializers.AllDataAccessRule.Raw, + TrueFoundry.AllDataAccessRule +> = core.serialization + .object({ + scope: core.serialization.stringLiteral("all_data"), + filters: core.serialization.list(AllDataAccessRuleFiltersItem).optional(), + }) + .extend(DataAccessRuleBase); export declare namespace AllDataAccessRule { export interface Raw extends DataAccessRuleBase.Raw { diff --git a/src/serialization/types/AllDataAccessRuleFiltersItem.ts b/src/serialization/types/AllDataAccessRuleFiltersItem.ts index cd2ddcfb..15ca2ac3 100644 --- a/src/serialization/types/AllDataAccessRuleFiltersItem.ts +++ b/src/serialization/types/AllDataAccessRuleFiltersItem.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GatewayDataCreatedByFilter } from "./GatewayDataCreatedByFilter.js"; import { GatewayDataMetadataFilter } from "./GatewayDataMetadataFilter.js"; -export const AllDataAccessRuleFiltersItem: core.serialization.Schema = core.serialization.undiscriminatedUnion([GatewayDataMetadataFilter, GatewayDataCreatedByFilter]); +export const AllDataAccessRuleFiltersItem: core.serialization.Schema< + serializers.AllDataAccessRuleFiltersItem.Raw, + TrueFoundry.AllDataAccessRuleFiltersItem +> = core.serialization.undiscriminatedUnion([GatewayDataMetadataFilter, GatewayDataCreatedByFilter]); export declare namespace AllDataAccessRuleFiltersItem { export type Raw = GatewayDataMetadataFilter.Raw | GatewayDataCreatedByFilter.Raw; diff --git a/src/serialization/types/AllowedValuesConstraint.ts b/src/serialization/types/AllowedValuesConstraint.ts index 365f2a0d..41baf2e1 100644 --- a/src/serialization/types/AllowedValuesConstraint.ts +++ b/src/serialization/types/AllowedValuesConstraint.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AllowedValuesConstraint: core.serialization.ObjectSchema = core.serialization.object({ - "constraint": core.serialization.stringLiteral("allowed_values"), - "allowedValues": core.serialization.property("allowed_values", core.serialization.list(core.serialization.string())) - }); +export const AllowedValuesConstraint: core.serialization.ObjectSchema< + serializers.AllowedValuesConstraint.Raw, + TrueFoundry.AllowedValuesConstraint +> = core.serialization.object({ + constraint: core.serialization.stringLiteral("allowed_values"), + allowedValues: core.serialization.property("allowed_values", core.serialization.list(core.serialization.string())), +}); export declare namespace AllowedValuesConstraint { export interface Raw { diff --git a/src/serialization/types/AmqpInputConfig.ts b/src/serialization/types/AmqpInputConfig.ts index 727765e3..51050174 100644 --- a/src/serialization/types/AmqpInputConfig.ts +++ b/src/serialization/types/AmqpInputConfig.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AmqpInputConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("amqp"), - "url": core.serialization.string(), - "queueName": core.serialization.property("queue_name", core.serialization.string()), - "waitTimeSeconds": core.serialization.property("wait_time_seconds", core.serialization.number()) - }); +export const AmqpInputConfig: core.serialization.ObjectSchema< + serializers.AmqpInputConfig.Raw, + TrueFoundry.AmqpInputConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("amqp"), + url: core.serialization.string(), + queueName: core.serialization.property("queue_name", core.serialization.string()), + waitTimeSeconds: core.serialization.property("wait_time_seconds", core.serialization.number()), +}); export declare namespace AmqpInputConfig { export interface Raw { diff --git a/src/serialization/types/AmqpMetricConfig.ts b/src/serialization/types/AmqpMetricConfig.ts index 2b42cfee..6eae0cce 100644 --- a/src/serialization/types/AmqpMetricConfig.ts +++ b/src/serialization/types/AmqpMetricConfig.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AmqpMetricConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("amqp"), - "queueLength": core.serialization.property("queue_length", core.serialization.number()) - }); +export const AmqpMetricConfig: core.serialization.ObjectSchema< + serializers.AmqpMetricConfig.Raw, + TrueFoundry.AmqpMetricConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("amqp"), + queueLength: core.serialization.property("queue_length", core.serialization.number()), +}); export declare namespace AmqpMetricConfig { export interface Raw { diff --git a/src/serialization/types/AmqpOutputConfig.ts b/src/serialization/types/AmqpOutputConfig.ts index c4cfc950..cb948e84 100644 --- a/src/serialization/types/AmqpOutputConfig.ts +++ b/src/serialization/types/AmqpOutputConfig.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AmqpOutputConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("amqp"), - "url": core.serialization.string(), - "routingKey": core.serialization.property("routing_key", core.serialization.string()), - "exchangeName": core.serialization.property("exchange_name", core.serialization.string().optional()) - }); +export const AmqpOutputConfig: core.serialization.ObjectSchema< + serializers.AmqpOutputConfig.Raw, + TrueFoundry.AmqpOutputConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("amqp"), + url: core.serialization.string(), + routingKey: core.serialization.property("routing_key", core.serialization.string()), + exchangeName: core.serialization.property("exchange_name", core.serialization.string().optional()), +}); export declare namespace AmqpOutputConfig { export interface Raw { diff --git a/src/serialization/types/AnthropicIntegrations.ts b/src/serialization/types/AnthropicIntegrations.ts index af211be8..e714600c 100644 --- a/src/serialization/types/AnthropicIntegrations.ts +++ b/src/serialization/types/AnthropicIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { AnthropicModel } from "./AnthropicModel.js"; -export const AnthropicIntegrations: core.serialization.ObjectSchema = AnthropicModel; +export const AnthropicIntegrations: core.serialization.ObjectSchema< + serializers.AnthropicIntegrations.Raw, + TrueFoundry.AnthropicIntegrations +> = AnthropicModel; export declare namespace AnthropicIntegrations { export type Raw = AnthropicModel.Raw; diff --git a/src/serialization/types/AnthropicKeyAuth.ts b/src/serialization/types/AnthropicKeyAuth.ts index 1880d07d..8d7aeee4 100644 --- a/src/serialization/types/AnthropicKeyAuth.ts +++ b/src/serialization/types/AnthropicKeyAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AnthropicKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) - }); +export const AnthropicKeyAuth: core.serialization.ObjectSchema< + serializers.AnthropicKeyAuth.Raw, + TrueFoundry.AnthropicKeyAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), +}); export declare namespace AnthropicKeyAuth { export interface Raw { diff --git a/src/serialization/types/AnthropicModel.ts b/src/serialization/types/AnthropicModel.ts index f1c609a9..7997e4f9 100644 --- a/src/serialization/types/AnthropicModel.ts +++ b/src/serialization/types/AnthropicModel.ts @@ -1,19 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const AnthropicModel: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "type": core.serialization.stringLiteral("integration/model/anthropic"), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const AnthropicModel: core.serialization.ObjectSchema< + serializers.AnthropicModel.Raw, + TrueFoundry.AnthropicModel +> = core.serialization.object({ + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + type: core.serialization.stringLiteral("integration/model/anthropic"), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace AnthropicModel { export interface Raw { diff --git a/src/serialization/types/AnthropicProviderAccount.ts b/src/serialization/types/AnthropicProviderAccount.ts index 840d0acb..5c2358bf 100644 --- a/src/serialization/types/AnthropicProviderAccount.ts +++ b/src/serialization/types/AnthropicProviderAccount.ts @@ -1,28 +1,33 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AnthropicIntegrations } from "./AnthropicIntegrations.js"; import { AnthropicKeyAuth } from "./AnthropicKeyAuth.js"; import { Collaborator } from "./Collaborator.js"; import { OwnedBy } from "./OwnedBy.js"; -export const AnthropicProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/anthropic"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", AnthropicKeyAuth.optional()), - "integrations": core.serialization.list(AnthropicIntegrations).optional(), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const AnthropicProviderAccount: core.serialization.ObjectSchema< + serializers.AnthropicProviderAccount.Raw, + TrueFoundry.AnthropicProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/anthropic"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", AnthropicKeyAuth.optional()), + baseUrl: core.serialization.property("base_url", core.serialization.string().optional()), + integrations: core.serialization.list(AnthropicIntegrations).optional(), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace AnthropicProviderAccount { export interface Raw { type: "provider-account/anthropic"; name: string; auth_data?: AnthropicKeyAuth.Raw | null; + base_url?: string | null; integrations?: AnthropicIntegrations.Raw[] | null; collaborators?: Collaborator.Raw[] | null; ownedBy?: OwnedBy.Raw | null; diff --git a/src/serialization/types/Application.ts b/src/serialization/types/Application.ts index 3672d9a1..e033cbca 100644 --- a/src/serialization/types/Application.ts +++ b/src/serialization/types/Application.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; import * as serializers from "../index.js"; import { Alert } from "./Alert.js"; @@ -12,60 +12,65 @@ import { Deployment } from "./Deployment.js"; import { Recommendation } from "./Recommendation.js"; import { Subject } from "./Subject.js"; -export const Application: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string().optional(), - "fqn": core.serialization.string().optional(), - "name": core.serialization.string().optional(), - "type": ApplicationType.optional(), - "createdBySubject": Subject, - "tenantName": core.serialization.string().optional(), - "metadata": ApplicationMetadata.optional(), - "lifecycleStage": ApplicationLifecycleStage, - "workspaceId": core.serialization.string().optional(), - "lastVersion": core.serialization.number().optional(), - "activeVersion": core.serialization.number().optional(), - "applicationSetId": core.serialization.string().optional(), - "createdAt": core.serialization.date().optional(), - "updatedAt": core.serialization.date().optional(), - "recommendations": core.serialization.list(Recommendation).optional(), - "alerts": core.serialization.list(Alert).optional(), - "alertsSummary": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - "applicationDebugInfos": core.serialization.list(core.serialization.lazyObject(() => serializers.ApplicationDebugInfo)).optional(), - "potentialProblems": core.serialization.list(ApplicationProblem).optional(), - "autopilot": core.serialization.record(core.serialization.string(), core.serialization.unknown()), - "workspaceFqn": core.serialization.string().optional(), - "createdBy": core.serialization.string().optional(), - "deployment": Deployment.optional(), - "activeDeploymentId": core.serialization.string().optional(), - "lastDeploymentId": core.serialization.string().optional() +export const Application: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string().optionalNullable(), + fqn: core.serialization.string().optionalNullable(), + name: core.serialization.string().optionalNullable(), + type: ApplicationType.optionalNullable(), + createdBySubject: Subject, + tenantName: core.serialization.string().optionalNullable(), + metadata: ApplicationMetadata.optionalNullable(), + lifecycleStage: ApplicationLifecycleStage, + workspaceId: core.serialization.string().optionalNullable(), + lastVersion: core.serialization.number().optionalNullable(), + activeVersion: core.serialization.number().optionalNullable(), + applicationSetId: core.serialization.string().optionalNullable(), + createdAt: core.serialization.date().optionalNullable(), + updatedAt: core.serialization.date().optionalNullable(), + recommendations: core.serialization.list(Recommendation).optionalNullable(), + alerts: core.serialization.list(Alert).optionalNullable(), + alertsSummary: core.serialization + .record(core.serialization.string(), core.serialization.unknown()) + .optionalNullable(), + applicationDebugInfos: core.serialization + .list(core.serialization.lazyObject(() => serializers.ApplicationDebugInfo)) + .optionalNullable(), + potentialProblems: core.serialization.list(ApplicationProblem).optionalNullable(), + autopilot: core.serialization.record(core.serialization.string(), core.serialization.unknown()), + workspaceFqn: core.serialization.string().optionalNullable(), + createdBy: core.serialization.string().optionalNullable(), + deployment: Deployment.optionalNullable(), + activeDeploymentId: core.serialization.string().optionalNullable(), + lastDeploymentId: core.serialization.string().optionalNullable(), }); export declare namespace Application { export interface Raw { - id?: string | null; - fqn?: string | null; - name?: string | null; - type?: ApplicationType.Raw | null; + id?: (string | null | undefined) | null; + fqn?: (string | null | undefined) | null; + name?: (string | null | undefined) | null; + type?: (ApplicationType.Raw | null | undefined) | null; createdBySubject: Subject.Raw; - tenantName?: string | null; - metadata?: ApplicationMetadata.Raw | null; + tenantName?: (string | null | undefined) | null; + metadata?: (ApplicationMetadata.Raw | null | undefined) | null; lifecycleStage: ApplicationLifecycleStage.Raw; - workspaceId?: string | null; - lastVersion?: number | null; - activeVersion?: number | null; - applicationSetId?: string | null; - createdAt?: string | null; - updatedAt?: string | null; - recommendations?: Recommendation.Raw[] | null; - alerts?: Alert.Raw[] | null; - alertsSummary?: Record | null; - applicationDebugInfos?: serializers.ApplicationDebugInfo.Raw[] | null; - potentialProblems?: ApplicationProblem.Raw[] | null; + workspaceId?: (string | null | undefined) | null; + lastVersion?: (number | null | undefined) | null; + activeVersion?: (number | null | undefined) | null; + applicationSetId?: (string | null | undefined) | null; + createdAt?: (string | null | undefined) | null; + updatedAt?: (string | null | undefined) | null; + recommendations?: (Recommendation.Raw[] | null | undefined) | null; + alerts?: (Alert.Raw[] | null | undefined) | null; + alertsSummary?: (Record | null | undefined) | null; + applicationDebugInfos?: (serializers.ApplicationDebugInfo.Raw[] | null | undefined) | null; + potentialProblems?: (ApplicationProblem.Raw[] | null | undefined) | null; autopilot: Record; - workspaceFqn?: string | null; - createdBy?: string | null; - deployment?: Deployment.Raw | null; - activeDeploymentId?: string | null; - lastDeploymentId?: string | null; + workspaceFqn?: (string | null | undefined) | null; + createdBy?: (string | null | undefined) | null; + deployment?: (Deployment.Raw | null | undefined) | null; + activeDeploymentId?: (string | null | undefined) | null; + lastDeploymentId?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/ApplicationDebugInfo.ts b/src/serialization/types/ApplicationDebugInfo.ts index df6db2bc..189259d1 100644 --- a/src/serialization/types/ApplicationDebugInfo.ts +++ b/src/serialization/types/ApplicationDebugInfo.ts @@ -1,25 +1,28 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; import * as serializers from "../index.js"; -export const ApplicationDebugInfo: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string().optional(), - "applicationId": core.serialization.string(), - "application": core.serialization.lazyObject(() => serializers.Application).optional(), - "debugInfo": core.serialization.record(core.serialization.string(), core.serialization.unknown()), - "createdAt": core.serialization.date().optional(), - "updatedAt": core.serialization.date().optional() - }); +export const ApplicationDebugInfo: core.serialization.ObjectSchema< + serializers.ApplicationDebugInfo.Raw, + TrueFoundry.ApplicationDebugInfo +> = core.serialization.object({ + id: core.serialization.string().optionalNullable(), + applicationId: core.serialization.string(), + application: core.serialization.lazyObject(() => serializers.Application).optionalNullable(), + debugInfo: core.serialization.record(core.serialization.string(), core.serialization.unknown()), + createdAt: core.serialization.date().optionalNullable(), + updatedAt: core.serialization.date().optionalNullable(), +}); export declare namespace ApplicationDebugInfo { export interface Raw { - id?: string | null; + id?: (string | null | undefined) | null; applicationId: string; - application?: serializers.Application.Raw | null; + application?: (serializers.Application.Raw | null | undefined) | null; debugInfo: Record; - createdAt?: string | null; - updatedAt?: string | null; + createdAt?: (string | null | undefined) | null; + updatedAt?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/ApplicationLifecycleStage.ts b/src/serialization/types/ApplicationLifecycleStage.ts index bb81c559..d9a4e83e 100644 --- a/src/serialization/types/ApplicationLifecycleStage.ts +++ b/src/serialization/types/ApplicationLifecycleStage.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const ApplicationLifecycleStage: core.serialization.Schema = core.serialization.enum_(["active", "deleting", "deletion_failed"]); +export const ApplicationLifecycleStage: core.serialization.Schema< + serializers.ApplicationLifecycleStage.Raw, + TrueFoundry.ApplicationLifecycleStage +> = core.serialization.enum_(["active", "deleting", "deletion_failed"]); export declare namespace ApplicationLifecycleStage { export type Raw = "active" | "deleting" | "deletion_failed"; diff --git a/src/serialization/types/ApplicationMetadata.ts b/src/serialization/types/ApplicationMetadata.ts index 8835308f..0d12a91f 100644 --- a/src/serialization/types/ApplicationMetadata.ts +++ b/src/serialization/types/ApplicationMetadata.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const ApplicationMetadata: core.serialization.ObjectSchema = core.serialization.object({ - "paused": core.serialization.boolean().optional() - }); +export const ApplicationMetadata: core.serialization.ObjectSchema< + serializers.ApplicationMetadata.Raw, + TrueFoundry.ApplicationMetadata +> = core.serialization.object({ + paused: core.serialization.boolean().optionalNullable(), +}); export declare namespace ApplicationMetadata { export interface Raw { - paused?: boolean | null; + paused?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/types/ApplicationProblem.ts b/src/serialization/types/ApplicationProblem.ts index e54e6d41..46d95023 100644 --- a/src/serialization/types/ApplicationProblem.ts +++ b/src/serialization/types/ApplicationProblem.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const ApplicationProblem: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string() - }); +export const ApplicationProblem: core.serialization.ObjectSchema< + serializers.ApplicationProblem.Raw, + TrueFoundry.ApplicationProblem +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string(), +}); export declare namespace ApplicationProblem { export interface Raw { diff --git a/src/serialization/types/ApplicationSet.ts b/src/serialization/types/ApplicationSet.ts index 3bc7afc5..7cd24650 100644 --- a/src/serialization/types/ApplicationSet.ts +++ b/src/serialization/types/ApplicationSet.ts @@ -1,19 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ApplicationSetComponentsItem } from "./ApplicationSetComponentsItem.js"; -export const ApplicationSet: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("application-set"), - "name": core.serialization.string(), - "components": core.serialization.list(ApplicationSetComponentsItem).optional(), - "template": core.serialization.string().optional(), - "values": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - "workspaceFqn": core.serialization.property("workspace_fqn", core.serialization.string().optional()), - "convertTemplateManifest": core.serialization.property("convert_template_manifest", core.serialization.boolean().optional()) - }); +export const ApplicationSet: core.serialization.ObjectSchema< + serializers.ApplicationSet.Raw, + TrueFoundry.ApplicationSet +> = core.serialization.object({ + type: core.serialization.stringLiteral("application-set"), + name: core.serialization.string(), + components: core.serialization.list(ApplicationSetComponentsItem).optional(), + template: core.serialization.string().optional(), + values: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + workspaceFqn: core.serialization.property("workspace_fqn", core.serialization.string().optional()), + convertTemplateManifest: core.serialization.property( + "convert_template_manifest", + core.serialization.boolean().optional(), + ), +}); export declare namespace ApplicationSet { export interface Raw { diff --git a/src/serialization/types/ApplicationSetComponentsItem.ts b/src/serialization/types/ApplicationSetComponentsItem.ts index 68ef6429..b7831353 100644 --- a/src/serialization/types/ApplicationSetComponentsItem.ts +++ b/src/serialization/types/ApplicationSetComponentsItem.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AsyncService } from "./AsyncService.js"; import { Helm } from "./Helm.js"; import { Job } from "./Job.js"; import { Service } from "./Service.js"; -export const ApplicationSetComponentsItem: core.serialization.Schema = core.serialization.undiscriminatedUnion([Service, AsyncService, Job, Helm]); +export const ApplicationSetComponentsItem: core.serialization.Schema< + serializers.ApplicationSetComponentsItem.Raw, + TrueFoundry.ApplicationSetComponentsItem +> = core.serialization.undiscriminatedUnion([Service, AsyncService, Job, Helm]); export declare namespace ApplicationSetComponentsItem { export type Raw = Service.Raw | AsyncService.Raw | Job.Raw | Helm.Raw; diff --git a/src/serialization/types/ApplicationSummary.ts b/src/serialization/types/ApplicationSummary.ts index bab5ed6a..4ee79503 100644 --- a/src/serialization/types/ApplicationSummary.ts +++ b/src/serialization/types/ApplicationSummary.ts @@ -1,34 +1,37 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ApplicationLifecycleStage } from "./ApplicationLifecycleStage.js"; import { ApplicationMetadata } from "./ApplicationMetadata.js"; import { ApplicationType } from "./ApplicationType.js"; -export const ApplicationSummary: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string().optional(), - "fqn": core.serialization.string().optional(), - "name": core.serialization.string().optional(), - "type": ApplicationType.optional(), - "metadata": ApplicationMetadata.optional(), - "lifecycleStage": ApplicationLifecycleStage, - "workspaceId": core.serialization.string().optional(), - "activeVersion": core.serialization.number().optional(), - "applicationSetId": core.serialization.string().optional() - }); +export const ApplicationSummary: core.serialization.ObjectSchema< + serializers.ApplicationSummary.Raw, + TrueFoundry.ApplicationSummary +> = core.serialization.object({ + id: core.serialization.string().optionalNullable(), + fqn: core.serialization.string().optionalNullable(), + name: core.serialization.string().optionalNullable(), + type: ApplicationType.optionalNullable(), + metadata: ApplicationMetadata.optionalNullable(), + lifecycleStage: ApplicationLifecycleStage, + workspaceId: core.serialization.string().optionalNullable(), + activeVersion: core.serialization.number().optionalNullable(), + applicationSetId: core.serialization.string().optionalNullable(), +}); export declare namespace ApplicationSummary { export interface Raw { - id?: string | null; - fqn?: string | null; - name?: string | null; - type?: ApplicationType.Raw | null; - metadata?: ApplicationMetadata.Raw | null; + id?: (string | null | undefined) | null; + fqn?: (string | null | undefined) | null; + name?: (string | null | undefined) | null; + type?: (ApplicationType.Raw | null | undefined) | null; + metadata?: (ApplicationMetadata.Raw | null | undefined) | null; lifecycleStage: ApplicationLifecycleStage.Raw; - workspaceId?: string | null; - activeVersion?: number | null; - applicationSetId?: string | null; + workspaceId?: (string | null | undefined) | null; + activeVersion?: (number | null | undefined) | null; + applicationSetId?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/ApplicationType.ts b/src/serialization/types/ApplicationType.ts index 38c50b0c..cce2549a 100644 --- a/src/serialization/types/ApplicationType.ts +++ b/src/serialization/types/ApplicationType.ts @@ -1,11 +1,43 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const ApplicationType: core.serialization.Schema = core.serialization.enum_(["async-service", "service", "job", "spark-job", "helm", "notebook", "spark-notebook", "codeserver", "rstudio", "ssh-server", "volume", "application", "application-set", "intercept", "workflow"]); +export const ApplicationType: core.serialization.Schema = + core.serialization.enum_([ + "async-service", + "service", + "job", + "spark-job", + "helm", + "notebook", + "spark-notebook", + "codeserver", + "rstudio", + "ssh-server", + "volume", + "application", + "application-set", + "intercept", + "workflow", + ]); export declare namespace ApplicationType { - export type Raw = "async-service" | "service" | "job" | "spark-job" | "helm" | "notebook" | "spark-notebook" | "codeserver" | "rstudio" | "ssh-server" | "volume" | "application" | "application-set" | "intercept" | "workflow"; + export type Raw = + | "async-service" + | "service" + | "job" + | "spark-job" + | "helm" + | "notebook" + | "spark-notebook" + | "codeserver" + | "rstudio" + | "ssh-server" + | "volume" + | "application" + | "application-set" + | "intercept" + | "workflow"; } diff --git a/src/serialization/types/Artifact.ts b/src/serialization/types/Artifact.ts index 37732fda..33d89c0e 100644 --- a/src/serialization/types/Artifact.ts +++ b/src/serialization/types/Artifact.ts @@ -1,22 +1,26 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ArtifactVersion } from "./ArtifactVersion.js"; import { Subject } from "./Subject.js"; -export const Artifact: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string(), - "mlRepoId": core.serialization.property("ml_repo_id", core.serialization.string()), - "type": core.serialization.stringLiteral("artifact").optional(), - "name": core.serialization.string(), - "fqn": core.serialization.string(), - "createdBySubject": core.serialization.property("created_by_subject", Subject), - "createdAt": core.serialization.property("created_at", core.serialization.date().optional()), - "updatedAt": core.serialization.property("updated_at", core.serialization.date().optional()), - "latestVersion": core.serialization.property("latest_version", ArtifactVersion.optional()), - "runSteps": core.serialization.property("run_steps", core.serialization.list(core.serialization.number()).optional()) +export const Artifact: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string(), + mlRepoId: core.serialization.property("ml_repo_id", core.serialization.string()), + type: core.serialization.stringLiteral("artifact").optional(), + name: core.serialization.string(), + fqn: core.serialization.string(), + createdBySubject: core.serialization.property("created_by_subject", Subject), + createdAt: core.serialization.property("created_at", core.serialization.date().optionalNullable()), + updatedAt: core.serialization.property("updated_at", core.serialization.date().optionalNullable()), + latestVersion: core.serialization.property("latest_version", ArtifactVersion.optionalNullable()), + runSteps: core.serialization.property( + "run_steps", + core.serialization.list(core.serialization.number()).optionalNullable(), + ), }); export declare namespace Artifact { @@ -27,9 +31,9 @@ export declare namespace Artifact { name: string; fqn: string; created_by_subject: Subject.Raw; - created_at?: string | null; - updated_at?: string | null; - latest_version?: ArtifactVersion.Raw | null; - run_steps?: number[] | null; + created_at?: (string | null | undefined) | null; + updated_at?: (string | null | undefined) | null; + latest_version?: (ArtifactVersion.Raw | null | undefined) | null; + run_steps?: (number[] | null | undefined) | null; } } diff --git a/src/serialization/types/ArtifactManifest.ts b/src/serialization/types/ArtifactManifest.ts index 2280d3dd..eed4f513 100644 --- a/src/serialization/types/ArtifactManifest.ts +++ b/src/serialization/types/ArtifactManifest.ts @@ -1,24 +1,29 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ArtifactManifestSource } from "./ArtifactManifestSource.js"; import { BaseArtifactVersion } from "./BaseArtifactVersion.js"; -export const ArtifactManifest: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("artifact-version"), - "description": core.serialization.string().optional(), - "versionAlias": core.serialization.property("version_alias", core.serialization.string().optional()), - "source": ArtifactManifestSource, - "step": core.serialization.number(), - "runId": core.serialization.property("run_id", core.serialization.string().optional()) - }).extend(BaseArtifactVersion); +export const ArtifactManifest: core.serialization.ObjectSchema< + serializers.ArtifactManifest.Raw, + TrueFoundry.ArtifactManifest +> = core.serialization + .object({ + type: core.serialization.stringLiteral("artifact-version"), + description: core.serialization.string().optionalNullable(), + versionAlias: core.serialization.property("version_alias", core.serialization.string().optional()), + source: ArtifactManifestSource, + step: core.serialization.number(), + runId: core.serialization.property("run_id", core.serialization.string().optional()), + }) + .extend(BaseArtifactVersion); export declare namespace ArtifactManifest { export interface Raw extends BaseArtifactVersion.Raw { type: "artifact-version"; - description?: string | null; + description?: (string | null | undefined) | null; version_alias?: string | null; source: ArtifactManifestSource.Raw; step: number; diff --git a/src/serialization/types/ArtifactManifestSource.ts b/src/serialization/types/ArtifactManifestSource.ts index 2f98d427..53f4e81b 100644 --- a/src/serialization/types/ArtifactManifestSource.ts +++ b/src/serialization/types/ArtifactManifestSource.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ExternalBlobStorageSource } from "./ExternalBlobStorageSource.js"; import { LocalArtifactSource } from "./LocalArtifactSource.js"; import { TrueFoundryManagedSource } from "./TrueFoundryManagedSource.js"; -export const ArtifactManifestSource: core.serialization.Schema = core.serialization.undiscriminatedUnion([TrueFoundryManagedSource, ExternalBlobStorageSource, LocalArtifactSource]); +export const ArtifactManifestSource: core.serialization.Schema< + serializers.ArtifactManifestSource.Raw, + TrueFoundry.ArtifactManifestSource +> = core.serialization.undiscriminatedUnion([TrueFoundryManagedSource, ExternalBlobStorageSource, LocalArtifactSource]); export declare namespace ArtifactManifestSource { export type Raw = TrueFoundryManagedSource.Raw | ExternalBlobStorageSource.Raw | LocalArtifactSource.Raw; diff --git a/src/serialization/types/ArtifactPath.ts b/src/serialization/types/ArtifactPath.ts index c570ab0d..d2a7ac4d 100644 --- a/src/serialization/types/ArtifactPath.ts +++ b/src/serialization/types/ArtifactPath.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const ArtifactPath: core.serialization.ObjectSchema = core.serialization.object({ - "src": core.serialization.string(), - "dest": core.serialization.string().optional() +export const ArtifactPath: core.serialization.ObjectSchema = + core.serialization.object({ + src: core.serialization.string(), + dest: core.serialization.string().optional(), }); export declare namespace ArtifactPath { diff --git a/src/serialization/types/ArtifactType.ts b/src/serialization/types/ArtifactType.ts index 723cc00f..f63c5e56 100644 --- a/src/serialization/types/ArtifactType.ts +++ b/src/serialization/types/ArtifactType.ts @@ -1,10 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const ArtifactType: core.serialization.Schema = core.serialization.string(); +export const ArtifactType: core.serialization.Schema = + core.serialization.string(); export declare namespace ArtifactType { export type Raw = string; diff --git a/src/serialization/types/ArtifactVersion.ts b/src/serialization/types/ArtifactVersion.ts index 59a09535..3d12e242 100644 --- a/src/serialization/types/ArtifactVersion.ts +++ b/src/serialization/types/ArtifactVersion.ts @@ -1,35 +1,38 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ArtifactManifest } from "./ArtifactManifest.js"; import { Subject } from "./Subject.js"; -export const ArtifactVersion: core.serialization.ObjectSchema = core.serialization.object({ - "createdAt": core.serialization.property("created_at", core.serialization.date().optional()), - "updatedAt": core.serialization.property("updated_at", core.serialization.date().optional()), - "manifest": ArtifactManifest, - "id": core.serialization.string(), - "fqn": core.serialization.string(), - "createdBySubject": core.serialization.property("created_by_subject", Subject), - "mlRepoId": core.serialization.property("ml_repo_id", core.serialization.string()), - "usageCodeSnippet": core.serialization.property("usage_code_snippet", core.serialization.string().optional()), - "tags": core.serialization.list(core.serialization.string()).optional(), - "artifactId": core.serialization.property("artifact_id", core.serialization.string()) - }); +export const ArtifactVersion: core.serialization.ObjectSchema< + serializers.ArtifactVersion.Raw, + TrueFoundry.ArtifactVersion +> = core.serialization.object({ + createdAt: core.serialization.property("created_at", core.serialization.date().optionalNullable()), + updatedAt: core.serialization.property("updated_at", core.serialization.date().optionalNullable()), + manifest: ArtifactManifest, + id: core.serialization.string(), + fqn: core.serialization.string(), + createdBySubject: core.serialization.property("created_by_subject", Subject), + mlRepoId: core.serialization.property("ml_repo_id", core.serialization.string()), + usageCodeSnippet: core.serialization.property("usage_code_snippet", core.serialization.string().optionalNullable()), + tags: core.serialization.list(core.serialization.string()).optionalNullable(), + artifactId: core.serialization.property("artifact_id", core.serialization.string()), +}); export declare namespace ArtifactVersion { export interface Raw { - created_at?: string | null; - updated_at?: string | null; + created_at?: (string | null | undefined) | null; + updated_at?: (string | null | undefined) | null; manifest: ArtifactManifest.Raw; id: string; fqn: string; created_by_subject: Subject.Raw; ml_repo_id: string; - usage_code_snippet?: string | null; - tags?: string[] | null; + usage_code_snippet?: (string | null | undefined) | null; + tags?: (string[] | null | undefined) | null; artifact_id: string; } } diff --git a/src/serialization/types/ArtifactsCacheVolume.ts b/src/serialization/types/ArtifactsCacheVolume.ts index 8af4df76..df07f88f 100644 --- a/src/serialization/types/ArtifactsCacheVolume.ts +++ b/src/serialization/types/ArtifactsCacheVolume.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const ArtifactsCacheVolume: core.serialization.ObjectSchema = core.serialization.object({ - "storageClass": core.serialization.property("storage_class", core.serialization.string()), - "cacheSize": core.serialization.property("cache_size", core.serialization.number()) - }); +export const ArtifactsCacheVolume: core.serialization.ObjectSchema< + serializers.ArtifactsCacheVolume.Raw, + TrueFoundry.ArtifactsCacheVolume +> = core.serialization.object({ + storageClass: core.serialization.property("storage_class", core.serialization.string()), + cacheSize: core.serialization.property("cache_size", core.serialization.number()), +}); export declare namespace ArtifactsCacheVolume { export interface Raw { diff --git a/src/serialization/types/ArtifactsDownload.ts b/src/serialization/types/ArtifactsDownload.ts index 21e4b05e..68759007 100644 --- a/src/serialization/types/ArtifactsDownload.ts +++ b/src/serialization/types/ArtifactsDownload.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ArtifactsCacheVolume } from "./ArtifactsCacheVolume.js"; import { ArtifactsDownloadArtifactsItem } from "./ArtifactsDownloadArtifactsItem.js"; -export const ArtifactsDownload: core.serialization.ObjectSchema = core.serialization.object({ - "cacheVolume": core.serialization.property("cache_volume", ArtifactsCacheVolume.optional()), - "artifacts": core.serialization.list(ArtifactsDownloadArtifactsItem) - }); +export const ArtifactsDownload: core.serialization.ObjectSchema< + serializers.ArtifactsDownload.Raw, + TrueFoundry.ArtifactsDownload +> = core.serialization.object({ + cacheVolume: core.serialization.property("cache_volume", ArtifactsCacheVolume.optional()), + artifacts: core.serialization.list(ArtifactsDownloadArtifactsItem), +}); export declare namespace ArtifactsDownload { export interface Raw { diff --git a/src/serialization/types/ArtifactsDownloadArtifactsItem.ts b/src/serialization/types/ArtifactsDownloadArtifactsItem.ts index c3d687c3..0eaab274 100644 --- a/src/serialization/types/ArtifactsDownloadArtifactsItem.ts +++ b/src/serialization/types/ArtifactsDownloadArtifactsItem.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { HuggingfaceArtifactSource } from "./HuggingfaceArtifactSource.js"; import { TrueFoundryArtifactSource } from "./TrueFoundryArtifactSource.js"; -export const ArtifactsDownloadArtifactsItem: core.serialization.Schema = core.serialization.undiscriminatedUnion([TrueFoundryArtifactSource, HuggingfaceArtifactSource]); +export const ArtifactsDownloadArtifactsItem: core.serialization.Schema< + serializers.ArtifactsDownloadArtifactsItem.Raw, + TrueFoundry.ArtifactsDownloadArtifactsItem +> = core.serialization.undiscriminatedUnion([TrueFoundryArtifactSource, HuggingfaceArtifactSource]); export declare namespace ArtifactsDownloadArtifactsItem { export type Raw = TrueFoundryArtifactSource.Raw | HuggingfaceArtifactSource.Raw; diff --git a/src/serialization/types/AssistantMessage.ts b/src/serialization/types/AssistantMessage.ts index 8cb9ca38..35e248a8 100644 --- a/src/serialization/types/AssistantMessage.ts +++ b/src/serialization/types/AssistantMessage.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AssistantMessageContent } from "./AssistantMessageContent.js"; import { ToolCall } from "./ToolCall.js"; -export const AssistantMessage: core.serialization.ObjectSchema = core.serialization.object({ - "role": core.serialization.stringLiteral("assistant"), - "content": AssistantMessageContent.optional(), - "toolCalls": core.serialization.property("tool_calls", core.serialization.list(ToolCall).optional()), - "name": core.serialization.string().optional() - }); +export const AssistantMessage: core.serialization.ObjectSchema< + serializers.AssistantMessage.Raw, + TrueFoundry.AssistantMessage +> = core.serialization.object({ + role: core.serialization.stringLiteral("assistant"), + content: AssistantMessageContent.optional(), + toolCalls: core.serialization.property("tool_calls", core.serialization.list(ToolCall).optional()), + name: core.serialization.string().optional(), +}); export declare namespace AssistantMessage { export interface Raw { diff --git a/src/serialization/types/AssistantMessageContent.ts b/src/serialization/types/AssistantMessageContent.ts index f1212b2e..be150e61 100644 --- a/src/serialization/types/AssistantMessageContent.ts +++ b/src/serialization/types/AssistantMessageContent.ts @@ -1,12 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AssistantMessageContentOneItem } from "./AssistantMessageContentOneItem.js"; import { BlobStorageReference } from "./BlobStorageReference.js"; -export const AssistantMessageContent: core.serialization.Schema = core.serialization.undiscriminatedUnion([core.serialization.string(), core.serialization.list(AssistantMessageContentOneItem), BlobStorageReference]); +export const AssistantMessageContent: core.serialization.Schema< + serializers.AssistantMessageContent.Raw, + TrueFoundry.AssistantMessageContent +> = core.serialization.undiscriminatedUnion([ + core.serialization.string(), + core.serialization.list(AssistantMessageContentOneItem), + BlobStorageReference, +]); export declare namespace AssistantMessageContent { export type Raw = string | AssistantMessageContentOneItem.Raw[] | BlobStorageReference.Raw; diff --git a/src/serialization/types/AssistantMessageContentOneItem.ts b/src/serialization/types/AssistantMessageContentOneItem.ts index b91bbb3f..de45d6fb 100644 --- a/src/serialization/types/AssistantMessageContentOneItem.ts +++ b/src/serialization/types/AssistantMessageContentOneItem.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { RefusalContentPart } from "./RefusalContentPart.js"; import { TextContentPart } from "./TextContentPart.js"; -export const AssistantMessageContentOneItem: core.serialization.Schema = core.serialization.undiscriminatedUnion([TextContentPart, RefusalContentPart]); +export const AssistantMessageContentOneItem: core.serialization.Schema< + serializers.AssistantMessageContentOneItem.Raw, + TrueFoundry.AssistantMessageContentOneItem +> = core.serialization.undiscriminatedUnion([TextContentPart, RefusalContentPart]); export declare namespace AssistantMessageContentOneItem { export type Raw = TextContentPart.Raw | RefusalContentPart.Raw; diff --git a/src/serialization/types/AsyncProcessorSidecar.ts b/src/serialization/types/AsyncProcessorSidecar.ts index 2bc05971..cd5a5cae 100644 --- a/src/serialization/types/AsyncProcessorSidecar.ts +++ b/src/serialization/types/AsyncProcessorSidecar.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AsyncProcessorSidecar: core.serialization.ObjectSchema = core.serialization.object({ - "destinationUrl": core.serialization.property("destination_url", core.serialization.string()), - "requestTimeout": core.serialization.property("request_timeout", core.serialization.number().optional()), - "sidecarImage": core.serialization.property("sidecar_image", core.serialization.string().optional()) - }); +export const AsyncProcessorSidecar: core.serialization.ObjectSchema< + serializers.AsyncProcessorSidecar.Raw, + TrueFoundry.AsyncProcessorSidecar +> = core.serialization.object({ + destinationUrl: core.serialization.property("destination_url", core.serialization.string()), + requestTimeout: core.serialization.property("request_timeout", core.serialization.number().optional()), + sidecarImage: core.serialization.property("sidecar_image", core.serialization.string().optional()), +}); export declare namespace AsyncProcessorSidecar { export interface Raw { diff --git a/src/serialization/types/AsyncService.ts b/src/serialization/types/AsyncService.ts index da3b5c51..ba054cfc 100644 --- a/src/serialization/types/AsyncService.ts +++ b/src/serialization/types/AsyncService.ts @@ -1,21 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AsyncProcessorSidecar } from "./AsyncProcessorSidecar.js"; import { AsyncServiceReplicas } from "./AsyncServiceReplicas.js"; import { BaseService } from "./BaseService.js"; import { Rolling } from "./Rolling.js"; import { WorkerConfig } from "./WorkerConfig.js"; -export const AsyncService: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("async-service"), - "replicas": AsyncServiceReplicas, - "rolloutStrategy": core.serialization.property("rollout_strategy", Rolling.optional()), - "workerConfig": core.serialization.property("worker_config", WorkerConfig), - "sidecar": AsyncProcessorSidecar.optional() - }).extend(BaseService); +export const AsyncService: core.serialization.ObjectSchema = + core.serialization + .object({ + type: core.serialization.stringLiteral("async-service"), + replicas: AsyncServiceReplicas, + rolloutStrategy: core.serialization.property("rollout_strategy", Rolling.optional()), + workerConfig: core.serialization.property("worker_config", WorkerConfig), + sidecar: AsyncProcessorSidecar.optional(), + }) + .extend(BaseService); export declare namespace AsyncService { export interface Raw extends BaseService.Raw { diff --git a/src/serialization/types/AsyncServiceAutoscaling.ts b/src/serialization/types/AsyncServiceAutoscaling.ts index 1871dd98..538b0d0f 100644 --- a/src/serialization/types/AsyncServiceAutoscaling.ts +++ b/src/serialization/types/AsyncServiceAutoscaling.ts @@ -1,14 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AsyncServiceAutoscalingMetrics } from "./AsyncServiceAutoscalingMetrics.js"; import { BaseAutoscaling } from "./BaseAutoscaling.js"; -export const AsyncServiceAutoscaling: core.serialization.ObjectSchema = core.serialization.object({ - "metrics": AsyncServiceAutoscalingMetrics - }).extend(BaseAutoscaling); +export const AsyncServiceAutoscaling: core.serialization.ObjectSchema< + serializers.AsyncServiceAutoscaling.Raw, + TrueFoundry.AsyncServiceAutoscaling +> = core.serialization + .object({ + metrics: AsyncServiceAutoscalingMetrics, + }) + .extend(BaseAutoscaling); export declare namespace AsyncServiceAutoscaling { export interface Raw extends BaseAutoscaling.Raw { diff --git a/src/serialization/types/AsyncServiceAutoscalingMetrics.ts b/src/serialization/types/AsyncServiceAutoscalingMetrics.ts index efecd82e..960ddabf 100644 --- a/src/serialization/types/AsyncServiceAutoscalingMetrics.ts +++ b/src/serialization/types/AsyncServiceAutoscalingMetrics.ts @@ -1,16 +1,30 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AmqpMetricConfig } from "./AmqpMetricConfig.js"; import { CronMetric } from "./CronMetric.js"; import { KafkaMetricConfig } from "./KafkaMetricConfig.js"; import { NatsMetricConfig } from "./NatsMetricConfig.js"; import { SqsQueueMetricConfig } from "./SqsQueueMetricConfig.js"; -export const AsyncServiceAutoscalingMetrics: core.serialization.Schema = core.serialization.undiscriminatedUnion([SqsQueueMetricConfig, NatsMetricConfig, KafkaMetricConfig, CronMetric, AmqpMetricConfig]); +export const AsyncServiceAutoscalingMetrics: core.serialization.Schema< + serializers.AsyncServiceAutoscalingMetrics.Raw, + TrueFoundry.AsyncServiceAutoscalingMetrics +> = core.serialization.undiscriminatedUnion([ + SqsQueueMetricConfig, + NatsMetricConfig, + KafkaMetricConfig, + CronMetric, + AmqpMetricConfig, +]); export declare namespace AsyncServiceAutoscalingMetrics { - export type Raw = SqsQueueMetricConfig.Raw | NatsMetricConfig.Raw | KafkaMetricConfig.Raw | CronMetric.Raw | AmqpMetricConfig.Raw; + export type Raw = + | SqsQueueMetricConfig.Raw + | NatsMetricConfig.Raw + | KafkaMetricConfig.Raw + | CronMetric.Raw + | AmqpMetricConfig.Raw; } diff --git a/src/serialization/types/AsyncServiceReplicas.ts b/src/serialization/types/AsyncServiceReplicas.ts index 24686103..830dacee 100644 --- a/src/serialization/types/AsyncServiceReplicas.ts +++ b/src/serialization/types/AsyncServiceReplicas.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AsyncServiceAutoscaling } from "./AsyncServiceAutoscaling.js"; -export const AsyncServiceReplicas: core.serialization.Schema = core.serialization.undiscriminatedUnion([core.serialization.number(), AsyncServiceAutoscaling]); +export const AsyncServiceReplicas: core.serialization.Schema< + serializers.AsyncServiceReplicas.Raw, + TrueFoundry.AsyncServiceReplicas +> = core.serialization.undiscriminatedUnion([core.serialization.number(), AsyncServiceAutoscaling]); export declare namespace AsyncServiceReplicas { export type Raw = number | AsyncServiceAutoscaling.Raw; diff --git a/src/serialization/types/AutoRotate.ts b/src/serialization/types/AutoRotate.ts index 6b874a55..464adca7 100644 --- a/src/serialization/types/AutoRotate.ts +++ b/src/serialization/types/AutoRotate.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AutoRotate: core.serialization.ObjectSchema = core.serialization.object({ - "autoRotateInterval": core.serialization.property("auto_rotate_interval", core.serialization.number()), - "gracePeriod": core.serialization.property("grace_period", core.serialization.number()) +export const AutoRotate: core.serialization.ObjectSchema = + core.serialization.object({ + autoRotateInterval: core.serialization.property("auto_rotate_interval", core.serialization.number()), + gracePeriod: core.serialization.property("grace_period", core.serialization.number()), }); export declare namespace AutoRotate { diff --git a/src/serialization/types/Autoshutdown.ts b/src/serialization/types/Autoshutdown.ts index 635c4b1f..7ce773d5 100644 --- a/src/serialization/types/Autoshutdown.ts +++ b/src/serialization/types/Autoshutdown.ts @@ -1,11 +1,12 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const Autoshutdown: core.serialization.ObjectSchema = core.serialization.object({ - "waitTime": core.serialization.property("wait_time", core.serialization.number()) +export const Autoshutdown: core.serialization.ObjectSchema = + core.serialization.object({ + waitTime: core.serialization.property("wait_time", core.serialization.number()), }); export declare namespace Autoshutdown { diff --git a/src/serialization/types/AwsAccessKeyAuth.ts b/src/serialization/types/AwsAccessKeyAuth.ts index 259ad466..d447fc51 100644 --- a/src/serialization/types/AwsAccessKeyAuth.ts +++ b/src/serialization/types/AwsAccessKeyAuth.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AwsAccessKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "awsAccessKeyId": core.serialization.property("aws_access_key_id", core.serialization.string()), - "awsSecretAccessKey": core.serialization.property("aws_secret_access_key", core.serialization.string()), - "awsSessionToken": core.serialization.property("aws_session_token", core.serialization.string().optional()) - }); +export const AwsAccessKeyAuth: core.serialization.ObjectSchema< + serializers.AwsAccessKeyAuth.Raw, + TrueFoundry.AwsAccessKeyAuth +> = core.serialization.object({ + awsAccessKeyId: core.serialization.property("aws_access_key_id", core.serialization.string()), + awsSecretAccessKey: core.serialization.property("aws_secret_access_key", core.serialization.string()), + awsSessionToken: core.serialization.property("aws_session_token", core.serialization.string().optional()), +}); export declare namespace AwsAccessKeyAuth { export interface Raw { diff --git a/src/serialization/types/AwsAccessKeyBasedAuth.ts b/src/serialization/types/AwsAccessKeyBasedAuth.ts index 3b2c61be..7445557f 100644 --- a/src/serialization/types/AwsAccessKeyBasedAuth.ts +++ b/src/serialization/types/AwsAccessKeyBasedAuth.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AwsAccessKeyBasedAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("access-key-based"), - "accessKeyId": core.serialization.property("access_key_id", core.serialization.string()), - "secretAccessKey": core.serialization.property("secret_access_key", core.serialization.string()) - }); +export const AwsAccessKeyBasedAuth: core.serialization.ObjectSchema< + serializers.AwsAccessKeyBasedAuth.Raw, + TrueFoundry.AwsAccessKeyBasedAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("access-key-based"), + accessKeyId: core.serialization.property("access_key_id", core.serialization.string()), + secretAccessKey: core.serialization.property("secret_access_key", core.serialization.string()), +}); export declare namespace AwsAccessKeyBasedAuth { export interface Raw { diff --git a/src/serialization/types/AwsAssumedRoleBasedAuth.ts b/src/serialization/types/AwsAssumedRoleBasedAuth.ts index e1371b1d..96e46061 100644 --- a/src/serialization/types/AwsAssumedRoleBasedAuth.ts +++ b/src/serialization/types/AwsAssumedRoleBasedAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AwsAssumedRoleBasedAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("assumed-role-based"), - "assumedRoleArn": core.serialization.property("assumed_role_arn", core.serialization.string()) - }); +export const AwsAssumedRoleBasedAuth: core.serialization.ObjectSchema< + serializers.AwsAssumedRoleBasedAuth.Raw, + TrueFoundry.AwsAssumedRoleBasedAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("assumed-role-based"), + assumedRoleArn: core.serialization.property("assumed_role_arn", core.serialization.string()), +}); export declare namespace AwsAssumedRoleBasedAuth { export interface Raw { diff --git a/src/serialization/types/AwsBedrockApiKeyAuth.ts b/src/serialization/types/AwsBedrockApiKeyAuth.ts index dd0c0569..0aa886a8 100644 --- a/src/serialization/types/AwsBedrockApiKeyAuth.ts +++ b/src/serialization/types/AwsBedrockApiKeyAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AwsBedrockApiKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) - }); +export const AwsBedrockApiKeyAuth: core.serialization.ObjectSchema< + serializers.AwsBedrockApiKeyAuth.Raw, + TrueFoundry.AwsBedrockApiKeyAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), +}); export declare namespace AwsBedrockApiKeyAuth { export interface Raw { diff --git a/src/serialization/types/AwsBedrockAssumedRoleBasedAuth.ts b/src/serialization/types/AwsBedrockAssumedRoleBasedAuth.ts index 545468f2..c389d82f 100644 --- a/src/serialization/types/AwsBedrockAssumedRoleBasedAuth.ts +++ b/src/serialization/types/AwsBedrockAssumedRoleBasedAuth.ts @@ -1,13 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsAssumedRoleBasedAuth } from "./AwsAssumedRoleBasedAuth.js"; -export const AwsBedrockAssumedRoleBasedAuth: core.serialization.ObjectSchema = core.serialization.object({ - "externalId": core.serialization.property("external_id", core.serialization.string().optional()) - }).extend(AwsAssumedRoleBasedAuth); +export const AwsBedrockAssumedRoleBasedAuth: core.serialization.ObjectSchema< + serializers.AwsBedrockAssumedRoleBasedAuth.Raw, + TrueFoundry.AwsBedrockAssumedRoleBasedAuth +> = core.serialization + .object({ + externalId: core.serialization.property("external_id", core.serialization.string().optional()), + }) + .extend(AwsAssumedRoleBasedAuth); export declare namespace AwsBedrockAssumedRoleBasedAuth { export interface Raw extends AwsAssumedRoleBasedAuth.Raw { diff --git a/src/serialization/types/AwsBedrockGuardrailConfig.ts b/src/serialization/types/AwsBedrockGuardrailConfig.ts index 9f86ef2b..97c1045b 100644 --- a/src/serialization/types/AwsBedrockGuardrailConfig.ts +++ b/src/serialization/types/AwsBedrockGuardrailConfig.ts @@ -1,23 +1,26 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsBedrockGuardrailConfigAuthData } from "./AwsBedrockGuardrailConfigAuthData.js"; import { AwsBedrockGuardrailConfigConfig } from "./AwsBedrockGuardrailConfigConfig.js"; import { AwsBedrockGuardrailConfigOperation } from "./AwsBedrockGuardrailConfigOperation.js"; import { EnforcingStrategy } from "./EnforcingStrategy.js"; -export const AwsBedrockGuardrailConfig: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string().optional(), - "type": core.serialization.stringLiteral("integration/guardrail-config/aws-bedrock"), - "authData": core.serialization.property("auth_data", AwsBedrockGuardrailConfigAuthData.optional()), - "operation": AwsBedrockGuardrailConfigOperation, - "priority": core.serialization.number().optional(), - "enforcingStrategy": core.serialization.property("enforcing_strategy", EnforcingStrategy), - "config": AwsBedrockGuardrailConfigConfig - }); +export const AwsBedrockGuardrailConfig: core.serialization.ObjectSchema< + serializers.AwsBedrockGuardrailConfig.Raw, + TrueFoundry.AwsBedrockGuardrailConfig +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + type: core.serialization.stringLiteral("integration/guardrail-config/aws-bedrock"), + authData: core.serialization.property("auth_data", AwsBedrockGuardrailConfigAuthData.optional()), + operation: AwsBedrockGuardrailConfigOperation, + priority: core.serialization.number().optional(), + enforcingStrategy: core.serialization.property("enforcing_strategy", EnforcingStrategy), + config: AwsBedrockGuardrailConfigConfig, +}); export declare namespace AwsBedrockGuardrailConfig { export interface Raw { diff --git a/src/serialization/types/AwsBedrockGuardrailConfigAuthData.ts b/src/serialization/types/AwsBedrockGuardrailConfigAuthData.ts index 33e17d93..300625f6 100644 --- a/src/serialization/types/AwsBedrockGuardrailConfigAuthData.ts +++ b/src/serialization/types/AwsBedrockGuardrailConfigAuthData.ts @@ -1,13 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsAccessKeyBasedAuth } from "./AwsAccessKeyBasedAuth.js"; import { AwsBedrockApiKeyAuth } from "./AwsBedrockApiKeyAuth.js"; import { AwsBedrockAssumedRoleBasedAuth } from "./AwsBedrockAssumedRoleBasedAuth.js"; -export const AwsBedrockGuardrailConfigAuthData: core.serialization.Schema = core.serialization.undiscriminatedUnion([AwsAccessKeyBasedAuth, AwsBedrockAssumedRoleBasedAuth, AwsBedrockApiKeyAuth]); +export const AwsBedrockGuardrailConfigAuthData: core.serialization.Schema< + serializers.AwsBedrockGuardrailConfigAuthData.Raw, + TrueFoundry.AwsBedrockGuardrailConfigAuthData +> = core.serialization.undiscriminatedUnion([ + AwsAccessKeyBasedAuth, + AwsBedrockAssumedRoleBasedAuth, + AwsBedrockApiKeyAuth, +]); export declare namespace AwsBedrockGuardrailConfigAuthData { export type Raw = AwsAccessKeyBasedAuth.Raw | AwsBedrockAssumedRoleBasedAuth.Raw | AwsBedrockApiKeyAuth.Raw; diff --git a/src/serialization/types/AwsBedrockGuardrailConfigConfig.ts b/src/serialization/types/AwsBedrockGuardrailConfigConfig.ts index c07ce896..21029638 100644 --- a/src/serialization/types/AwsBedrockGuardrailConfigConfig.ts +++ b/src/serialization/types/AwsBedrockGuardrailConfigConfig.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsRegion } from "./AwsRegion.js"; -export const AwsBedrockGuardrailConfigConfig: core.serialization.ObjectSchema = core.serialization.object({ - "guardrailId": core.serialization.property("guardrail_id", core.serialization.string()), - "guardrailVersion": core.serialization.property("guardrail_version", core.serialization.string()), - "region": AwsRegion - }); +export const AwsBedrockGuardrailConfigConfig: core.serialization.ObjectSchema< + serializers.AwsBedrockGuardrailConfigConfig.Raw, + TrueFoundry.AwsBedrockGuardrailConfigConfig +> = core.serialization.object({ + guardrailId: core.serialization.property("guardrail_id", core.serialization.string()), + guardrailVersion: core.serialization.property("guardrail_version", core.serialization.string()), + region: AwsRegion, +}); export declare namespace AwsBedrockGuardrailConfigConfig { export interface Raw { diff --git a/src/serialization/types/AwsBedrockGuardrailConfigOperation.ts b/src/serialization/types/AwsBedrockGuardrailConfigOperation.ts index 5a3a5490..169ee5db 100644 --- a/src/serialization/types/AwsBedrockGuardrailConfigOperation.ts +++ b/src/serialization/types/AwsBedrockGuardrailConfigOperation.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AwsBedrockGuardrailConfigOperation: core.serialization.Schema = core.serialization.enum_(["validate", "mutate"]); +export const AwsBedrockGuardrailConfigOperation: core.serialization.Schema< + serializers.AwsBedrockGuardrailConfigOperation.Raw, + TrueFoundry.AwsBedrockGuardrailConfigOperation +> = core.serialization.enum_(["validate", "mutate"]); export declare namespace AwsBedrockGuardrailConfigOperation { export type Raw = "validate" | "mutate"; diff --git a/src/serialization/types/AwsBedrockMantleIntegrations.ts b/src/serialization/types/AwsBedrockMantleIntegrations.ts index 281a7581..980a02aa 100644 --- a/src/serialization/types/AwsBedrockMantleIntegrations.ts +++ b/src/serialization/types/AwsBedrockMantleIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { BedrockMantleModel } from "./BedrockMantleModel.js"; -export const AwsBedrockMantleIntegrations: core.serialization.ObjectSchema = BedrockMantleModel; +export const AwsBedrockMantleIntegrations: core.serialization.ObjectSchema< + serializers.AwsBedrockMantleIntegrations.Raw, + TrueFoundry.AwsBedrockMantleIntegrations +> = BedrockMantleModel; export declare namespace AwsBedrockMantleIntegrations { export type Raw = BedrockMantleModel.Raw; diff --git a/src/serialization/types/AwsBedrockMantleProviderAccount.ts b/src/serialization/types/AwsBedrockMantleProviderAccount.ts index a5d63af3..a37114ff 100644 --- a/src/serialization/types/AwsBedrockMantleProviderAccount.ts +++ b/src/serialization/types/AwsBedrockMantleProviderAccount.ts @@ -1,30 +1,35 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsBedrockMantleIntegrations } from "./AwsBedrockMantleIntegrations.js"; import { AwsBedrockMantleProviderAccountAuthData } from "./AwsBedrockMantleProviderAccountAuthData.js"; import { AwsRegion } from "./AwsRegion.js"; import { Collaborator } from "./Collaborator.js"; import { OwnedBy } from "./OwnedBy.js"; -export const AwsBedrockMantleProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/aws-bedrock-mantle"), - "name": core.serialization.string(), - "region": AwsRegion, - "authData": core.serialization.property("auth_data", AwsBedrockMantleProviderAccountAuthData.optional()), - "integrations": core.serialization.list(AwsBedrockMantleIntegrations), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const AwsBedrockMantleProviderAccount: core.serialization.ObjectSchema< + serializers.AwsBedrockMantleProviderAccount.Raw, + TrueFoundry.AwsBedrockMantleProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/aws-bedrock-mantle"), + name: core.serialization.string(), + region: AwsRegion, + baseUrl: core.serialization.property("base_url", core.serialization.string().optional()), + authData: core.serialization.property("auth_data", AwsBedrockMantleProviderAccountAuthData.optional()), + integrations: core.serialization.list(AwsBedrockMantleIntegrations), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace AwsBedrockMantleProviderAccount { export interface Raw { type: "provider-account/aws-bedrock-mantle"; name: string; region: AwsRegion.Raw; + base_url?: string | null; auth_data?: AwsBedrockMantleProviderAccountAuthData.Raw | null; integrations: AwsBedrockMantleIntegrations.Raw[]; collaborators?: Collaborator.Raw[] | null; diff --git a/src/serialization/types/AwsBedrockMantleProviderAccountAuthData.ts b/src/serialization/types/AwsBedrockMantleProviderAccountAuthData.ts index c5064565..ff7d10f1 100644 --- a/src/serialization/types/AwsBedrockMantleProviderAccountAuthData.ts +++ b/src/serialization/types/AwsBedrockMantleProviderAccountAuthData.ts @@ -1,13 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsAccessKeyBasedAuth } from "./AwsAccessKeyBasedAuth.js"; import { AwsBedrockApiKeyAuth } from "./AwsBedrockApiKeyAuth.js"; import { AwsBedrockAssumedRoleBasedAuth } from "./AwsBedrockAssumedRoleBasedAuth.js"; -export const AwsBedrockMantleProviderAccountAuthData: core.serialization.Schema = core.serialization.undiscriminatedUnion([AwsAccessKeyBasedAuth, AwsBedrockAssumedRoleBasedAuth, AwsBedrockApiKeyAuth]); +export const AwsBedrockMantleProviderAccountAuthData: core.serialization.Schema< + serializers.AwsBedrockMantleProviderAccountAuthData.Raw, + TrueFoundry.AwsBedrockMantleProviderAccountAuthData +> = core.serialization.undiscriminatedUnion([ + AwsAccessKeyBasedAuth, + AwsBedrockAssumedRoleBasedAuth, + AwsBedrockApiKeyAuth, +]); export declare namespace AwsBedrockMantleProviderAccountAuthData { export type Raw = AwsAccessKeyBasedAuth.Raw | AwsBedrockAssumedRoleBasedAuth.Raw | AwsBedrockApiKeyAuth.Raw; diff --git a/src/serialization/types/AwsBedrockProviderAccount.ts b/src/serialization/types/AwsBedrockProviderAccount.ts index aeb5549f..317f870c 100644 --- a/src/serialization/types/AwsBedrockProviderAccount.ts +++ b/src/serialization/types/AwsBedrockProviderAccount.ts @@ -1,30 +1,35 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsBedrockProviderAccountAuthData } from "./AwsBedrockProviderAccountAuthData.js"; import { AwsRegion } from "./AwsRegion.js"; import { BedrockModel } from "./BedrockModel.js"; import { Collaborator } from "./Collaborator.js"; import { OwnedBy } from "./OwnedBy.js"; -export const AwsBedrockProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/aws-bedrock"), - "name": core.serialization.string(), - "region": AwsRegion, - "authData": core.serialization.property("auth_data", AwsBedrockProviderAccountAuthData.optional()), - "integrations": core.serialization.list(BedrockModel), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const AwsBedrockProviderAccount: core.serialization.ObjectSchema< + serializers.AwsBedrockProviderAccount.Raw, + TrueFoundry.AwsBedrockProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/aws-bedrock"), + name: core.serialization.string(), + region: AwsRegion, + baseUrl: core.serialization.property("base_url", core.serialization.string().optional()), + authData: core.serialization.property("auth_data", AwsBedrockProviderAccountAuthData.optional()), + integrations: core.serialization.list(BedrockModel), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace AwsBedrockProviderAccount { export interface Raw { type: "provider-account/aws-bedrock"; name: string; region: AwsRegion.Raw; + base_url?: string | null; auth_data?: AwsBedrockProviderAccountAuthData.Raw | null; integrations: BedrockModel.Raw[]; collaborators?: Collaborator.Raw[] | null; diff --git a/src/serialization/types/AwsBedrockProviderAccountAuthData.ts b/src/serialization/types/AwsBedrockProviderAccountAuthData.ts index df9d1886..bccb0b15 100644 --- a/src/serialization/types/AwsBedrockProviderAccountAuthData.ts +++ b/src/serialization/types/AwsBedrockProviderAccountAuthData.ts @@ -1,13 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsAccessKeyBasedAuth } from "./AwsAccessKeyBasedAuth.js"; import { AwsBedrockApiKeyAuth } from "./AwsBedrockApiKeyAuth.js"; import { AwsBedrockAssumedRoleBasedAuth } from "./AwsBedrockAssumedRoleBasedAuth.js"; -export const AwsBedrockProviderAccountAuthData: core.serialization.Schema = core.serialization.undiscriminatedUnion([AwsAccessKeyBasedAuth, AwsBedrockAssumedRoleBasedAuth, AwsBedrockApiKeyAuth]); +export const AwsBedrockProviderAccountAuthData: core.serialization.Schema< + serializers.AwsBedrockProviderAccountAuthData.Raw, + TrueFoundry.AwsBedrockProviderAccountAuthData +> = core.serialization.undiscriminatedUnion([ + AwsAccessKeyBasedAuth, + AwsBedrockAssumedRoleBasedAuth, + AwsBedrockApiKeyAuth, +]); export declare namespace AwsBedrockProviderAccountAuthData { export type Raw = AwsAccessKeyBasedAuth.Raw | AwsBedrockAssumedRoleBasedAuth.Raw | AwsBedrockApiKeyAuth.Raw; diff --git a/src/serialization/types/AwsClaudePlatformApiKeyAuth.ts b/src/serialization/types/AwsClaudePlatformApiKeyAuth.ts index 35707d1b..466399df 100644 --- a/src/serialization/types/AwsClaudePlatformApiKeyAuth.ts +++ b/src/serialization/types/AwsClaudePlatformApiKeyAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AwsClaudePlatformApiKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) - }); +export const AwsClaudePlatformApiKeyAuth: core.serialization.ObjectSchema< + serializers.AwsClaudePlatformApiKeyAuth.Raw, + TrueFoundry.AwsClaudePlatformApiKeyAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), +}); export declare namespace AwsClaudePlatformApiKeyAuth { export interface Raw { diff --git a/src/serialization/types/AwsClaudePlatformAssumedRoleBasedAuth.ts b/src/serialization/types/AwsClaudePlatformAssumedRoleBasedAuth.ts index 3ed8fef9..990021a1 100644 --- a/src/serialization/types/AwsClaudePlatformAssumedRoleBasedAuth.ts +++ b/src/serialization/types/AwsClaudePlatformAssumedRoleBasedAuth.ts @@ -1,13 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsAssumedRoleBasedAuth } from "./AwsAssumedRoleBasedAuth.js"; -export const AwsClaudePlatformAssumedRoleBasedAuth: core.serialization.ObjectSchema = core.serialization.object({ - "externalId": core.serialization.property("external_id", core.serialization.string().optional()) - }).extend(AwsAssumedRoleBasedAuth); +export const AwsClaudePlatformAssumedRoleBasedAuth: core.serialization.ObjectSchema< + serializers.AwsClaudePlatformAssumedRoleBasedAuth.Raw, + TrueFoundry.AwsClaudePlatformAssumedRoleBasedAuth +> = core.serialization + .object({ + externalId: core.serialization.property("external_id", core.serialization.string().optional()), + }) + .extend(AwsAssumedRoleBasedAuth); export declare namespace AwsClaudePlatformAssumedRoleBasedAuth { export interface Raw extends AwsAssumedRoleBasedAuth.Raw { diff --git a/src/serialization/types/AwsClaudePlatformIntegrations.ts b/src/serialization/types/AwsClaudePlatformIntegrations.ts index 23ee138d..9f08512a 100644 --- a/src/serialization/types/AwsClaudePlatformIntegrations.ts +++ b/src/serialization/types/AwsClaudePlatformIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { AwsClaudePlatformModel } from "./AwsClaudePlatformModel.js"; -export const AwsClaudePlatformIntegrations: core.serialization.ObjectSchema = AwsClaudePlatformModel; +export const AwsClaudePlatformIntegrations: core.serialization.ObjectSchema< + serializers.AwsClaudePlatformIntegrations.Raw, + TrueFoundry.AwsClaudePlatformIntegrations +> = AwsClaudePlatformModel; export declare namespace AwsClaudePlatformIntegrations { export type Raw = AwsClaudePlatformModel.Raw; diff --git a/src/serialization/types/AwsClaudePlatformModel.ts b/src/serialization/types/AwsClaudePlatformModel.ts index 99162d98..1383320e 100644 --- a/src/serialization/types/AwsClaudePlatformModel.ts +++ b/src/serialization/types/AwsClaudePlatformModel.ts @@ -1,19 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const AwsClaudePlatformModel: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "type": core.serialization.stringLiteral("integration/model/aws-claude-platform"), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const AwsClaudePlatformModel: core.serialization.ObjectSchema< + serializers.AwsClaudePlatformModel.Raw, + TrueFoundry.AwsClaudePlatformModel +> = core.serialization.object({ + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + type: core.serialization.stringLiteral("integration/model/aws-claude-platform"), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace AwsClaudePlatformModel { export interface Raw { diff --git a/src/serialization/types/AwsClaudePlatformProviderAccount.ts b/src/serialization/types/AwsClaudePlatformProviderAccount.ts index 7f5bd4fd..db8787a1 100644 --- a/src/serialization/types/AwsClaudePlatformProviderAccount.ts +++ b/src/serialization/types/AwsClaudePlatformProviderAccount.ts @@ -1,25 +1,29 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsClaudePlatformIntegrations } from "./AwsClaudePlatformIntegrations.js"; import { AwsClaudePlatformProviderAccountAuthData } from "./AwsClaudePlatformProviderAccountAuthData.js"; import { AwsRegion } from "./AwsRegion.js"; import { Collaborator } from "./Collaborator.js"; import { OwnedBy } from "./OwnedBy.js"; -export const AwsClaudePlatformProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/aws-claude-platform"), - "name": core.serialization.string(), - "workspaceId": core.serialization.property("workspace_id", core.serialization.string()), - "region": AwsRegion, - "authData": core.serialization.property("auth_data", AwsClaudePlatformProviderAccountAuthData.optional()), - "integrations": core.serialization.list(AwsClaudePlatformIntegrations).optional(), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const AwsClaudePlatformProviderAccount: core.serialization.ObjectSchema< + serializers.AwsClaudePlatformProviderAccount.Raw, + TrueFoundry.AwsClaudePlatformProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/aws-claude-platform"), + name: core.serialization.string(), + workspaceId: core.serialization.property("workspace_id", core.serialization.string()), + region: AwsRegion, + baseUrl: core.serialization.property("base_url", core.serialization.string().optional()), + authData: core.serialization.property("auth_data", AwsClaudePlatformProviderAccountAuthData.optional()), + integrations: core.serialization.list(AwsClaudePlatformIntegrations).optional(), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace AwsClaudePlatformProviderAccount { export interface Raw { @@ -27,6 +31,7 @@ export declare namespace AwsClaudePlatformProviderAccount { name: string; workspace_id: string; region: AwsRegion.Raw; + base_url?: string | null; auth_data?: AwsClaudePlatformProviderAccountAuthData.Raw | null; integrations?: AwsClaudePlatformIntegrations.Raw[] | null; collaborators?: Collaborator.Raw[] | null; diff --git a/src/serialization/types/AwsClaudePlatformProviderAccountAuthData.ts b/src/serialization/types/AwsClaudePlatformProviderAccountAuthData.ts index df8fec79..b79716e6 100644 --- a/src/serialization/types/AwsClaudePlatformProviderAccountAuthData.ts +++ b/src/serialization/types/AwsClaudePlatformProviderAccountAuthData.ts @@ -1,14 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsAccessKeyBasedAuth } from "./AwsAccessKeyBasedAuth.js"; import { AwsClaudePlatformApiKeyAuth } from "./AwsClaudePlatformApiKeyAuth.js"; import { AwsClaudePlatformAssumedRoleBasedAuth } from "./AwsClaudePlatformAssumedRoleBasedAuth.js"; -export const AwsClaudePlatformProviderAccountAuthData: core.serialization.Schema = core.serialization.undiscriminatedUnion([AwsAccessKeyBasedAuth, AwsClaudePlatformAssumedRoleBasedAuth, AwsClaudePlatformApiKeyAuth]); +export const AwsClaudePlatformProviderAccountAuthData: core.serialization.Schema< + serializers.AwsClaudePlatformProviderAccountAuthData.Raw, + TrueFoundry.AwsClaudePlatformProviderAccountAuthData +> = core.serialization.undiscriminatedUnion([ + AwsAccessKeyBasedAuth, + AwsClaudePlatformAssumedRoleBasedAuth, + AwsClaudePlatformApiKeyAuth, +]); export declare namespace AwsClaudePlatformProviderAccountAuthData { - export type Raw = AwsAccessKeyBasedAuth.Raw | AwsClaudePlatformAssumedRoleBasedAuth.Raw | AwsClaudePlatformApiKeyAuth.Raw; + export type Raw = + | AwsAccessKeyBasedAuth.Raw + | AwsClaudePlatformAssumedRoleBasedAuth.Raw + | AwsClaudePlatformApiKeyAuth.Raw; } diff --git a/src/serialization/types/AwsEcr.ts b/src/serialization/types/AwsEcr.ts index 8981f4fc..7d32495f 100644 --- a/src/serialization/types/AwsEcr.ts +++ b/src/serialization/types/AwsEcr.ts @@ -1,16 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsEcrAuthData } from "./AwsEcrAuthData.js"; -export const AwsEcr: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/docker-registry/aws/ecr"), - "name": core.serialization.string(), - "registryUrl": core.serialization.property("registry_url", core.serialization.string()), - "authData": core.serialization.property("auth_data", AwsEcrAuthData.optional()), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) +export const AwsEcr: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("integration/docker-registry/aws/ecr"), + name: core.serialization.string(), + registryUrl: core.serialization.property("registry_url", core.serialization.string()), + authData: core.serialization.property("auth_data", AwsEcrAuthData.optional()), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace AwsEcr { diff --git a/src/serialization/types/AwsEcrAuthData.ts b/src/serialization/types/AwsEcrAuthData.ts index f238ed51..8d1985dc 100644 --- a/src/serialization/types/AwsEcrAuthData.ts +++ b/src/serialization/types/AwsEcrAuthData.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsAccessKeyBasedAuth } from "./AwsAccessKeyBasedAuth.js"; import { AwsAssumedRoleBasedAuth } from "./AwsAssumedRoleBasedAuth.js"; -export const AwsEcrAuthData: core.serialization.Schema = core.serialization.undiscriminatedUnion([AwsAccessKeyBasedAuth, AwsAssumedRoleBasedAuth]); +export const AwsEcrAuthData: core.serialization.Schema = + core.serialization.undiscriminatedUnion([AwsAccessKeyBasedAuth, AwsAssumedRoleBasedAuth]); export declare namespace AwsEcrAuthData { export type Raw = AwsAccessKeyBasedAuth.Raw | AwsAssumedRoleBasedAuth.Raw; diff --git a/src/serialization/types/AwsEksIntegration.ts b/src/serialization/types/AwsEksIntegration.ts index 6ac01fcf..482de73e 100644 --- a/src/serialization/types/AwsEksIntegration.ts +++ b/src/serialization/types/AwsEksIntegration.ts @@ -1,19 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsEksIntegrationAuthData } from "./AwsEksIntegrationAuthData.js"; import { AwsRegion } from "./AwsRegion.js"; -export const AwsEksIntegration: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/cluster/aws/eks"), - "name": core.serialization.string(), - "region": AwsRegion, - "clusterName": core.serialization.property("cluster_name", core.serialization.string()), - "authData": core.serialization.property("auth_data", AwsEksIntegrationAuthData.optional()), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const AwsEksIntegration: core.serialization.ObjectSchema< + serializers.AwsEksIntegration.Raw, + TrueFoundry.AwsEksIntegration +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/cluster/aws/eks"), + name: core.serialization.string(), + region: AwsRegion, + clusterName: core.serialization.property("cluster_name", core.serialization.string()), + authData: core.serialization.property("auth_data", AwsEksIntegrationAuthData.optional()), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace AwsEksIntegration { export interface Raw { diff --git a/src/serialization/types/AwsEksIntegrationAuthData.ts b/src/serialization/types/AwsEksIntegrationAuthData.ts index 6f276290..1585c824 100644 --- a/src/serialization/types/AwsEksIntegrationAuthData.ts +++ b/src/serialization/types/AwsEksIntegrationAuthData.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsAccessKeyBasedAuth } from "./AwsAccessKeyBasedAuth.js"; import { AwsAssumedRoleBasedAuth } from "./AwsAssumedRoleBasedAuth.js"; -export const AwsEksIntegrationAuthData: core.serialization.Schema = core.serialization.undiscriminatedUnion([AwsAccessKeyBasedAuth, AwsAssumedRoleBasedAuth]); +export const AwsEksIntegrationAuthData: core.serialization.Schema< + serializers.AwsEksIntegrationAuthData.Raw, + TrueFoundry.AwsEksIntegrationAuthData +> = core.serialization.undiscriminatedUnion([AwsAccessKeyBasedAuth, AwsAssumedRoleBasedAuth]); export declare namespace AwsEksIntegrationAuthData { export type Raw = AwsAccessKeyBasedAuth.Raw | AwsAssumedRoleBasedAuth.Raw; diff --git a/src/serialization/types/AwsInferentia.ts b/src/serialization/types/AwsInferentia.ts index ad92194c..aa56f74c 100644 --- a/src/serialization/types/AwsInferentia.ts +++ b/src/serialization/types/AwsInferentia.ts @@ -1,13 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AwsInferentia: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("aws_inferentia"), - "name": core.serialization.string().optional(), - "count": core.serialization.number() +export const AwsInferentia: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("aws_inferentia"), + name: core.serialization.string().optional(), + count: core.serialization.number(), }); export declare namespace AwsInferentia { diff --git a/src/serialization/types/AwsIntegrations.ts b/src/serialization/types/AwsIntegrations.ts index c755cf30..38fc26d2 100644 --- a/src/serialization/types/AwsIntegrations.ts +++ b/src/serialization/types/AwsIntegrations.ts @@ -1,15 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsEcr } from "./AwsEcr.js"; import { AwsEksIntegration } from "./AwsEksIntegration.js"; import { AwsParameterStore } from "./AwsParameterStore.js"; import { AwsS3 } from "./AwsS3.js"; import { AwsSecretsManager } from "./AwsSecretsManager.js"; -export const AwsIntegrations: core.serialization.Schema = core.serialization.undiscriminatedUnion([AwsEcr, AwsS3, AwsParameterStore, AwsSecretsManager, AwsEksIntegration]); +export const AwsIntegrations: core.serialization.Schema = + core.serialization.undiscriminatedUnion([AwsEcr, AwsS3, AwsParameterStore, AwsSecretsManager, AwsEksIntegration]); export declare namespace AwsIntegrations { export type Raw = AwsEcr.Raw | AwsS3.Raw | AwsParameterStore.Raw | AwsSecretsManager.Raw | AwsEksIntegration.Raw; diff --git a/src/serialization/types/AwsParameterStore.ts b/src/serialization/types/AwsParameterStore.ts index 62f4bed0..7fb6964b 100644 --- a/src/serialization/types/AwsParameterStore.ts +++ b/src/serialization/types/AwsParameterStore.ts @@ -1,19 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsParameterStoreAuthData } from "./AwsParameterStoreAuthData.js"; import { AwsRegion } from "./AwsRegion.js"; -export const AwsParameterStore: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/secret-store/aws/parameter-store"), - "name": core.serialization.string(), - "region": AwsRegion, - "authData": core.serialization.property("auth_data", AwsParameterStoreAuthData.optional()), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()), - "kmsArn": core.serialization.property("kms_arn", core.serialization.string().optional()) - }); +export const AwsParameterStore: core.serialization.ObjectSchema< + serializers.AwsParameterStore.Raw, + TrueFoundry.AwsParameterStore +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/secret-store/aws/parameter-store"), + name: core.serialization.string(), + region: AwsRegion, + authData: core.serialization.property("auth_data", AwsParameterStoreAuthData.optional()), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), + kmsArn: core.serialization.property("kms_arn", core.serialization.string().optional()), +}); export declare namespace AwsParameterStore { export interface Raw { diff --git a/src/serialization/types/AwsParameterStoreAuthData.ts b/src/serialization/types/AwsParameterStoreAuthData.ts index fd15642d..f80ce5c2 100644 --- a/src/serialization/types/AwsParameterStoreAuthData.ts +++ b/src/serialization/types/AwsParameterStoreAuthData.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsAccessKeyBasedAuth } from "./AwsAccessKeyBasedAuth.js"; import { AwsAssumedRoleBasedAuth } from "./AwsAssumedRoleBasedAuth.js"; -export const AwsParameterStoreAuthData: core.serialization.Schema = core.serialization.undiscriminatedUnion([AwsAccessKeyBasedAuth, AwsAssumedRoleBasedAuth]); +export const AwsParameterStoreAuthData: core.serialization.Schema< + serializers.AwsParameterStoreAuthData.Raw, + TrueFoundry.AwsParameterStoreAuthData +> = core.serialization.undiscriminatedUnion([AwsAccessKeyBasedAuth, AwsAssumedRoleBasedAuth]); export declare namespace AwsParameterStoreAuthData { export type Raw = AwsAccessKeyBasedAuth.Raw | AwsAssumedRoleBasedAuth.Raw; diff --git a/src/serialization/types/AwsProviderAccount.ts b/src/serialization/types/AwsProviderAccount.ts index 21f49234..427d575f 100644 --- a/src/serialization/types/AwsProviderAccount.ts +++ b/src/serialization/types/AwsProviderAccount.ts @@ -1,20 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsIntegrations } from "./AwsIntegrations.js"; import { AwsProviderAccountAuthData } from "./AwsProviderAccountAuthData.js"; import { OwnedBy } from "./OwnedBy.js"; -export const AwsProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/aws"), - "name": core.serialization.string(), - "awsAccountId": core.serialization.property("aws_account_id", core.serialization.string()), - "authData": core.serialization.property("auth_data", AwsProviderAccountAuthData.optional()), - "integrations": core.serialization.list(AwsIntegrations), - "ownedBy": OwnedBy.optional() - }); +export const AwsProviderAccount: core.serialization.ObjectSchema< + serializers.AwsProviderAccount.Raw, + TrueFoundry.AwsProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/aws"), + name: core.serialization.string(), + awsAccountId: core.serialization.property("aws_account_id", core.serialization.string()), + authData: core.serialization.property("auth_data", AwsProviderAccountAuthData.optional()), + integrations: core.serialization.list(AwsIntegrations), + ownedBy: OwnedBy.optional(), +}); export declare namespace AwsProviderAccount { export interface Raw { diff --git a/src/serialization/types/AwsProviderAccountAuthData.ts b/src/serialization/types/AwsProviderAccountAuthData.ts index ad8d7cb9..8fb7fb65 100644 --- a/src/serialization/types/AwsProviderAccountAuthData.ts +++ b/src/serialization/types/AwsProviderAccountAuthData.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsAccessKeyBasedAuth } from "./AwsAccessKeyBasedAuth.js"; import { AwsAssumedRoleBasedAuth } from "./AwsAssumedRoleBasedAuth.js"; -export const AwsProviderAccountAuthData: core.serialization.Schema = core.serialization.undiscriminatedUnion([AwsAccessKeyBasedAuth, AwsAssumedRoleBasedAuth]); +export const AwsProviderAccountAuthData: core.serialization.Schema< + serializers.AwsProviderAccountAuthData.Raw, + TrueFoundry.AwsProviderAccountAuthData +> = core.serialization.undiscriminatedUnion([AwsAccessKeyBasedAuth, AwsAssumedRoleBasedAuth]); export declare namespace AwsProviderAccountAuthData { export type Raw = AwsAccessKeyBasedAuth.Raw | AwsAssumedRoleBasedAuth.Raw; diff --git a/src/serialization/types/AwsRegion.ts b/src/serialization/types/AwsRegion.ts index 1c55176f..e58688fb 100644 --- a/src/serialization/types/AwsRegion.ts +++ b/src/serialization/types/AwsRegion.ts @@ -1,11 +1,89 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AwsRegion: core.serialization.Schema = core.serialization.enum_(["af-south-1", "ap-east-1", "ap-northeast-1", "ap-northeast-2", "ap-northeast-3", "ap-south-1", "ap-south-2", "ap-southeast-1", "ap-southeast-2", "ap-southeast-3", "ap-southeast-4", "ap-southeast-5", "ap-southeast-7", "ca-central-1", "ca-west-1", "cn-north-1", "cn-northwest-1", "eu-central-1", "eu-central-2", "eu-north-1", "eu-south-1", "eu-south-2", "eu-west-1", "eu-west-2", "eu-west-3", "il-central-1", "me-central-1", "me-south-1", "mx-central-1", "sa-east-1", "us-east-1", "us-east-2", "us-gov-east-1", "us-gov-west-1", "us-west-1", "us-west-2", "ap-southeast-6", "ap-east-2"]); +export const AwsRegion: core.serialization.Schema = + core.serialization.enum_([ + "af-south-1", + "ap-east-1", + "ap-northeast-1", + "ap-northeast-2", + "ap-northeast-3", + "ap-south-1", + "ap-south-2", + "ap-southeast-1", + "ap-southeast-2", + "ap-southeast-3", + "ap-southeast-4", + "ap-southeast-5", + "ap-southeast-7", + "ca-central-1", + "ca-west-1", + "cn-north-1", + "cn-northwest-1", + "eu-central-1", + "eu-central-2", + "eu-north-1", + "eu-south-1", + "eu-south-2", + "eu-west-1", + "eu-west-2", + "eu-west-3", + "il-central-1", + "me-central-1", + "me-south-1", + "mx-central-1", + "sa-east-1", + "us-east-1", + "us-east-2", + "us-gov-east-1", + "us-gov-west-1", + "us-west-1", + "us-west-2", + "ap-southeast-6", + "ap-east-2", + ]); export declare namespace AwsRegion { - export type Raw = "af-south-1" | "ap-east-1" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ap-south-1" | "ap-south-2" | "ap-southeast-1" | "ap-southeast-2" | "ap-southeast-3" | "ap-southeast-4" | "ap-southeast-5" | "ap-southeast-7" | "ca-central-1" | "ca-west-1" | "cn-north-1" | "cn-northwest-1" | "eu-central-1" | "eu-central-2" | "eu-north-1" | "eu-south-1" | "eu-south-2" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "il-central-1" | "me-central-1" | "me-south-1" | "mx-central-1" | "sa-east-1" | "us-east-1" | "us-east-2" | "us-gov-east-1" | "us-gov-west-1" | "us-west-1" | "us-west-2" | "ap-southeast-6" | "ap-east-2"; + export type Raw = + | "af-south-1" + | "ap-east-1" + | "ap-northeast-1" + | "ap-northeast-2" + | "ap-northeast-3" + | "ap-south-1" + | "ap-south-2" + | "ap-southeast-1" + | "ap-southeast-2" + | "ap-southeast-3" + | "ap-southeast-4" + | "ap-southeast-5" + | "ap-southeast-7" + | "ca-central-1" + | "ca-west-1" + | "cn-north-1" + | "cn-northwest-1" + | "eu-central-1" + | "eu-central-2" + | "eu-north-1" + | "eu-south-1" + | "eu-south-2" + | "eu-west-1" + | "eu-west-2" + | "eu-west-3" + | "il-central-1" + | "me-central-1" + | "me-south-1" + | "mx-central-1" + | "sa-east-1" + | "us-east-1" + | "us-east-2" + | "us-gov-east-1" + | "us-gov-west-1" + | "us-west-1" + | "us-west-2" + | "ap-southeast-6" + | "ap-east-2"; } diff --git a/src/serialization/types/AwsS3.ts b/src/serialization/types/AwsS3.ts index 74acfc6c..a2d9b8f3 100644 --- a/src/serialization/types/AwsS3.ts +++ b/src/serialization/types/AwsS3.ts @@ -1,18 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsRegion } from "./AwsRegion.js"; import { AwsS3AuthData } from "./AwsS3AuthData.js"; -export const AwsS3: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/blob-storage/aws/s3"), - "name": core.serialization.string(), - "storageRoot": core.serialization.property("storage_root", core.serialization.string()), - "region": AwsRegion, - "authData": core.serialization.property("auth_data", AwsS3AuthData.optional()), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) +export const AwsS3: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("integration/blob-storage/aws/s3"), + name: core.serialization.string(), + storageRoot: core.serialization.property("storage_root", core.serialization.string()), + region: AwsRegion, + authData: core.serialization.property("auth_data", AwsS3AuthData.optional()), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace AwsS3 { diff --git a/src/serialization/types/AwsS3AuthData.ts b/src/serialization/types/AwsS3AuthData.ts index 789c8153..5061dd68 100644 --- a/src/serialization/types/AwsS3AuthData.ts +++ b/src/serialization/types/AwsS3AuthData.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsAccessKeyBasedAuth } from "./AwsAccessKeyBasedAuth.js"; import { AwsAssumedRoleBasedAuth } from "./AwsAssumedRoleBasedAuth.js"; -export const AwsS3AuthData: core.serialization.Schema = core.serialization.undiscriminatedUnion([AwsAccessKeyBasedAuth, AwsAssumedRoleBasedAuth]); +export const AwsS3AuthData: core.serialization.Schema = + core.serialization.undiscriminatedUnion([AwsAccessKeyBasedAuth, AwsAssumedRoleBasedAuth]); export declare namespace AwsS3AuthData { export type Raw = AwsAccessKeyBasedAuth.Raw | AwsAssumedRoleBasedAuth.Raw; diff --git a/src/serialization/types/AwsSagemakerProviderAccount.ts b/src/serialization/types/AwsSagemakerProviderAccount.ts index 5000d47c..c67ca6df 100644 --- a/src/serialization/types/AwsSagemakerProviderAccount.ts +++ b/src/serialization/types/AwsSagemakerProviderAccount.ts @@ -1,24 +1,27 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsRegion } from "./AwsRegion.js"; import { AwsSagemakerProviderAccountAuthData } from "./AwsSagemakerProviderAccountAuthData.js"; import { Collaborator } from "./Collaborator.js"; import { OwnedBy } from "./OwnedBy.js"; import { SagemakerModel } from "./SagemakerModel.js"; -export const AwsSagemakerProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/aws-sagemaker"), - "name": core.serialization.string(), - "region": AwsRegion, - "authData": core.serialization.property("auth_data", AwsSagemakerProviderAccountAuthData.optional()), - "integrations": core.serialization.list(SagemakerModel), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const AwsSagemakerProviderAccount: core.serialization.ObjectSchema< + serializers.AwsSagemakerProviderAccount.Raw, + TrueFoundry.AwsSagemakerProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/aws-sagemaker"), + name: core.serialization.string(), + region: AwsRegion, + authData: core.serialization.property("auth_data", AwsSagemakerProviderAccountAuthData.optional()), + integrations: core.serialization.list(SagemakerModel), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace AwsSagemakerProviderAccount { export interface Raw { diff --git a/src/serialization/types/AwsSagemakerProviderAccountAuthData.ts b/src/serialization/types/AwsSagemakerProviderAccountAuthData.ts index a73534eb..b2fbccef 100644 --- a/src/serialization/types/AwsSagemakerProviderAccountAuthData.ts +++ b/src/serialization/types/AwsSagemakerProviderAccountAuthData.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsAccessKeyBasedAuth } from "./AwsAccessKeyBasedAuth.js"; import { SagemakerAssumedRoleBasedAuth } from "./SagemakerAssumedRoleBasedAuth.js"; -export const AwsSagemakerProviderAccountAuthData: core.serialization.Schema = core.serialization.undiscriminatedUnion([AwsAccessKeyBasedAuth, SagemakerAssumedRoleBasedAuth]); +export const AwsSagemakerProviderAccountAuthData: core.serialization.Schema< + serializers.AwsSagemakerProviderAccountAuthData.Raw, + TrueFoundry.AwsSagemakerProviderAccountAuthData +> = core.serialization.undiscriminatedUnion([AwsAccessKeyBasedAuth, SagemakerAssumedRoleBasedAuth]); export declare namespace AwsSagemakerProviderAccountAuthData { export type Raw = AwsAccessKeyBasedAuth.Raw | SagemakerAssumedRoleBasedAuth.Raw; diff --git a/src/serialization/types/AwsSecretsManager.ts b/src/serialization/types/AwsSecretsManager.ts index bf03f8e7..e503fe6a 100644 --- a/src/serialization/types/AwsSecretsManager.ts +++ b/src/serialization/types/AwsSecretsManager.ts @@ -1,19 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsRegion } from "./AwsRegion.js"; import { AwsSecretsManagerAuthData } from "./AwsSecretsManagerAuthData.js"; -export const AwsSecretsManager: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/secret-store/aws/secrets-manager"), - "name": core.serialization.string(), - "region": AwsRegion, - "authData": core.serialization.property("auth_data", AwsSecretsManagerAuthData.optional()), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()), - "kmsArn": core.serialization.property("kms_arn", core.serialization.string().optional()) - }); +export const AwsSecretsManager: core.serialization.ObjectSchema< + serializers.AwsSecretsManager.Raw, + TrueFoundry.AwsSecretsManager +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/secret-store/aws/secrets-manager"), + name: core.serialization.string(), + region: AwsRegion, + authData: core.serialization.property("auth_data", AwsSecretsManagerAuthData.optional()), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), + kmsArn: core.serialization.property("kms_arn", core.serialization.string().optional()), +}); export declare namespace AwsSecretsManager { export interface Raw { diff --git a/src/serialization/types/AwsSecretsManagerAuthData.ts b/src/serialization/types/AwsSecretsManagerAuthData.ts index 35b7e0b4..e8a4579d 100644 --- a/src/serialization/types/AwsSecretsManagerAuthData.ts +++ b/src/serialization/types/AwsSecretsManagerAuthData.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsAccessKeyBasedAuth } from "./AwsAccessKeyBasedAuth.js"; import { AwsAssumedRoleBasedAuth } from "./AwsAssumedRoleBasedAuth.js"; -export const AwsSecretsManagerAuthData: core.serialization.Schema = core.serialization.undiscriminatedUnion([AwsAccessKeyBasedAuth, AwsAssumedRoleBasedAuth]); +export const AwsSecretsManagerAuthData: core.serialization.Schema< + serializers.AwsSecretsManagerAuthData.Raw, + TrueFoundry.AwsSecretsManagerAuthData +> = core.serialization.undiscriminatedUnion([AwsAccessKeyBasedAuth, AwsAssumedRoleBasedAuth]); export declare namespace AwsSecretsManagerAuthData { export type Raw = AwsAccessKeyBasedAuth.Raw | AwsAssumedRoleBasedAuth.Raw; diff --git a/src/serialization/types/AwsSqsAccessKeyBasedAuth.ts b/src/serialization/types/AwsSqsAccessKeyBasedAuth.ts index ceff5152..d2dd6be5 100644 --- a/src/serialization/types/AwsSqsAccessKeyBasedAuth.ts +++ b/src/serialization/types/AwsSqsAccessKeyBasedAuth.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AwsSqsAccessKeyBasedAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("access-key-based"), - "accessKeyId": core.serialization.property("access_key_id", core.serialization.string()), - "secretAccessKey": core.serialization.property("secret_access_key", core.serialization.string()) - }); +export const AwsSqsAccessKeyBasedAuth: core.serialization.ObjectSchema< + serializers.AwsSqsAccessKeyBasedAuth.Raw, + TrueFoundry.AwsSqsAccessKeyBasedAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("access-key-based"), + accessKeyId: core.serialization.property("access_key_id", core.serialization.string()), + secretAccessKey: core.serialization.property("secret_access_key", core.serialization.string()), +}); export declare namespace AwsSqsAccessKeyBasedAuth { export interface Raw { diff --git a/src/serialization/types/AwsSqsAssumedRoleBasedAuth.ts b/src/serialization/types/AwsSqsAssumedRoleBasedAuth.ts index 6cb03086..ade36da1 100644 --- a/src/serialization/types/AwsSqsAssumedRoleBasedAuth.ts +++ b/src/serialization/types/AwsSqsAssumedRoleBasedAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AwsSqsAssumedRoleBasedAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("assumed-role-based"), - "assumedRoleArn": core.serialization.property("assumed_role_arn", core.serialization.string()) - }); +export const AwsSqsAssumedRoleBasedAuth: core.serialization.ObjectSchema< + serializers.AwsSqsAssumedRoleBasedAuth.Raw, + TrueFoundry.AwsSqsAssumedRoleBasedAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("assumed-role-based"), + assumedRoleArn: core.serialization.property("assumed_role_arn", core.serialization.string()), +}); export declare namespace AwsSqsAssumedRoleBasedAuth { export interface Raw { diff --git a/src/serialization/types/AzureAksIntegration.ts b/src/serialization/types/AzureAksIntegration.ts index 9aaf17b7..1cf398f6 100644 --- a/src/serialization/types/AzureAksIntegration.ts +++ b/src/serialization/types/AzureAksIntegration.ts @@ -1,18 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AzureOAuth } from "./AzureOAuth.js"; -export const AzureAksIntegration: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/cluster/azure/aks"), - "name": core.serialization.string(), - "resourceGroup": core.serialization.property("resource_group", core.serialization.string()), - "clusterName": core.serialization.property("cluster_name", core.serialization.string()), - "authData": core.serialization.property("auth_data", AzureOAuth.optional()), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const AzureAksIntegration: core.serialization.ObjectSchema< + serializers.AzureAksIntegration.Raw, + TrueFoundry.AzureAksIntegration +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/cluster/azure/aks"), + name: core.serialization.string(), + resourceGroup: core.serialization.property("resource_group", core.serialization.string()), + clusterName: core.serialization.property("cluster_name", core.serialization.string()), + authData: core.serialization.property("auth_data", AzureOAuth.optional()), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace AzureAksIntegration { export interface Raw { diff --git a/src/serialization/types/AzureBasicAuth.ts b/src/serialization/types/AzureBasicAuth.ts index bc161c56..4c50e3f4 100644 --- a/src/serialization/types/AzureBasicAuth.ts +++ b/src/serialization/types/AzureBasicAuth.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AzureBasicAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("basic-auth"), - "username": core.serialization.string(), - "password": core.serialization.string() - }); +export const AzureBasicAuth: core.serialization.ObjectSchema< + serializers.AzureBasicAuth.Raw, + TrueFoundry.AzureBasicAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("basic-auth"), + username: core.serialization.string(), + password: core.serialization.string(), +}); export declare namespace AzureBasicAuth { export interface Raw { diff --git a/src/serialization/types/AzureBlobStorage.ts b/src/serialization/types/AzureBlobStorage.ts index 5e30b72f..404c4df8 100644 --- a/src/serialization/types/AzureBlobStorage.ts +++ b/src/serialization/types/AzureBlobStorage.ts @@ -1,17 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AzureConnectionStringAuth } from "./AzureConnectionStringAuth.js"; -export const AzureBlobStorage: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/blob-storage/azure/blob"), - "name": core.serialization.string(), - "storageRoot": core.serialization.property("storage_root", core.serialization.string()), - "authData": core.serialization.property("auth_data", AzureConnectionStringAuth.optional()), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const AzureBlobStorage: core.serialization.ObjectSchema< + serializers.AzureBlobStorage.Raw, + TrueFoundry.AzureBlobStorage +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/blob-storage/azure/blob"), + name: core.serialization.string(), + storageRoot: core.serialization.property("storage_root", core.serialization.string()), + authData: core.serialization.property("auth_data", AzureConnectionStringAuth.optional()), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace AzureBlobStorage { export interface Raw { diff --git a/src/serialization/types/AzureCertificateAuth.ts b/src/serialization/types/AzureCertificateAuth.ts index 12c122f9..4bfb63e6 100644 --- a/src/serialization/types/AzureCertificateAuth.ts +++ b/src/serialization/types/AzureCertificateAuth.ts @@ -1,16 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AzureCertificateAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("certificate"), - "tenantId": core.serialization.property("tenant_id", core.serialization.string()), - "clientId": core.serialization.property("client_id", core.serialization.string()), - "certificate": core.serialization.string(), - "certificateThumbprint": core.serialization.property("certificate_thumbprint", core.serialization.string()) - }); +export const AzureCertificateAuth: core.serialization.ObjectSchema< + serializers.AzureCertificateAuth.Raw, + TrueFoundry.AzureCertificateAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("certificate"), + tenantId: core.serialization.property("tenant_id", core.serialization.string()), + clientId: core.serialization.property("client_id", core.serialization.string()), + certificate: core.serialization.string(), + certificateThumbprint: core.serialization.property("certificate_thumbprint", core.serialization.string()), +}); export declare namespace AzureCertificateAuth { export interface Raw { diff --git a/src/serialization/types/AzureClientSecretAuth.ts b/src/serialization/types/AzureClientSecretAuth.ts index a794d563..be01b3b3 100644 --- a/src/serialization/types/AzureClientSecretAuth.ts +++ b/src/serialization/types/AzureClientSecretAuth.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AzureClientSecretAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("client-secret"), - "tenantId": core.serialization.property("tenant_id", core.serialization.string()), - "clientId": core.serialization.property("client_id", core.serialization.string()), - "clientSecret": core.serialization.property("client_secret", core.serialization.string()) - }); +export const AzureClientSecretAuth: core.serialization.ObjectSchema< + serializers.AzureClientSecretAuth.Raw, + TrueFoundry.AzureClientSecretAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("client-secret"), + tenantId: core.serialization.property("tenant_id", core.serialization.string()), + clientId: core.serialization.property("client_id", core.serialization.string()), + clientSecret: core.serialization.property("client_secret", core.serialization.string()), +}); export declare namespace AzureClientSecretAuth { export interface Raw { diff --git a/src/serialization/types/AzureConnectionStringAuth.ts b/src/serialization/types/AzureConnectionStringAuth.ts index b90a27a7..c635bc47 100644 --- a/src/serialization/types/AzureConnectionStringAuth.ts +++ b/src/serialization/types/AzureConnectionStringAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AzureConnectionStringAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("connection-string"), - "connectionString": core.serialization.property("connection_string", core.serialization.string()) - }); +export const AzureConnectionStringAuth: core.serialization.ObjectSchema< + serializers.AzureConnectionStringAuth.Raw, + TrueFoundry.AzureConnectionStringAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("connection-string"), + connectionString: core.serialization.property("connection_string", core.serialization.string()), +}); export declare namespace AzureConnectionStringAuth { export interface Raw { diff --git a/src/serialization/types/AzureContainerRegistry.ts b/src/serialization/types/AzureContainerRegistry.ts index 2eaefd78..5901a959 100644 --- a/src/serialization/types/AzureContainerRegistry.ts +++ b/src/serialization/types/AzureContainerRegistry.ts @@ -1,17 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AzureBasicAuth } from "./AzureBasicAuth.js"; -export const AzureContainerRegistry: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/docker-registry/azure/acr"), - "name": core.serialization.string(), - "registryUrl": core.serialization.property("registry_url", core.serialization.string()), - "authData": core.serialization.property("auth_data", AzureBasicAuth.optional()), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const AzureContainerRegistry: core.serialization.ObjectSchema< + serializers.AzureContainerRegistry.Raw, + TrueFoundry.AzureContainerRegistry +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/docker-registry/azure/acr"), + name: core.serialization.string(), + registryUrl: core.serialization.property("registry_url", core.serialization.string()), + authData: core.serialization.property("auth_data", AzureBasicAuth.optional()), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace AzureContainerRegistry { export interface Raw { diff --git a/src/serialization/types/AzureContentSafetyCategory.ts b/src/serialization/types/AzureContentSafetyCategory.ts index 8ad84b24..1e6e7ad2 100644 --- a/src/serialization/types/AzureContentSafetyCategory.ts +++ b/src/serialization/types/AzureContentSafetyCategory.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AzureContentSafetyCategory: core.serialization.Schema = core.serialization.enum_(["Hate", "SelfHarm", "Sexual", "Violence"]); +export const AzureContentSafetyCategory: core.serialization.Schema< + serializers.AzureContentSafetyCategory.Raw, + TrueFoundry.AzureContentSafetyCategory +> = core.serialization.enum_(["Hate", "SelfHarm", "Sexual", "Violence"]); export declare namespace AzureContentSafetyCategory { export type Raw = "Hate" | "SelfHarm" | "Sexual" | "Violence"; diff --git a/src/serialization/types/AzureContentSafetyGuardrailConfig.ts b/src/serialization/types/AzureContentSafetyGuardrailConfig.ts index 850542fd..64453bf6 100644 --- a/src/serialization/types/AzureContentSafetyGuardrailConfig.ts +++ b/src/serialization/types/AzureContentSafetyGuardrailConfig.ts @@ -1,21 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AzureContentSafetyGuardrailConfigAuthData } from "./AzureContentSafetyGuardrailConfigAuthData.js"; import { AzureContentSafetyGuardrailConfigConfig } from "./AzureContentSafetyGuardrailConfigConfig.js"; import { EnforcingStrategy } from "./EnforcingStrategy.js"; -export const AzureContentSafetyGuardrailConfig: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string().optional(), - "type": core.serialization.stringLiteral("integration/guardrail-config/azure-content-safety"), - "authData": core.serialization.property("auth_data", AzureContentSafetyGuardrailConfigAuthData), - "operation": core.serialization.stringLiteral("validate"), - "enforcingStrategy": core.serialization.property("enforcing_strategy", EnforcingStrategy), - "config": AzureContentSafetyGuardrailConfigConfig - }); +export const AzureContentSafetyGuardrailConfig: core.serialization.ObjectSchema< + serializers.AzureContentSafetyGuardrailConfig.Raw, + TrueFoundry.AzureContentSafetyGuardrailConfig +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + type: core.serialization.stringLiteral("integration/guardrail-config/azure-content-safety"), + authData: core.serialization.property("auth_data", AzureContentSafetyGuardrailConfigAuthData), + operation: core.serialization.stringLiteral("validate"), + enforcingStrategy: core.serialization.property("enforcing_strategy", EnforcingStrategy), + config: AzureContentSafetyGuardrailConfigConfig, +}); export declare namespace AzureContentSafetyGuardrailConfig { export interface Raw { diff --git a/src/serialization/types/AzureContentSafetyGuardrailConfigAuthData.ts b/src/serialization/types/AzureContentSafetyGuardrailConfigAuthData.ts index d6f07358..a9366cd1 100644 --- a/src/serialization/types/AzureContentSafetyGuardrailConfigAuthData.ts +++ b/src/serialization/types/AzureContentSafetyGuardrailConfigAuthData.ts @@ -1,15 +1,27 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AzureCertificateAuth } from "./AzureCertificateAuth.js"; import { AzureClientSecretAuth } from "./AzureClientSecretAuth.js"; import { AzureKeyAuth } from "./AzureKeyAuth.js"; import { AzureWorkloadIdentityAuth } from "./AzureWorkloadIdentityAuth.js"; -export const AzureContentSafetyGuardrailConfigAuthData: core.serialization.Schema = core.serialization.undiscriminatedUnion([AzureKeyAuth, AzureCertificateAuth, AzureClientSecretAuth, AzureWorkloadIdentityAuth]); +export const AzureContentSafetyGuardrailConfigAuthData: core.serialization.Schema< + serializers.AzureContentSafetyGuardrailConfigAuthData.Raw, + TrueFoundry.AzureContentSafetyGuardrailConfigAuthData +> = core.serialization.undiscriminatedUnion([ + AzureKeyAuth, + AzureCertificateAuth, + AzureClientSecretAuth, + AzureWorkloadIdentityAuth, +]); export declare namespace AzureContentSafetyGuardrailConfigAuthData { - export type Raw = AzureKeyAuth.Raw | AzureCertificateAuth.Raw | AzureClientSecretAuth.Raw | AzureWorkloadIdentityAuth.Raw; + export type Raw = + | AzureKeyAuth.Raw + | AzureCertificateAuth.Raw + | AzureClientSecretAuth.Raw + | AzureWorkloadIdentityAuth.Raw; } diff --git a/src/serialization/types/AzureContentSafetyGuardrailConfigConfig.ts b/src/serialization/types/AzureContentSafetyGuardrailConfigConfig.ts index 83828913..e9c2af1a 100644 --- a/src/serialization/types/AzureContentSafetyGuardrailConfigConfig.ts +++ b/src/serialization/types/AzureContentSafetyGuardrailConfigConfig.ts @@ -1,18 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AzureContentSafetyCategory } from "./AzureContentSafetyCategory.js"; -export const AzureContentSafetyGuardrailConfigConfig: core.serialization.ObjectSchema = core.serialization.object({ - "resourceName": core.serialization.property("resource_name", core.serialization.string()), - "apiVersion": core.serialization.property("api_version", core.serialization.string()), - "customHost": core.serialization.property("custom_host", core.serialization.string().optional()), - "blocklistNames": core.serialization.property("blocklist_names", core.serialization.list(core.serialization.string()).optional()), - "severityThreshold": core.serialization.property("severity_threshold", core.serialization.number()), - "categories": core.serialization.list(AzureContentSafetyCategory) - }); +export const AzureContentSafetyGuardrailConfigConfig: core.serialization.ObjectSchema< + serializers.AzureContentSafetyGuardrailConfigConfig.Raw, + TrueFoundry.AzureContentSafetyGuardrailConfigConfig +> = core.serialization.object({ + resourceName: core.serialization.property("resource_name", core.serialization.string()), + apiVersion: core.serialization.property("api_version", core.serialization.string()), + customHost: core.serialization.property("custom_host", core.serialization.string().optional()), + blocklistNames: core.serialization.property( + "blocklist_names", + core.serialization.list(core.serialization.string()).optional(), + ), + severityThreshold: core.serialization.property("severity_threshold", core.serialization.number()), + categories: core.serialization.list(AzureContentSafetyCategory), +}); export declare namespace AzureContentSafetyGuardrailConfigConfig { export interface Raw { diff --git a/src/serialization/types/AzureFoundryModel.ts b/src/serialization/types/AzureFoundryModel.ts index 9578d1ba..f7a9ab5d 100644 --- a/src/serialization/types/AzureFoundryModel.ts +++ b/src/serialization/types/AzureFoundryModel.ts @@ -1,23 +1,29 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AzureFoundryModelAuthData } from "./AzureFoundryModelAuthData.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const AzureFoundryModel: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/model/azure-foundry"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", AzureFoundryModelAuthData), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "azureEndpoint": core.serialization.property("azure_endpoint", core.serialization.string()), - "apiVersion": core.serialization.property("api_version", core.serialization.string().optional()), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const AzureFoundryModel: core.serialization.ObjectSchema< + serializers.AzureFoundryModel.Raw, + TrueFoundry.AzureFoundryModel +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/model/azure-foundry"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", AzureFoundryModelAuthData), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + modelId: core.serialization.property("model_id", core.serialization.string()), + azureEndpoint: core.serialization.property("azure_endpoint", core.serialization.string()), + apiVersion: core.serialization.property("api_version", core.serialization.string().optional()), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace AzureFoundryModel { export interface Raw { diff --git a/src/serialization/types/AzureFoundryModelAuthData.ts b/src/serialization/types/AzureFoundryModelAuthData.ts index 7c2adcce..d1d52026 100644 --- a/src/serialization/types/AzureFoundryModelAuthData.ts +++ b/src/serialization/types/AzureFoundryModelAuthData.ts @@ -1,15 +1,27 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AzureCertificateAuth } from "./AzureCertificateAuth.js"; import { AzureClientSecretAuth } from "./AzureClientSecretAuth.js"; import { AzureKeyAuth } from "./AzureKeyAuth.js"; import { AzureWorkloadIdentityAuth } from "./AzureWorkloadIdentityAuth.js"; -export const AzureFoundryModelAuthData: core.serialization.Schema = core.serialization.undiscriminatedUnion([AzureKeyAuth, AzureCertificateAuth, AzureClientSecretAuth, AzureWorkloadIdentityAuth]); +export const AzureFoundryModelAuthData: core.serialization.Schema< + serializers.AzureFoundryModelAuthData.Raw, + TrueFoundry.AzureFoundryModelAuthData +> = core.serialization.undiscriminatedUnion([ + AzureKeyAuth, + AzureCertificateAuth, + AzureClientSecretAuth, + AzureWorkloadIdentityAuth, +]); export declare namespace AzureFoundryModelAuthData { - export type Raw = AzureKeyAuth.Raw | AzureCertificateAuth.Raw | AzureClientSecretAuth.Raw | AzureWorkloadIdentityAuth.Raw; + export type Raw = + | AzureKeyAuth.Raw + | AzureCertificateAuth.Raw + | AzureClientSecretAuth.Raw + | AzureWorkloadIdentityAuth.Raw; } diff --git a/src/serialization/types/AzureFoundryProviderAccount.ts b/src/serialization/types/AzureFoundryProviderAccount.ts index 61038287..aaf19292 100644 --- a/src/serialization/types/AzureFoundryProviderAccount.ts +++ b/src/serialization/types/AzureFoundryProviderAccount.ts @@ -1,20 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AzureFoundryModel } from "./AzureFoundryModel.js"; import { Collaborator } from "./Collaborator.js"; import { OwnedBy } from "./OwnedBy.js"; -export const AzureFoundryProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/azure-foundry"), - "name": core.serialization.string(), - "integrations": core.serialization.list(AzureFoundryModel), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const AzureFoundryProviderAccount: core.serialization.ObjectSchema< + serializers.AzureFoundryProviderAccount.Raw, + TrueFoundry.AzureFoundryProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/azure-foundry"), + name: core.serialization.string(), + integrations: core.serialization.list(AzureFoundryModel), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace AzureFoundryProviderAccount { export interface Raw { diff --git a/src/serialization/types/AzureIntegrations.ts b/src/serialization/types/AzureIntegrations.ts index f885730b..1bd65895 100644 --- a/src/serialization/types/AzureIntegrations.ts +++ b/src/serialization/types/AzureIntegrations.ts @@ -1,16 +1,30 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AzureAksIntegration } from "./AzureAksIntegration.js"; import { AzureBlobStorage } from "./AzureBlobStorage.js"; import { AzureContainerRegistry } from "./AzureContainerRegistry.js"; import { AzureReposIntegration } from "./AzureReposIntegration.js"; import { AzureVault } from "./AzureVault.js"; -export const AzureIntegrations: core.serialization.Schema = core.serialization.undiscriminatedUnion([AzureAksIntegration, AzureContainerRegistry, AzureBlobStorage, AzureVault, AzureReposIntegration]); +export const AzureIntegrations: core.serialization.Schema< + serializers.AzureIntegrations.Raw, + TrueFoundry.AzureIntegrations +> = core.serialization.undiscriminatedUnion([ + AzureAksIntegration, + AzureContainerRegistry, + AzureBlobStorage, + AzureVault, + AzureReposIntegration, +]); export declare namespace AzureIntegrations { - export type Raw = AzureAksIntegration.Raw | AzureContainerRegistry.Raw | AzureBlobStorage.Raw | AzureVault.Raw | AzureReposIntegration.Raw; + export type Raw = + | AzureAksIntegration.Raw + | AzureContainerRegistry.Raw + | AzureBlobStorage.Raw + | AzureVault.Raw + | AzureReposIntegration.Raw; } diff --git a/src/serialization/types/AzureKeyAuth.ts b/src/serialization/types/AzureKeyAuth.ts index 1b9b7d5e..7c3c1bdf 100644 --- a/src/serialization/types/AzureKeyAuth.ts +++ b/src/serialization/types/AzureKeyAuth.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AzureKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) +export const AzureKeyAuth: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), }); export declare namespace AzureKeyAuth { diff --git a/src/serialization/types/AzureOAuth.ts b/src/serialization/types/AzureOAuth.ts index fad7bf59..3b18b5c2 100644 --- a/src/serialization/types/AzureOAuth.ts +++ b/src/serialization/types/AzureOAuth.ts @@ -1,15 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AzureOAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("oauth"), - "tenantId": core.serialization.property("tenant_id", core.serialization.string()), - "clientId": core.serialization.property("client_id", core.serialization.string()), - "clientSecret": core.serialization.property("client_secret", core.serialization.string()), - "subscriptionId": core.serialization.property("subscription_id", core.serialization.string()) +export const AzureOAuth: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("oauth"), + tenantId: core.serialization.property("tenant_id", core.serialization.string()), + clientId: core.serialization.property("client_id", core.serialization.string()), + clientSecret: core.serialization.property("client_secret", core.serialization.string()), + subscriptionId: core.serialization.property("subscription_id", core.serialization.string()), }); export declare namespace AzureOAuth { diff --git a/src/serialization/types/AzureOpenAiModel.ts b/src/serialization/types/AzureOpenAiModel.ts index 4d465b39..72a0d492 100644 --- a/src/serialization/types/AzureOpenAiModel.ts +++ b/src/serialization/types/AzureOpenAiModel.ts @@ -1,23 +1,29 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AzureOpenAiModelDeploymentType } from "./AzureOpenAiModelDeploymentType.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const AzureOpenAiModel: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/model/azure-openai"), - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "apiVersion": core.serialization.property("api_version", core.serialization.string()), - "foundationModel": core.serialization.property("foundation_model", core.serialization.string().optional()), - "deploymentType": core.serialization.property("deployment_type", AzureOpenAiModelDeploymentType.optional()), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const AzureOpenAiModel: core.serialization.ObjectSchema< + serializers.AzureOpenAiModel.Raw, + TrueFoundry.AzureOpenAiModel +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/model/azure-openai"), + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + apiVersion: core.serialization.property("api_version", core.serialization.string()), + foundationModel: core.serialization.property("foundation_model", core.serialization.string().optional()), + deploymentType: core.serialization.property("deployment_type", AzureOpenAiModelDeploymentType.optional()), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace AzureOpenAiModel { export interface Raw { diff --git a/src/serialization/types/AzureOpenAiModelDeploymentType.ts b/src/serialization/types/AzureOpenAiModelDeploymentType.ts index 5a2d1127..318bd9d3 100644 --- a/src/serialization/types/AzureOpenAiModelDeploymentType.ts +++ b/src/serialization/types/AzureOpenAiModelDeploymentType.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AzureOpenAiModelDeploymentType: core.serialization.Schema = core.serialization.enum_(["standard", "datazone_us", "datazone_eu", "global"]); +export const AzureOpenAiModelDeploymentType: core.serialization.Schema< + serializers.AzureOpenAiModelDeploymentType.Raw, + TrueFoundry.AzureOpenAiModelDeploymentType +> = core.serialization.enum_(["standard", "datazone_us", "datazone_eu", "global"]); export declare namespace AzureOpenAiModelDeploymentType { export type Raw = "standard" | "datazone_us" | "datazone_eu" | "global"; diff --git a/src/serialization/types/AzureOpenAiProviderAccount.ts b/src/serialization/types/AzureOpenAiProviderAccount.ts index d90c0530..31a3acbd 100644 --- a/src/serialization/types/AzureOpenAiProviderAccount.ts +++ b/src/serialization/types/AzureOpenAiProviderAccount.ts @@ -1,23 +1,26 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AzureOpenAiModel } from "./AzureOpenAiModel.js"; import { AzureOpenAiProviderAccountAuthData } from "./AzureOpenAiProviderAccountAuthData.js"; import { Collaborator } from "./Collaborator.js"; import { OwnedBy } from "./OwnedBy.js"; -export const AzureOpenAiProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/azure-openai"), - "name": core.serialization.string(), - "azureEndpoint": core.serialization.property("azure_endpoint", core.serialization.string()), - "authData": core.serialization.property("auth_data", AzureOpenAiProviderAccountAuthData), - "integrations": core.serialization.list(AzureOpenAiModel), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const AzureOpenAiProviderAccount: core.serialization.ObjectSchema< + serializers.AzureOpenAiProviderAccount.Raw, + TrueFoundry.AzureOpenAiProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/azure-openai"), + name: core.serialization.string(), + azureEndpoint: core.serialization.property("azure_endpoint", core.serialization.string()), + authData: core.serialization.property("auth_data", AzureOpenAiProviderAccountAuthData), + integrations: core.serialization.list(AzureOpenAiModel), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace AzureOpenAiProviderAccount { export interface Raw { diff --git a/src/serialization/types/AzureOpenAiProviderAccountAuthData.ts b/src/serialization/types/AzureOpenAiProviderAccountAuthData.ts index 67e67689..69166e76 100644 --- a/src/serialization/types/AzureOpenAiProviderAccountAuthData.ts +++ b/src/serialization/types/AzureOpenAiProviderAccountAuthData.ts @@ -1,15 +1,27 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AzureCertificateAuth } from "./AzureCertificateAuth.js"; import { AzureClientSecretAuth } from "./AzureClientSecretAuth.js"; import { AzureKeyAuth } from "./AzureKeyAuth.js"; import { AzureWorkloadIdentityAuth } from "./AzureWorkloadIdentityAuth.js"; -export const AzureOpenAiProviderAccountAuthData: core.serialization.Schema = core.serialization.undiscriminatedUnion([AzureKeyAuth, AzureCertificateAuth, AzureClientSecretAuth, AzureWorkloadIdentityAuth]); +export const AzureOpenAiProviderAccountAuthData: core.serialization.Schema< + serializers.AzureOpenAiProviderAccountAuthData.Raw, + TrueFoundry.AzureOpenAiProviderAccountAuthData +> = core.serialization.undiscriminatedUnion([ + AzureKeyAuth, + AzureCertificateAuth, + AzureClientSecretAuth, + AzureWorkloadIdentityAuth, +]); export declare namespace AzureOpenAiProviderAccountAuthData { - export type Raw = AzureKeyAuth.Raw | AzureCertificateAuth.Raw | AzureClientSecretAuth.Raw | AzureWorkloadIdentityAuth.Raw; + export type Raw = + | AzureKeyAuth.Raw + | AzureCertificateAuth.Raw + | AzureClientSecretAuth.Raw + | AzureWorkloadIdentityAuth.Raw; } diff --git a/src/serialization/types/AzurePiiCategory.ts b/src/serialization/types/AzurePiiCategory.ts index bbeeecce..12bf3e6c 100644 --- a/src/serialization/types/AzurePiiCategory.ts +++ b/src/serialization/types/AzurePiiCategory.ts @@ -1,11 +1,339 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AzurePiiCategory: core.serialization.Schema = core.serialization.enum_(["*", "ABARoutingNumber", "Address", "Age", "ARNationalIdentityNumber", "AUBankAccountNumber", "AUDriversLicenseNumber", "AUMedicalAccountNumber", "AUPassportNumber", "AUTaxFileNumber", "AUBusinessNumber", "AUCompanyNumber", "ATIdentityCard", "ATTaxIdentificationNumber", "ATValueAddedTaxNumber", "AzureDocumentDBAuthKey", "AzureIAASDatabaseConnectionAndSQLString", "AzureIoTConnectionString", "AzurePublishSettingPassword", "AzureRedisCacheString", "AzureSAS", "AzureServiceBusString", "AzureStorageAccountKey", "AzureStorageAccountGeneric", "BankAccountNumber", "BENationalNumber", "BEValueAddedTaxNumber", "BRCPFNumber", "BRLegalEntityNumber", "BRNationalIDRG", "BGUniformCivilNumber", "CABankAccountNumber", "CADriversLicenseNumber", "CAHealthServiceNumber", "CAPassportNumber", "CAPersonalHealthID", "CASocialInsuranceNumber", "CLIdentityCardNumber", "CNResidentIdentityCardNumber", "CreditCardNumber", "HRIdentityCardNumber", "HRNationalIDCardNumber", "HRPersonalIdentificationNumber", "CYIdentityCard", "CYTaxIdentificationNumber", "CZPersonalIdentityNumber", "Date", "DateTime", "DKPersonalIdentificationNumber", "DEANumber", "Email", "EEPersonalIdentificationCode", "EUDebitCardNumber", "EUDriversLicenseNumber", "EUGPSCoordinates", "EUNationalIdentificationNumber", "EUPassportNumber", "EUSocialSecurityNumber", "EUTaxIdentificationNumber", "FIEuropeanHealthNumber", "FINationalID", "FIPassportNumber", "FRDriversLicenseNumber", "FRHealthInsuranceNumber", "FRNationalID", "FRPassportNumber", "FRSocialSecurityNumber", "FRTaxIdentificationNumber", "FRValueAddedTaxNumber", "DEDriversLicenseNumber", "DEPassportNumber", "DEIdentityCardNumber", "DETaxIdentificationNumber", "DEValueAddedTaxNumber", "GRNationalIDCard", "GRTaxIdentificationNumber", "HKIdentityCardNumber", "HUValueAddedTaxNumber", "HUPersonalIdentificationNumber", "HUTaxIdentificationNumber", "INPermanentAccountNumber", "INUniqueIdentificationNumber", "IDIdentityCardNumber", "InternationalBankingAccountNumber", "IPAddress", "IEPersonalPublicServiceNumber", "ILBankAccountNumber", "ILNationalID", "ITDriversLicenseNumber", "ITFiscalCode", "ITValueAddedTaxNumber", "JPBankAccountNumber", "JPDriversLicenseNumber", "JPPassportNumber", "JPResidentRegistrationNumber", "JPSocialInsuranceNumber", "JPMyNumberCorporate", "JPMyNumberPersonal", "JPResidenceCardNumber", "LVPersonalCode", "LTPersonalCode", "LUNationalIdentificationNumberNatural", "LUNationalIdentificationNumberNonNatural", "MYIdentityCardNumber", "MTIdentityCardNumber", "MTTaxIDNumber", "NLCitizensServiceNumber", "NLTaxIdentificationNumber", "NLValueAddedTaxNumber", "NZBankAccountNumber", "NZDriversLicenseNumber", "NZInlandRevenueNumber", "NZMinistryOfHealthNumber", "NZSocialWelfareNumber", "NOIdentityNumber", "Organization", "Person", "PersonType", "PHUnifiedMultiPurposeIDNumber", "PhoneNumber", "PLIdentityCard", "PLNationalID", "PLPassportNumber", "PLTaxIdentificationNumber", "PLREGONNumber", "PTCitizenCardNumber", "PTTaxIdentificationNumber", "ROPersonalNumericalCode", "RUPassportNumberDomestic", "RUPassportNumberInternational", "SANationalID", "SGNationalRegistrationIdentityCardNumber", "SKPersonalNumber", "SITaxIdentificationNumber", "SIUniqueMasterCitizenNumber", "ZAIdentificationNumber", "KRResidentRegistrationNumber", "ESDNI", "ESSocialSecurityNumber", "ESTaxIdentificationNumber", "AzureSQLConnectionString", "SENationalID", "SEPassportNumber", "SETaxIdentificationNumber", "SWIFTCode", "CHSocialSecurityNumber", "TWNationalID", "TWPassportNumber", "TWResidentCertificate", "THPopulationIdentificationCode", "TRNationalIdentificationNumber", "UKDriversLicenseNumber", "UKElectoralRollNumber", "UKNationalHealthNumber", "UKNationalInsuranceNumber", "UKUniqueTaxpayerNumber", "USUKPassportNumber", "USBankAccountNumber", "USDriversLicenseNumber", "USIndividualTaxpayerIdentification", "USSocialSecurityNumber", "URL"]); +export const AzurePiiCategory: core.serialization.Schema< + serializers.AzurePiiCategory.Raw, + TrueFoundry.AzurePiiCategory +> = core.serialization.enum_([ + "*", + "ABARoutingNumber", + "Address", + "Age", + "ARNationalIdentityNumber", + "AUBankAccountNumber", + "AUDriversLicenseNumber", + "AUMedicalAccountNumber", + "AUPassportNumber", + "AUTaxFileNumber", + "AUBusinessNumber", + "AUCompanyNumber", + "ATIdentityCard", + "ATTaxIdentificationNumber", + "ATValueAddedTaxNumber", + "AzureDocumentDBAuthKey", + "AzureIAASDatabaseConnectionAndSQLString", + "AzureIoTConnectionString", + "AzurePublishSettingPassword", + "AzureRedisCacheString", + "AzureSAS", + "AzureServiceBusString", + "AzureStorageAccountKey", + "AzureStorageAccountGeneric", + "BankAccountNumber", + "BENationalNumber", + "BEValueAddedTaxNumber", + "BRCPFNumber", + "BRLegalEntityNumber", + "BRNationalIDRG", + "BGUniformCivilNumber", + "CABankAccountNumber", + "CADriversLicenseNumber", + "CAHealthServiceNumber", + "CAPassportNumber", + "CAPersonalHealthID", + "CASocialInsuranceNumber", + "CLIdentityCardNumber", + "CNResidentIdentityCardNumber", + "CreditCardNumber", + "HRIdentityCardNumber", + "HRNationalIDCardNumber", + "HRPersonalIdentificationNumber", + "CYIdentityCard", + "CYTaxIdentificationNumber", + "CZPersonalIdentityNumber", + "Date", + "DateTime", + "DKPersonalIdentificationNumber", + "DEANumber", + "Email", + "EEPersonalIdentificationCode", + "EUDebitCardNumber", + "EUDriversLicenseNumber", + "EUGPSCoordinates", + "EUNationalIdentificationNumber", + "EUPassportNumber", + "EUSocialSecurityNumber", + "EUTaxIdentificationNumber", + "FIEuropeanHealthNumber", + "FINationalID", + "FIPassportNumber", + "FRDriversLicenseNumber", + "FRHealthInsuranceNumber", + "FRNationalID", + "FRPassportNumber", + "FRSocialSecurityNumber", + "FRTaxIdentificationNumber", + "FRValueAddedTaxNumber", + "DEDriversLicenseNumber", + "DEPassportNumber", + "DEIdentityCardNumber", + "DETaxIdentificationNumber", + "DEValueAddedTaxNumber", + "GRNationalIDCard", + "GRTaxIdentificationNumber", + "HKIdentityCardNumber", + "HUValueAddedTaxNumber", + "HUPersonalIdentificationNumber", + "HUTaxIdentificationNumber", + "INPermanentAccountNumber", + "INUniqueIdentificationNumber", + "IDIdentityCardNumber", + "InternationalBankingAccountNumber", + "IPAddress", + "IEPersonalPublicServiceNumber", + "ILBankAccountNumber", + "ILNationalID", + "ITDriversLicenseNumber", + "ITFiscalCode", + "ITValueAddedTaxNumber", + "JPBankAccountNumber", + "JPDriversLicenseNumber", + "JPPassportNumber", + "JPResidentRegistrationNumber", + "JPSocialInsuranceNumber", + "JPMyNumberCorporate", + "JPMyNumberPersonal", + "JPResidenceCardNumber", + "LVPersonalCode", + "LTPersonalCode", + "LUNationalIdentificationNumberNatural", + "LUNationalIdentificationNumberNonNatural", + "MYIdentityCardNumber", + "MTIdentityCardNumber", + "MTTaxIDNumber", + "NLCitizensServiceNumber", + "NLTaxIdentificationNumber", + "NLValueAddedTaxNumber", + "NZBankAccountNumber", + "NZDriversLicenseNumber", + "NZInlandRevenueNumber", + "NZMinistryOfHealthNumber", + "NZSocialWelfareNumber", + "NOIdentityNumber", + "Organization", + "Person", + "PersonType", + "PHUnifiedMultiPurposeIDNumber", + "PhoneNumber", + "PLIdentityCard", + "PLNationalID", + "PLPassportNumber", + "PLTaxIdentificationNumber", + "PLREGONNumber", + "PTCitizenCardNumber", + "PTTaxIdentificationNumber", + "ROPersonalNumericalCode", + "RUPassportNumberDomestic", + "RUPassportNumberInternational", + "SANationalID", + "SGNationalRegistrationIdentityCardNumber", + "SKPersonalNumber", + "SITaxIdentificationNumber", + "SIUniqueMasterCitizenNumber", + "ZAIdentificationNumber", + "KRResidentRegistrationNumber", + "ESDNI", + "ESSocialSecurityNumber", + "ESTaxIdentificationNumber", + "AzureSQLConnectionString", + "SENationalID", + "SEPassportNumber", + "SETaxIdentificationNumber", + "SWIFTCode", + "CHSocialSecurityNumber", + "TWNationalID", + "TWPassportNumber", + "TWResidentCertificate", + "THPopulationIdentificationCode", + "TRNationalIdentificationNumber", + "UKDriversLicenseNumber", + "UKElectoralRollNumber", + "UKNationalHealthNumber", + "UKNationalInsuranceNumber", + "UKUniqueTaxpayerNumber", + "USUKPassportNumber", + "USBankAccountNumber", + "USDriversLicenseNumber", + "USIndividualTaxpayerIdentification", + "USSocialSecurityNumber", + "URL", +]); export declare namespace AzurePiiCategory { - export type Raw = "*" | "ABARoutingNumber" | "Address" | "Age" | "ARNationalIdentityNumber" | "AUBankAccountNumber" | "AUDriversLicenseNumber" | "AUMedicalAccountNumber" | "AUPassportNumber" | "AUTaxFileNumber" | "AUBusinessNumber" | "AUCompanyNumber" | "ATIdentityCard" | "ATTaxIdentificationNumber" | "ATValueAddedTaxNumber" | "AzureDocumentDBAuthKey" | "AzureIAASDatabaseConnectionAndSQLString" | "AzureIoTConnectionString" | "AzurePublishSettingPassword" | "AzureRedisCacheString" | "AzureSAS" | "AzureServiceBusString" | "AzureStorageAccountKey" | "AzureStorageAccountGeneric" | "BankAccountNumber" | "BENationalNumber" | "BEValueAddedTaxNumber" | "BRCPFNumber" | "BRLegalEntityNumber" | "BRNationalIDRG" | "BGUniformCivilNumber" | "CABankAccountNumber" | "CADriversLicenseNumber" | "CAHealthServiceNumber" | "CAPassportNumber" | "CAPersonalHealthID" | "CASocialInsuranceNumber" | "CLIdentityCardNumber" | "CNResidentIdentityCardNumber" | "CreditCardNumber" | "HRIdentityCardNumber" | "HRNationalIDCardNumber" | "HRPersonalIdentificationNumber" | "CYIdentityCard" | "CYTaxIdentificationNumber" | "CZPersonalIdentityNumber" | "Date" | "DateTime" | "DKPersonalIdentificationNumber" | "DEANumber" | "Email" | "EEPersonalIdentificationCode" | "EUDebitCardNumber" | "EUDriversLicenseNumber" | "EUGPSCoordinates" | "EUNationalIdentificationNumber" | "EUPassportNumber" | "EUSocialSecurityNumber" | "EUTaxIdentificationNumber" | "FIEuropeanHealthNumber" | "FINationalID" | "FIPassportNumber" | "FRDriversLicenseNumber" | "FRHealthInsuranceNumber" | "FRNationalID" | "FRPassportNumber" | "FRSocialSecurityNumber" | "FRTaxIdentificationNumber" | "FRValueAddedTaxNumber" | "DEDriversLicenseNumber" | "DEPassportNumber" | "DEIdentityCardNumber" | "DETaxIdentificationNumber" | "DEValueAddedTaxNumber" | "GRNationalIDCard" | "GRTaxIdentificationNumber" | "HKIdentityCardNumber" | "HUValueAddedTaxNumber" | "HUPersonalIdentificationNumber" | "HUTaxIdentificationNumber" | "INPermanentAccountNumber" | "INUniqueIdentificationNumber" | "IDIdentityCardNumber" | "InternationalBankingAccountNumber" | "IPAddress" | "IEPersonalPublicServiceNumber" | "ILBankAccountNumber" | "ILNationalID" | "ITDriversLicenseNumber" | "ITFiscalCode" | "ITValueAddedTaxNumber" | "JPBankAccountNumber" | "JPDriversLicenseNumber" | "JPPassportNumber" | "JPResidentRegistrationNumber" | "JPSocialInsuranceNumber" | "JPMyNumberCorporate" | "JPMyNumberPersonal" | "JPResidenceCardNumber" | "LVPersonalCode" | "LTPersonalCode" | "LUNationalIdentificationNumberNatural" | "LUNationalIdentificationNumberNonNatural" | "MYIdentityCardNumber" | "MTIdentityCardNumber" | "MTTaxIDNumber" | "NLCitizensServiceNumber" | "NLTaxIdentificationNumber" | "NLValueAddedTaxNumber" | "NZBankAccountNumber" | "NZDriversLicenseNumber" | "NZInlandRevenueNumber" | "NZMinistryOfHealthNumber" | "NZSocialWelfareNumber" | "NOIdentityNumber" | "Organization" | "Person" | "PersonType" | "PHUnifiedMultiPurposeIDNumber" | "PhoneNumber" | "PLIdentityCard" | "PLNationalID" | "PLPassportNumber" | "PLTaxIdentificationNumber" | "PLREGONNumber" | "PTCitizenCardNumber" | "PTTaxIdentificationNumber" | "ROPersonalNumericalCode" | "RUPassportNumberDomestic" | "RUPassportNumberInternational" | "SANationalID" | "SGNationalRegistrationIdentityCardNumber" | "SKPersonalNumber" | "SITaxIdentificationNumber" | "SIUniqueMasterCitizenNumber" | "ZAIdentificationNumber" | "KRResidentRegistrationNumber" | "ESDNI" | "ESSocialSecurityNumber" | "ESTaxIdentificationNumber" | "AzureSQLConnectionString" | "SENationalID" | "SEPassportNumber" | "SETaxIdentificationNumber" | "SWIFTCode" | "CHSocialSecurityNumber" | "TWNationalID" | "TWPassportNumber" | "TWResidentCertificate" | "THPopulationIdentificationCode" | "TRNationalIdentificationNumber" | "UKDriversLicenseNumber" | "UKElectoralRollNumber" | "UKNationalHealthNumber" | "UKNationalInsuranceNumber" | "UKUniqueTaxpayerNumber" | "USUKPassportNumber" | "USBankAccountNumber" | "USDriversLicenseNumber" | "USIndividualTaxpayerIdentification" | "USSocialSecurityNumber" | "URL"; + export type Raw = + | "*" + | "ABARoutingNumber" + | "Address" + | "Age" + | "ARNationalIdentityNumber" + | "AUBankAccountNumber" + | "AUDriversLicenseNumber" + | "AUMedicalAccountNumber" + | "AUPassportNumber" + | "AUTaxFileNumber" + | "AUBusinessNumber" + | "AUCompanyNumber" + | "ATIdentityCard" + | "ATTaxIdentificationNumber" + | "ATValueAddedTaxNumber" + | "AzureDocumentDBAuthKey" + | "AzureIAASDatabaseConnectionAndSQLString" + | "AzureIoTConnectionString" + | "AzurePublishSettingPassword" + | "AzureRedisCacheString" + | "AzureSAS" + | "AzureServiceBusString" + | "AzureStorageAccountKey" + | "AzureStorageAccountGeneric" + | "BankAccountNumber" + | "BENationalNumber" + | "BEValueAddedTaxNumber" + | "BRCPFNumber" + | "BRLegalEntityNumber" + | "BRNationalIDRG" + | "BGUniformCivilNumber" + | "CABankAccountNumber" + | "CADriversLicenseNumber" + | "CAHealthServiceNumber" + | "CAPassportNumber" + | "CAPersonalHealthID" + | "CASocialInsuranceNumber" + | "CLIdentityCardNumber" + | "CNResidentIdentityCardNumber" + | "CreditCardNumber" + | "HRIdentityCardNumber" + | "HRNationalIDCardNumber" + | "HRPersonalIdentificationNumber" + | "CYIdentityCard" + | "CYTaxIdentificationNumber" + | "CZPersonalIdentityNumber" + | "Date" + | "DateTime" + | "DKPersonalIdentificationNumber" + | "DEANumber" + | "Email" + | "EEPersonalIdentificationCode" + | "EUDebitCardNumber" + | "EUDriversLicenseNumber" + | "EUGPSCoordinates" + | "EUNationalIdentificationNumber" + | "EUPassportNumber" + | "EUSocialSecurityNumber" + | "EUTaxIdentificationNumber" + | "FIEuropeanHealthNumber" + | "FINationalID" + | "FIPassportNumber" + | "FRDriversLicenseNumber" + | "FRHealthInsuranceNumber" + | "FRNationalID" + | "FRPassportNumber" + | "FRSocialSecurityNumber" + | "FRTaxIdentificationNumber" + | "FRValueAddedTaxNumber" + | "DEDriversLicenseNumber" + | "DEPassportNumber" + | "DEIdentityCardNumber" + | "DETaxIdentificationNumber" + | "DEValueAddedTaxNumber" + | "GRNationalIDCard" + | "GRTaxIdentificationNumber" + | "HKIdentityCardNumber" + | "HUValueAddedTaxNumber" + | "HUPersonalIdentificationNumber" + | "HUTaxIdentificationNumber" + | "INPermanentAccountNumber" + | "INUniqueIdentificationNumber" + | "IDIdentityCardNumber" + | "InternationalBankingAccountNumber" + | "IPAddress" + | "IEPersonalPublicServiceNumber" + | "ILBankAccountNumber" + | "ILNationalID" + | "ITDriversLicenseNumber" + | "ITFiscalCode" + | "ITValueAddedTaxNumber" + | "JPBankAccountNumber" + | "JPDriversLicenseNumber" + | "JPPassportNumber" + | "JPResidentRegistrationNumber" + | "JPSocialInsuranceNumber" + | "JPMyNumberCorporate" + | "JPMyNumberPersonal" + | "JPResidenceCardNumber" + | "LVPersonalCode" + | "LTPersonalCode" + | "LUNationalIdentificationNumberNatural" + | "LUNationalIdentificationNumberNonNatural" + | "MYIdentityCardNumber" + | "MTIdentityCardNumber" + | "MTTaxIDNumber" + | "NLCitizensServiceNumber" + | "NLTaxIdentificationNumber" + | "NLValueAddedTaxNumber" + | "NZBankAccountNumber" + | "NZDriversLicenseNumber" + | "NZInlandRevenueNumber" + | "NZMinistryOfHealthNumber" + | "NZSocialWelfareNumber" + | "NOIdentityNumber" + | "Organization" + | "Person" + | "PersonType" + | "PHUnifiedMultiPurposeIDNumber" + | "PhoneNumber" + | "PLIdentityCard" + | "PLNationalID" + | "PLPassportNumber" + | "PLTaxIdentificationNumber" + | "PLREGONNumber" + | "PTCitizenCardNumber" + | "PTTaxIdentificationNumber" + | "ROPersonalNumericalCode" + | "RUPassportNumberDomestic" + | "RUPassportNumberInternational" + | "SANationalID" + | "SGNationalRegistrationIdentityCardNumber" + | "SKPersonalNumber" + | "SITaxIdentificationNumber" + | "SIUniqueMasterCitizenNumber" + | "ZAIdentificationNumber" + | "KRResidentRegistrationNumber" + | "ESDNI" + | "ESSocialSecurityNumber" + | "ESTaxIdentificationNumber" + | "AzureSQLConnectionString" + | "SENationalID" + | "SEPassportNumber" + | "SETaxIdentificationNumber" + | "SWIFTCode" + | "CHSocialSecurityNumber" + | "TWNationalID" + | "TWPassportNumber" + | "TWResidentCertificate" + | "THPopulationIdentificationCode" + | "TRNationalIdentificationNumber" + | "UKDriversLicenseNumber" + | "UKElectoralRollNumber" + | "UKNationalHealthNumber" + | "UKNationalInsuranceNumber" + | "UKUniqueTaxpayerNumber" + | "USUKPassportNumber" + | "USBankAccountNumber" + | "USDriversLicenseNumber" + | "USIndividualTaxpayerIdentification" + | "USSocialSecurityNumber" + | "URL"; } diff --git a/src/serialization/types/AzurePiiGuardrailConfig.ts b/src/serialization/types/AzurePiiGuardrailConfig.ts index 98943909..9d6ece6d 100644 --- a/src/serialization/types/AzurePiiGuardrailConfig.ts +++ b/src/serialization/types/AzurePiiGuardrailConfig.ts @@ -1,23 +1,26 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AzurePiiGuardrailConfigAuthData } from "./AzurePiiGuardrailConfigAuthData.js"; import { AzurePiiGuardrailConfigConfig } from "./AzurePiiGuardrailConfigConfig.js"; import { AzurePiiGuardrailConfigOperation } from "./AzurePiiGuardrailConfigOperation.js"; import { EnforcingStrategy } from "./EnforcingStrategy.js"; -export const AzurePiiGuardrailConfig: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string().optional(), - "type": core.serialization.stringLiteral("integration/guardrail-config/azure-pii"), - "authData": core.serialization.property("auth_data", AzurePiiGuardrailConfigAuthData), - "operation": AzurePiiGuardrailConfigOperation, - "priority": core.serialization.number().optional(), - "enforcingStrategy": core.serialization.property("enforcing_strategy", EnforcingStrategy), - "config": AzurePiiGuardrailConfigConfig - }); +export const AzurePiiGuardrailConfig: core.serialization.ObjectSchema< + serializers.AzurePiiGuardrailConfig.Raw, + TrueFoundry.AzurePiiGuardrailConfig +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + type: core.serialization.stringLiteral("integration/guardrail-config/azure-pii"), + authData: core.serialization.property("auth_data", AzurePiiGuardrailConfigAuthData), + operation: AzurePiiGuardrailConfigOperation, + priority: core.serialization.number().optional(), + enforcingStrategy: core.serialization.property("enforcing_strategy", EnforcingStrategy), + config: AzurePiiGuardrailConfigConfig, +}); export declare namespace AzurePiiGuardrailConfig { export interface Raw { diff --git a/src/serialization/types/AzurePiiGuardrailConfigAuthData.ts b/src/serialization/types/AzurePiiGuardrailConfigAuthData.ts index 4f677e14..67ff0704 100644 --- a/src/serialization/types/AzurePiiGuardrailConfigAuthData.ts +++ b/src/serialization/types/AzurePiiGuardrailConfigAuthData.ts @@ -1,15 +1,27 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AzureCertificateAuth } from "./AzureCertificateAuth.js"; import { AzureClientSecretAuth } from "./AzureClientSecretAuth.js"; import { AzureKeyAuth } from "./AzureKeyAuth.js"; import { AzureWorkloadIdentityAuth } from "./AzureWorkloadIdentityAuth.js"; -export const AzurePiiGuardrailConfigAuthData: core.serialization.Schema = core.serialization.undiscriminatedUnion([AzureKeyAuth, AzureCertificateAuth, AzureClientSecretAuth, AzureWorkloadIdentityAuth]); +export const AzurePiiGuardrailConfigAuthData: core.serialization.Schema< + serializers.AzurePiiGuardrailConfigAuthData.Raw, + TrueFoundry.AzurePiiGuardrailConfigAuthData +> = core.serialization.undiscriminatedUnion([ + AzureKeyAuth, + AzureCertificateAuth, + AzureClientSecretAuth, + AzureWorkloadIdentityAuth, +]); export declare namespace AzurePiiGuardrailConfigAuthData { - export type Raw = AzureKeyAuth.Raw | AzureCertificateAuth.Raw | AzureClientSecretAuth.Raw | AzureWorkloadIdentityAuth.Raw; + export type Raw = + | AzureKeyAuth.Raw + | AzureCertificateAuth.Raw + | AzureClientSecretAuth.Raw + | AzureWorkloadIdentityAuth.Raw; } diff --git a/src/serialization/types/AzurePiiGuardrailConfigConfig.ts b/src/serialization/types/AzurePiiGuardrailConfigConfig.ts index 209b7027..77cdda8b 100644 --- a/src/serialization/types/AzurePiiGuardrailConfigConfig.ts +++ b/src/serialization/types/AzurePiiGuardrailConfigConfig.ts @@ -1,20 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AzurePiiCategory } from "./AzurePiiCategory.js"; import { AzurePiiGuardrailConfigConfigDomain } from "./AzurePiiGuardrailConfigConfigDomain.js"; -export const AzurePiiGuardrailConfigConfig: core.serialization.ObjectSchema = core.serialization.object({ - "resourceName": core.serialization.property("resource_name", core.serialization.string()), - "apiVersion": core.serialization.property("api_version", core.serialization.string()), - "customHost": core.serialization.property("custom_host", core.serialization.string().optional()), - "domain": AzurePiiGuardrailConfigConfigDomain, - "piiCategories": core.serialization.property("pii_categories", core.serialization.list(AzurePiiCategory)), - "modelVersion": core.serialization.property("model_version", core.serialization.string()), - "language": core.serialization.string() - }); +export const AzurePiiGuardrailConfigConfig: core.serialization.ObjectSchema< + serializers.AzurePiiGuardrailConfigConfig.Raw, + TrueFoundry.AzurePiiGuardrailConfigConfig +> = core.serialization.object({ + resourceName: core.serialization.property("resource_name", core.serialization.string()), + apiVersion: core.serialization.property("api_version", core.serialization.string()), + customHost: core.serialization.property("custom_host", core.serialization.string().optional()), + domain: AzurePiiGuardrailConfigConfigDomain, + piiCategories: core.serialization.property("pii_categories", core.serialization.list(AzurePiiCategory)), + modelVersion: core.serialization.property("model_version", core.serialization.string()), + language: core.serialization.string(), +}); export declare namespace AzurePiiGuardrailConfigConfig { export interface Raw { diff --git a/src/serialization/types/AzurePiiGuardrailConfigConfigDomain.ts b/src/serialization/types/AzurePiiGuardrailConfigConfigDomain.ts index 16348f3d..ef132d86 100644 --- a/src/serialization/types/AzurePiiGuardrailConfigConfigDomain.ts +++ b/src/serialization/types/AzurePiiGuardrailConfigConfigDomain.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AzurePiiGuardrailConfigConfigDomain: core.serialization.Schema = core.serialization.enum_(["none", "phi"]); +export const AzurePiiGuardrailConfigConfigDomain: core.serialization.Schema< + serializers.AzurePiiGuardrailConfigConfigDomain.Raw, + TrueFoundry.AzurePiiGuardrailConfigConfigDomain +> = core.serialization.enum_(["none", "phi"]); export declare namespace AzurePiiGuardrailConfigConfigDomain { export type Raw = "none" | "phi"; diff --git a/src/serialization/types/AzurePiiGuardrailConfigOperation.ts b/src/serialization/types/AzurePiiGuardrailConfigOperation.ts index 6253bf79..65bb3ed0 100644 --- a/src/serialization/types/AzurePiiGuardrailConfigOperation.ts +++ b/src/serialization/types/AzurePiiGuardrailConfigOperation.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AzurePiiGuardrailConfigOperation: core.serialization.Schema = core.serialization.enum_(["mutate", "validate"]); +export const AzurePiiGuardrailConfigOperation: core.serialization.Schema< + serializers.AzurePiiGuardrailConfigOperation.Raw, + TrueFoundry.AzurePiiGuardrailConfigOperation +> = core.serialization.enum_(["mutate", "validate"]); export declare namespace AzurePiiGuardrailConfigOperation { export type Raw = "mutate" | "validate"; diff --git a/src/serialization/types/AzurePromptShieldGuardrailConfig.ts b/src/serialization/types/AzurePromptShieldGuardrailConfig.ts index 0287d9d8..9fcc411b 100644 --- a/src/serialization/types/AzurePromptShieldGuardrailConfig.ts +++ b/src/serialization/types/AzurePromptShieldGuardrailConfig.ts @@ -1,21 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AzurePromptShieldGuardrailConfigAuthData } from "./AzurePromptShieldGuardrailConfigAuthData.js"; import { AzurePromptShieldGuardrailConfigConfig } from "./AzurePromptShieldGuardrailConfigConfig.js"; import { EnforcingStrategy } from "./EnforcingStrategy.js"; -export const AzurePromptShieldGuardrailConfig: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string().optional(), - "type": core.serialization.stringLiteral("integration/guardrail-config/azure-prompt-shield"), - "authData": core.serialization.property("auth_data", AzurePromptShieldGuardrailConfigAuthData), - "operation": core.serialization.stringLiteral("validate"), - "enforcingStrategy": core.serialization.property("enforcing_strategy", EnforcingStrategy), - "config": AzurePromptShieldGuardrailConfigConfig - }); +export const AzurePromptShieldGuardrailConfig: core.serialization.ObjectSchema< + serializers.AzurePromptShieldGuardrailConfig.Raw, + TrueFoundry.AzurePromptShieldGuardrailConfig +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + type: core.serialization.stringLiteral("integration/guardrail-config/azure-prompt-shield"), + authData: core.serialization.property("auth_data", AzurePromptShieldGuardrailConfigAuthData), + operation: core.serialization.stringLiteral("validate"), + enforcingStrategy: core.serialization.property("enforcing_strategy", EnforcingStrategy), + config: AzurePromptShieldGuardrailConfigConfig, +}); export declare namespace AzurePromptShieldGuardrailConfig { export interface Raw { diff --git a/src/serialization/types/AzurePromptShieldGuardrailConfigAuthData.ts b/src/serialization/types/AzurePromptShieldGuardrailConfigAuthData.ts index 3dec73cc..9f8a57ad 100644 --- a/src/serialization/types/AzurePromptShieldGuardrailConfigAuthData.ts +++ b/src/serialization/types/AzurePromptShieldGuardrailConfigAuthData.ts @@ -1,15 +1,27 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AzureCertificateAuth } from "./AzureCertificateAuth.js"; import { AzureClientSecretAuth } from "./AzureClientSecretAuth.js"; import { AzureKeyAuth } from "./AzureKeyAuth.js"; import { AzureWorkloadIdentityAuth } from "./AzureWorkloadIdentityAuth.js"; -export const AzurePromptShieldGuardrailConfigAuthData: core.serialization.Schema = core.serialization.undiscriminatedUnion([AzureKeyAuth, AzureCertificateAuth, AzureClientSecretAuth, AzureWorkloadIdentityAuth]); +export const AzurePromptShieldGuardrailConfigAuthData: core.serialization.Schema< + serializers.AzurePromptShieldGuardrailConfigAuthData.Raw, + TrueFoundry.AzurePromptShieldGuardrailConfigAuthData +> = core.serialization.undiscriminatedUnion([ + AzureKeyAuth, + AzureCertificateAuth, + AzureClientSecretAuth, + AzureWorkloadIdentityAuth, +]); export declare namespace AzurePromptShieldGuardrailConfigAuthData { - export type Raw = AzureKeyAuth.Raw | AzureCertificateAuth.Raw | AzureClientSecretAuth.Raw | AzureWorkloadIdentityAuth.Raw; + export type Raw = + | AzureKeyAuth.Raw + | AzureCertificateAuth.Raw + | AzureClientSecretAuth.Raw + | AzureWorkloadIdentityAuth.Raw; } diff --git a/src/serialization/types/AzurePromptShieldGuardrailConfigConfig.ts b/src/serialization/types/AzurePromptShieldGuardrailConfigConfig.ts index 6eef822f..1142d102 100644 --- a/src/serialization/types/AzurePromptShieldGuardrailConfigConfig.ts +++ b/src/serialization/types/AzurePromptShieldGuardrailConfigConfig.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AzurePromptShieldGuardrailConfigConfig: core.serialization.ObjectSchema = core.serialization.object({ - "resourceName": core.serialization.property("resource_name", core.serialization.string()), - "apiVersion": core.serialization.property("api_version", core.serialization.string()), - "customHost": core.serialization.property("custom_host", core.serialization.string().optional()) - }); +export const AzurePromptShieldGuardrailConfigConfig: core.serialization.ObjectSchema< + serializers.AzurePromptShieldGuardrailConfigConfig.Raw, + TrueFoundry.AzurePromptShieldGuardrailConfigConfig +> = core.serialization.object({ + resourceName: core.serialization.property("resource_name", core.serialization.string()), + apiVersion: core.serialization.property("api_version", core.serialization.string()), + customHost: core.serialization.property("custom_host", core.serialization.string().optional()), +}); export declare namespace AzurePromptShieldGuardrailConfigConfig { export interface Raw { diff --git a/src/serialization/types/AzureProviderAccount.ts b/src/serialization/types/AzureProviderAccount.ts index eeb4e92d..51de4076 100644 --- a/src/serialization/types/AzureProviderAccount.ts +++ b/src/serialization/types/AzureProviderAccount.ts @@ -1,18 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AzureIntegrations } from "./AzureIntegrations.js"; import { OwnedBy } from "./OwnedBy.js"; -export const AzureProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/azure"), - "name": core.serialization.string(), - "subscriptionId": core.serialization.property("subscription_id", core.serialization.string().optional()), - "integrations": core.serialization.list(AzureIntegrations), - "ownedBy": OwnedBy.optional() - }); +export const AzureProviderAccount: core.serialization.ObjectSchema< + serializers.AzureProviderAccount.Raw, + TrueFoundry.AzureProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/azure"), + name: core.serialization.string(), + subscriptionId: core.serialization.property("subscription_id", core.serialization.string().optional()), + integrations: core.serialization.list(AzureIntegrations), + ownedBy: OwnedBy.optional(), +}); export declare namespace AzureProviderAccount { export interface Raw { diff --git a/src/serialization/types/AzureReposIntegration.ts b/src/serialization/types/AzureReposIntegration.ts index 5360dff9..296b2d34 100644 --- a/src/serialization/types/AzureReposIntegration.ts +++ b/src/serialization/types/AzureReposIntegration.ts @@ -1,17 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AzureReposIntegrationAuthData } from "./AzureReposIntegrationAuthData.js"; -export const AzureReposIntegration: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/vcs/azure"), - "name": core.serialization.string(), - "accountName": core.serialization.property("account_name", core.serialization.string()), - "authData": core.serialization.property("auth_data", AzureReposIntegrationAuthData.optional()), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const AzureReposIntegration: core.serialization.ObjectSchema< + serializers.AzureReposIntegration.Raw, + TrueFoundry.AzureReposIntegration +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/vcs/azure"), + name: core.serialization.string(), + accountName: core.serialization.property("account_name", core.serialization.string()), + authData: core.serialization.property("auth_data", AzureReposIntegrationAuthData.optional()), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace AzureReposIntegration { export interface Raw { diff --git a/src/serialization/types/AzureReposIntegrationAuthData.ts b/src/serialization/types/AzureReposIntegrationAuthData.ts index 40056a50..c3618210 100644 --- a/src/serialization/types/AzureReposIntegrationAuthData.ts +++ b/src/serialization/types/AzureReposIntegrationAuthData.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { VcsoAuthAuthData } from "./VcsoAuthAuthData.js"; import { VcsTokenAuthData } from "./VcsTokenAuthData.js"; -export const AzureReposIntegrationAuthData: core.serialization.Schema = core.serialization.undiscriminatedUnion([VcsoAuthAuthData, VcsTokenAuthData]); +export const AzureReposIntegrationAuthData: core.serialization.Schema< + serializers.AzureReposIntegrationAuthData.Raw, + TrueFoundry.AzureReposIntegrationAuthData +> = core.serialization.undiscriminatedUnion([VcsoAuthAuthData, VcsTokenAuthData]); export declare namespace AzureReposIntegrationAuthData { export type Raw = VcsoAuthAuthData.Raw | VcsTokenAuthData.Raw; diff --git a/src/serialization/types/AzureVault.ts b/src/serialization/types/AzureVault.ts index f3b86e0a..6a99f3fa 100644 --- a/src/serialization/types/AzureVault.ts +++ b/src/serialization/types/AzureVault.ts @@ -1,16 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AzureOAuth } from "./AzureOAuth.js"; -export const AzureVault: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/secret-store/azure/vault"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", AzureOAuth.optional()), - "keyVaultName": core.serialization.property("key_vault_name", core.serialization.string()), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) +export const AzureVault: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("integration/secret-store/azure/vault"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", AzureOAuth.optional()), + keyVaultName: core.serialization.property("key_vault_name", core.serialization.string()), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace AzureVault { diff --git a/src/serialization/types/AzureWorkloadIdentityAuth.ts b/src/serialization/types/AzureWorkloadIdentityAuth.ts index 262131c9..d0cf5e2e 100644 --- a/src/serialization/types/AzureWorkloadIdentityAuth.ts +++ b/src/serialization/types/AzureWorkloadIdentityAuth.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const AzureWorkloadIdentityAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("workload-identity"), - "tenantId": core.serialization.property("tenant_id", core.serialization.string()), - "clientId": core.serialization.property("client_id", core.serialization.string()) - }); +export const AzureWorkloadIdentityAuth: core.serialization.ObjectSchema< + serializers.AzureWorkloadIdentityAuth.Raw, + TrueFoundry.AzureWorkloadIdentityAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("workload-identity"), + tenantId: core.serialization.property("tenant_id", core.serialization.string()), + clientId: core.serialization.property("client_id", core.serialization.string()), +}); export declare namespace AzureWorkloadIdentityAuth { export interface Raw { diff --git a/src/serialization/types/BaseArtifactVersion.ts b/src/serialization/types/BaseArtifactVersion.ts index 0489c710..51b51ebb 100644 --- a/src/serialization/types/BaseArtifactVersion.ts +++ b/src/serialization/types/BaseArtifactVersion.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const BaseArtifactVersion: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string().optional(), - "metadata": core.serialization.record(core.serialization.string(), core.serialization.unknown()), - "mlRepo": core.serialization.property("ml_repo", core.serialization.string().optional()), - "version": core.serialization.number().optional() - }); +export const BaseArtifactVersion: core.serialization.ObjectSchema< + serializers.BaseArtifactVersion.Raw, + TrueFoundry.BaseArtifactVersion +> = core.serialization.object({ + name: core.serialization.string().optional(), + metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()), + mlRepo: core.serialization.property("ml_repo", core.serialization.string().optional()), + version: core.serialization.number().optional(), +}); export declare namespace BaseArtifactVersion { export interface Raw { diff --git a/src/serialization/types/BaseAutoscaling.ts b/src/serialization/types/BaseAutoscaling.ts index 47346d10..15a3972f 100644 --- a/src/serialization/types/BaseAutoscaling.ts +++ b/src/serialization/types/BaseAutoscaling.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const BaseAutoscaling: core.serialization.ObjectSchema = core.serialization.object({ - "minReplicas": core.serialization.property("min_replicas", core.serialization.number()), - "maxReplicas": core.serialization.property("max_replicas", core.serialization.number()), - "pollingInterval": core.serialization.property("polling_interval", core.serialization.number().optional()) - }); +export const BaseAutoscaling: core.serialization.ObjectSchema< + serializers.BaseAutoscaling.Raw, + TrueFoundry.BaseAutoscaling +> = core.serialization.object({ + minReplicas: core.serialization.property("min_replicas", core.serialization.number()), + maxReplicas: core.serialization.property("max_replicas", core.serialization.number()), + pollingInterval: core.serialization.property("polling_interval", core.serialization.number().optional()), +}); export declare namespace BaseAutoscaling { export interface Raw { diff --git a/src/serialization/types/BaseOAuth2Login.ts b/src/serialization/types/BaseOAuth2Login.ts index a64bff7c..84976d3e 100644 --- a/src/serialization/types/BaseOAuth2Login.ts +++ b/src/serialization/types/BaseOAuth2Login.ts @@ -1,18 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BaseOAuth2LoginJwtSource } from "./BaseOAuth2LoginJwtSource.js"; -export const BaseOAuth2Login: core.serialization.ObjectSchema = core.serialization.object({ - "clientId": core.serialization.property("client_id", core.serialization.string()), - "clientSecret": core.serialization.property("client_secret", core.serialization.string().optional()), - "authorizationUrl": core.serialization.property("authorization_url", core.serialization.string()), - "tokenUrl": core.serialization.property("token_url", core.serialization.string()), - "scopes": core.serialization.list(core.serialization.string()), - "jwtSource": core.serialization.property("jwt_source", BaseOAuth2LoginJwtSource) - }); +export const BaseOAuth2Login: core.serialization.ObjectSchema< + serializers.BaseOAuth2Login.Raw, + TrueFoundry.BaseOAuth2Login +> = core.serialization.object({ + clientId: core.serialization.property("client_id", core.serialization.string()), + clientSecret: core.serialization.property("client_secret", core.serialization.string().optional()), + authorizationUrl: core.serialization.property("authorization_url", core.serialization.string()), + tokenUrl: core.serialization.property("token_url", core.serialization.string()), + scopes: core.serialization.list(core.serialization.string()), + jwtSource: core.serialization.property("jwt_source", BaseOAuth2LoginJwtSource), +}); export declare namespace BaseOAuth2Login { export interface Raw { diff --git a/src/serialization/types/BaseOAuth2LoginJwtSource.ts b/src/serialization/types/BaseOAuth2LoginJwtSource.ts index 4f333f2a..57013016 100644 --- a/src/serialization/types/BaseOAuth2LoginJwtSource.ts +++ b/src/serialization/types/BaseOAuth2LoginJwtSource.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const BaseOAuth2LoginJwtSource: core.serialization.Schema = core.serialization.enum_(["access_token", "id_token"]); +export const BaseOAuth2LoginJwtSource: core.serialization.Schema< + serializers.BaseOAuth2LoginJwtSource.Raw, + TrueFoundry.BaseOAuth2LoginJwtSource +> = core.serialization.enum_(["access_token", "id_token"]); export declare namespace BaseOAuth2LoginJwtSource { export type Raw = "access_token" | "id_token"; diff --git a/src/serialization/types/BaseRemoteAgent.ts b/src/serialization/types/BaseRemoteAgent.ts index e2345b49..f4824c18 100644 --- a/src/serialization/types/BaseRemoteAgent.ts +++ b/src/serialization/types/BaseRemoteAgent.ts @@ -1,18 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { OwnedBy } from "./OwnedBy.js"; -export const BaseRemoteAgent: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string(), - "tags": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - "collaborators": core.serialization.list(Collaborator), - "ownedBy": OwnedBy.optional() - }); +export const BaseRemoteAgent: core.serialization.ObjectSchema< + serializers.BaseRemoteAgent.Raw, + TrueFoundry.BaseRemoteAgent +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string(), + tags: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + collaborators: core.serialization.list(Collaborator), + ownedBy: OwnedBy.optional(), +}); export declare namespace BaseRemoteAgent { export interface Raw { diff --git a/src/serialization/types/BaseService.ts b/src/serialization/types/BaseService.ts index 1074ae20..f075a81d 100644 --- a/src/serialization/types/BaseService.ts +++ b/src/serialization/types/BaseService.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ArtifactsDownload } from "./ArtifactsDownload.js"; import { BaseServiceImage } from "./BaseServiceImage.js"; import { BaseServiceMountsItem } from "./BaseServiceMountsItem.js"; @@ -11,21 +11,24 @@ import { Kustomize } from "./Kustomize.js"; import { Port } from "./Port.js"; import { Resources } from "./Resources.js"; -export const BaseService: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "image": BaseServiceImage, - "artifactsDownload": core.serialization.property("artifacts_download", ArtifactsDownload.optional()), - "resources": Resources.optional(), - "env": core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), - "ports": core.serialization.list(Port), - "serviceAccount": core.serialization.property("service_account", core.serialization.string().optional()), - "mounts": core.serialization.list(BaseServiceMountsItem).optional(), - "labels": core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), - "kustomize": Kustomize.optional(), - "livenessProbe": core.serialization.property("liveness_probe", HealthProbe.optional()), - "readinessProbe": core.serialization.property("readiness_probe", HealthProbe.optional()), - "startupProbe": core.serialization.property("startup_probe", HealthProbe.optional()), - "workspaceFqn": core.serialization.property("workspace_fqn", core.serialization.string().optional()) +export const BaseService: core.serialization.ObjectSchema = + core.serialization.object({ + name: core.serialization.string(), + image: BaseServiceImage, + artifactsDownload: core.serialization.property("artifacts_download", ArtifactsDownload.optional()), + resources: Resources.optional(), + env: core.serialization + .record(core.serialization.string(), core.serialization.string().nullable()) + .optionalNullable(), + ports: core.serialization.list(Port), + serviceAccount: core.serialization.property("service_account", core.serialization.string().optional()), + mounts: core.serialization.list(BaseServiceMountsItem).optional(), + labels: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), + kustomize: Kustomize.optional(), + livenessProbe: core.serialization.property("liveness_probe", HealthProbe.optional()), + readinessProbe: core.serialization.property("readiness_probe", HealthProbe.optional()), + startupProbe: core.serialization.property("startup_probe", HealthProbe.optional()), + workspaceFqn: core.serialization.property("workspace_fqn", core.serialization.string().optional()), }); export declare namespace BaseService { @@ -34,7 +37,7 @@ export declare namespace BaseService { image: BaseServiceImage.Raw; artifacts_download?: ArtifactsDownload.Raw | null; resources?: Resources.Raw | null; - env?: Record | null; + env?: (Record | null | undefined) | null; ports: Port.Raw[]; service_account?: string | null; mounts?: BaseServiceMountsItem.Raw[] | null; diff --git a/src/serialization/types/BaseServiceImage.ts b/src/serialization/types/BaseServiceImage.ts index 43256ee5..4695749d 100644 --- a/src/serialization/types/BaseServiceImage.ts +++ b/src/serialization/types/BaseServiceImage.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Build } from "./Build.js"; import { Image } from "./Image.js"; -export const BaseServiceImage: core.serialization.Schema = core.serialization.undiscriminatedUnion([Build, Image]); +export const BaseServiceImage: core.serialization.Schema< + serializers.BaseServiceImage.Raw, + TrueFoundry.BaseServiceImage +> = core.serialization.undiscriminatedUnion([Build, Image]); export declare namespace BaseServiceImage { export type Raw = Build.Raw | Image.Raw; diff --git a/src/serialization/types/BaseServiceMountsItem.ts b/src/serialization/types/BaseServiceMountsItem.ts index 5a2de737..6b54656c 100644 --- a/src/serialization/types/BaseServiceMountsItem.ts +++ b/src/serialization/types/BaseServiceMountsItem.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { SecretMount } from "./SecretMount.js"; import { StringDataMount } from "./StringDataMount.js"; import { VolumeMount } from "./VolumeMount.js"; -export const BaseServiceMountsItem: core.serialization.Schema = core.serialization.undiscriminatedUnion([SecretMount, StringDataMount, VolumeMount]); +export const BaseServiceMountsItem: core.serialization.Schema< + serializers.BaseServiceMountsItem.Raw, + TrueFoundry.BaseServiceMountsItem +> = core.serialization.undiscriminatedUnion([SecretMount, StringDataMount, VolumeMount]); export declare namespace BaseServiceMountsItem { export type Raw = SecretMount.Raw | StringDataMount.Raw | VolumeMount.Raw; diff --git a/src/serialization/types/BaseWorkbenchInput.ts b/src/serialization/types/BaseWorkbenchInput.ts index ce80c381..d056293e 100644 --- a/src/serialization/types/BaseWorkbenchInput.ts +++ b/src/serialization/types/BaseWorkbenchInput.ts @@ -1,29 +1,34 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BaseWorkbenchInputMountsItem } from "./BaseWorkbenchInputMountsItem.js"; import { Kustomize } from "./Kustomize.js"; import { Resources } from "./Resources.js"; -export const BaseWorkbenchInput: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "homeDirectorySize": core.serialization.property("home_directory_size", core.serialization.number()), - "resources": Resources.optional(), - "env": core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), - "mounts": core.serialization.list(BaseWorkbenchInputMountsItem).optional(), - "serviceAccount": core.serialization.property("service_account", core.serialization.string().optional()), - "kustomize": Kustomize.optional(), - "workspaceFqn": core.serialization.property("workspace_fqn", core.serialization.string().optional()) - }); +export const BaseWorkbenchInput: core.serialization.ObjectSchema< + serializers.BaseWorkbenchInput.Raw, + TrueFoundry.BaseWorkbenchInput +> = core.serialization.object({ + name: core.serialization.string(), + homeDirectorySize: core.serialization.property("home_directory_size", core.serialization.number()), + resources: Resources.optional(), + env: core.serialization + .record(core.serialization.string(), core.serialization.string().nullable()) + .optionalNullable(), + mounts: core.serialization.list(BaseWorkbenchInputMountsItem).optional(), + serviceAccount: core.serialization.property("service_account", core.serialization.string().optional()), + kustomize: Kustomize.optional(), + workspaceFqn: core.serialization.property("workspace_fqn", core.serialization.string().optional()), +}); export declare namespace BaseWorkbenchInput { export interface Raw { name: string; home_directory_size: number; resources?: Resources.Raw | null; - env?: Record | null; + env?: (Record | null | undefined) | null; mounts?: BaseWorkbenchInputMountsItem.Raw[] | null; service_account?: string | null; kustomize?: Kustomize.Raw | null; diff --git a/src/serialization/types/BaseWorkbenchInputMountsItem.ts b/src/serialization/types/BaseWorkbenchInputMountsItem.ts index bd65ebcf..a1c0ef81 100644 --- a/src/serialization/types/BaseWorkbenchInputMountsItem.ts +++ b/src/serialization/types/BaseWorkbenchInputMountsItem.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { SecretMount } from "./SecretMount.js"; import { StringDataMount } from "./StringDataMount.js"; import { VolumeMount } from "./VolumeMount.js"; -export const BaseWorkbenchInputMountsItem: core.serialization.Schema = core.serialization.undiscriminatedUnion([SecretMount, StringDataMount, VolumeMount]); +export const BaseWorkbenchInputMountsItem: core.serialization.Schema< + serializers.BaseWorkbenchInputMountsItem.Raw, + TrueFoundry.BaseWorkbenchInputMountsItem +> = core.serialization.undiscriminatedUnion([SecretMount, StringDataMount, VolumeMount]); export declare namespace BaseWorkbenchInputMountsItem { export type Raw = SecretMount.Raw | StringDataMount.Raw | VolumeMount.Raw; diff --git a/src/serialization/types/BasetenIntegrations.ts b/src/serialization/types/BasetenIntegrations.ts index 65729534..21bd3cc3 100644 --- a/src/serialization/types/BasetenIntegrations.ts +++ b/src/serialization/types/BasetenIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { BasetenModel } from "./BasetenModel.js"; -export const BasetenIntegrations: core.serialization.ObjectSchema = BasetenModel; +export const BasetenIntegrations: core.serialization.ObjectSchema< + serializers.BasetenIntegrations.Raw, + TrueFoundry.BasetenIntegrations +> = BasetenModel; export declare namespace BasetenIntegrations { export type Raw = BasetenModel.Raw; diff --git a/src/serialization/types/BasetenKeyAuth.ts b/src/serialization/types/BasetenKeyAuth.ts index d05ad6d2..fb817a18 100644 --- a/src/serialization/types/BasetenKeyAuth.ts +++ b/src/serialization/types/BasetenKeyAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const BasetenKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) - }); +export const BasetenKeyAuth: core.serialization.ObjectSchema< + serializers.BasetenKeyAuth.Raw, + TrueFoundry.BasetenKeyAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), +}); export declare namespace BasetenKeyAuth { export interface Raw { diff --git a/src/serialization/types/BasetenModel.ts b/src/serialization/types/BasetenModel.ts index 5a76f674..0f710d9f 100644 --- a/src/serialization/types/BasetenModel.ts +++ b/src/serialization/types/BasetenModel.ts @@ -1,18 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const BasetenModel: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/model/baseten"), - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) +export const BasetenModel: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("integration/model/baseten"), + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace BasetenModel { diff --git a/src/serialization/types/BasetenProviderAccount.ts b/src/serialization/types/BasetenProviderAccount.ts index 0c4cc709..9a2d6b1d 100644 --- a/src/serialization/types/BasetenProviderAccount.ts +++ b/src/serialization/types/BasetenProviderAccount.ts @@ -1,22 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BasetenIntegrations } from "./BasetenIntegrations.js"; import { BasetenKeyAuth } from "./BasetenKeyAuth.js"; import { Collaborator } from "./Collaborator.js"; import { OwnedBy } from "./OwnedBy.js"; -export const BasetenProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/baseten"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", BasetenKeyAuth), - "integrations": core.serialization.list(BasetenIntegrations).optional(), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const BasetenProviderAccount: core.serialization.ObjectSchema< + serializers.BasetenProviderAccount.Raw, + TrueFoundry.BasetenProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/baseten"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", BasetenKeyAuth), + integrations: core.serialization.list(BasetenIntegrations).optional(), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace BasetenProviderAccount { export interface Raw { diff --git a/src/serialization/types/BasicAuthCreds.ts b/src/serialization/types/BasicAuthCreds.ts index ede911ca..d23f63d1 100644 --- a/src/serialization/types/BasicAuthCreds.ts +++ b/src/serialization/types/BasicAuthCreds.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const BasicAuthCreds: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("basic_auth"), - "username": core.serialization.string(), - "password": core.serialization.string() - }); +export const BasicAuthCreds: core.serialization.ObjectSchema< + serializers.BasicAuthCreds.Raw, + TrueFoundry.BasicAuthCreds +> = core.serialization.object({ + type: core.serialization.stringLiteral("basic_auth"), + username: core.serialization.string(), + password: core.serialization.string(), +}); export declare namespace BasicAuthCreds { export interface Raw { diff --git a/src/serialization/types/BedrockMantleModel.ts b/src/serialization/types/BedrockMantleModel.ts index 6c969e8d..bea54410 100644 --- a/src/serialization/types/BedrockMantleModel.ts +++ b/src/serialization/types/BedrockMantleModel.ts @@ -1,21 +1,27 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsRegion } from "./AwsRegion.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const BedrockMantleModel: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "type": core.serialization.stringLiteral("integration/model/bedrock-mantle"), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "region": AwsRegion.optional(), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const BedrockMantleModel: core.serialization.ObjectSchema< + serializers.BedrockMantleModel.Raw, + TrueFoundry.BedrockMantleModel +> = core.serialization.object({ + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + type: core.serialization.stringLiteral("integration/model/bedrock-mantle"), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + region: AwsRegion.optional(), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace BedrockMantleModel { export interface Raw { diff --git a/src/serialization/types/BedrockModel.ts b/src/serialization/types/BedrockModel.ts index 7f286a33..8e00987a 100644 --- a/src/serialization/types/BedrockModel.ts +++ b/src/serialization/types/BedrockModel.ts @@ -1,20 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsRegion } from "./AwsRegion.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const BedrockModel: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "type": core.serialization.stringLiteral("integration/model/bedrock"), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "region": AwsRegion.optional(), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) +export const BedrockModel: core.serialization.ObjectSchema = + core.serialization.object({ + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + type: core.serialization.stringLiteral("integration/model/bedrock"), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + region: AwsRegion.optional(), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace BedrockModel { diff --git a/src/serialization/types/BitbucketDataCenterIntegration.ts b/src/serialization/types/BitbucketDataCenterIntegration.ts index f0b73756..44dcaeca 100644 --- a/src/serialization/types/BitbucketDataCenterIntegration.ts +++ b/src/serialization/types/BitbucketDataCenterIntegration.ts @@ -1,17 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { VcsTokenAuthData } from "./VcsTokenAuthData.js"; -export const BitbucketDataCenterIntegration: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/vcs/bitbucket/data-center"), - "name": core.serialization.string(), - "accountName": core.serialization.property("account_name", core.serialization.string()), - "authData": core.serialization.property("auth_data", VcsTokenAuthData), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const BitbucketDataCenterIntegration: core.serialization.ObjectSchema< + serializers.BitbucketDataCenterIntegration.Raw, + TrueFoundry.BitbucketDataCenterIntegration +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/vcs/bitbucket/data-center"), + name: core.serialization.string(), + accountName: core.serialization.property("account_name", core.serialization.string()), + authData: core.serialization.property("auth_data", VcsTokenAuthData), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace BitbucketDataCenterIntegration { export interface Raw { diff --git a/src/serialization/types/BitbucketIntegration.ts b/src/serialization/types/BitbucketIntegration.ts index 20600b0e..2611a8b8 100644 --- a/src/serialization/types/BitbucketIntegration.ts +++ b/src/serialization/types/BitbucketIntegration.ts @@ -1,17 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BitbucketIntegrationAuthData } from "./BitbucketIntegrationAuthData.js"; -export const BitbucketIntegration: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/vcs/bitbucket"), - "name": core.serialization.string(), - "accountName": core.serialization.property("account_name", core.serialization.string()), - "authData": core.serialization.property("auth_data", BitbucketIntegrationAuthData.optional()), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const BitbucketIntegration: core.serialization.ObjectSchema< + serializers.BitbucketIntegration.Raw, + TrueFoundry.BitbucketIntegration +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/vcs/bitbucket"), + name: core.serialization.string(), + accountName: core.serialization.property("account_name", core.serialization.string()), + authData: core.serialization.property("auth_data", BitbucketIntegrationAuthData.optional()), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace BitbucketIntegration { export interface Raw { diff --git a/src/serialization/types/BitbucketIntegrationAuthData.ts b/src/serialization/types/BitbucketIntegrationAuthData.ts index b9ec04cb..44c6f0ef 100644 --- a/src/serialization/types/BitbucketIntegrationAuthData.ts +++ b/src/serialization/types/BitbucketIntegrationAuthData.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { VcsoAuthAuthData } from "./VcsoAuthAuthData.js"; import { VcsTokenAuthData } from "./VcsTokenAuthData.js"; -export const BitbucketIntegrationAuthData: core.serialization.Schema = core.serialization.undiscriminatedUnion([VcsoAuthAuthData, VcsTokenAuthData]); +export const BitbucketIntegrationAuthData: core.serialization.Schema< + serializers.BitbucketIntegrationAuthData.Raw, + TrueFoundry.BitbucketIntegrationAuthData +> = core.serialization.undiscriminatedUnion([VcsoAuthAuthData, VcsTokenAuthData]); export declare namespace BitbucketIntegrationAuthData { export type Raw = VcsoAuthAuthData.Raw | VcsTokenAuthData.Raw; diff --git a/src/serialization/types/BitbucketIntegrations.ts b/src/serialization/types/BitbucketIntegrations.ts index fb51ac99..af37324f 100644 --- a/src/serialization/types/BitbucketIntegrations.ts +++ b/src/serialization/types/BitbucketIntegrations.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BitbucketDataCenterIntegration } from "./BitbucketDataCenterIntegration.js"; import { BitbucketIntegration } from "./BitbucketIntegration.js"; -export const BitbucketIntegrations: core.serialization.Schema = core.serialization.undiscriminatedUnion([BitbucketIntegration, BitbucketDataCenterIntegration]); +export const BitbucketIntegrations: core.serialization.Schema< + serializers.BitbucketIntegrations.Raw, + TrueFoundry.BitbucketIntegrations +> = core.serialization.undiscriminatedUnion([BitbucketIntegration, BitbucketDataCenterIntegration]); export declare namespace BitbucketIntegrations { export type Raw = BitbucketIntegration.Raw | BitbucketDataCenterIntegration.Raw; diff --git a/src/serialization/types/BitbucketProviderAccount.ts b/src/serialization/types/BitbucketProviderAccount.ts index a45f693e..efc80247 100644 --- a/src/serialization/types/BitbucketProviderAccount.ts +++ b/src/serialization/types/BitbucketProviderAccount.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BitbucketIntegrations } from "./BitbucketIntegrations.js"; import { OwnedBy } from "./OwnedBy.js"; -export const BitbucketProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/bitbucket"), - "name": core.serialization.string(), - "integrations": core.serialization.list(BitbucketIntegrations), - "ownedBy": OwnedBy.optional() - }); +export const BitbucketProviderAccount: core.serialization.ObjectSchema< + serializers.BitbucketProviderAccount.Raw, + TrueFoundry.BitbucketProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/bitbucket"), + name: core.serialization.string(), + integrations: core.serialization.list(BitbucketIntegrations), + ownedBy: OwnedBy.optional(), +}); export declare namespace BitbucketProviderAccount { export interface Raw { diff --git a/src/serialization/types/BlobStorageReference.ts b/src/serialization/types/BlobStorageReference.ts index 63e95f3d..de066c55 100644 --- a/src/serialization/types/BlobStorageReference.ts +++ b/src/serialization/types/BlobStorageReference.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { MimeType } from "./MimeType.js"; -export const BlobStorageReference: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("blob-storage"), - "path": core.serialization.string(), - "mimeType": core.serialization.property("mime_type", MimeType) - }); +export const BlobStorageReference: core.serialization.ObjectSchema< + serializers.BlobStorageReference.Raw, + TrueFoundry.BlobStorageReference +> = core.serialization.object({ + type: core.serialization.stringLiteral("blob-storage"), + path: core.serialization.string(), + mimeType: core.serialization.property("mime_type", MimeType), +}); export declare namespace BlobStorageReference { export interface Raw { diff --git a/src/serialization/types/BlueGreen.ts b/src/serialization/types/BlueGreen.ts index 4b37b565..32cc06ca 100644 --- a/src/serialization/types/BlueGreen.ts +++ b/src/serialization/types/BlueGreen.ts @@ -1,13 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const BlueGreen: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("blue_green"), - "enableAutoPromotion": core.serialization.property("enable_auto_promotion", core.serialization.boolean().optional()), - "autoPromotionSeconds": core.serialization.property("auto_promotion_seconds", core.serialization.number().optional()) +export const BlueGreen: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("blue_green"), + enableAutoPromotion: core.serialization.property( + "enable_auto_promotion", + core.serialization.boolean().optional(), + ), + autoPromotionSeconds: core.serialization.property( + "auto_promotion_seconds", + core.serialization.number().optional(), + ), }); export declare namespace BlueGreen { diff --git a/src/serialization/types/BudgetAlert.ts b/src/serialization/types/BudgetAlert.ts index bfe2c65d..632db331 100644 --- a/src/serialization/types/BudgetAlert.ts +++ b/src/serialization/types/BudgetAlert.ts @@ -1,13 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { NotificationTarget } from "./NotificationTarget.js"; -export const BudgetAlert: core.serialization.ObjectSchema = core.serialization.object({ - "thresholds": core.serialization.list(core.serialization.number()), - "notificationTarget": core.serialization.property("notification_target", core.serialization.list(NotificationTarget)) +export const BudgetAlert: core.serialization.ObjectSchema = + core.serialization.object({ + thresholds: core.serialization.list(core.serialization.number()), + notificationTarget: core.serialization.property( + "notification_target", + core.serialization.list(NotificationTarget), + ), }); export declare namespace BudgetAlert { diff --git a/src/serialization/types/BudgetConfig.ts b/src/serialization/types/BudgetConfig.ts index abb842ee..2aa31d91 100644 --- a/src/serialization/types/BudgetConfig.ts +++ b/src/serialization/types/BudgetConfig.ts @@ -1,13 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BudgetRule } from "./BudgetRule.js"; -export const BudgetConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("gateway-budget-config"), - "rules": core.serialization.list(BudgetRule) +export const BudgetConfig: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("gateway-budget-config"), + rules: core.serialization.list(BudgetRule), }); export declare namespace BudgetConfig { diff --git a/src/serialization/types/BudgetEntityUsage.ts b/src/serialization/types/BudgetEntityUsage.ts new file mode 100644 index 00000000..903842b4 --- /dev/null +++ b/src/serialization/types/BudgetEntityUsage.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { PeriodUsage } from "./PeriodUsage.js"; + +export const BudgetEntityUsage: core.serialization.ObjectSchema< + serializers.BudgetEntityUsage.Raw, + TrueFoundry.BudgetEntityUsage +> = core.serialization.object({ + entity: core.serialization.string().optionalNullable(), + periods: core.serialization.record(core.serialization.string(), PeriodUsage), +}); + +export declare namespace BudgetEntityUsage { + export interface Raw { + entity?: (string | null | undefined) | null; + periods: Record; + } +} diff --git a/src/serialization/types/BudgetLimitUnit.ts b/src/serialization/types/BudgetLimitUnit.ts index 806a119b..42cb8825 100644 --- a/src/serialization/types/BudgetLimitUnit.ts +++ b/src/serialization/types/BudgetLimitUnit.ts @@ -1,11 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const BudgetLimitUnit: core.serialization.Schema = core.serialization.enum_(["cost_per_day", "cost_per_month", "cost_per_week", "cost_per_quarter", "tokens_per_day", "tokens_per_month"]); +export const BudgetLimitUnit: core.serialization.Schema = + core.serialization.enum_([ + "cost_per_day", + "cost_per_month", + "cost_per_week", + "cost_per_quarter", + "tokens_per_day", + "tokens_per_month", + ]); export declare namespace BudgetLimitUnit { - export type Raw = "cost_per_day" | "cost_per_month" | "cost_per_week" | "cost_per_quarter" | "tokens_per_day" | "tokens_per_month"; + export type Raw = + | "cost_per_day" + | "cost_per_month" + | "cost_per_week" + | "cost_per_quarter" + | "tokens_per_day" + | "tokens_per_month"; } diff --git a/src/serialization/types/BudgetRule.ts b/src/serialization/types/BudgetRule.ts index 489dcbfe..511c5226 100644 --- a/src/serialization/types/BudgetRule.ts +++ b/src/serialization/types/BudgetRule.ts @@ -1,20 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BudgetAlert } from "./BudgetAlert.js"; import { BudgetLimitUnit } from "./BudgetLimitUnit.js"; import { BudgetWhen } from "./BudgetWhen.js"; -export const BudgetRule: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string(), - "when": BudgetWhen, - "limitTo": core.serialization.property("limit_to", core.serialization.number()), - "unit": BudgetLimitUnit, - "budgetAppliesPer": core.serialization.property("budget_applies_per", core.serialization.list(core.serialization.string()).optional()), - "alerts": BudgetAlert.optional(), - "auditMode": core.serialization.property("audit_mode", core.serialization.boolean().optional()) +export const BudgetRule: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string(), + when: BudgetWhen, + limitTo: core.serialization.property("limit_to", core.serialization.number()), + unit: BudgetLimitUnit, + budgetAppliesPer: core.serialization.property( + "budget_applies_per", + core.serialization.list(core.serialization.string()).optional(), + ), + alerts: BudgetAlert.optional(), + auditMode: core.serialization.property("audit_mode", core.serialization.boolean().optional()), }); export declare namespace BudgetRule { diff --git a/src/serialization/types/BudgetUsageEntry.ts b/src/serialization/types/BudgetUsageEntry.ts new file mode 100644 index 00000000..6544a760 --- /dev/null +++ b/src/serialization/types/BudgetUsageEntry.ts @@ -0,0 +1,31 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { BudgetEntityUsage } from "./BudgetEntityUsage.js"; +import { BudgetUsageEntryMode } from "./BudgetUsageEntryMode.js"; +import { BudgetUsageEntryType } from "./BudgetUsageEntryType.js"; + +export const BudgetUsageEntry: core.serialization.ObjectSchema< + serializers.BudgetUsageEntry.Raw, + TrueFoundry.BudgetUsageEntry +> = core.serialization.object({ + name: core.serialization.string(), + type: BudgetUsageEntryType, + teamName: core.serialization.property("team_name", core.serialization.string().optionalNullable()), + appliesTo: core.serialization.property("applies_to", core.serialization.string()), + mode: BudgetUsageEntryMode, + entities: core.serialization.list(BudgetEntityUsage), +}); + +export declare namespace BudgetUsageEntry { + export interface Raw { + name: string; + type: BudgetUsageEntryType.Raw; + team_name?: (string | null | undefined) | null; + applies_to: string; + mode: BudgetUsageEntryMode.Raw; + entities: BudgetEntityUsage.Raw[]; + } +} diff --git a/src/serialization/types/BudgetUsageEntryMode.ts b/src/serialization/types/BudgetUsageEntryMode.ts new file mode 100644 index 00000000..a427cab8 --- /dev/null +++ b/src/serialization/types/BudgetUsageEntryMode.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const BudgetUsageEntryMode: core.serialization.Schema< + serializers.BudgetUsageEntryMode.Raw, + TrueFoundry.BudgetUsageEntryMode +> = core.serialization.enum_(["enforce", "audit", "soft_enforce"]); + +export declare namespace BudgetUsageEntryMode { + export type Raw = "enforce" | "audit" | "soft_enforce"; +} diff --git a/src/serialization/types/BudgetUsageEntryType.ts b/src/serialization/types/BudgetUsageEntryType.ts new file mode 100644 index 00000000..100f5dae --- /dev/null +++ b/src/serialization/types/BudgetUsageEntryType.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const BudgetUsageEntryType: core.serialization.Schema< + serializers.BudgetUsageEntryType.Raw, + TrueFoundry.BudgetUsageEntryType +> = core.serialization.enum_(["tenant-budget-config", "team-budget-config"]); + +export declare namespace BudgetUsageEntryType { + export type Raw = "tenant-budget-config" | "team-budget-config"; +} diff --git a/src/serialization/types/BudgetUsageResponse.ts b/src/serialization/types/BudgetUsageResponse.ts new file mode 100644 index 00000000..a1748268 --- /dev/null +++ b/src/serialization/types/BudgetUsageResponse.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { BudgetUsageEntry } from "./BudgetUsageEntry.js"; + +export const BudgetUsageResponse: core.serialization.ObjectSchema< + serializers.BudgetUsageResponse.Raw, + TrueFoundry.BudgetUsageResponse +> = core.serialization.object({ + matched: core.serialization.list(BudgetUsageEntry), +}); + +export declare namespace BudgetUsageResponse { + export interface Raw { + matched: BudgetUsageEntry.Raw[]; + } +} diff --git a/src/serialization/types/BudgetV2Alert.ts b/src/serialization/types/BudgetV2Alert.ts index 1b1153d2..bba9752e 100644 --- a/src/serialization/types/BudgetV2Alert.ts +++ b/src/serialization/types/BudgetV2Alert.ts @@ -1,20 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { NotificationTarget } from "./NotificationTarget.js"; -export const BudgetV2Alert: core.serialization.ObjectSchema = core.serialization.object({ - "thresholds": core.serialization.list(core.serialization.number()), - "notifyBreachingUser": core.serialization.property("notify_breaching_user", core.serialization.boolean().optional()), - "notificationTarget": core.serialization.property("notification_target", core.serialization.list(NotificationTarget).optional()) +export const BudgetV2Alert: core.serialization.ObjectSchema = + core.serialization.object({ + thresholds: core.serialization.list(core.serialization.number()), + notificationTarget: core.serialization.property( + "notification_target", + core.serialization.list(NotificationTarget).optional(), + ), }); export declare namespace BudgetV2Alert { export interface Raw { thresholds: number[]; - notify_breaching_user?: boolean | null; notification_target?: NotificationTarget.Raw[] | null; } } diff --git a/src/serialization/types/BudgetV2AppliesTo.ts b/src/serialization/types/BudgetV2AppliesTo.ts index 2959acd7..9957a522 100644 --- a/src/serialization/types/BudgetV2AppliesTo.ts +++ b/src/serialization/types/BudgetV2AppliesTo.ts @@ -1,16 +1,30 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BudgetV2AppliesToAggregate } from "./BudgetV2AppliesToAggregate.js"; import { BudgetV2AppliesToMetadata } from "./BudgetV2AppliesToMetadata.js"; import { BudgetV2AppliesToPerModel } from "./BudgetV2AppliesToPerModel.js"; import { BudgetV2AppliesToPerUser } from "./BudgetV2AppliesToPerUser.js"; import { BudgetV2AppliesToPerVirtualAccount } from "./BudgetV2AppliesToPerVirtualAccount.js"; -export const BudgetV2AppliesTo: core.serialization.Schema = core.serialization.undiscriminatedUnion([BudgetV2AppliesToAggregate, BudgetV2AppliesToPerUser, BudgetV2AppliesToPerModel, BudgetV2AppliesToPerVirtualAccount, BudgetV2AppliesToMetadata]); +export const BudgetV2AppliesTo: core.serialization.Schema< + serializers.BudgetV2AppliesTo.Raw, + TrueFoundry.BudgetV2AppliesTo +> = core.serialization.undiscriminatedUnion([ + BudgetV2AppliesToAggregate, + BudgetV2AppliesToPerUser, + BudgetV2AppliesToPerModel, + BudgetV2AppliesToPerVirtualAccount, + BudgetV2AppliesToMetadata, +]); export declare namespace BudgetV2AppliesTo { - export type Raw = BudgetV2AppliesToAggregate.Raw | BudgetV2AppliesToPerUser.Raw | BudgetV2AppliesToPerModel.Raw | BudgetV2AppliesToPerVirtualAccount.Raw | BudgetV2AppliesToMetadata.Raw; + export type Raw = + | BudgetV2AppliesToAggregate.Raw + | BudgetV2AppliesToPerUser.Raw + | BudgetV2AppliesToPerModel.Raw + | BudgetV2AppliesToPerVirtualAccount.Raw + | BudgetV2AppliesToMetadata.Raw; } diff --git a/src/serialization/types/BudgetV2AppliesToAggregate.ts b/src/serialization/types/BudgetV2AppliesToAggregate.ts index 5953b843..75f796b3 100644 --- a/src/serialization/types/BudgetV2AppliesToAggregate.ts +++ b/src/serialization/types/BudgetV2AppliesToAggregate.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const BudgetV2AppliesToAggregate: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("aggregate") - }); +export const BudgetV2AppliesToAggregate: core.serialization.ObjectSchema< + serializers.BudgetV2AppliesToAggregate.Raw, + TrueFoundry.BudgetV2AppliesToAggregate +> = core.serialization.object({ + type: core.serialization.stringLiteral("aggregate"), +}); export declare namespace BudgetV2AppliesToAggregate { export interface Raw { diff --git a/src/serialization/types/BudgetV2AppliesToMetadata.ts b/src/serialization/types/BudgetV2AppliesToMetadata.ts index 74abcba8..57db8f99 100644 --- a/src/serialization/types/BudgetV2AppliesToMetadata.ts +++ b/src/serialization/types/BudgetV2AppliesToMetadata.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BudgetV2PerMetadataOverride } from "./BudgetV2PerMetadataOverride.js"; -export const BudgetV2AppliesToMetadata: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("metadata"), - "metadata": core.serialization.string(), - "overrides": core.serialization.list(BudgetV2PerMetadataOverride).optional() - }); +export const BudgetV2AppliesToMetadata: core.serialization.ObjectSchema< + serializers.BudgetV2AppliesToMetadata.Raw, + TrueFoundry.BudgetV2AppliesToMetadata +> = core.serialization.object({ + type: core.serialization.stringLiteral("metadata"), + metadata: core.serialization.string(), + overrides: core.serialization.list(BudgetV2PerMetadataOverride).optional(), +}); export declare namespace BudgetV2AppliesToMetadata { export interface Raw { diff --git a/src/serialization/types/BudgetV2AppliesToPerModel.ts b/src/serialization/types/BudgetV2AppliesToPerModel.ts index e03c0d39..41f697d9 100644 --- a/src/serialization/types/BudgetV2AppliesToPerModel.ts +++ b/src/serialization/types/BudgetV2AppliesToPerModel.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BudgetV2PerModelOverride } from "./BudgetV2PerModelOverride.js"; -export const BudgetV2AppliesToPerModel: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("per-model"), - "overrides": core.serialization.list(BudgetV2PerModelOverride).optional() - }); +export const BudgetV2AppliesToPerModel: core.serialization.ObjectSchema< + serializers.BudgetV2AppliesToPerModel.Raw, + TrueFoundry.BudgetV2AppliesToPerModel +> = core.serialization.object({ + type: core.serialization.stringLiteral("per-model"), + overrides: core.serialization.list(BudgetV2PerModelOverride).optional(), +}); export declare namespace BudgetV2AppliesToPerModel { export interface Raw { diff --git a/src/serialization/types/BudgetV2AppliesToPerUser.ts b/src/serialization/types/BudgetV2AppliesToPerUser.ts index 6973c456..5b2cc8a2 100644 --- a/src/serialization/types/BudgetV2AppliesToPerUser.ts +++ b/src/serialization/types/BudgetV2AppliesToPerUser.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BudgetV2PerUserOverride } from "./BudgetV2PerUserOverride.js"; -export const BudgetV2AppliesToPerUser: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("per-user"), - "overrides": core.serialization.list(BudgetV2PerUserOverride).optional() - }); +export const BudgetV2AppliesToPerUser: core.serialization.ObjectSchema< + serializers.BudgetV2AppliesToPerUser.Raw, + TrueFoundry.BudgetV2AppliesToPerUser +> = core.serialization.object({ + type: core.serialization.stringLiteral("per-user"), + overrides: core.serialization.list(BudgetV2PerUserOverride).optional(), +}); export declare namespace BudgetV2AppliesToPerUser { export interface Raw { diff --git a/src/serialization/types/BudgetV2AppliesToPerVirtualAccount.ts b/src/serialization/types/BudgetV2AppliesToPerVirtualAccount.ts index 716aa05b..f961f71c 100644 --- a/src/serialization/types/BudgetV2AppliesToPerVirtualAccount.ts +++ b/src/serialization/types/BudgetV2AppliesToPerVirtualAccount.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BudgetV2PerVirtualAccountOverride } from "./BudgetV2PerVirtualAccountOverride.js"; -export const BudgetV2AppliesToPerVirtualAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("per-virtual-account"), - "overrides": core.serialization.list(BudgetV2PerVirtualAccountOverride).optional() - }); +export const BudgetV2AppliesToPerVirtualAccount: core.serialization.ObjectSchema< + serializers.BudgetV2AppliesToPerVirtualAccount.Raw, + TrueFoundry.BudgetV2AppliesToPerVirtualAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("per-virtual-account"), + overrides: core.serialization.list(BudgetV2PerVirtualAccountOverride).optional(), +}); export declare namespace BudgetV2AppliesToPerVirtualAccount { export interface Raw { diff --git a/src/serialization/types/BudgetV2InNotInFilter.ts b/src/serialization/types/BudgetV2InNotInFilter.ts index a742648b..52cd4d6a 100644 --- a/src/serialization/types/BudgetV2InNotInFilter.ts +++ b/src/serialization/types/BudgetV2InNotInFilter.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const BudgetV2InNotInFilter: core.serialization.ObjectSchema = core.serialization.object({ - "in": core.serialization.list(core.serialization.string()).optional(), - "notIn": core.serialization.property("not_in", core.serialization.list(core.serialization.string()).optional()) - }); +export const BudgetV2InNotInFilter: core.serialization.ObjectSchema< + serializers.BudgetV2InNotInFilter.Raw, + TrueFoundry.BudgetV2InNotInFilter +> = core.serialization.object({ + in: core.serialization.list(core.serialization.string()).optional(), + notIn: core.serialization.property("not_in", core.serialization.list(core.serialization.string()).optional()), +}); export declare namespace BudgetV2InNotInFilter { export interface Raw { - "in"?: string[] | null; + in?: string[] | null; not_in?: string[] | null; } } diff --git a/src/serialization/types/BudgetV2Limits.ts b/src/serialization/types/BudgetV2Limits.ts index 4ae02d7d..3287ed26 100644 --- a/src/serialization/types/BudgetV2Limits.ts +++ b/src/serialization/types/BudgetV2Limits.ts @@ -1,15 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const BudgetV2Limits: core.serialization.ObjectSchema = core.serialization.object({ - "costPerDay": core.serialization.property("cost_per_day", core.serialization.number().optional()), - "costPerWeek": core.serialization.property("cost_per_week", core.serialization.number().optional()), - "costPerMonth": core.serialization.property("cost_per_month", core.serialization.number().optional()), - "costPerQuarter": core.serialization.property("cost_per_quarter", core.serialization.number().optional()) - }); +export const BudgetV2Limits: core.serialization.ObjectSchema< + serializers.BudgetV2Limits.Raw, + TrueFoundry.BudgetV2Limits +> = core.serialization.object({ + costPerDay: core.serialization.property("cost_per_day", core.serialization.number().optional()), + costPerWeek: core.serialization.property("cost_per_week", core.serialization.number().optional()), + costPerMonth: core.serialization.property("cost_per_month", core.serialization.number().optional()), + costPerQuarter: core.serialization.property("cost_per_quarter", core.serialization.number().optional()), + costPerLifetime: core.serialization.property("cost_per_lifetime", core.serialization.number().optional()), +}); export declare namespace BudgetV2Limits { export interface Raw { @@ -17,5 +21,6 @@ export declare namespace BudgetV2Limits { cost_per_week?: number | null; cost_per_month?: number | null; cost_per_quarter?: number | null; + cost_per_lifetime?: number | null; } } diff --git a/src/serialization/types/BudgetV2OverrideLimits.ts b/src/serialization/types/BudgetV2OverrideLimits.ts index 30cbc16e..5bdb2845 100644 --- a/src/serialization/types/BudgetV2OverrideLimits.ts +++ b/src/serialization/types/BudgetV2OverrideLimits.ts @@ -1,15 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const BudgetV2OverrideLimits: core.serialization.ObjectSchema = core.serialization.object({ - "costPerDay": core.serialization.property("cost_per_day", core.serialization.number().optional()), - "costPerWeek": core.serialization.property("cost_per_week", core.serialization.number().optional()), - "costPerMonth": core.serialization.property("cost_per_month", core.serialization.number().optional()), - "costPerQuarter": core.serialization.property("cost_per_quarter", core.serialization.number().optional()) - }); +export const BudgetV2OverrideLimits: core.serialization.ObjectSchema< + serializers.BudgetV2OverrideLimits.Raw, + TrueFoundry.BudgetV2OverrideLimits +> = core.serialization.object({ + costPerDay: core.serialization.property("cost_per_day", core.serialization.number().optional()), + costPerWeek: core.serialization.property("cost_per_week", core.serialization.number().optional()), + costPerMonth: core.serialization.property("cost_per_month", core.serialization.number().optional()), + costPerQuarter: core.serialization.property("cost_per_quarter", core.serialization.number().optional()), + costPerLifetime: core.serialization.property("cost_per_lifetime", core.serialization.number().optional()), +}); export declare namespace BudgetV2OverrideLimits { export interface Raw { @@ -17,5 +21,6 @@ export declare namespace BudgetV2OverrideLimits { cost_per_week?: number | null; cost_per_month?: number | null; cost_per_quarter?: number | null; + cost_per_lifetime?: number | null; } } diff --git a/src/serialization/types/BudgetV2PerMetadataOverride.ts b/src/serialization/types/BudgetV2PerMetadataOverride.ts index 6c40f9b7..6a71168b 100644 --- a/src/serialization/types/BudgetV2PerMetadataOverride.ts +++ b/src/serialization/types/BudgetV2PerMetadataOverride.ts @@ -1,14 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BudgetV2OverrideLimits } from "./BudgetV2OverrideLimits.js"; -export const BudgetV2PerMetadataOverride: core.serialization.ObjectSchema = core.serialization.object({ - "metadataValues": core.serialization.property("metadata_values", core.serialization.list(core.serialization.string())), - "limits": BudgetV2OverrideLimits - }); +export const BudgetV2PerMetadataOverride: core.serialization.ObjectSchema< + serializers.BudgetV2PerMetadataOverride.Raw, + TrueFoundry.BudgetV2PerMetadataOverride +> = core.serialization.object({ + metadataValues: core.serialization.property( + "metadata_values", + core.serialization.list(core.serialization.string()), + ), + limits: BudgetV2OverrideLimits, +}); export declare namespace BudgetV2PerMetadataOverride { export interface Raw { diff --git a/src/serialization/types/BudgetV2PerModelOverride.ts b/src/serialization/types/BudgetV2PerModelOverride.ts index 51060167..763c8461 100644 --- a/src/serialization/types/BudgetV2PerModelOverride.ts +++ b/src/serialization/types/BudgetV2PerModelOverride.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BudgetV2OverrideLimits } from "./BudgetV2OverrideLimits.js"; -export const BudgetV2PerModelOverride: core.serialization.ObjectSchema = core.serialization.object({ - "models": core.serialization.list(core.serialization.string()), - "limits": BudgetV2OverrideLimits - }); +export const BudgetV2PerModelOverride: core.serialization.ObjectSchema< + serializers.BudgetV2PerModelOverride.Raw, + TrueFoundry.BudgetV2PerModelOverride +> = core.serialization.object({ + models: core.serialization.list(core.serialization.string()), + limits: BudgetV2OverrideLimits, +}); export declare namespace BudgetV2PerModelOverride { export interface Raw { diff --git a/src/serialization/types/BudgetV2PerUserOverride.ts b/src/serialization/types/BudgetV2PerUserOverride.ts index f6dbc180..bea1cbab 100644 --- a/src/serialization/types/BudgetV2PerUserOverride.ts +++ b/src/serialization/types/BudgetV2PerUserOverride.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BudgetV2OverrideLimits } from "./BudgetV2OverrideLimits.js"; -export const BudgetV2PerUserOverride: core.serialization.ObjectSchema = core.serialization.object({ - "users": core.serialization.list(core.serialization.string()), - "limits": BudgetV2OverrideLimits - }); +export const BudgetV2PerUserOverride: core.serialization.ObjectSchema< + serializers.BudgetV2PerUserOverride.Raw, + TrueFoundry.BudgetV2PerUserOverride +> = core.serialization.object({ + users: core.serialization.list(core.serialization.string()), + limits: BudgetV2OverrideLimits, +}); export declare namespace BudgetV2PerUserOverride { export interface Raw { diff --git a/src/serialization/types/BudgetV2PerVirtualAccountOverride.ts b/src/serialization/types/BudgetV2PerVirtualAccountOverride.ts index 53d3b747..97057e44 100644 --- a/src/serialization/types/BudgetV2PerVirtualAccountOverride.ts +++ b/src/serialization/types/BudgetV2PerVirtualAccountOverride.ts @@ -1,14 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BudgetV2OverrideLimits } from "./BudgetV2OverrideLimits.js"; -export const BudgetV2PerVirtualAccountOverride: core.serialization.ObjectSchema = core.serialization.object({ - "virtualAccounts": core.serialization.property("virtual_accounts", core.serialization.list(core.serialization.string())), - "limits": BudgetV2OverrideLimits - }); +export const BudgetV2PerVirtualAccountOverride: core.serialization.ObjectSchema< + serializers.BudgetV2PerVirtualAccountOverride.Raw, + TrueFoundry.BudgetV2PerVirtualAccountOverride +> = core.serialization.object({ + virtualAccounts: core.serialization.property( + "virtual_accounts", + core.serialization.list(core.serialization.string()), + ), + limits: BudgetV2OverrideLimits, +}); export declare namespace BudgetV2PerVirtualAccountOverride { export interface Raw { diff --git a/src/serialization/types/BudgetV2SubjectsTeamScoped.ts b/src/serialization/types/BudgetV2SubjectsTeamScoped.ts index bc26e541..1d54d070 100644 --- a/src/serialization/types/BudgetV2SubjectsTeamScoped.ts +++ b/src/serialization/types/BudgetV2SubjectsTeamScoped.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BudgetV2InNotInFilter } from "./BudgetV2InNotInFilter.js"; -export const BudgetV2SubjectsTeamScoped: core.serialization.ObjectSchema = core.serialization.object({ - "users": BudgetV2InNotInFilter.optional(), - "virtualAccounts": core.serialization.property("virtual_accounts", BudgetV2InNotInFilter.optional()) - }); +export const BudgetV2SubjectsTeamScoped: core.serialization.ObjectSchema< + serializers.BudgetV2SubjectsTeamScoped.Raw, + TrueFoundry.BudgetV2SubjectsTeamScoped +> = core.serialization.object({ + users: BudgetV2InNotInFilter.optional(), + virtualAccounts: core.serialization.property("virtual_accounts", BudgetV2InNotInFilter.optional()), +}); export declare namespace BudgetV2SubjectsTeamScoped { export interface Raw { diff --git a/src/serialization/types/BudgetV2SubjectsTenantScoped.ts b/src/serialization/types/BudgetV2SubjectsTenantScoped.ts index b88b24ed..70cf647f 100644 --- a/src/serialization/types/BudgetV2SubjectsTenantScoped.ts +++ b/src/serialization/types/BudgetV2SubjectsTenantScoped.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BudgetV2InNotInFilter } from "./BudgetV2InNotInFilter.js"; -export const BudgetV2SubjectsTenantScoped: core.serialization.ObjectSchema = core.serialization.object({ - "users": BudgetV2InNotInFilter.optional(), - "teams": BudgetV2InNotInFilter.optional(), - "virtualAccounts": core.serialization.property("virtual_accounts", BudgetV2InNotInFilter.optional()) - }); +export const BudgetV2SubjectsTenantScoped: core.serialization.ObjectSchema< + serializers.BudgetV2SubjectsTenantScoped.Raw, + TrueFoundry.BudgetV2SubjectsTenantScoped +> = core.serialization.object({ + users: BudgetV2InNotInFilter.optional(), + teams: BudgetV2InNotInFilter.optional(), + virtualAccounts: core.serialization.property("virtual_accounts", BudgetV2InNotInFilter.optional()), +}); export declare namespace BudgetV2SubjectsTenantScoped { export interface Raw { diff --git a/src/serialization/types/BudgetV2WhenTeamScoped.ts b/src/serialization/types/BudgetV2WhenTeamScoped.ts index fb42fd5f..1487b2b6 100644 --- a/src/serialization/types/BudgetV2WhenTeamScoped.ts +++ b/src/serialization/types/BudgetV2WhenTeamScoped.ts @@ -1,21 +1,26 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BudgetV2InNotInFilter } from "./BudgetV2InNotInFilter.js"; import { BudgetV2SubjectsTeamScoped } from "./BudgetV2SubjectsTeamScoped.js"; -export const BudgetV2WhenTeamScoped: core.serialization.ObjectSchema = core.serialization.object({ - "subjects": BudgetV2SubjectsTeamScoped.optional(), - "models": BudgetV2InNotInFilter.optional(), - "metadata": core.serialization.record(core.serialization.string(), BudgetV2InNotInFilter).optional() - }); +export const BudgetV2WhenTeamScoped: core.serialization.ObjectSchema< + serializers.BudgetV2WhenTeamScoped.Raw, + TrueFoundry.BudgetV2WhenTeamScoped +> = core.serialization.object({ + subjects: BudgetV2SubjectsTeamScoped.optional(), + models: BudgetV2InNotInFilter.optional(), + providerAccounts: core.serialization.property("provider_accounts", BudgetV2InNotInFilter.optional()), + metadata: core.serialization.record(core.serialization.string(), BudgetV2InNotInFilter).optional(), +}); export declare namespace BudgetV2WhenTeamScoped { export interface Raw { subjects?: BudgetV2SubjectsTeamScoped.Raw | null; models?: BudgetV2InNotInFilter.Raw | null; + provider_accounts?: BudgetV2InNotInFilter.Raw | null; metadata?: Record | null; } } diff --git a/src/serialization/types/BudgetV2WhenTenantScoped.ts b/src/serialization/types/BudgetV2WhenTenantScoped.ts index bcda9f79..65fa566f 100644 --- a/src/serialization/types/BudgetV2WhenTenantScoped.ts +++ b/src/serialization/types/BudgetV2WhenTenantScoped.ts @@ -1,21 +1,26 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BudgetV2InNotInFilter } from "./BudgetV2InNotInFilter.js"; import { BudgetV2SubjectsTenantScoped } from "./BudgetV2SubjectsTenantScoped.js"; -export const BudgetV2WhenTenantScoped: core.serialization.ObjectSchema = core.serialization.object({ - "subjects": BudgetV2SubjectsTenantScoped.optional(), - "models": BudgetV2InNotInFilter.optional(), - "metadata": core.serialization.record(core.serialization.string(), BudgetV2InNotInFilter).optional() - }); +export const BudgetV2WhenTenantScoped: core.serialization.ObjectSchema< + serializers.BudgetV2WhenTenantScoped.Raw, + TrueFoundry.BudgetV2WhenTenantScoped +> = core.serialization.object({ + subjects: BudgetV2SubjectsTenantScoped.optional(), + models: BudgetV2InNotInFilter.optional(), + providerAccounts: core.serialization.property("provider_accounts", BudgetV2InNotInFilter.optional()), + metadata: core.serialization.record(core.serialization.string(), BudgetV2InNotInFilter).optional(), +}); export declare namespace BudgetV2WhenTenantScoped { export interface Raw { subjects?: BudgetV2SubjectsTenantScoped.Raw | null; models?: BudgetV2InNotInFilter.Raw | null; + provider_accounts?: BudgetV2InNotInFilter.Raw | null; metadata?: Record | null; } } diff --git a/src/serialization/types/BudgetWhen.ts b/src/serialization/types/BudgetWhen.ts index 8993bede..09b19bce 100644 --- a/src/serialization/types/BudgetWhen.ts +++ b/src/serialization/types/BudgetWhen.ts @@ -1,13 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const BudgetWhen: core.serialization.ObjectSchema = core.serialization.object({ - "subjects": core.serialization.list(core.serialization.string()).optional(), - "models": core.serialization.list(core.serialization.string()).optional(), - "metadata": core.serialization.record(core.serialization.string(), core.serialization.string()).optional() +export const BudgetWhen: core.serialization.ObjectSchema = + core.serialization.object({ + subjects: core.serialization.list(core.serialization.string()).optional(), + models: core.serialization.list(core.serialization.string()).optional(), + metadata: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), }); export declare namespace BudgetWhen { diff --git a/src/serialization/types/Build.ts b/src/serialization/types/Build.ts index 3095dc82..f260f9d5 100644 --- a/src/serialization/types/Build.ts +++ b/src/serialization/types/Build.ts @@ -1,16 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BuildBuildSource } from "./BuildBuildSource.js"; import { BuildBuildSpec } from "./BuildBuildSpec.js"; -export const Build: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("build"), - "dockerRegistry": core.serialization.property("docker_registry", core.serialization.string().optional()), - "buildSource": core.serialization.property("build_source", BuildBuildSource), - "buildSpec": core.serialization.property("build_spec", BuildBuildSpec) +export const Build: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("build"), + dockerRegistry: core.serialization.property("docker_registry", core.serialization.string().optional()), + buildSource: core.serialization.property("build_source", BuildBuildSource), + buildSpec: core.serialization.property("build_spec", BuildBuildSpec), }); export declare namespace Build { diff --git a/src/serialization/types/BuildBuildSource.ts b/src/serialization/types/BuildBuildSource.ts index f34a6b23..226a29ed 100644 --- a/src/serialization/types/BuildBuildSource.ts +++ b/src/serialization/types/BuildBuildSource.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GitSource } from "./GitSource.js"; import { LocalSource } from "./LocalSource.js"; import { RemoteSource } from "./RemoteSource.js"; -export const BuildBuildSource: core.serialization.Schema = core.serialization.undiscriminatedUnion([RemoteSource, GitSource, LocalSource]); +export const BuildBuildSource: core.serialization.Schema< + serializers.BuildBuildSource.Raw, + TrueFoundry.BuildBuildSource +> = core.serialization.undiscriminatedUnion([RemoteSource, GitSource, LocalSource]); export declare namespace BuildBuildSource { export type Raw = RemoteSource.Raw | GitSource.Raw | LocalSource.Raw; diff --git a/src/serialization/types/BuildBuildSpec.ts b/src/serialization/types/BuildBuildSpec.ts index af5cce11..822d7aa9 100644 --- a/src/serialization/types/BuildBuildSpec.ts +++ b/src/serialization/types/BuildBuildSpec.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { DockerFileBuild } from "./DockerFileBuild.js"; import { PythonBuild } from "./PythonBuild.js"; -export const BuildBuildSpec: core.serialization.Schema = core.serialization.undiscriminatedUnion([DockerFileBuild, PythonBuild]); +export const BuildBuildSpec: core.serialization.Schema = + core.serialization.undiscriminatedUnion([DockerFileBuild, PythonBuild]); export declare namespace BuildBuildSpec { export type Raw = DockerFileBuild.Raw | PythonBuild.Raw; diff --git a/src/serialization/types/BuildInfo.ts b/src/serialization/types/BuildInfo.ts index 3352bcf5..091e750c 100644 --- a/src/serialization/types/BuildInfo.ts +++ b/src/serialization/types/BuildInfo.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const BuildInfo: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "status": core.serialization.number() +export const BuildInfo: core.serialization.ObjectSchema = + core.serialization.object({ + name: core.serialization.string(), + status: core.serialization.number(), }); export declare namespace BuildInfo { diff --git a/src/serialization/types/BuildSecret.ts b/src/serialization/types/BuildSecret.ts index 833ba105..90c6076b 100644 --- a/src/serialization/types/BuildSecret.ts +++ b/src/serialization/types/BuildSecret.ts @@ -1,13 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const BuildSecret: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string(), - "value": core.serialization.string(), - "env": core.serialization.string().optional() +export const BuildSecret: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string(), + value: core.serialization.string(), + env: core.serialization.string().optional(), }); export declare namespace BuildSecret { diff --git a/src/serialization/types/BuildStatus.ts b/src/serialization/types/BuildStatus.ts deleted file mode 100644 index 138916dc..00000000 --- a/src/serialization/types/BuildStatus.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; - -export const BuildStatus: core.serialization.Schema = core.serialization.enum_(["STARTED", "SUCCEEDED", "FAILED"]); - -export declare namespace BuildStatus { - export type Raw = "STARTED" | "SUCCEEDED" | "FAILED"; -} diff --git a/src/serialization/types/CalypsoAiApiKeyAuth.ts b/src/serialization/types/CalypsoAiApiKeyAuth.ts new file mode 100644 index 00000000..efb47924 --- /dev/null +++ b/src/serialization/types/CalypsoAiApiKeyAuth.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CalypsoAiApiKeyAuth: core.serialization.ObjectSchema< + serializers.CalypsoAiApiKeyAuth.Raw, + TrueFoundry.CalypsoAiApiKeyAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), +}); + +export declare namespace CalypsoAiApiKeyAuth { + export interface Raw { + type: "api-key"; + api_key: string; + } +} diff --git a/src/serialization/types/CalypsoAiGuardrailConfig.ts b/src/serialization/types/CalypsoAiGuardrailConfig.ts new file mode 100644 index 00000000..836e1e7b --- /dev/null +++ b/src/serialization/types/CalypsoAiGuardrailConfig.ts @@ -0,0 +1,36 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CalypsoAiApiKeyAuth } from "./CalypsoAiApiKeyAuth.js"; +import { CalypsoAiGuardrailConfigConfig } from "./CalypsoAiGuardrailConfigConfig.js"; +import { CalypsoAiGuardrailConfigOperation } from "./CalypsoAiGuardrailConfigOperation.js"; +import { EnforcingStrategy } from "./EnforcingStrategy.js"; + +export const CalypsoAiGuardrailConfig: core.serialization.ObjectSchema< + serializers.CalypsoAiGuardrailConfig.Raw, + TrueFoundry.CalypsoAiGuardrailConfig +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + type: core.serialization.stringLiteral("integration/guardrail-config/calypsoai"), + authData: core.serialization.property("auth_data", CalypsoAiApiKeyAuth), + operation: CalypsoAiGuardrailConfigOperation, + priority: core.serialization.number().optional(), + enforcingStrategy: core.serialization.property("enforcing_strategy", EnforcingStrategy), + config: CalypsoAiGuardrailConfigConfig, +}); + +export declare namespace CalypsoAiGuardrailConfig { + export interface Raw { + name: string; + description?: string | null; + type: "integration/guardrail-config/calypsoai"; + auth_data: CalypsoAiApiKeyAuth.Raw; + operation: CalypsoAiGuardrailConfigOperation.Raw; + priority?: number | null; + enforcing_strategy: EnforcingStrategy.Raw; + config: CalypsoAiGuardrailConfigConfig.Raw; + } +} diff --git a/src/serialization/types/CalypsoAiGuardrailConfigConfig.ts b/src/serialization/types/CalypsoAiGuardrailConfigConfig.ts new file mode 100644 index 00000000..8e516064 --- /dev/null +++ b/src/serialization/types/CalypsoAiGuardrailConfigConfig.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CalypsoAiGuardrailConfigConfig: core.serialization.ObjectSchema< + serializers.CalypsoAiGuardrailConfigConfig.Raw, + TrueFoundry.CalypsoAiGuardrailConfigConfig +> = core.serialization.object({ + baseUrl: core.serialization.property("base_url", core.serialization.string().optional()), + project: core.serialization.string().optional(), +}); + +export declare namespace CalypsoAiGuardrailConfigConfig { + export interface Raw { + base_url?: string | null; + project?: string | null; + } +} diff --git a/src/serialization/types/CalypsoAiGuardrailConfigOperation.ts b/src/serialization/types/CalypsoAiGuardrailConfigOperation.ts new file mode 100644 index 00000000..a882dd98 --- /dev/null +++ b/src/serialization/types/CalypsoAiGuardrailConfigOperation.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CalypsoAiGuardrailConfigOperation: core.serialization.Schema< + serializers.CalypsoAiGuardrailConfigOperation.Raw, + TrueFoundry.CalypsoAiGuardrailConfigOperation +> = core.serialization.enum_(["validate", "mutate"]); + +export declare namespace CalypsoAiGuardrailConfigOperation { + export type Raw = "validate" | "mutate"; +} diff --git a/src/serialization/types/Canary.ts b/src/serialization/types/Canary.ts index 91f5da8a..b7eafc92 100644 --- a/src/serialization/types/Canary.ts +++ b/src/serialization/types/Canary.ts @@ -1,13 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { CanaryStep } from "./CanaryStep.js"; -export const Canary: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("canary"), - "steps": core.serialization.list(CanaryStep) +export const Canary: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("canary"), + steps: core.serialization.list(CanaryStep), }); export declare namespace Canary { diff --git a/src/serialization/types/CanaryStep.ts b/src/serialization/types/CanaryStep.ts index 2668a659..33345a48 100644 --- a/src/serialization/types/CanaryStep.ts +++ b/src/serialization/types/CanaryStep.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const CanaryStep: core.serialization.ObjectSchema = core.serialization.object({ - "weightPercentage": core.serialization.property("weight_percentage", core.serialization.number()), - "pauseDuration": core.serialization.property("pause_duration", core.serialization.number().optional()) +export const CanaryStep: core.serialization.ObjectSchema = + core.serialization.object({ + weightPercentage: core.serialization.property("weight_percentage", core.serialization.number()), + pauseDuration: core.serialization.property("pause_duration", core.serialization.number().optional()), }); export declare namespace CanaryStep { diff --git a/src/serialization/types/CartesiaApiKeyAuth.ts b/src/serialization/types/CartesiaApiKeyAuth.ts index 0149c86a..eac56d4e 100644 --- a/src/serialization/types/CartesiaApiKeyAuth.ts +++ b/src/serialization/types/CartesiaApiKeyAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const CartesiaApiKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) - }); +export const CartesiaApiKeyAuth: core.serialization.ObjectSchema< + serializers.CartesiaApiKeyAuth.Raw, + TrueFoundry.CartesiaApiKeyAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), +}); export declare namespace CartesiaApiKeyAuth { export interface Raw { diff --git a/src/serialization/types/CartesiaModel.ts b/src/serialization/types/CartesiaModel.ts index 97f003fb..457a596a 100644 --- a/src/serialization/types/CartesiaModel.ts +++ b/src/serialization/types/CartesiaModel.ts @@ -1,18 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const CartesiaModel: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/model/cartesia"), - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) +export const CartesiaModel: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("integration/model/cartesia"), + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace CartesiaModel { diff --git a/src/serialization/types/CartesiaProviderAccount.ts b/src/serialization/types/CartesiaProviderAccount.ts index fc93a0ef..4a133e24 100644 --- a/src/serialization/types/CartesiaProviderAccount.ts +++ b/src/serialization/types/CartesiaProviderAccount.ts @@ -1,25 +1,28 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { CartesiaApiKeyAuth } from "./CartesiaApiKeyAuth.js"; import { CartesiaModel } from "./CartesiaModel.js"; import { CartesiaProviderAccountCartesiaVersion } from "./CartesiaProviderAccountCartesiaVersion.js"; import { Collaborator } from "./Collaborator.js"; import { OwnedBy } from "./OwnedBy.js"; -export const CartesiaProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/cartesia"), - "name": core.serialization.string(), - "baseUrl": core.serialization.property("base_url", core.serialization.string().optional()), - "cartesiaVersion": core.serialization.property("cartesia_version", CartesiaProviderAccountCartesiaVersion), - "authData": core.serialization.property("auth_data", CartesiaApiKeyAuth), - "integrations": core.serialization.list(CartesiaModel), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const CartesiaProviderAccount: core.serialization.ObjectSchema< + serializers.CartesiaProviderAccount.Raw, + TrueFoundry.CartesiaProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/cartesia"), + name: core.serialization.string(), + baseUrl: core.serialization.property("base_url", core.serialization.string().optional()), + cartesiaVersion: core.serialization.property("cartesia_version", CartesiaProviderAccountCartesiaVersion), + authData: core.serialization.property("auth_data", CartesiaApiKeyAuth), + integrations: core.serialization.list(CartesiaModel), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace CartesiaProviderAccount { export interface Raw { diff --git a/src/serialization/types/CartesiaProviderAccountCartesiaVersion.ts b/src/serialization/types/CartesiaProviderAccountCartesiaVersion.ts index c17708f8..875a824e 100644 --- a/src/serialization/types/CartesiaProviderAccountCartesiaVersion.ts +++ b/src/serialization/types/CartesiaProviderAccountCartesiaVersion.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const CartesiaProviderAccountCartesiaVersion: core.serialization.Schema = core.serialization.enum_(["2025-04-16", "2024-11-13", "2024-06-10"]); +export const CartesiaProviderAccountCartesiaVersion: core.serialization.Schema< + serializers.CartesiaProviderAccountCartesiaVersion.Raw, + TrueFoundry.CartesiaProviderAccountCartesiaVersion +> = core.serialization.enum_(["2025-04-16", "2024-11-13", "2024-06-10"]); export declare namespace CartesiaProviderAccountCartesiaVersion { export type Raw = "2025-04-16" | "2024-11-13" | "2024-06-10"; diff --git a/src/serialization/types/CedarGuardrailConfig.ts b/src/serialization/types/CedarGuardrailConfig.ts index a0be9806..940e5d47 100644 --- a/src/serialization/types/CedarGuardrailConfig.ts +++ b/src/serialization/types/CedarGuardrailConfig.ts @@ -1,19 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { CedarGuardrailConfigConfig } from "./CedarGuardrailConfigConfig.js"; import { EnforcingStrategy } from "./EnforcingStrategy.js"; -export const CedarGuardrailConfig: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string().optional(), - "type": core.serialization.stringLiteral("integration/guardrail-config/cedar"), - "operation": core.serialization.stringLiteral("validate"), - "enforcingStrategy": core.serialization.property("enforcing_strategy", EnforcingStrategy), - "config": CedarGuardrailConfigConfig - }); +export const CedarGuardrailConfig: core.serialization.ObjectSchema< + serializers.CedarGuardrailConfig.Raw, + TrueFoundry.CedarGuardrailConfig +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + type: core.serialization.stringLiteral("integration/guardrail-config/cedar"), + operation: core.serialization.stringLiteral("validate"), + enforcingStrategy: core.serialization.property("enforcing_strategy", EnforcingStrategy), + config: CedarGuardrailConfigConfig, +}); export declare namespace CedarGuardrailConfig { export interface Raw { diff --git a/src/serialization/types/CedarGuardrailConfigConfig.ts b/src/serialization/types/CedarGuardrailConfigConfig.ts index 4ab2d222..09ec2bd1 100644 --- a/src/serialization/types/CedarGuardrailConfigConfig.ts +++ b/src/serialization/types/CedarGuardrailConfigConfig.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const CedarGuardrailConfigConfig: core.serialization.ObjectSchema = core.serialization.object({ - "policy": core.serialization.string() - }); +export const CedarGuardrailConfigConfig: core.serialization.ObjectSchema< + serializers.CedarGuardrailConfigConfig.Raw, + TrueFoundry.CedarGuardrailConfigConfig +> = core.serialization.object({ + policy: core.serialization.string(), +}); export declare namespace CedarGuardrailConfigConfig { export interface Raw { diff --git a/src/serialization/types/CerebrasIntegrations.ts b/src/serialization/types/CerebrasIntegrations.ts index 53504724..968d6f18 100644 --- a/src/serialization/types/CerebrasIntegrations.ts +++ b/src/serialization/types/CerebrasIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { CerebrasModel } from "./CerebrasModel.js"; -export const CerebrasIntegrations: core.serialization.ObjectSchema = CerebrasModel; +export const CerebrasIntegrations: core.serialization.ObjectSchema< + serializers.CerebrasIntegrations.Raw, + TrueFoundry.CerebrasIntegrations +> = CerebrasModel; export declare namespace CerebrasIntegrations { export type Raw = CerebrasModel.Raw; diff --git a/src/serialization/types/CerebrasKeyAuth.ts b/src/serialization/types/CerebrasKeyAuth.ts index 4d273666..38a6a52d 100644 --- a/src/serialization/types/CerebrasKeyAuth.ts +++ b/src/serialization/types/CerebrasKeyAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const CerebrasKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) - }); +export const CerebrasKeyAuth: core.serialization.ObjectSchema< + serializers.CerebrasKeyAuth.Raw, + TrueFoundry.CerebrasKeyAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), +}); export declare namespace CerebrasKeyAuth { export interface Raw { diff --git a/src/serialization/types/CerebrasModel.ts b/src/serialization/types/CerebrasModel.ts index f23215b4..0d33750d 100644 --- a/src/serialization/types/CerebrasModel.ts +++ b/src/serialization/types/CerebrasModel.ts @@ -1,18 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const CerebrasModel: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/model/cerebras"), - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) +export const CerebrasModel: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("integration/model/cerebras"), + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace CerebrasModel { diff --git a/src/serialization/types/CerebrasProviderAccount.ts b/src/serialization/types/CerebrasProviderAccount.ts index 24eeb49f..5f3a6d66 100644 --- a/src/serialization/types/CerebrasProviderAccount.ts +++ b/src/serialization/types/CerebrasProviderAccount.ts @@ -1,22 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { CerebrasIntegrations } from "./CerebrasIntegrations.js"; import { CerebrasKeyAuth } from "./CerebrasKeyAuth.js"; import { Collaborator } from "./Collaborator.js"; import { OwnedBy } from "./OwnedBy.js"; -export const CerebrasProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/cerebras"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", CerebrasKeyAuth), - "integrations": core.serialization.list(CerebrasIntegrations).optional(), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const CerebrasProviderAccount: core.serialization.ObjectSchema< + serializers.CerebrasProviderAccount.Raw, + TrueFoundry.CerebrasProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/cerebras"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", CerebrasKeyAuth), + integrations: core.serialization.list(CerebrasIntegrations).optional(), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace CerebrasProviderAccount { export interface Raw { diff --git a/src/serialization/types/ChangePasswordResponse.ts b/src/serialization/types/ChangePasswordResponse.ts index 61708879..718ff632 100644 --- a/src/serialization/types/ChangePasswordResponse.ts +++ b/src/serialization/types/ChangePasswordResponse.ts @@ -1,12 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const ChangePasswordResponse: core.serialization.ObjectSchema = core.serialization.object({}); +export const ChangePasswordResponse: core.serialization.ObjectSchema< + serializers.ChangePasswordResponse.Raw, + TrueFoundry.ChangePasswordResponse +> = core.serialization.object({}); export declare namespace ChangePasswordResponse { - export interface Raw { - } + export type Raw = {}; } diff --git a/src/serialization/types/ChatMessageTurn.ts b/src/serialization/types/ChatMessageTurn.ts index 837252d9..09a4f1bb 100644 --- a/src/serialization/types/ChatMessageTurn.ts +++ b/src/serialization/types/ChatMessageTurn.ts @@ -1,16 +1,28 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AssistantMessage } from "./AssistantMessage.js"; import { DeveloperMessage } from "./DeveloperMessage.js"; import { SystemMessage } from "./SystemMessage.js"; import { ToolMessage } from "./ToolMessage.js"; import { UserMessage } from "./UserMessage.js"; -export const ChatMessageTurn: core.serialization.Schema = core.serialization.undiscriminatedUnion([SystemMessage, AssistantMessage, UserMessage, ToolMessage, DeveloperMessage]); +export const ChatMessageTurn: core.serialization.Schema = + core.serialization.undiscriminatedUnion([ + SystemMessage, + AssistantMessage, + UserMessage, + ToolMessage, + DeveloperMessage, + ]); export declare namespace ChatMessageTurn { - export type Raw = SystemMessage.Raw | AssistantMessage.Raw | UserMessage.Raw | ToolMessage.Raw | DeveloperMessage.Raw; + export type Raw = + | SystemMessage.Raw + | AssistantMessage.Raw + | UserMessage.Raw + | ToolMessage.Raw + | DeveloperMessage.Raw; } diff --git a/src/serialization/types/ChatPromptManifest.ts b/src/serialization/types/ChatPromptManifest.ts index 93487c6d..71d07fb6 100644 --- a/src/serialization/types/ChatPromptManifest.ts +++ b/src/serialization/types/ChatPromptManifest.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BaseArtifactVersion } from "./BaseArtifactVersion.js"; import { ChatMessageTurn } from "./ChatMessageTurn.js"; import { ChatPromptManifestCacheConfig } from "./ChatPromptManifestCacheConfig.js"; @@ -16,31 +16,44 @@ import { ModelConfiguration } from "./ModelConfiguration.js"; import { SubAgent } from "./SubAgent.js"; import { ToolSchema } from "./ToolSchema.js"; -export const ChatPromptManifest: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("chat_prompt"), - "description": core.serialization.string().optional(), - "versionAlias": core.serialization.property("version_alias", core.serialization.string().optional()), - "messages": core.serialization.list(ChatMessageTurn), - "variables": core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), - "modelConfiguration": core.serialization.property("model_configuration", ModelConfiguration.optional()), - "tools": core.serialization.list(ToolSchema).optional(), - "mcpServers": core.serialization.property("mcp_servers", core.serialization.list(ChatPromptManifestMcpServersItem).optional()), - "guardrails": Guardrails.optional(), - "responseFormat": core.serialization.property("response_format", ChatPromptManifestResponseFormat.optional()), - "routingConfig": core.serialization.property("routing_config", ChatPromptManifestRoutingConfig.optional()), - "cacheConfig": core.serialization.property("cache_config", ChatPromptManifestCacheConfig.optional()), - "toolCallToMcpMapping": core.serialization.property("tool_call_to_mcp_mapping", core.serialization.record(core.serialization.string(), McpServerToolDetails).optional()), - "loggingConfig": core.serialization.property("logging_config", LoggingConfig.optional()), - "subAgents": core.serialization.property("sub_agents", core.serialization.list(SubAgent).optional()) - }).extend(BaseArtifactVersion); +export const ChatPromptManifest: core.serialization.ObjectSchema< + serializers.ChatPromptManifest.Raw, + TrueFoundry.ChatPromptManifest +> = core.serialization + .object({ + type: core.serialization.stringLiteral("chat_prompt"), + description: core.serialization.string().optionalNullable(), + versionAlias: core.serialization.property("version_alias", core.serialization.string().optional()), + messages: core.serialization.list(ChatMessageTurn), + variables: core.serialization + .record(core.serialization.string(), core.serialization.string().nullable()) + .optional(), + modelConfiguration: core.serialization.property("model_configuration", ModelConfiguration.optional()), + tools: core.serialization.list(ToolSchema).optional(), + mcpServers: core.serialization.property( + "mcp_servers", + core.serialization.list(ChatPromptManifestMcpServersItem).optional(), + ), + guardrails: Guardrails.optional(), + responseFormat: core.serialization.property("response_format", ChatPromptManifestResponseFormat.optional()), + routingConfig: core.serialization.property("routing_config", ChatPromptManifestRoutingConfig.optional()), + cacheConfig: core.serialization.property("cache_config", ChatPromptManifestCacheConfig.optional()), + toolCallToMcpMapping: core.serialization.property( + "tool_call_to_mcp_mapping", + core.serialization.record(core.serialization.string(), McpServerToolDetails).optional(), + ), + loggingConfig: core.serialization.property("logging_config", LoggingConfig.optional()), + subAgents: core.serialization.property("sub_agents", core.serialization.list(SubAgent).optional()), + }) + .extend(BaseArtifactVersion); export declare namespace ChatPromptManifest { export interface Raw extends BaseArtifactVersion.Raw { type: "chat_prompt"; - description?: string | null; + description?: (string | null | undefined) | null; version_alias?: string | null; messages: ChatMessageTurn.Raw[]; - variables?: Record | null; + variables?: Record | null; model_configuration?: ModelConfiguration.Raw | null; tools?: ToolSchema.Raw[] | null; mcp_servers?: ChatPromptManifestMcpServersItem.Raw[] | null; diff --git a/src/serialization/types/ChatPromptManifestCacheConfig.ts b/src/serialization/types/ChatPromptManifestCacheConfig.ts index 7fc491ce..ca2eeb2f 100644 --- a/src/serialization/types/ChatPromptManifestCacheConfig.ts +++ b/src/serialization/types/ChatPromptManifestCacheConfig.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ExactMatchCacheConfig } from "./ExactMatchCacheConfig.js"; import { SemanticCacheConfig } from "./SemanticCacheConfig.js"; -export const ChatPromptManifestCacheConfig: core.serialization.Schema = core.serialization.undiscriminatedUnion([SemanticCacheConfig, ExactMatchCacheConfig]); +export const ChatPromptManifestCacheConfig: core.serialization.Schema< + serializers.ChatPromptManifestCacheConfig.Raw, + TrueFoundry.ChatPromptManifestCacheConfig +> = core.serialization.undiscriminatedUnion([SemanticCacheConfig, ExactMatchCacheConfig]); export declare namespace ChatPromptManifestCacheConfig { export type Raw = SemanticCacheConfig.Raw | ExactMatchCacheConfig.Raw; diff --git a/src/serialization/types/ChatPromptManifestMcpServersItem.ts b/src/serialization/types/ChatPromptManifestMcpServersItem.ts index 51e83f32..743136c4 100644 --- a/src/serialization/types/ChatPromptManifestMcpServersItem.ts +++ b/src/serialization/types/ChatPromptManifestMcpServersItem.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { McpServerWithFqn } from "./McpServerWithFqn.js"; import { McpServerWithUrl } from "./McpServerWithUrl.js"; -export const ChatPromptManifestMcpServersItem: core.serialization.Schema = core.serialization.undiscriminatedUnion([McpServerWithFqn, McpServerWithUrl]); +export const ChatPromptManifestMcpServersItem: core.serialization.Schema< + serializers.ChatPromptManifestMcpServersItem.Raw, + TrueFoundry.ChatPromptManifestMcpServersItem +> = core.serialization.undiscriminatedUnion([McpServerWithFqn, McpServerWithUrl]); export declare namespace ChatPromptManifestMcpServersItem { export type Raw = McpServerWithFqn.Raw | McpServerWithUrl.Raw; diff --git a/src/serialization/types/ChatPromptManifestResponseFormat.ts b/src/serialization/types/ChatPromptManifestResponseFormat.ts index 39c9ca77..6174c968 100644 --- a/src/serialization/types/ChatPromptManifestResponseFormat.ts +++ b/src/serialization/types/ChatPromptManifestResponseFormat.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { JsonObjectResponseFormat } from "./JsonObjectResponseFormat.js"; import { JsonSchemaResponseFormat } from "./JsonSchemaResponseFormat.js"; -export const ChatPromptManifestResponseFormat: core.serialization.Schema = core.serialization.undiscriminatedUnion([JsonObjectResponseFormat, JsonSchemaResponseFormat]); +export const ChatPromptManifestResponseFormat: core.serialization.Schema< + serializers.ChatPromptManifestResponseFormat.Raw, + TrueFoundry.ChatPromptManifestResponseFormat +> = core.serialization.undiscriminatedUnion([JsonObjectResponseFormat, JsonSchemaResponseFormat]); export declare namespace ChatPromptManifestResponseFormat { export type Raw = JsonObjectResponseFormat.Raw | JsonSchemaResponseFormat.Raw; diff --git a/src/serialization/types/ChatPromptManifestRoutingConfig.ts b/src/serialization/types/ChatPromptManifestRoutingConfig.ts index c31d2f30..a2ca8056 100644 --- a/src/serialization/types/ChatPromptManifestRoutingConfig.ts +++ b/src/serialization/types/ChatPromptManifestRoutingConfig.ts @@ -1,13 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { LatencyBasedLoadBalancing } from "./LatencyBasedLoadBalancing.js"; import { PriorityBasedLoadBalancing } from "./PriorityBasedLoadBalancing.js"; import { WeightBasedLoadBalancing } from "./WeightBasedLoadBalancing.js"; -export const ChatPromptManifestRoutingConfig: core.serialization.Schema = core.serialization.undiscriminatedUnion([WeightBasedLoadBalancing, LatencyBasedLoadBalancing, PriorityBasedLoadBalancing]); +export const ChatPromptManifestRoutingConfig: core.serialization.Schema< + serializers.ChatPromptManifestRoutingConfig.Raw, + TrueFoundry.ChatPromptManifestRoutingConfig +> = core.serialization.undiscriminatedUnion([ + WeightBasedLoadBalancing, + LatencyBasedLoadBalancing, + PriorityBasedLoadBalancing, +]); export declare namespace ChatPromptManifestRoutingConfig { export type Raw = WeightBasedLoadBalancing.Raw | LatencyBasedLoadBalancing.Raw | PriorityBasedLoadBalancing.Raw; diff --git a/src/serialization/types/CiscoAiDefenseGuardrailConfig.ts b/src/serialization/types/CiscoAiDefenseGuardrailConfig.ts new file mode 100644 index 00000000..4af6d456 --- /dev/null +++ b/src/serialization/types/CiscoAiDefenseGuardrailConfig.ts @@ -0,0 +1,33 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CiscoAiDefenseGuardrailConfigConfig } from "./CiscoAiDefenseGuardrailConfigConfig.js"; +import { CiscoAiDefenseKeyAuth } from "./CiscoAiDefenseKeyAuth.js"; +import { EnforcingStrategy } from "./EnforcingStrategy.js"; + +export const CiscoAiDefenseGuardrailConfig: core.serialization.ObjectSchema< + serializers.CiscoAiDefenseGuardrailConfig.Raw, + TrueFoundry.CiscoAiDefenseGuardrailConfig +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + type: core.serialization.stringLiteral("integration/guardrail-config/cisco-ai-defense"), + authData: core.serialization.property("auth_data", CiscoAiDefenseKeyAuth), + operation: core.serialization.stringLiteral("validate"), + enforcingStrategy: core.serialization.property("enforcing_strategy", EnforcingStrategy), + config: CiscoAiDefenseGuardrailConfigConfig, +}); + +export declare namespace CiscoAiDefenseGuardrailConfig { + export interface Raw { + name: string; + description?: string | null; + type: "integration/guardrail-config/cisco-ai-defense"; + auth_data: CiscoAiDefenseKeyAuth.Raw; + operation: "validate"; + enforcing_strategy: EnforcingStrategy.Raw; + config: CiscoAiDefenseGuardrailConfigConfig.Raw; + } +} diff --git a/src/serialization/types/CiscoAiDefenseGuardrailConfigConfig.ts b/src/serialization/types/CiscoAiDefenseGuardrailConfigConfig.ts new file mode 100644 index 00000000..07e27cfc --- /dev/null +++ b/src/serialization/types/CiscoAiDefenseGuardrailConfigConfig.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CiscoAiDefenseGuardrailConfigConfigRegion } from "./CiscoAiDefenseGuardrailConfigConfigRegion.js"; + +export const CiscoAiDefenseGuardrailConfigConfig: core.serialization.ObjectSchema< + serializers.CiscoAiDefenseGuardrailConfigConfig.Raw, + TrueFoundry.CiscoAiDefenseGuardrailConfigConfig +> = core.serialization.object({ + region: CiscoAiDefenseGuardrailConfigConfigRegion, + metadata: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), +}); + +export declare namespace CiscoAiDefenseGuardrailConfigConfig { + export interface Raw { + region: CiscoAiDefenseGuardrailConfigConfigRegion.Raw; + metadata?: Record | null; + } +} diff --git a/src/serialization/types/CiscoAiDefenseGuardrailConfigConfigRegion.ts b/src/serialization/types/CiscoAiDefenseGuardrailConfigConfigRegion.ts new file mode 100644 index 00000000..47103bba --- /dev/null +++ b/src/serialization/types/CiscoAiDefenseGuardrailConfigConfigRegion.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CiscoAiDefenseGuardrailConfigConfigRegion: core.serialization.Schema< + serializers.CiscoAiDefenseGuardrailConfigConfigRegion.Raw, + TrueFoundry.CiscoAiDefenseGuardrailConfigConfigRegion +> = core.serialization.enum_(["us", "eu", "ap"]); + +export declare namespace CiscoAiDefenseGuardrailConfigConfigRegion { + export type Raw = "us" | "eu" | "ap"; +} diff --git a/src/serialization/types/CiscoAiDefenseKeyAuth.ts b/src/serialization/types/CiscoAiDefenseKeyAuth.ts new file mode 100644 index 00000000..8e44ead3 --- /dev/null +++ b/src/serialization/types/CiscoAiDefenseKeyAuth.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const CiscoAiDefenseKeyAuth: core.serialization.ObjectSchema< + serializers.CiscoAiDefenseKeyAuth.Raw, + TrueFoundry.CiscoAiDefenseKeyAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), +}); + +export declare namespace CiscoAiDefenseKeyAuth { + export interface Raw { + type: "api-key"; + api_key: string; + } +} diff --git a/src/serialization/types/ClouderaIntegrations.ts b/src/serialization/types/ClouderaIntegrations.ts index abbf0063..dd0de21c 100644 --- a/src/serialization/types/ClouderaIntegrations.ts +++ b/src/serialization/types/ClouderaIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { ClouderaModel } from "./ClouderaModel.js"; -export const ClouderaIntegrations: core.serialization.ObjectSchema = ClouderaModel; +export const ClouderaIntegrations: core.serialization.ObjectSchema< + serializers.ClouderaIntegrations.Raw, + TrueFoundry.ClouderaIntegrations +> = ClouderaModel; export declare namespace ClouderaIntegrations { export type Raw = ClouderaModel.Raw; diff --git a/src/serialization/types/ClouderaModel.ts b/src/serialization/types/ClouderaModel.ts index 8f8f2fcf..5d9e3d52 100644 --- a/src/serialization/types/ClouderaModel.ts +++ b/src/serialization/types/ClouderaModel.ts @@ -1,19 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const ClouderaModel: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/model/cloudera"), - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "baseUrl": core.serialization.property("base_url", core.serialization.string()), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) +export const ClouderaModel: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("integration/model/cloudera"), + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + baseUrl: core.serialization.property("base_url", core.serialization.string()), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace ClouderaModel { diff --git a/src/serialization/types/ClouderaProviderAccount.ts b/src/serialization/types/ClouderaProviderAccount.ts index 93bc4701..78e1a72f 100644 --- a/src/serialization/types/ClouderaProviderAccount.ts +++ b/src/serialization/types/ClouderaProviderAccount.ts @@ -1,22 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ClouderaIntegrations } from "./ClouderaIntegrations.js"; import { ClouderaProviderAccountAuthData } from "./ClouderaProviderAccountAuthData.js"; import { Collaborator } from "./Collaborator.js"; import { OwnedBy } from "./OwnedBy.js"; -export const ClouderaProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/cloudera"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", ClouderaProviderAccountAuthData), - "integrations": core.serialization.list(ClouderaIntegrations), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const ClouderaProviderAccount: core.serialization.ObjectSchema< + serializers.ClouderaProviderAccount.Raw, + TrueFoundry.ClouderaProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/cloudera"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", ClouderaProviderAccountAuthData), + integrations: core.serialization.list(ClouderaIntegrations), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace ClouderaProviderAccount { export interface Raw { diff --git a/src/serialization/types/ClouderaProviderAccountAuthData.ts b/src/serialization/types/ClouderaProviderAccountAuthData.ts index 22881f8c..b65e837b 100644 --- a/src/serialization/types/ClouderaProviderAccountAuthData.ts +++ b/src/serialization/types/ClouderaProviderAccountAuthData.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ClouderaTokenAuth } from "./ClouderaTokenAuth.js"; import { ClouderaWorkloadAuthToken } from "./ClouderaWorkloadAuthToken.js"; -export const ClouderaProviderAccountAuthData: core.serialization.Schema = core.serialization.undiscriminatedUnion([ClouderaWorkloadAuthToken, ClouderaTokenAuth]); +export const ClouderaProviderAccountAuthData: core.serialization.Schema< + serializers.ClouderaProviderAccountAuthData.Raw, + TrueFoundry.ClouderaProviderAccountAuthData +> = core.serialization.undiscriminatedUnion([ClouderaWorkloadAuthToken, ClouderaTokenAuth]); export declare namespace ClouderaProviderAccountAuthData { export type Raw = ClouderaWorkloadAuthToken.Raw | ClouderaTokenAuth.Raw; diff --git a/src/serialization/types/ClouderaTokenAuth.ts b/src/serialization/types/ClouderaTokenAuth.ts index 87d311d7..dd3c0352 100644 --- a/src/serialization/types/ClouderaTokenAuth.ts +++ b/src/serialization/types/ClouderaTokenAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const ClouderaTokenAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("token"), - "apiToken": core.serialization.property("api_token", core.serialization.string()) - }); +export const ClouderaTokenAuth: core.serialization.ObjectSchema< + serializers.ClouderaTokenAuth.Raw, + TrueFoundry.ClouderaTokenAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("token"), + apiToken: core.serialization.property("api_token", core.serialization.string()), +}); export declare namespace ClouderaTokenAuth { export interface Raw { diff --git a/src/serialization/types/ClouderaWorkloadAuthToken.ts b/src/serialization/types/ClouderaWorkloadAuthToken.ts index 332d6719..50af0656 100644 --- a/src/serialization/types/ClouderaWorkloadAuthToken.ts +++ b/src/serialization/types/ClouderaWorkloadAuthToken.ts @@ -1,16 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const ClouderaWorkloadAuthToken: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("workload-auth-token"), - "cdpBaseUrl": core.serialization.property("cdp_base_url", core.serialization.string()), - "accessKeyId": core.serialization.property("access_key_id", core.serialization.string()), - "privateKey": core.serialization.property("private_key", core.serialization.string()), - "workloadName": core.serialization.property("workload_name", core.serialization.string()) - }); +export const ClouderaWorkloadAuthToken: core.serialization.ObjectSchema< + serializers.ClouderaWorkloadAuthToken.Raw, + TrueFoundry.ClouderaWorkloadAuthToken +> = core.serialization.object({ + type: core.serialization.stringLiteral("workload-auth-token"), + cdpBaseUrl: core.serialization.property("cdp_base_url", core.serialization.string()), + accessKeyId: core.serialization.property("access_key_id", core.serialization.string()), + privateKey: core.serialization.property("private_key", core.serialization.string()), + workloadName: core.serialization.property("workload_name", core.serialization.string()), +}); export declare namespace ClouderaWorkloadAuthToken { export interface Raw { diff --git a/src/serialization/types/Cluster.ts b/src/serialization/types/Cluster.ts index 2749c56a..1cfc9a97 100644 --- a/src/serialization/types/Cluster.ts +++ b/src/serialization/types/Cluster.ts @@ -1,21 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ClusterManifest } from "./ClusterManifest.js"; import { Subject } from "./Subject.js"; -export const Cluster: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string(), - "fqn": core.serialization.string(), - "manifest": ClusterManifest, - "tenantName": core.serialization.string(), - "accountId": core.serialization.string(), - "createdBySubject": Subject.optional(), - "createdAt": core.serialization.date(), - "updatedAt": core.serialization.date(), - "createdBy": core.serialization.string().optional() +export const Cluster: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string(), + fqn: core.serialization.string(), + manifest: ClusterManifest, + tenantName: core.serialization.string(), + accountId: core.serialization.string(), + createdBySubject: Subject.optionalNullable(), + createdAt: core.serialization.date(), + updatedAt: core.serialization.date(), + createdBy: core.serialization.string().optionalNullable(), }); export declare namespace Cluster { @@ -25,9 +26,9 @@ export declare namespace Cluster { manifest: ClusterManifest.Raw; tenantName: string; accountId: string; - createdBySubject?: Subject.Raw | null; + createdBySubject?: (Subject.Raw | null | undefined) | null; createdAt: string; updatedAt: string; - createdBy?: string | null; + createdBy?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/ClusterGateway.ts b/src/serialization/types/ClusterGateway.ts index e38800b9..1596bc32 100644 --- a/src/serialization/types/ClusterGateway.ts +++ b/src/serialization/types/ClusterGateway.ts @@ -1,23 +1,26 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const ClusterGateway: core.serialization.ObjectSchema = core.serialization.object({ - "uid": core.serialization.string().optional(), - "name": core.serialization.string(), - "hosts": core.serialization.list(core.serialization.string()), - "isTieBreaker": core.serialization.boolean().optional(), - "selector": core.serialization.record(core.serialization.string(), core.serialization.string()) - }); +export const ClusterGateway: core.serialization.ObjectSchema< + serializers.ClusterGateway.Raw, + TrueFoundry.ClusterGateway +> = core.serialization.object({ + uid: core.serialization.string().optionalNullable(), + name: core.serialization.string(), + hosts: core.serialization.list(core.serialization.string()), + isTieBreaker: core.serialization.boolean().optionalNullable(), + selector: core.serialization.record(core.serialization.string(), core.serialization.string()), +}); export declare namespace ClusterGateway { export interface Raw { - uid?: string | null; + uid?: (string | null | undefined) | null; name: string; hosts: string[]; - isTieBreaker?: boolean | null; + isTieBreaker?: (boolean | null | undefined) | null; selector: Record; } } diff --git a/src/serialization/types/ClusterManifest.ts b/src/serialization/types/ClusterManifest.ts index a56304bc..d2228377 100644 --- a/src/serialization/types/ClusterManifest.ts +++ b/src/serialization/types/ClusterManifest.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ClusterManifestClusterType } from "./ClusterManifestClusterType.js"; import { ClusterManifestMonitoring } from "./ClusterManifestMonitoring.js"; import { ClusterManifestNodeLabelKeys } from "./ClusterManifestNodeLabelKeys.js"; @@ -13,24 +13,45 @@ import { Nodepool } from "./Nodepool.js"; import { OwnedBy } from "./OwnedBy.js"; import { SparkConfig } from "./SparkConfig.js"; -export const ClusterManifest: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("cluster"), - "name": core.serialization.string(), - "clusterType": core.serialization.property("cluster_type", ClusterManifestClusterType), - "environmentNames": core.serialization.property("environment_names", core.serialization.list(core.serialization.string())), - "baseDomains": core.serialization.property("base_domains", core.serialization.list(core.serialization.string()).optional()), - "monitoring": ClusterManifestMonitoring.optional(), - "defaultRegistryFqn": core.serialization.property("default_registry_fqn", core.serialization.string().optional()), - "workbenchConfig": core.serialization.property("workbench_config", ClusterManifestWorkbenchConfig.optional()), - "sparkConfig": core.serialization.property("spark_config", SparkConfig.optional()), - "ingressControllerConfig": core.serialization.property("ingress_controller_config", IngressControllerConfig.optional()), - "clusterIntegrationFqn": core.serialization.property("cluster_integration_fqn", core.serialization.string().optional()), - "workflowStorageIntegrationFqn": core.serialization.property("workflow_storage_integration_fqn", core.serialization.string().optional()), - "supportedNodepools": core.serialization.property("supported_nodepools", core.serialization.list(Nodepool).optional()), - "nodeLabelKeys": core.serialization.property("node_label_keys", ClusterManifestNodeLabelKeys.optional()), - "collaborators": core.serialization.list(Collaborator), - "ownedBy": OwnedBy.optional() - }); +export const ClusterManifest: core.serialization.ObjectSchema< + serializers.ClusterManifest.Raw, + TrueFoundry.ClusterManifest +> = core.serialization.object({ + type: core.serialization.stringLiteral("cluster"), + name: core.serialization.string(), + clusterType: core.serialization.property("cluster_type", ClusterManifestClusterType), + environmentNames: core.serialization.property( + "environment_names", + core.serialization.list(core.serialization.string()), + ), + baseDomains: core.serialization.property( + "base_domains", + core.serialization.list(core.serialization.string()).optional(), + ), + monitoring: ClusterManifestMonitoring.optional(), + defaultRegistryFqn: core.serialization.property("default_registry_fqn", core.serialization.string().optional()), + workbenchConfig: core.serialization.property("workbench_config", ClusterManifestWorkbenchConfig.optional()), + sparkConfig: core.serialization.property("spark_config", SparkConfig.optional()), + ingressControllerConfig: core.serialization.property( + "ingress_controller_config", + IngressControllerConfig.optional(), + ), + clusterIntegrationFqn: core.serialization.property( + "cluster_integration_fqn", + core.serialization.string().optional(), + ), + workflowStorageIntegrationFqn: core.serialization.property( + "workflow_storage_integration_fqn", + core.serialization.string().optional(), + ), + supportedNodepools: core.serialization.property( + "supported_nodepools", + core.serialization.list(Nodepool).optional(), + ), + nodeLabelKeys: core.serialization.property("node_label_keys", ClusterManifestNodeLabelKeys.optional()), + collaborators: core.serialization.list(Collaborator), + ownedBy: OwnedBy.optional(), +}); export declare namespace ClusterManifest { export interface Raw { diff --git a/src/serialization/types/ClusterManifestClusterType.ts b/src/serialization/types/ClusterManifestClusterType.ts index aa97464c..052167eb 100644 --- a/src/serialization/types/ClusterManifestClusterType.ts +++ b/src/serialization/types/ClusterManifestClusterType.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const ClusterManifestClusterType: core.serialization.Schema = core.serialization.enum_(["aws-eks", "gcp-gke-standard", "azure-aks", "generic", "civo-talos"]); +export const ClusterManifestClusterType: core.serialization.Schema< + serializers.ClusterManifestClusterType.Raw, + TrueFoundry.ClusterManifestClusterType +> = core.serialization.enum_(["aws-eks", "gcp-gke-standard", "azure-aks", "generic", "civo-talos"]); export declare namespace ClusterManifestClusterType { export type Raw = "aws-eks" | "gcp-gke-standard" | "azure-aks" | "generic" | "civo-talos"; diff --git a/src/serialization/types/ClusterManifestMonitoring.ts b/src/serialization/types/ClusterManifestMonitoring.ts index 0f4f17cb..89e881bc 100644 --- a/src/serialization/types/ClusterManifestMonitoring.ts +++ b/src/serialization/types/ClusterManifestMonitoring.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const ClusterManifestMonitoring: core.serialization.ObjectSchema = core.serialization.object({ - "lokiUrl": core.serialization.property("loki_url", core.serialization.string().optional()), - "victoriaLogsUrl": core.serialization.property("victoria_logs_url", core.serialization.string().optional()), - "prometheusUrl": core.serialization.property("prometheus_url", core.serialization.string().optional()), - "kubecostUrl": core.serialization.property("kubecost_url", core.serialization.string().optional()) - }); +export const ClusterManifestMonitoring: core.serialization.ObjectSchema< + serializers.ClusterManifestMonitoring.Raw, + TrueFoundry.ClusterManifestMonitoring +> = core.serialization.object({ + lokiUrl: core.serialization.property("loki_url", core.serialization.string().optional()), + victoriaLogsUrl: core.serialization.property("victoria_logs_url", core.serialization.string().optional()), + prometheusUrl: core.serialization.property("prometheus_url", core.serialization.string().optional()), + kubecostUrl: core.serialization.property("kubecost_url", core.serialization.string().optional()), +}); export declare namespace ClusterManifestMonitoring { export interface Raw { diff --git a/src/serialization/types/ClusterManifestNodeLabelKeys.ts b/src/serialization/types/ClusterManifestNodeLabelKeys.ts index f0a8382b..c7e227a4 100644 --- a/src/serialization/types/ClusterManifestNodeLabelKeys.ts +++ b/src/serialization/types/ClusterManifestNodeLabelKeys.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const ClusterManifestNodeLabelKeys: core.serialization.ObjectSchema = core.serialization.object({ - "nodepoolSelectorLabel": core.serialization.property("nodepool_selector_label", core.serialization.string()) - }); +export const ClusterManifestNodeLabelKeys: core.serialization.ObjectSchema< + serializers.ClusterManifestNodeLabelKeys.Raw, + TrueFoundry.ClusterManifestNodeLabelKeys +> = core.serialization.object({ + nodepoolSelectorLabel: core.serialization.property("nodepool_selector_label", core.serialization.string()), +}); export declare namespace ClusterManifestNodeLabelKeys { export interface Raw { diff --git a/src/serialization/types/ClusterManifestWorkbenchConfig.ts b/src/serialization/types/ClusterManifestWorkbenchConfig.ts index 5bfb9b29..4bfaae85 100644 --- a/src/serialization/types/ClusterManifestWorkbenchConfig.ts +++ b/src/serialization/types/ClusterManifestWorkbenchConfig.ts @@ -1,16 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { NotebookConfig } from "./NotebookConfig.js"; import { SshServerConfig } from "./SshServerConfig.js"; -export const ClusterManifestWorkbenchConfig: core.serialization.ObjectSchema = core.serialization.object({ - "notebookConfig": core.serialization.property("notebook_config", NotebookConfig.optional()), - "sshServerConfig": core.serialization.property("ssh_server_config", SshServerConfig.optional()), - "defaultStorageClass": core.serialization.property("default_storage_class", core.serialization.string().optional()) - }); +export const ClusterManifestWorkbenchConfig: core.serialization.ObjectSchema< + serializers.ClusterManifestWorkbenchConfig.Raw, + TrueFoundry.ClusterManifestWorkbenchConfig +> = core.serialization.object({ + notebookConfig: core.serialization.property("notebook_config", NotebookConfig.optional()), + sshServerConfig: core.serialization.property("ssh_server_config", SshServerConfig.optional()), + defaultStorageClass: core.serialization.property("default_storage_class", core.serialization.string().optional()), +}); export declare namespace ClusterManifestWorkbenchConfig { export interface Raw { diff --git a/src/serialization/types/ClusterType.ts b/src/serialization/types/ClusterType.ts index ebe1f0e0..82d78509 100644 --- a/src/serialization/types/ClusterType.ts +++ b/src/serialization/types/ClusterType.ts @@ -1,10 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const ClusterType: core.serialization.Schema = core.serialization.enum_(["aws-eks", "gcp-gke-standard", "azure-aks", "generic", "civo-talos"]); +export const ClusterType: core.serialization.Schema = + core.serialization.enum_(["aws-eks", "gcp-gke-standard", "azure-aks", "generic", "civo-talos"]); export declare namespace ClusterType { export type Raw = "aws-eks" | "gcp-gke-standard" | "azure-aks" | "generic" | "civo-talos"; diff --git a/src/serialization/types/CodeSafetyLinterGuardrailConfig.ts b/src/serialization/types/CodeSafetyLinterGuardrailConfig.ts index fa329bab..75ebe14c 100644 --- a/src/serialization/types/CodeSafetyLinterGuardrailConfig.ts +++ b/src/serialization/types/CodeSafetyLinterGuardrailConfig.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { EnforcingStrategy } from "./EnforcingStrategy.js"; -export const CodeSafetyLinterGuardrailConfig: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string().optional(), - "type": core.serialization.stringLiteral("integration/guardrail-config/code-safety-linter"), - "operation": core.serialization.stringLiteral("validate"), - "enforcingStrategy": core.serialization.property("enforcing_strategy", EnforcingStrategy) - }); +export const CodeSafetyLinterGuardrailConfig: core.serialization.ObjectSchema< + serializers.CodeSafetyLinterGuardrailConfig.Raw, + TrueFoundry.CodeSafetyLinterGuardrailConfig +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + type: core.serialization.stringLiteral("integration/guardrail-config/code-safety-linter"), + operation: core.serialization.stringLiteral("validate"), + enforcingStrategy: core.serialization.property("enforcing_strategy", EnforcingStrategy), +}); export declare namespace CodeSafetyLinterGuardrailConfig { export interface Raw { diff --git a/src/serialization/types/Codeserver.ts b/src/serialization/types/Codeserver.ts index 67b0b243..eb81a94a 100644 --- a/src/serialization/types/Codeserver.ts +++ b/src/serialization/types/Codeserver.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BaseWorkbenchInput } from "./BaseWorkbenchInput.js"; import { WorkbenchImage } from "./WorkbenchImage.js"; -export const Codeserver: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("codeserver"), - "image": WorkbenchImage - }).extend(BaseWorkbenchInput); +export const Codeserver: core.serialization.ObjectSchema = + core.serialization + .object({ + type: core.serialization.stringLiteral("codeserver"), + image: WorkbenchImage, + }) + .extend(BaseWorkbenchInput); export declare namespace Codeserver { export interface Raw extends BaseWorkbenchInput.Raw { diff --git a/src/serialization/types/CohereIntegrations.ts b/src/serialization/types/CohereIntegrations.ts index bf6caffc..5994c8d1 100644 --- a/src/serialization/types/CohereIntegrations.ts +++ b/src/serialization/types/CohereIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { CohereModel } from "./CohereModel.js"; -export const CohereIntegrations: core.serialization.ObjectSchema = CohereModel; +export const CohereIntegrations: core.serialization.ObjectSchema< + serializers.CohereIntegrations.Raw, + TrueFoundry.CohereIntegrations +> = CohereModel; export declare namespace CohereIntegrations { export type Raw = CohereModel.Raw; diff --git a/src/serialization/types/CohereKeyAuth.ts b/src/serialization/types/CohereKeyAuth.ts index 55523e4a..30ba5a7c 100644 --- a/src/serialization/types/CohereKeyAuth.ts +++ b/src/serialization/types/CohereKeyAuth.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const CohereKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) +export const CohereKeyAuth: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), }); export declare namespace CohereKeyAuth { diff --git a/src/serialization/types/CohereModel.ts b/src/serialization/types/CohereModel.ts index 5b24758c..b001b4ea 100644 --- a/src/serialization/types/CohereModel.ts +++ b/src/serialization/types/CohereModel.ts @@ -1,18 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const CohereModel: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/model/cohere"), - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) +export const CohereModel: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("integration/model/cohere"), + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace CohereModel { diff --git a/src/serialization/types/CohereProviderAccount.ts b/src/serialization/types/CohereProviderAccount.ts index affd4d2e..374662c2 100644 --- a/src/serialization/types/CohereProviderAccount.ts +++ b/src/serialization/types/CohereProviderAccount.ts @@ -1,22 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { CohereIntegrations } from "./CohereIntegrations.js"; import { CohereKeyAuth } from "./CohereKeyAuth.js"; import { Collaborator } from "./Collaborator.js"; import { OwnedBy } from "./OwnedBy.js"; -export const CohereProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/cohere"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", CohereKeyAuth), - "integrations": core.serialization.list(CohereIntegrations).optional(), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const CohereProviderAccount: core.serialization.ObjectSchema< + serializers.CohereProviderAccount.Raw, + TrueFoundry.CohereProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/cohere"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", CohereKeyAuth), + integrations: core.serialization.list(CohereIntegrations).optional(), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace CohereProviderAccount { export interface Raw { diff --git a/src/serialization/types/Collaborator.ts b/src/serialization/types/Collaborator.ts index 4821428a..5929e2f0 100644 --- a/src/serialization/types/Collaborator.ts +++ b/src/serialization/types/Collaborator.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const Collaborator: core.serialization.ObjectSchema = core.serialization.object({ - "subject": core.serialization.string(), - "roleId": core.serialization.property("role_id", core.serialization.string()) +export const Collaborator: core.serialization.ObjectSchema = + core.serialization.object({ + subject: core.serialization.string(), + roleId: core.serialization.property("role_id", core.serialization.string()), }); export declare namespace Collaborator { diff --git a/src/serialization/types/CommonToolsSettings.ts b/src/serialization/types/CommonToolsSettings.ts index a027702b..e4781149 100644 --- a/src/serialization/types/CommonToolsSettings.ts +++ b/src/serialization/types/CommonToolsSettings.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const CommonToolsSettings: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("settings/common-tools"), - "webSearch": core.serialization.property("web_search", core.serialization.boolean()), - "codeExecutor": core.serialization.property("code_executor", core.serialization.boolean()), - "sandboxExec": core.serialization.property("sandbox_exec", core.serialization.boolean()), - "sequentialThinking": core.serialization.property("sequential_thinking", core.serialization.boolean()), - "webScrape": core.serialization.property("web_scrape", core.serialization.boolean()) - }); +export const CommonToolsSettings: core.serialization.ObjectSchema< + serializers.CommonToolsSettings.Raw, + TrueFoundry.CommonToolsSettings +> = core.serialization.object({ + type: core.serialization.stringLiteral("settings/common-tools"), + webSearch: core.serialization.property("web_search", core.serialization.boolean()), + codeExecutor: core.serialization.property("code_executor", core.serialization.boolean()), + sandboxExec: core.serialization.property("sandbox_exec", core.serialization.boolean()), + sequentialThinking: core.serialization.property("sequential_thinking", core.serialization.boolean()), + webScrape: core.serialization.property("web_scrape", core.serialization.boolean()), +}); export declare namespace CommonToolsSettings { export interface Raw { diff --git a/src/serialization/types/ComplexityBasedLoadBalanceTarget.ts b/src/serialization/types/ComplexityBasedLoadBalanceTarget.ts new file mode 100644 index 00000000..0e6e3c66 --- /dev/null +++ b/src/serialization/types/ComplexityBasedLoadBalanceTarget.ts @@ -0,0 +1,44 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { ComplexityBasedLoadBalanceTargetTier } from "./ComplexityBasedLoadBalanceTargetTier.js"; +import { HeadersOverride } from "./HeadersOverride.js"; +import { RetryConfig } from "./RetryConfig.js"; + +export const ComplexityBasedLoadBalanceTarget: core.serialization.ObjectSchema< + serializers.ComplexityBasedLoadBalanceTarget.Raw, + TrueFoundry.ComplexityBasedLoadBalanceTarget +> = core.serialization.object({ + target: core.serialization.string(), + tier: ComplexityBasedLoadBalanceTargetTier, + retryConfig: core.serialization.property("retry_config", RetryConfig.optional()), + fallbackStatusCodes: core.serialization.property( + "fallback_status_codes", + core.serialization.list(core.serialization.string()).optional(), + ), + fallbackCandidate: core.serialization.property("fallback_candidate", core.serialization.boolean().optional()), + overrideParams: core.serialization.property( + "override_params", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + ), + headersOverride: core.serialization.property("headers_override", HeadersOverride.optional()), + metadataMatch: core.serialization.property( + "metadata_match", + core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), + ), +}); + +export declare namespace ComplexityBasedLoadBalanceTarget { + export interface Raw { + target: string; + tier: ComplexityBasedLoadBalanceTargetTier.Raw; + retry_config?: RetryConfig.Raw | null; + fallback_status_codes?: string[] | null; + fallback_candidate?: boolean | null; + override_params?: Record | null; + headers_override?: HeadersOverride.Raw | null; + metadata_match?: Record | null; + } +} diff --git a/src/serialization/types/ComplexityBasedLoadBalanceTargetTier.ts b/src/serialization/types/ComplexityBasedLoadBalanceTargetTier.ts new file mode 100644 index 00000000..c5b374a0 --- /dev/null +++ b/src/serialization/types/ComplexityBasedLoadBalanceTargetTier.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const ComplexityBasedLoadBalanceTargetTier: core.serialization.Schema< + serializers.ComplexityBasedLoadBalanceTargetTier.Raw, + TrueFoundry.ComplexityBasedLoadBalanceTargetTier +> = core.serialization.enum_(["simple", "medium", "complex"]); + +export declare namespace ComplexityBasedLoadBalanceTargetTier { + export type Raw = "simple" | "medium" | "complex"; +} diff --git a/src/serialization/types/ComplexityBasedLoadBalancing.ts b/src/serialization/types/ComplexityBasedLoadBalancing.ts new file mode 100644 index 00000000..d239abc4 --- /dev/null +++ b/src/serialization/types/ComplexityBasedLoadBalancing.ts @@ -0,0 +1,33 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { ComplexityBasedLoadBalanceTarget } from "./ComplexityBasedLoadBalanceTarget.js"; +import { ComplexityBasedLoadBalancingClassificationStrategy } from "./ComplexityBasedLoadBalancingClassificationStrategy.js"; +import { ComplexityStickyRouting } from "./ComplexityStickyRouting.js"; + +export const ComplexityBasedLoadBalancing: core.serialization.ObjectSchema< + serializers.ComplexityBasedLoadBalancing.Raw, + TrueFoundry.ComplexityBasedLoadBalancing +> = core.serialization.object({ + type: core.serialization.stringLiteral("complexity-based-routing"), + classificationStrategy: core.serialization.property( + "classification_strategy", + ComplexityBasedLoadBalancingClassificationStrategy.optional(), + ), + loadBalanceTargets: core.serialization.property( + "load_balance_targets", + core.serialization.list(ComplexityBasedLoadBalanceTarget), + ), + stickyRouting: core.serialization.property("sticky_routing", ComplexityStickyRouting.optional()), +}); + +export declare namespace ComplexityBasedLoadBalancing { + export interface Raw { + type: "complexity-based-routing"; + classification_strategy?: ComplexityBasedLoadBalancingClassificationStrategy.Raw | null; + load_balance_targets: ComplexityBasedLoadBalanceTarget.Raw[]; + sticky_routing?: ComplexityStickyRouting.Raw | null; + } +} diff --git a/src/serialization/types/ComplexityBasedLoadBalancingClassificationStrategy.ts b/src/serialization/types/ComplexityBasedLoadBalancingClassificationStrategy.ts new file mode 100644 index 00000000..a8f489e6 --- /dev/null +++ b/src/serialization/types/ComplexityBasedLoadBalancingClassificationStrategy.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { HeuristicClassificationStrategy } from "./HeuristicClassificationStrategy.js"; +import { LlmClassificationStrategy } from "./LlmClassificationStrategy.js"; + +export const ComplexityBasedLoadBalancingClassificationStrategy: core.serialization.Schema< + serializers.ComplexityBasedLoadBalancingClassificationStrategy.Raw, + TrueFoundry.ComplexityBasedLoadBalancingClassificationStrategy +> = core.serialization.undiscriminatedUnion([HeuristicClassificationStrategy, LlmClassificationStrategy]); + +export declare namespace ComplexityBasedLoadBalancingClassificationStrategy { + export type Raw = HeuristicClassificationStrategy.Raw | LlmClassificationStrategy.Raw; +} diff --git a/src/serialization/types/ComplexityStickyRouting.ts b/src/serialization/types/ComplexityStickyRouting.ts new file mode 100644 index 00000000..92bda250 --- /dev/null +++ b/src/serialization/types/ComplexityStickyRouting.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { StickySessionIdentifier } from "./StickySessionIdentifier.js"; + +export const ComplexityStickyRouting: core.serialization.ObjectSchema< + serializers.ComplexityStickyRouting.Raw, + TrueFoundry.ComplexityStickyRouting +> = core.serialization.object({ + ttlSeconds: core.serialization.property("ttl_seconds", core.serialization.number()), + sessionIdentifiers: core.serialization.property( + "session_identifiers", + core.serialization.list(StickySessionIdentifier), + ), +}); + +export declare namespace ComplexityStickyRouting { + export interface Raw { + ttl_seconds: number; + session_identifiers: StickySessionIdentifier.Raw[]; + } +} diff --git a/src/serialization/types/Config.ts b/src/serialization/types/Config.ts index ffc9d378..ee82e0ad 100644 --- a/src/serialization/types/Config.ts +++ b/src/serialization/types/Config.ts @@ -1,12 +1,12 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const Config: core.serialization.ObjectSchema = core.serialization.object({}); +export const Config: core.serialization.ObjectSchema = + core.serialization.object({}); export declare namespace Config { - export interface Raw { - } + export type Raw = {}; } diff --git a/src/serialization/types/ContainerTaskConfig.ts b/src/serialization/types/ContainerTaskConfig.ts index 643fa684..db33d96f 100644 --- a/src/serialization/types/ContainerTaskConfig.ts +++ b/src/serialization/types/ContainerTaskConfig.ts @@ -1,26 +1,31 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ContainerTaskConfigImage } from "./ContainerTaskConfigImage.js"; import { ContainerTaskConfigMountsItem } from "./ContainerTaskConfigMountsItem.js"; import { Resources } from "./Resources.js"; -export const ContainerTaskConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("container-task-config"), - "image": ContainerTaskConfigImage, - "env": core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), - "resources": Resources.optional(), - "mounts": core.serialization.list(ContainerTaskConfigMountsItem).optional(), - "serviceAccount": core.serialization.property("service_account", core.serialization.string().optional()) - }); +export const ContainerTaskConfig: core.serialization.ObjectSchema< + serializers.ContainerTaskConfig.Raw, + TrueFoundry.ContainerTaskConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("container-task-config"), + image: ContainerTaskConfigImage, + env: core.serialization + .record(core.serialization.string(), core.serialization.string().nullable()) + .optionalNullable(), + resources: Resources.optional(), + mounts: core.serialization.list(ContainerTaskConfigMountsItem).optional(), + serviceAccount: core.serialization.property("service_account", core.serialization.string().optional()), +}); export declare namespace ContainerTaskConfig { export interface Raw { type: "container-task-config"; image: ContainerTaskConfigImage.Raw; - env?: Record | null; + env?: (Record | null | undefined) | null; resources?: Resources.Raw | null; mounts?: ContainerTaskConfigMountsItem.Raw[] | null; service_account?: string | null; diff --git a/src/serialization/types/ContainerTaskConfigImage.ts b/src/serialization/types/ContainerTaskConfigImage.ts index 94f65287..02ec9093 100644 --- a/src/serialization/types/ContainerTaskConfigImage.ts +++ b/src/serialization/types/ContainerTaskConfigImage.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Build } from "./Build.js"; import { Image } from "./Image.js"; -export const ContainerTaskConfigImage: core.serialization.Schema = core.serialization.undiscriminatedUnion([Build, Image]); +export const ContainerTaskConfigImage: core.serialization.Schema< + serializers.ContainerTaskConfigImage.Raw, + TrueFoundry.ContainerTaskConfigImage +> = core.serialization.undiscriminatedUnion([Build, Image]); export declare namespace ContainerTaskConfigImage { export type Raw = Build.Raw | Image.Raw; diff --git a/src/serialization/types/ContainerTaskConfigMountsItem.ts b/src/serialization/types/ContainerTaskConfigMountsItem.ts index b5d9a897..7e68aeba 100644 --- a/src/serialization/types/ContainerTaskConfigMountsItem.ts +++ b/src/serialization/types/ContainerTaskConfigMountsItem.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { SecretMount } from "./SecretMount.js"; import { StringDataMount } from "./StringDataMount.js"; import { VolumeMount } from "./VolumeMount.js"; -export const ContainerTaskConfigMountsItem: core.serialization.Schema = core.serialization.undiscriminatedUnion([SecretMount, StringDataMount, VolumeMount]); +export const ContainerTaskConfigMountsItem: core.serialization.Schema< + serializers.ContainerTaskConfigMountsItem.Raw, + TrueFoundry.ContainerTaskConfigMountsItem +> = core.serialization.undiscriminatedUnion([SecretMount, StringDataMount, VolumeMount]); export declare namespace ContainerTaskConfigMountsItem { export type Raw = SecretMount.Raw | StringDataMount.Raw | VolumeMount.Raw; diff --git a/src/serialization/types/CoreNatsOutputConfig.ts b/src/serialization/types/CoreNatsOutputConfig.ts index 0d29b586..f2d2106c 100644 --- a/src/serialization/types/CoreNatsOutputConfig.ts +++ b/src/serialization/types/CoreNatsOutputConfig.ts @@ -1,16 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { NatsUserPasswordAuth } from "./NatsUserPasswordAuth.js"; -export const CoreNatsOutputConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("core-nats"), - "natsUrl": core.serialization.property("nats_url", core.serialization.string()), - "rootSubject": core.serialization.property("root_subject", core.serialization.string()), - "auth": NatsUserPasswordAuth.optional() - }); +export const CoreNatsOutputConfig: core.serialization.ObjectSchema< + serializers.CoreNatsOutputConfig.Raw, + TrueFoundry.CoreNatsOutputConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("core-nats"), + natsUrl: core.serialization.property("nats_url", core.serialization.string()), + rootSubject: core.serialization.property("root_subject", core.serialization.string()), + auth: NatsUserPasswordAuth.optional(), +}); export declare namespace CoreNatsOutputConfig { export interface Raw { diff --git a/src/serialization/types/CpuUtilizationMetric.ts b/src/serialization/types/CpuUtilizationMetric.ts index 17b5b27d..c6d5941f 100644 --- a/src/serialization/types/CpuUtilizationMetric.ts +++ b/src/serialization/types/CpuUtilizationMetric.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const CpuUtilizationMetric: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("cpu_utilization"), - "value": core.serialization.number() - }); +export const CpuUtilizationMetric: core.serialization.ObjectSchema< + serializers.CpuUtilizationMetric.Raw, + TrueFoundry.CpuUtilizationMetric +> = core.serialization.object({ + type: core.serialization.stringLiteral("cpu_utilization"), + value: core.serialization.number(), +}); export declare namespace CpuUtilizationMetric { export interface Raw { diff --git a/src/serialization/types/CreateDockerRepositoryResponse.ts b/src/serialization/types/CreateDockerRepositoryResponse.ts index 7c720ce7..d28c3137 100644 --- a/src/serialization/types/CreateDockerRepositoryResponse.ts +++ b/src/serialization/types/CreateDockerRepositoryResponse.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const CreateDockerRepositoryResponse: core.serialization.ObjectSchema = core.serialization.object({ - "repoName": core.serialization.string() - }); +export const CreateDockerRepositoryResponse: core.serialization.ObjectSchema< + serializers.CreateDockerRepositoryResponse.Raw, + TrueFoundry.CreateDockerRepositoryResponse +> = core.serialization.object({ + repoName: core.serialization.string(), +}); export declare namespace CreateDockerRepositoryResponse { export interface Raw { diff --git a/src/serialization/types/CreateMultiPartUploadRequest.ts b/src/serialization/types/CreateMultiPartUploadRequest.ts index f3e1da04..b892e717 100644 --- a/src/serialization/types/CreateMultiPartUploadRequest.ts +++ b/src/serialization/types/CreateMultiPartUploadRequest.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const CreateMultiPartUploadRequest: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string(), - "path": core.serialization.string(), - "numParts": core.serialization.property("num_parts", core.serialization.number()) - }); +export const CreateMultiPartUploadRequest: core.serialization.ObjectSchema< + serializers.CreateMultiPartUploadRequest.Raw, + TrueFoundry.CreateMultiPartUploadRequest +> = core.serialization.object({ + id: core.serialization.string(), + path: core.serialization.string(), + numParts: core.serialization.property("num_parts", core.serialization.number()), +}); export declare namespace CreateMultiPartUploadRequest { export interface Raw { diff --git a/src/serialization/types/CreatePersonalAccessTokenResponse.ts b/src/serialization/types/CreatePersonalAccessTokenResponse.ts index 1a5322cf..ba58326d 100644 --- a/src/serialization/types/CreatePersonalAccessTokenResponse.ts +++ b/src/serialization/types/CreatePersonalAccessTokenResponse.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const CreatePersonalAccessTokenResponse: core.serialization.ObjectSchema = core.serialization.object({ - "token": core.serialization.string() - }); +export const CreatePersonalAccessTokenResponse: core.serialization.ObjectSchema< + serializers.CreatePersonalAccessTokenResponse.Raw, + TrueFoundry.CreatePersonalAccessTokenResponse +> = core.serialization.object({ + token: core.serialization.string(), +}); export declare namespace CreatePersonalAccessTokenResponse { export interface Raw { diff --git a/src/serialization/types/CreateRunResponse.ts b/src/serialization/types/CreateRunResponse.ts index 6638c1c1..73ab4a9f 100644 --- a/src/serialization/types/CreateRunResponse.ts +++ b/src/serialization/types/CreateRunResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Run } from "./Run.js"; -export const CreateRunResponse: core.serialization.ObjectSchema = core.serialization.object({ - "run": Run - }); +export const CreateRunResponse: core.serialization.ObjectSchema< + serializers.CreateRunResponse.Raw, + TrueFoundry.CreateRunResponse +> = core.serialization.object({ + run: Run, +}); export declare namespace CreateRunResponse { export interface Raw { diff --git a/src/serialization/types/CronMetric.ts b/src/serialization/types/CronMetric.ts index ef2e32a4..c34e4546 100644 --- a/src/serialization/types/CronMetric.ts +++ b/src/serialization/types/CronMetric.ts @@ -1,15 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const CronMetric: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("cron"), - "desiredReplicas": core.serialization.property("desired_replicas", core.serialization.number().optional()), - "start": core.serialization.string(), - "end": core.serialization.string(), - "timezone": core.serialization.string() +export const CronMetric: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("cron"), + desiredReplicas: core.serialization.property("desired_replicas", core.serialization.number().optional()), + start: core.serialization.string(), + end: core.serialization.string(), + timezone: core.serialization.string(), }); export declare namespace CronMetric { diff --git a/src/serialization/types/CrowdStrikeAidrGuardrailConfig.ts b/src/serialization/types/CrowdStrikeAidrGuardrailConfig.ts index 020c7301..8d851ba6 100644 --- a/src/serialization/types/CrowdStrikeAidrGuardrailConfig.ts +++ b/src/serialization/types/CrowdStrikeAidrGuardrailConfig.ts @@ -1,23 +1,26 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { CrowdStrikeAidrGuardrailConfigConfig } from "./CrowdStrikeAidrGuardrailConfigConfig.js"; import { CrowdStrikeAidrGuardrailConfigOperation } from "./CrowdStrikeAidrGuardrailConfigOperation.js"; import { CrowdStrikeAidrKeyAuth } from "./CrowdStrikeAidrKeyAuth.js"; import { EnforcingStrategy } from "./EnforcingStrategy.js"; -export const CrowdStrikeAidrGuardrailConfig: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string().optional(), - "type": core.serialization.stringLiteral("integration/guardrail-config/crowdstrike-aidr"), - "authData": core.serialization.property("auth_data", CrowdStrikeAidrKeyAuth), - "operation": CrowdStrikeAidrGuardrailConfigOperation, - "priority": core.serialization.number().optional(), - "enforcingStrategy": core.serialization.property("enforcing_strategy", EnforcingStrategy), - "config": CrowdStrikeAidrGuardrailConfigConfig - }); +export const CrowdStrikeAidrGuardrailConfig: core.serialization.ObjectSchema< + serializers.CrowdStrikeAidrGuardrailConfig.Raw, + TrueFoundry.CrowdStrikeAidrGuardrailConfig +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + type: core.serialization.stringLiteral("integration/guardrail-config/crowdstrike-aidr"), + authData: core.serialization.property("auth_data", CrowdStrikeAidrKeyAuth), + operation: CrowdStrikeAidrGuardrailConfigOperation, + priority: core.serialization.number().optional(), + enforcingStrategy: core.serialization.property("enforcing_strategy", EnforcingStrategy), + config: CrowdStrikeAidrGuardrailConfigConfig, +}); export declare namespace CrowdStrikeAidrGuardrailConfig { export interface Raw { diff --git a/src/serialization/types/CrowdStrikeAidrGuardrailConfigConfig.ts b/src/serialization/types/CrowdStrikeAidrGuardrailConfigConfig.ts index 7f4be8ed..233fc328 100644 --- a/src/serialization/types/CrowdStrikeAidrGuardrailConfigConfig.ts +++ b/src/serialization/types/CrowdStrikeAidrGuardrailConfigConfig.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const CrowdStrikeAidrGuardrailConfigConfig: core.serialization.ObjectSchema = core.serialization.object({ - "baseUrl": core.serialization.property("base_url", core.serialization.string().optional()) - }); +export const CrowdStrikeAidrGuardrailConfigConfig: core.serialization.ObjectSchema< + serializers.CrowdStrikeAidrGuardrailConfigConfig.Raw, + TrueFoundry.CrowdStrikeAidrGuardrailConfigConfig +> = core.serialization.object({ + baseUrl: core.serialization.property("base_url", core.serialization.string().optional()), +}); export declare namespace CrowdStrikeAidrGuardrailConfigConfig { export interface Raw { diff --git a/src/serialization/types/CrowdStrikeAidrGuardrailConfigOperation.ts b/src/serialization/types/CrowdStrikeAidrGuardrailConfigOperation.ts index ddb6b1c4..676df955 100644 --- a/src/serialization/types/CrowdStrikeAidrGuardrailConfigOperation.ts +++ b/src/serialization/types/CrowdStrikeAidrGuardrailConfigOperation.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const CrowdStrikeAidrGuardrailConfigOperation: core.serialization.Schema = core.serialization.enum_(["validate", "mutate"]); +export const CrowdStrikeAidrGuardrailConfigOperation: core.serialization.Schema< + serializers.CrowdStrikeAidrGuardrailConfigOperation.Raw, + TrueFoundry.CrowdStrikeAidrGuardrailConfigOperation +> = core.serialization.enum_(["validate", "mutate"]); export declare namespace CrowdStrikeAidrGuardrailConfigOperation { export type Raw = "validate" | "mutate"; diff --git a/src/serialization/types/CrowdStrikeAidrKeyAuth.ts b/src/serialization/types/CrowdStrikeAidrKeyAuth.ts index 09fa15da..15287100 100644 --- a/src/serialization/types/CrowdStrikeAidrKeyAuth.ts +++ b/src/serialization/types/CrowdStrikeAidrKeyAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const CrowdStrikeAidrKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) - }); +export const CrowdStrikeAidrKeyAuth: core.serialization.ObjectSchema< + serializers.CrowdStrikeAidrKeyAuth.Raw, + TrueFoundry.CrowdStrikeAidrKeyAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), +}); export declare namespace CrowdStrikeAidrKeyAuth { export interface Raw { diff --git a/src/serialization/types/CustomAgentServerAuth.ts b/src/serialization/types/CustomAgentServerAuth.ts index 3fa64d73..23776eec 100644 --- a/src/serialization/types/CustomAgentServerAuth.ts +++ b/src/serialization/types/CustomAgentServerAuth.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { CustomServerHeaderAuth } from "./CustomServerHeaderAuth.js"; import { CustomServerPassthrough } from "./CustomServerPassthrough.js"; -export const CustomAgentServerAuth: core.serialization.Schema = core.serialization.undiscriminatedUnion([CustomServerHeaderAuth, CustomServerPassthrough]); +export const CustomAgentServerAuth: core.serialization.Schema< + serializers.CustomAgentServerAuth.Raw, + TrueFoundry.CustomAgentServerAuth +> = core.serialization.undiscriminatedUnion([CustomServerHeaderAuth, CustomServerPassthrough]); export declare namespace CustomAgentServerAuth { export type Raw = CustomServerHeaderAuth.Raw | CustomServerPassthrough.Raw; diff --git a/src/serialization/types/CustomBasicAuth.ts b/src/serialization/types/CustomBasicAuth.ts index ac801dc6..65cd7e6d 100644 --- a/src/serialization/types/CustomBasicAuth.ts +++ b/src/serialization/types/CustomBasicAuth.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const CustomBasicAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("basic-auth"), - "username": core.serialization.string(), - "password": core.serialization.string() - }); +export const CustomBasicAuth: core.serialization.ObjectSchema< + serializers.CustomBasicAuth.Raw, + TrueFoundry.CustomBasicAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("basic-auth"), + username: core.serialization.string(), + password: core.serialization.string(), +}); export declare namespace CustomBasicAuth { export interface Raw { diff --git a/src/serialization/types/CustomBearerAuth.ts b/src/serialization/types/CustomBearerAuth.ts index 33da92d6..b8a29711 100644 --- a/src/serialization/types/CustomBearerAuth.ts +++ b/src/serialization/types/CustomBearerAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const CustomBearerAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("bearer-auth"), - "bearerToken": core.serialization.property("bearer_token", core.serialization.string()) - }); +export const CustomBearerAuth: core.serialization.ObjectSchema< + serializers.CustomBearerAuth.Raw, + TrueFoundry.CustomBearerAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("bearer-auth"), + bearerToken: core.serialization.property("bearer_token", core.serialization.string()), +}); export declare namespace CustomBearerAuth { export interface Raw { diff --git a/src/serialization/types/CustomBlobStorage.ts b/src/serialization/types/CustomBlobStorage.ts index c9bcdda9..928e15d6 100644 --- a/src/serialization/types/CustomBlobStorage.ts +++ b/src/serialization/types/CustomBlobStorage.ts @@ -1,19 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { CustomBasicAuth } from "./CustomBasicAuth.js"; -export const CustomBlobStorage: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/blob-storage/custom"), - "name": core.serialization.string(), - "endpoint": core.serialization.string(), - "storageRoot": core.serialization.property("storage_root", core.serialization.string()), - "region": core.serialization.string().optional(), - "authData": core.serialization.property("auth_data", CustomBasicAuth), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const CustomBlobStorage: core.serialization.ObjectSchema< + serializers.CustomBlobStorage.Raw, + TrueFoundry.CustomBlobStorage +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/blob-storage/custom"), + name: core.serialization.string(), + endpoint: core.serialization.string(), + storageRoot: core.serialization.property("storage_root", core.serialization.string()), + region: core.serialization.string().optional(), + authData: core.serialization.property("auth_data", CustomBasicAuth), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace CustomBlobStorage { export interface Raw { diff --git a/src/serialization/types/CustomEndpoint.ts b/src/serialization/types/CustomEndpoint.ts index 3b70d4c5..0e59847a 100644 --- a/src/serialization/types/CustomEndpoint.ts +++ b/src/serialization/types/CustomEndpoint.ts @@ -1,22 +1,28 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { CustomEndpointTargetConfig } from "./CustomEndpointTargetConfig.js"; import { CustomHeaderAuth } from "./CustomHeaderAuth.js"; import { CustomTlsSettings } from "./CustomTlsSettings.js"; -export const CustomEndpoint: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/model/custom-endpoint"), - "name": core.serialization.string(), - "baseUrl": core.serialization.property("base_url", core.serialization.string()), - "authData": core.serialization.property("auth_data", CustomHeaderAuth.optional()), - "headers": core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), - "tlsSettings": core.serialization.property("tls_settings", CustomTlsSettings.optional()), - "loadbalancingConfig": core.serialization.property("loadbalancing_config", CustomEndpointTargetConfig.optional()), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const CustomEndpoint: core.serialization.ObjectSchema< + serializers.CustomEndpoint.Raw, + TrueFoundry.CustomEndpoint +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/model/custom-endpoint"), + name: core.serialization.string(), + baseUrl: core.serialization.property("base_url", core.serialization.string()), + authData: core.serialization.property("auth_data", CustomHeaderAuth.optional()), + headers: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), + tlsSettings: core.serialization.property("tls_settings", CustomTlsSettings.optional()), + loadbalancingConfig: core.serialization.property("loadbalancing_config", CustomEndpointTargetConfig.optional()), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace CustomEndpoint { export interface Raw { diff --git a/src/serialization/types/CustomEndpointIntegrations.ts b/src/serialization/types/CustomEndpointIntegrations.ts index 842f86e3..677632df 100644 --- a/src/serialization/types/CustomEndpointIntegrations.ts +++ b/src/serialization/types/CustomEndpointIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { CustomEndpoint } from "./CustomEndpoint.js"; -export const CustomEndpointIntegrations: core.serialization.ObjectSchema = CustomEndpoint; +export const CustomEndpointIntegrations: core.serialization.ObjectSchema< + serializers.CustomEndpointIntegrations.Raw, + TrueFoundry.CustomEndpointIntegrations +> = CustomEndpoint; export declare namespace CustomEndpointIntegrations { export type Raw = CustomEndpoint.Raw; diff --git a/src/serialization/types/CustomEndpointProviderAccount.ts b/src/serialization/types/CustomEndpointProviderAccount.ts index 81eca478..46aa987b 100644 --- a/src/serialization/types/CustomEndpointProviderAccount.ts +++ b/src/serialization/types/CustomEndpointProviderAccount.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { CustomEndpointIntegrations } from "./CustomEndpointIntegrations.js"; import { CustomEndpointProviderAccountEndpointType } from "./CustomEndpointProviderAccountEndpointType.js"; @@ -10,17 +10,20 @@ import { CustomEndpointProviderAccountRoutingType } from "./CustomEndpointProvid import { CustomHeaderAuth } from "./CustomHeaderAuth.js"; import { OwnedBy } from "./OwnedBy.js"; -export const CustomEndpointProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/custom-endpoint"), - "name": core.serialization.string(), - "endpointType": core.serialization.property("endpoint_type", CustomEndpointProviderAccountEndpointType.optional()), - "routingType": core.serialization.property("routing_type", CustomEndpointProviderAccountRoutingType.optional()), - "slug": core.serialization.string().optional(), - "authData": core.serialization.property("auth_data", CustomHeaderAuth.optional()), - "integrations": core.serialization.list(CustomEndpointIntegrations), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional() - }); +export const CustomEndpointProviderAccount: core.serialization.ObjectSchema< + serializers.CustomEndpointProviderAccount.Raw, + TrueFoundry.CustomEndpointProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/custom-endpoint"), + name: core.serialization.string(), + endpointType: core.serialization.property("endpoint_type", CustomEndpointProviderAccountEndpointType.optional()), + routingType: core.serialization.property("routing_type", CustomEndpointProviderAccountRoutingType.optional()), + slug: core.serialization.string().optional(), + authData: core.serialization.property("auth_data", CustomHeaderAuth.optional()), + integrations: core.serialization.list(CustomEndpointIntegrations), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), +}); export declare namespace CustomEndpointProviderAccount { export interface Raw { diff --git a/src/serialization/types/CustomEndpointProviderAccountEndpointType.ts b/src/serialization/types/CustomEndpointProviderAccountEndpointType.ts index 12745bdf..27ab1faa 100644 --- a/src/serialization/types/CustomEndpointProviderAccountEndpointType.ts +++ b/src/serialization/types/CustomEndpointProviderAccountEndpointType.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const CustomEndpointProviderAccountEndpointType: core.serialization.Schema = core.serialization.enum_(["azure-speech-service", "other"]); +export const CustomEndpointProviderAccountEndpointType: core.serialization.Schema< + serializers.CustomEndpointProviderAccountEndpointType.Raw, + TrueFoundry.CustomEndpointProviderAccountEndpointType +> = core.serialization.enum_(["azure-speech-service", "other"]); export declare namespace CustomEndpointProviderAccountEndpointType { export type Raw = "azure-speech-service" | "other"; diff --git a/src/serialization/types/CustomEndpointProviderAccountRoutingType.ts b/src/serialization/types/CustomEndpointProviderAccountRoutingType.ts index 96cb9aaf..6031b403 100644 --- a/src/serialization/types/CustomEndpointProviderAccountRoutingType.ts +++ b/src/serialization/types/CustomEndpointProviderAccountRoutingType.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const CustomEndpointProviderAccountRoutingType: core.serialization.Schema = core.serialization.enum_(["weight", "priority"]); +export const CustomEndpointProviderAccountRoutingType: core.serialization.Schema< + serializers.CustomEndpointProviderAccountRoutingType.Raw, + TrueFoundry.CustomEndpointProviderAccountRoutingType +> = core.serialization.enum_(["weight", "priority"]); export declare namespace CustomEndpointProviderAccountRoutingType { export type Raw = "weight" | "priority"; diff --git a/src/serialization/types/CustomEndpointTargetConfig.ts b/src/serialization/types/CustomEndpointTargetConfig.ts index d596285a..26afde29 100644 --- a/src/serialization/types/CustomEndpointTargetConfig.ts +++ b/src/serialization/types/CustomEndpointTargetConfig.ts @@ -1,16 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const CustomEndpointTargetConfig: core.serialization.ObjectSchema = core.serialization.object({ - "weight": core.serialization.number().optional(), - "priority": core.serialization.number().optional(), - "fallbackStatusCodes": core.serialization.property("fallback_status_codes", core.serialization.list(core.serialization.string()).optional()), - "fallbackCandidate": core.serialization.property("fallback_candidate", core.serialization.boolean().optional()), - "metadataMatch": core.serialization.property("metadata_match", core.serialization.record(core.serialization.string(), core.serialization.string()).optional()) - }); +export const CustomEndpointTargetConfig: core.serialization.ObjectSchema< + serializers.CustomEndpointTargetConfig.Raw, + TrueFoundry.CustomEndpointTargetConfig +> = core.serialization.object({ + weight: core.serialization.number().optional(), + priority: core.serialization.number().optional(), + fallbackStatusCodes: core.serialization.property( + "fallback_status_codes", + core.serialization.list(core.serialization.string()).optional(), + ), + fallbackCandidate: core.serialization.property("fallback_candidate", core.serialization.boolean().optional()), + metadataMatch: core.serialization.property( + "metadata_match", + core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), + ), +}); export declare namespace CustomEndpointTargetConfig { export interface Raw { diff --git a/src/serialization/types/CustomFramework.ts b/src/serialization/types/CustomFramework.ts index 36c8838a..4037c8c8 100644 --- a/src/serialization/types/CustomFramework.ts +++ b/src/serialization/types/CustomFramework.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const CustomFramework: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("custom") - }); +export const CustomFramework: core.serialization.ObjectSchema< + serializers.CustomFramework.Raw, + TrueFoundry.CustomFramework +> = core.serialization.object({ + type: core.serialization.stringLiteral("custom"), +}); export declare namespace CustomFramework { export interface Raw { diff --git a/src/serialization/types/CustomGuardrailConfig.ts b/src/serialization/types/CustomGuardrailConfig.ts index 6f4096a5..727427c4 100644 --- a/src/serialization/types/CustomGuardrailConfig.ts +++ b/src/serialization/types/CustomGuardrailConfig.ts @@ -1,25 +1,28 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { CustomGuardrailConfigAuthData } from "./CustomGuardrailConfigAuthData.js"; import { CustomGuardrailConfigConfig } from "./CustomGuardrailConfigConfig.js"; import { CustomGuardrailConfigOperation } from "./CustomGuardrailConfigOperation.js"; import { CustomGuardrailConfigTarget } from "./CustomGuardrailConfigTarget.js"; import { EnforcingStrategy } from "./EnforcingStrategy.js"; -export const CustomGuardrailConfig: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string().optional(), - "type": core.serialization.stringLiteral("integration/guardrail-config/custom"), - "authData": core.serialization.property("auth_data", CustomGuardrailConfigAuthData.optional()), - "operation": CustomGuardrailConfigOperation, - "priority": core.serialization.number().optional(), - "enforcingStrategy": core.serialization.property("enforcing_strategy", EnforcingStrategy), - "target": CustomGuardrailConfigTarget, - "config": CustomGuardrailConfigConfig - }); +export const CustomGuardrailConfig: core.serialization.ObjectSchema< + serializers.CustomGuardrailConfig.Raw, + TrueFoundry.CustomGuardrailConfig +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + type: core.serialization.stringLiteral("integration/guardrail-config/custom"), + authData: core.serialization.property("auth_data", CustomGuardrailConfigAuthData.optional()), + operation: CustomGuardrailConfigOperation, + priority: core.serialization.number().optional(), + enforcingStrategy: core.serialization.property("enforcing_strategy", EnforcingStrategy), + target: CustomGuardrailConfigTarget, + config: CustomGuardrailConfigConfig, +}); export declare namespace CustomGuardrailConfig { export interface Raw { diff --git a/src/serialization/types/CustomGuardrailConfigAuthData.ts b/src/serialization/types/CustomGuardrailConfigAuthData.ts index 24f1db15..76cf1ecf 100644 --- a/src/serialization/types/CustomGuardrailConfigAuthData.ts +++ b/src/serialization/types/CustomGuardrailConfigAuthData.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { CustomBasicAuth } from "./CustomBasicAuth.js"; import { CustomBearerAuth } from "./CustomBearerAuth.js"; -export const CustomGuardrailConfigAuthData: core.serialization.Schema = core.serialization.undiscriminatedUnion([CustomBasicAuth, CustomBearerAuth]); +export const CustomGuardrailConfigAuthData: core.serialization.Schema< + serializers.CustomGuardrailConfigAuthData.Raw, + TrueFoundry.CustomGuardrailConfigAuthData +> = core.serialization.undiscriminatedUnion([CustomBasicAuth, CustomBearerAuth]); export declare namespace CustomGuardrailConfigAuthData { export type Raw = CustomBasicAuth.Raw | CustomBearerAuth.Raw; diff --git a/src/serialization/types/CustomGuardrailConfigConfig.ts b/src/serialization/types/CustomGuardrailConfigConfig.ts index 9b3de39e..fddbc367 100644 --- a/src/serialization/types/CustomGuardrailConfigConfig.ts +++ b/src/serialization/types/CustomGuardrailConfigConfig.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const CustomGuardrailConfigConfig: core.serialization.ObjectSchema = core.serialization.object({ - "url": core.serialization.string(), - "headers": core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), - "config": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() - }); +export const CustomGuardrailConfigConfig: core.serialization.ObjectSchema< + serializers.CustomGuardrailConfigConfig.Raw, + TrueFoundry.CustomGuardrailConfigConfig +> = core.serialization.object({ + url: core.serialization.string(), + headers: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), + config: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), +}); export declare namespace CustomGuardrailConfigConfig { export interface Raw { diff --git a/src/serialization/types/CustomGuardrailConfigOperation.ts b/src/serialization/types/CustomGuardrailConfigOperation.ts index 1d5b112d..e738a30c 100644 --- a/src/serialization/types/CustomGuardrailConfigOperation.ts +++ b/src/serialization/types/CustomGuardrailConfigOperation.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const CustomGuardrailConfigOperation: core.serialization.Schema = core.serialization.enum_(["validate", "mutate"]); +export const CustomGuardrailConfigOperation: core.serialization.Schema< + serializers.CustomGuardrailConfigOperation.Raw, + TrueFoundry.CustomGuardrailConfigOperation +> = core.serialization.enum_(["validate", "mutate"]); export declare namespace CustomGuardrailConfigOperation { export type Raw = "validate" | "mutate"; diff --git a/src/serialization/types/CustomGuardrailConfigTarget.ts b/src/serialization/types/CustomGuardrailConfigTarget.ts index fec1a17e..651af9e0 100644 --- a/src/serialization/types/CustomGuardrailConfigTarget.ts +++ b/src/serialization/types/CustomGuardrailConfigTarget.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const CustomGuardrailConfigTarget: core.serialization.Schema = core.serialization.enum_(["request", "response"]); +export const CustomGuardrailConfigTarget: core.serialization.Schema< + serializers.CustomGuardrailConfigTarget.Raw, + TrueFoundry.CustomGuardrailConfigTarget +> = core.serialization.enum_(["request", "response"]); export declare namespace CustomGuardrailConfigTarget { export type Raw = "request" | "response"; diff --git a/src/serialization/types/CustomHeaderAuth.ts b/src/serialization/types/CustomHeaderAuth.ts index 868b482c..2f182535 100644 --- a/src/serialization/types/CustomHeaderAuth.ts +++ b/src/serialization/types/CustomHeaderAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const CustomHeaderAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("header"), - "headers": core.serialization.record(core.serialization.string(), core.serialization.string()) - }); +export const CustomHeaderAuth: core.serialization.ObjectSchema< + serializers.CustomHeaderAuth.Raw, + TrueFoundry.CustomHeaderAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("header"), + headers: core.serialization.record(core.serialization.string(), core.serialization.string()), +}); export declare namespace CustomHeaderAuth { export interface Raw { diff --git a/src/serialization/types/CustomHelmRepo.ts b/src/serialization/types/CustomHelmRepo.ts index 0d91a4b0..d0dbb76e 100644 --- a/src/serialization/types/CustomHelmRepo.ts +++ b/src/serialization/types/CustomHelmRepo.ts @@ -1,17 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { CustomBasicAuth } from "./CustomBasicAuth.js"; -export const CustomHelmRepo: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/helm-repo/custom"), - "name": core.serialization.string(), - "repoUrl": core.serialization.property("repo_url", core.serialization.string()), - "authData": core.serialization.property("auth_data", CustomBasicAuth), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const CustomHelmRepo: core.serialization.ObjectSchema< + serializers.CustomHelmRepo.Raw, + TrueFoundry.CustomHelmRepo +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/helm-repo/custom"), + name: core.serialization.string(), + repoUrl: core.serialization.property("repo_url", core.serialization.string()), + authData: core.serialization.property("auth_data", CustomBasicAuth), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace CustomHelmRepo { export interface Raw { diff --git a/src/serialization/types/CustomIntegrations.ts b/src/serialization/types/CustomIntegrations.ts index 990fabf6..e2f3262b 100644 --- a/src/serialization/types/CustomIntegrations.ts +++ b/src/serialization/types/CustomIntegrations.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { CustomBlobStorage } from "./CustomBlobStorage.js"; import { CustomHelmRepo } from "./CustomHelmRepo.js"; import { CustomJwtAuthIntegration } from "./CustomJwtAuthIntegration.js"; @@ -10,8 +10,24 @@ import { CustomUsernamePasswordArtifactsRegistry } from "./CustomUsernamePasswor import { EmailNotificationChannel } from "./EmailNotificationChannel.js"; import { GenericSecretStoreIntegration } from "./GenericSecretStoreIntegration.js"; -export const CustomIntegrations: core.serialization.Schema = core.serialization.undiscriminatedUnion([CustomUsernamePasswordArtifactsRegistry, EmailNotificationChannel, CustomHelmRepo, CustomBlobStorage, CustomJwtAuthIntegration, GenericSecretStoreIntegration]); +export const CustomIntegrations: core.serialization.Schema< + serializers.CustomIntegrations.Raw, + TrueFoundry.CustomIntegrations +> = core.serialization.undiscriminatedUnion([ + CustomUsernamePasswordArtifactsRegistry, + EmailNotificationChannel, + CustomHelmRepo, + CustomBlobStorage, + CustomJwtAuthIntegration, + GenericSecretStoreIntegration, +]); export declare namespace CustomIntegrations { - export type Raw = CustomUsernamePasswordArtifactsRegistry.Raw | EmailNotificationChannel.Raw | CustomHelmRepo.Raw | CustomBlobStorage.Raw | CustomJwtAuthIntegration.Raw | GenericSecretStoreIntegration.Raw; + export type Raw = + | CustomUsernamePasswordArtifactsRegistry.Raw + | EmailNotificationChannel.Raw + | CustomHelmRepo.Raw + | CustomBlobStorage.Raw + | CustomJwtAuthIntegration.Raw + | GenericSecretStoreIntegration.Raw; } diff --git a/src/serialization/types/CustomJwtAuthIntegration.ts b/src/serialization/types/CustomJwtAuthIntegration.ts index 31f8592f..cfcdd434 100644 --- a/src/serialization/types/CustomJwtAuthIntegration.ts +++ b/src/serialization/types/CustomJwtAuthIntegration.ts @@ -1,18 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { OAuth2LoginProvider } from "./OAuth2LoginProvider.js"; -export const CustomJwtAuthIntegration: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/jwt-auth/custom"), - "name": core.serialization.string(), - "issuer": core.serialization.string(), - "jwksUri": core.serialization.property("jwks_uri", core.serialization.string()), - "loginProvider": core.serialization.property("login_provider", OAuth2LoginProvider.optional()), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const CustomJwtAuthIntegration: core.serialization.ObjectSchema< + serializers.CustomJwtAuthIntegration.Raw, + TrueFoundry.CustomJwtAuthIntegration +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/jwt-auth/custom"), + name: core.serialization.string(), + issuer: core.serialization.string(), + jwksUri: core.serialization.property("jwks_uri", core.serialization.string()), + loginProvider: core.serialization.property("login_provider", OAuth2LoginProvider.optional()), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace CustomJwtAuthIntegration { export interface Raw { diff --git a/src/serialization/types/CustomProviderAccount.ts b/src/serialization/types/CustomProviderAccount.ts index 12191960..97eb5864 100644 --- a/src/serialization/types/CustomProviderAccount.ts +++ b/src/serialization/types/CustomProviderAccount.ts @@ -1,19 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { CustomBasicAuth } from "./CustomBasicAuth.js"; import { CustomIntegrations } from "./CustomIntegrations.js"; import { OwnedBy } from "./OwnedBy.js"; -export const CustomProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/custom"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", CustomBasicAuth.optional()), - "integrations": core.serialization.list(CustomIntegrations), - "ownedBy": OwnedBy.optional() - }); +export const CustomProviderAccount: core.serialization.ObjectSchema< + serializers.CustomProviderAccount.Raw, + TrueFoundry.CustomProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/custom"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", CustomBasicAuth.optional()), + integrations: core.serialization.list(CustomIntegrations), + ownedBy: OwnedBy.optional(), +}); export declare namespace CustomProviderAccount { export interface Raw { diff --git a/src/serialization/types/CustomRegexPattern.ts b/src/serialization/types/CustomRegexPattern.ts index a5568ff1..f03bcf80 100644 --- a/src/serialization/types/CustomRegexPattern.ts +++ b/src/serialization/types/CustomRegexPattern.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const CustomRegexPattern: core.serialization.ObjectSchema = core.serialization.object({ - "pattern": core.serialization.string(), - "redactionText": core.serialization.property("redaction_text", core.serialization.string().optional()) - }); +export const CustomRegexPattern: core.serialization.ObjectSchema< + serializers.CustomRegexPattern.Raw, + TrueFoundry.CustomRegexPattern +> = core.serialization.object({ + pattern: core.serialization.string(), + redactionText: core.serialization.property("redaction_text", core.serialization.string().optional()), +}); export declare namespace CustomRegexPattern { export interface Raw { diff --git a/src/serialization/types/CustomServerHeaderAuth.ts b/src/serialization/types/CustomServerHeaderAuth.ts index 3df8f672..1d63f997 100644 --- a/src/serialization/types/CustomServerHeaderAuth.ts +++ b/src/serialization/types/CustomServerHeaderAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const CustomServerHeaderAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("header"), - "headers": core.serialization.record(core.serialization.string(), core.serialization.string()) - }); +export const CustomServerHeaderAuth: core.serialization.ObjectSchema< + serializers.CustomServerHeaderAuth.Raw, + TrueFoundry.CustomServerHeaderAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("header"), + headers: core.serialization.record(core.serialization.string(), core.serialization.string()), +}); export declare namespace CustomServerHeaderAuth { export interface Raw { diff --git a/src/serialization/types/CustomServerPassthrough.ts b/src/serialization/types/CustomServerPassthrough.ts index 0447c75f..3ecc3a6d 100644 --- a/src/serialization/types/CustomServerPassthrough.ts +++ b/src/serialization/types/CustomServerPassthrough.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const CustomServerPassthrough: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("passthrough") - }); +export const CustomServerPassthrough: core.serialization.ObjectSchema< + serializers.CustomServerPassthrough.Raw, + TrueFoundry.CustomServerPassthrough +> = core.serialization.object({ + type: core.serialization.stringLiteral("passthrough"), +}); export declare namespace CustomServerPassthrough { export interface Raw { diff --git a/src/serialization/types/CustomTlsSettings.ts b/src/serialization/types/CustomTlsSettings.ts index fa628e68..a0e0edfc 100644 --- a/src/serialization/types/CustomTlsSettings.ts +++ b/src/serialization/types/CustomTlsSettings.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const CustomTlsSettings: core.serialization.ObjectSchema = core.serialization.object({ - "rejectUnauthorized": core.serialization.property("reject_unauthorized", core.serialization.boolean()), - "caCert": core.serialization.property("ca_cert", core.serialization.string().optional()) - }); +export const CustomTlsSettings: core.serialization.ObjectSchema< + serializers.CustomTlsSettings.Raw, + TrueFoundry.CustomTlsSettings +> = core.serialization.object({ + rejectUnauthorized: core.serialization.property("reject_unauthorized", core.serialization.boolean()), + caCert: core.serialization.property("ca_cert", core.serialization.string().optional()), +}); export declare namespace CustomTlsSettings { export interface Raw { diff --git a/src/serialization/types/CustomUsernamePasswordArtifactsRegistry.ts b/src/serialization/types/CustomUsernamePasswordArtifactsRegistry.ts index 8c02fa3c..34fdcd47 100644 --- a/src/serialization/types/CustomUsernamePasswordArtifactsRegistry.ts +++ b/src/serialization/types/CustomUsernamePasswordArtifactsRegistry.ts @@ -1,17 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { CustomBasicAuth } from "./CustomBasicAuth.js"; -export const CustomUsernamePasswordArtifactsRegistry: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/docker-registry/custom"), - "name": core.serialization.string(), - "registryUrl": core.serialization.property("registry_url", core.serialization.string()), - "authData": core.serialization.property("auth_data", CustomBasicAuth.optional()), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const CustomUsernamePasswordArtifactsRegistry: core.serialization.ObjectSchema< + serializers.CustomUsernamePasswordArtifactsRegistry.Raw, + TrueFoundry.CustomUsernamePasswordArtifactsRegistry +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/docker-registry/custom"), + name: core.serialization.string(), + registryUrl: core.serialization.property("registry_url", core.serialization.string()), + authData: core.serialization.property("auth_data", CustomBasicAuth.optional()), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace CustomUsernamePasswordArtifactsRegistry { export interface Raw { diff --git a/src/serialization/types/DataAccessRule.ts b/src/serialization/types/DataAccessRule.ts index d4cc9d79..13d6805b 100644 --- a/src/serialization/types/DataAccessRule.ts +++ b/src/serialization/types/DataAccessRule.ts @@ -1,13 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AllDataAccessRule } from "./AllDataAccessRule.js"; import { OwnDataAccessRule } from "./OwnDataAccessRule.js"; import { TeamDataAccessRule } from "./TeamDataAccessRule.js"; -export const DataAccessRule: core.serialization.Schema = core.serialization.undiscriminatedUnion([OwnDataAccessRule, TeamDataAccessRule, AllDataAccessRule]); +export const DataAccessRule: core.serialization.Schema = + core.serialization.undiscriminatedUnion([OwnDataAccessRule, TeamDataAccessRule, AllDataAccessRule]); export declare namespace DataAccessRule { export type Raw = OwnDataAccessRule.Raw | TeamDataAccessRule.Raw | AllDataAccessRule.Raw; diff --git a/src/serialization/types/DataAccessRuleBase.ts b/src/serialization/types/DataAccessRuleBase.ts index 03497877..465ec616 100644 --- a/src/serialization/types/DataAccessRuleBase.ts +++ b/src/serialization/types/DataAccessRuleBase.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GatewayDataType } from "./GatewayDataType.js"; -export const DataAccessRuleBase: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string(), - "description": core.serialization.string().optional(), - "enabled": core.serialization.boolean().optional(), - "subjects": core.serialization.list(core.serialization.string()), - "dataTypes": core.serialization.property("data_types", core.serialization.list(GatewayDataType)) - }); +export const DataAccessRuleBase: core.serialization.ObjectSchema< + serializers.DataAccessRuleBase.Raw, + TrueFoundry.DataAccessRuleBase +> = core.serialization.object({ + id: core.serialization.string(), + description: core.serialization.string().optional(), + enabled: core.serialization.boolean().optional(), + subjects: core.serialization.list(core.serialization.string()), + dataTypes: core.serialization.property("data_types", core.serialization.list(GatewayDataType)), +}); export declare namespace DataAccessRuleBase { export interface Raw { diff --git a/src/serialization/types/DataDirectory.ts b/src/serialization/types/DataDirectory.ts index fb2e13e9..75101113 100644 --- a/src/serialization/types/DataDirectory.ts +++ b/src/serialization/types/DataDirectory.ts @@ -1,21 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { DataDirectoryManifest } from "./DataDirectoryManifest.js"; import { Subject } from "./Subject.js"; -export const DataDirectory: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string(), - "mlRepoId": core.serialization.property("ml_repo_id", core.serialization.string()), - "name": core.serialization.string(), - "fqn": core.serialization.string(), - "createdBySubject": core.serialization.property("created_by_subject", Subject), - "createdAt": core.serialization.property("created_at", core.serialization.date()), - "updatedAt": core.serialization.property("updated_at", core.serialization.date()), - "manifest": DataDirectoryManifest, - "usageCodeSnippet": core.serialization.property("usage_code_snippet", core.serialization.string().optional()) +export const DataDirectory: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string(), + mlRepoId: core.serialization.property("ml_repo_id", core.serialization.string()), + name: core.serialization.string(), + fqn: core.serialization.string(), + createdBySubject: core.serialization.property("created_by_subject", Subject), + createdAt: core.serialization.property("created_at", core.serialization.date()), + updatedAt: core.serialization.property("updated_at", core.serialization.date()), + manifest: DataDirectoryManifest, + usageCodeSnippet: core.serialization.property( + "usage_code_snippet", + core.serialization.string().optionalNullable(), + ), }); export declare namespace DataDirectory { @@ -28,6 +32,6 @@ export declare namespace DataDirectory { created_at: string; updated_at: string; manifest: DataDirectoryManifest.Raw; - usage_code_snippet?: string | null; + usage_code_snippet?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/DataDirectoryManifest.ts b/src/serialization/types/DataDirectoryManifest.ts index 53fc0e28..46d61899 100644 --- a/src/serialization/types/DataDirectoryManifest.ts +++ b/src/serialization/types/DataDirectoryManifest.ts @@ -1,25 +1,28 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { DataDirectoryManifestSource } from "./DataDirectoryManifestSource.js"; -export const DataDirectoryManifest: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("data-dir"), - "name": core.serialization.string(), - "mlRepo": core.serialization.property("ml_repo", core.serialization.string()), - "description": core.serialization.string().optional(), - "metadata": core.serialization.record(core.serialization.string(), core.serialization.unknown()), - "source": DataDirectoryManifestSource - }); +export const DataDirectoryManifest: core.serialization.ObjectSchema< + serializers.DataDirectoryManifest.Raw, + TrueFoundry.DataDirectoryManifest +> = core.serialization.object({ + type: core.serialization.stringLiteral("data-dir"), + name: core.serialization.string(), + mlRepo: core.serialization.property("ml_repo", core.serialization.string()), + description: core.serialization.string().optionalNullable(), + metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()), + source: DataDirectoryManifestSource, +}); export declare namespace DataDirectoryManifest { export interface Raw { type: "data-dir"; name: string; ml_repo: string; - description?: string | null; + description?: (string | null | undefined) | null; metadata: Record; source: DataDirectoryManifestSource.Raw; } diff --git a/src/serialization/types/DataDirectoryManifestSource.ts b/src/serialization/types/DataDirectoryManifestSource.ts index 67d49983..e4733f87 100644 --- a/src/serialization/types/DataDirectoryManifestSource.ts +++ b/src/serialization/types/DataDirectoryManifestSource.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ExternalBlobStorageSource } from "./ExternalBlobStorageSource.js"; import { TrueFoundryManagedSource } from "./TrueFoundryManagedSource.js"; -export const DataDirectoryManifestSource: core.serialization.Schema = core.serialization.undiscriminatedUnion([TrueFoundryManagedSource, ExternalBlobStorageSource]); +export const DataDirectoryManifestSource: core.serialization.Schema< + serializers.DataDirectoryManifestSource.Raw, + TrueFoundry.DataDirectoryManifestSource +> = core.serialization.undiscriminatedUnion([TrueFoundryManagedSource, ExternalBlobStorageSource]); export declare namespace DataDirectoryManifestSource { export type Raw = TrueFoundryManagedSource.Raw | ExternalBlobStorageSource.Raw; diff --git a/src/serialization/types/DatabricksApiKeyAuth.ts b/src/serialization/types/DatabricksApiKeyAuth.ts index 82cd1440..d87e4b23 100644 --- a/src/serialization/types/DatabricksApiKeyAuth.ts +++ b/src/serialization/types/DatabricksApiKeyAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const DatabricksApiKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) - }); +export const DatabricksApiKeyAuth: core.serialization.ObjectSchema< + serializers.DatabricksApiKeyAuth.Raw, + TrueFoundry.DatabricksApiKeyAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), +}); export declare namespace DatabricksApiKeyAuth { export interface Raw { diff --git a/src/serialization/types/DatabricksIntegrations.ts b/src/serialization/types/DatabricksIntegrations.ts index 5d704857..fa820c52 100644 --- a/src/serialization/types/DatabricksIntegrations.ts +++ b/src/serialization/types/DatabricksIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { DatabricksModel } from "./DatabricksModel.js"; -export const DatabricksIntegrations: core.serialization.ObjectSchema = DatabricksModel; +export const DatabricksIntegrations: core.serialization.ObjectSchema< + serializers.DatabricksIntegrations.Raw, + TrueFoundry.DatabricksIntegrations +> = DatabricksModel; export declare namespace DatabricksIntegrations { export type Raw = DatabricksModel.Raw; diff --git a/src/serialization/types/DatabricksJobTaskConfig.ts b/src/serialization/types/DatabricksJobTaskConfig.ts index a9f74748..9c23359a 100644 --- a/src/serialization/types/DatabricksJobTaskConfig.ts +++ b/src/serialization/types/DatabricksJobTaskConfig.ts @@ -1,23 +1,36 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { DatabricksJobTaskConfigImage } from "./DatabricksJobTaskConfigImage.js"; import { Resources } from "./Resources.js"; -export const DatabricksJobTaskConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("databricks-job-task-config"), - "image": DatabricksJobTaskConfigImage, - "workspaceHost": core.serialization.property("workspace_host", core.serialization.string()), - "jobId": core.serialization.property("job_id", core.serialization.string()), - "serviceAccount": core.serialization.property("service_account", core.serialization.string().optional()), - "jobParameters": core.serialization.property("job_parameters", core.serialization.record(core.serialization.string(), core.serialization.string()).optional()), - "timeoutSeconds": core.serialization.property("timeout_seconds", core.serialization.number().optional()), - "skipWaitForCompletion": core.serialization.property("skip_wait_for_completion", core.serialization.boolean().optional()), - "env": core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), - "resources": Resources.optional() - }); +export const DatabricksJobTaskConfig: core.serialization.ObjectSchema< + serializers.DatabricksJobTaskConfig.Raw, + TrueFoundry.DatabricksJobTaskConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("databricks-job-task-config"), + image: DatabricksJobTaskConfigImage, + workspaceHost: core.serialization.property("workspace_host", core.serialization.string()), + jobId: core.serialization.property("job_id", core.serialization.string()), + serviceAccount: core.serialization.property("service_account", core.serialization.string().optional()), + jobParameters: core.serialization.property( + "job_parameters", + core.serialization + .record(core.serialization.string(), core.serialization.string().nullable()) + .optionalNullable(), + ), + timeoutSeconds: core.serialization.property("timeout_seconds", core.serialization.number().optionalNullable()), + skipWaitForCompletion: core.serialization.property( + "skip_wait_for_completion", + core.serialization.boolean().optional(), + ), + env: core.serialization + .record(core.serialization.string(), core.serialization.string().nullable()) + .optionalNullable(), + resources: Resources.optional(), +}); export declare namespace DatabricksJobTaskConfig { export interface Raw { @@ -26,10 +39,10 @@ export declare namespace DatabricksJobTaskConfig { workspace_host: string; job_id: string; service_account?: string | null; - job_parameters?: Record | null; - timeout_seconds?: number | null; + job_parameters?: (Record | null | undefined) | null; + timeout_seconds?: (number | null | undefined) | null; skip_wait_for_completion?: boolean | null; - env?: Record | null; + env?: (Record | null | undefined) | null; resources?: Resources.Raw | null; } } diff --git a/src/serialization/types/DatabricksJobTaskConfigImage.ts b/src/serialization/types/DatabricksJobTaskConfigImage.ts index 9653c5f1..1a11211f 100644 --- a/src/serialization/types/DatabricksJobTaskConfigImage.ts +++ b/src/serialization/types/DatabricksJobTaskConfigImage.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { TaskDockerFileBuild } from "./TaskDockerFileBuild.js"; import { TaskPythonBuild } from "./TaskPythonBuild.js"; -export const DatabricksJobTaskConfigImage: core.serialization.Schema = core.serialization.undiscriminatedUnion([TaskPythonBuild, TaskDockerFileBuild]); +export const DatabricksJobTaskConfigImage: core.serialization.Schema< + serializers.DatabricksJobTaskConfigImage.Raw, + TrueFoundry.DatabricksJobTaskConfigImage +> = core.serialization.undiscriminatedUnion([TaskPythonBuild, TaskDockerFileBuild]); export declare namespace DatabricksJobTaskConfigImage { export type Raw = TaskPythonBuild.Raw | TaskDockerFileBuild.Raw; diff --git a/src/serialization/types/DatabricksModel.ts b/src/serialization/types/DatabricksModel.ts index 96f9ad11..07434b1a 100644 --- a/src/serialization/types/DatabricksModel.ts +++ b/src/serialization/types/DatabricksModel.ts @@ -1,19 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const DatabricksModel: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/model/databricks"), - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const DatabricksModel: core.serialization.ObjectSchema< + serializers.DatabricksModel.Raw, + TrueFoundry.DatabricksModel +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/model/databricks"), + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace DatabricksModel { export interface Raw { diff --git a/src/serialization/types/DatabricksProviderAccount.ts b/src/serialization/types/DatabricksProviderAccount.ts index 503f957b..ff6db4c2 100644 --- a/src/serialization/types/DatabricksProviderAccount.ts +++ b/src/serialization/types/DatabricksProviderAccount.ts @@ -1,23 +1,26 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { DatabricksIntegrations } from "./DatabricksIntegrations.js"; import { DatabricksProviderAccountAuthData } from "./DatabricksProviderAccountAuthData.js"; import { OwnedBy } from "./OwnedBy.js"; -export const DatabricksProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/databricks"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", DatabricksProviderAccountAuthData), - "baseUrl": core.serialization.property("base_url", core.serialization.string()), - "integrations": core.serialization.list(DatabricksIntegrations), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const DatabricksProviderAccount: core.serialization.ObjectSchema< + serializers.DatabricksProviderAccount.Raw, + TrueFoundry.DatabricksProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/databricks"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", DatabricksProviderAccountAuthData), + baseUrl: core.serialization.property("base_url", core.serialization.string()), + integrations: core.serialization.list(DatabricksIntegrations), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace DatabricksProviderAccount { export interface Raw { diff --git a/src/serialization/types/DatabricksProviderAccountAuthData.ts b/src/serialization/types/DatabricksProviderAccountAuthData.ts index db6e4599..8f88a9d2 100644 --- a/src/serialization/types/DatabricksProviderAccountAuthData.ts +++ b/src/serialization/types/DatabricksProviderAccountAuthData.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { DatabricksApiKeyAuth } from "./DatabricksApiKeyAuth.js"; import { DatabricksServicePrincipalAuth } from "./DatabricksServicePrincipalAuth.js"; -export const DatabricksProviderAccountAuthData: core.serialization.Schema = core.serialization.undiscriminatedUnion([DatabricksServicePrincipalAuth, DatabricksApiKeyAuth]); +export const DatabricksProviderAccountAuthData: core.serialization.Schema< + serializers.DatabricksProviderAccountAuthData.Raw, + TrueFoundry.DatabricksProviderAccountAuthData +> = core.serialization.undiscriminatedUnion([DatabricksServicePrincipalAuth, DatabricksApiKeyAuth]); export declare namespace DatabricksProviderAccountAuthData { export type Raw = DatabricksServicePrincipalAuth.Raw | DatabricksApiKeyAuth.Raw; diff --git a/src/serialization/types/DatabricksServicePrincipalAuth.ts b/src/serialization/types/DatabricksServicePrincipalAuth.ts index c2952022..08cec5d2 100644 --- a/src/serialization/types/DatabricksServicePrincipalAuth.ts +++ b/src/serialization/types/DatabricksServicePrincipalAuth.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const DatabricksServicePrincipalAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("service-principal"), - "oauthSecret": core.serialization.property("oauth_secret", core.serialization.string()), - "clientId": core.serialization.property("client_id", core.serialization.string()) - }); +export const DatabricksServicePrincipalAuth: core.serialization.ObjectSchema< + serializers.DatabricksServicePrincipalAuth.Raw, + TrueFoundry.DatabricksServicePrincipalAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("service-principal"), + oauthSecret: core.serialization.property("oauth_secret", core.serialization.string()), + clientId: core.serialization.property("client_id", core.serialization.string()), +}); export declare namespace DatabricksServicePrincipalAuth { export interface Raw { diff --git a/src/serialization/types/DeactivateUserResponse.ts b/src/serialization/types/DeactivateUserResponse.ts index d51ed943..b7559e1a 100644 --- a/src/serialization/types/DeactivateUserResponse.ts +++ b/src/serialization/types/DeactivateUserResponse.ts @@ -1,12 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const DeactivateUserResponse: core.serialization.ObjectSchema = core.serialization.object({}); +export const DeactivateUserResponse: core.serialization.ObjectSchema< + serializers.DeactivateUserResponse.Raw, + TrueFoundry.DeactivateUserResponse +> = core.serialization.object({}); export declare namespace DeactivateUserResponse { - export interface Raw { - } + export type Raw = {}; } diff --git a/src/serialization/types/DeepgramApiKeyAuth.ts b/src/serialization/types/DeepgramApiKeyAuth.ts index 29a76d8a..4cec753f 100644 --- a/src/serialization/types/DeepgramApiKeyAuth.ts +++ b/src/serialization/types/DeepgramApiKeyAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const DeepgramApiKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) - }); +export const DeepgramApiKeyAuth: core.serialization.ObjectSchema< + serializers.DeepgramApiKeyAuth.Raw, + TrueFoundry.DeepgramApiKeyAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), +}); export declare namespace DeepgramApiKeyAuth { export interface Raw { diff --git a/src/serialization/types/DeepgramModel.ts b/src/serialization/types/DeepgramModel.ts index cf7d415b..97df5706 100644 --- a/src/serialization/types/DeepgramModel.ts +++ b/src/serialization/types/DeepgramModel.ts @@ -1,18 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const DeepgramModel: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/model/deepgram"), - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) +export const DeepgramModel: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("integration/model/deepgram"), + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace DeepgramModel { diff --git a/src/serialization/types/DeepgramProviderAccount.ts b/src/serialization/types/DeepgramProviderAccount.ts index 0298d131..89ba6eab 100644 --- a/src/serialization/types/DeepgramProviderAccount.ts +++ b/src/serialization/types/DeepgramProviderAccount.ts @@ -1,23 +1,26 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { DeepgramApiKeyAuth } from "./DeepgramApiKeyAuth.js"; import { DeepgramModel } from "./DeepgramModel.js"; import { OwnedBy } from "./OwnedBy.js"; -export const DeepgramProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/deepgram"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", DeepgramApiKeyAuth), - "baseUrl": core.serialization.property("base_url", core.serialization.string().optional()), - "integrations": core.serialization.list(DeepgramModel), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const DeepgramProviderAccount: core.serialization.ObjectSchema< + serializers.DeepgramProviderAccount.Raw, + TrueFoundry.DeepgramProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/deepgram"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", DeepgramApiKeyAuth), + baseUrl: core.serialization.property("base_url", core.serialization.string().optional()), + integrations: core.serialization.list(DeepgramModel), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace DeepgramProviderAccount { export interface Raw { diff --git a/src/serialization/types/DeepinfraIntegrations.ts b/src/serialization/types/DeepinfraIntegrations.ts index aa078fa8..ce27db1c 100644 --- a/src/serialization/types/DeepinfraIntegrations.ts +++ b/src/serialization/types/DeepinfraIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { DeepinfraModel } from "./DeepinfraModel.js"; -export const DeepinfraIntegrations: core.serialization.ObjectSchema = DeepinfraModel; +export const DeepinfraIntegrations: core.serialization.ObjectSchema< + serializers.DeepinfraIntegrations.Raw, + TrueFoundry.DeepinfraIntegrations +> = DeepinfraModel; export declare namespace DeepinfraIntegrations { export type Raw = DeepinfraModel.Raw; diff --git a/src/serialization/types/DeepinfraKeyAuth.ts b/src/serialization/types/DeepinfraKeyAuth.ts index c0a44f7b..74a2c928 100644 --- a/src/serialization/types/DeepinfraKeyAuth.ts +++ b/src/serialization/types/DeepinfraKeyAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const DeepinfraKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) - }); +export const DeepinfraKeyAuth: core.serialization.ObjectSchema< + serializers.DeepinfraKeyAuth.Raw, + TrueFoundry.DeepinfraKeyAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), +}); export declare namespace DeepinfraKeyAuth { export interface Raw { diff --git a/src/serialization/types/DeepinfraModel.ts b/src/serialization/types/DeepinfraModel.ts index fb460516..8b870671 100644 --- a/src/serialization/types/DeepinfraModel.ts +++ b/src/serialization/types/DeepinfraModel.ts @@ -1,19 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const DeepinfraModel: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/model/deepinfra"), - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const DeepinfraModel: core.serialization.ObjectSchema< + serializers.DeepinfraModel.Raw, + TrueFoundry.DeepinfraModel +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/model/deepinfra"), + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace DeepinfraModel { export interface Raw { diff --git a/src/serialization/types/DeepinfraProviderAccount.ts b/src/serialization/types/DeepinfraProviderAccount.ts index fffeb6a6..04d018f6 100644 --- a/src/serialization/types/DeepinfraProviderAccount.ts +++ b/src/serialization/types/DeepinfraProviderAccount.ts @@ -1,22 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { DeepinfraIntegrations } from "./DeepinfraIntegrations.js"; import { DeepinfraKeyAuth } from "./DeepinfraKeyAuth.js"; import { OwnedBy } from "./OwnedBy.js"; -export const DeepinfraProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/deepinfra"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", DeepinfraKeyAuth), - "integrations": core.serialization.list(DeepinfraIntegrations).optional(), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const DeepinfraProviderAccount: core.serialization.ObjectSchema< + serializers.DeepinfraProviderAccount.Raw, + TrueFoundry.DeepinfraProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/deepinfra"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", DeepinfraKeyAuth), + integrations: core.serialization.list(DeepinfraIntegrations).optional(), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace DeepinfraProviderAccount { export interface Raw { diff --git a/src/serialization/types/DeleteApplicationResponse.ts b/src/serialization/types/DeleteApplicationResponse.ts index 343f21ac..a2d3aae7 100644 --- a/src/serialization/types/DeleteApplicationResponse.ts +++ b/src/serialization/types/DeleteApplicationResponse.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const DeleteApplicationResponse: core.serialization.ObjectSchema = core.serialization.object({ - "message": core.serialization.string() - }); +export const DeleteApplicationResponse: core.serialization.ObjectSchema< + serializers.DeleteApplicationResponse.Raw, + TrueFoundry.DeleteApplicationResponse +> = core.serialization.object({ + message: core.serialization.string(), +}); export declare namespace DeleteApplicationResponse { export interface Raw { diff --git a/src/serialization/types/DeleteClusterResponse.ts b/src/serialization/types/DeleteClusterResponse.ts index 805df7dc..1674de81 100644 --- a/src/serialization/types/DeleteClusterResponse.ts +++ b/src/serialization/types/DeleteClusterResponse.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const DeleteClusterResponse: core.serialization.ObjectSchema = core.serialization.object({ - "message": core.serialization.string() - }); +export const DeleteClusterResponse: core.serialization.ObjectSchema< + serializers.DeleteClusterResponse.Raw, + TrueFoundry.DeleteClusterResponse +> = core.serialization.object({ + message: core.serialization.string(), +}); export declare namespace DeleteClusterResponse { export interface Raw { diff --git a/src/serialization/types/DeleteJobRunResponse.ts b/src/serialization/types/DeleteJobRunResponse.ts index ac81daa7..2bb59f1f 100644 --- a/src/serialization/types/DeleteJobRunResponse.ts +++ b/src/serialization/types/DeleteJobRunResponse.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const DeleteJobRunResponse: core.serialization.ObjectSchema = core.serialization.object({ - "message": core.serialization.string() - }); +export const DeleteJobRunResponse: core.serialization.ObjectSchema< + serializers.DeleteJobRunResponse.Raw, + TrueFoundry.DeleteJobRunResponse +> = core.serialization.object({ + message: core.serialization.string(), +}); export declare namespace DeleteJobRunResponse { export interface Raw { diff --git a/src/serialization/types/DeletePersonalAccessTokenResponse.ts b/src/serialization/types/DeletePersonalAccessTokenResponse.ts index 6fbf0561..5998ba12 100644 --- a/src/serialization/types/DeletePersonalAccessTokenResponse.ts +++ b/src/serialization/types/DeletePersonalAccessTokenResponse.ts @@ -1,12 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const DeletePersonalAccessTokenResponse: core.serialization.ObjectSchema = core.serialization.object({}); +export const DeletePersonalAccessTokenResponse: core.serialization.ObjectSchema< + serializers.DeletePersonalAccessTokenResponse.Raw, + TrueFoundry.DeletePersonalAccessTokenResponse +> = core.serialization.object({}); export declare namespace DeletePersonalAccessTokenResponse { - export interface Raw { - } + export type Raw = {}; } diff --git a/src/serialization/types/DeleteSecretGroupResponse.ts b/src/serialization/types/DeleteSecretGroupResponse.ts index 88847186..7cdc6eed 100644 --- a/src/serialization/types/DeleteSecretGroupResponse.ts +++ b/src/serialization/types/DeleteSecretGroupResponse.ts @@ -1,12 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const DeleteSecretGroupResponse: core.serialization.ObjectSchema = core.serialization.object({}); +export const DeleteSecretGroupResponse: core.serialization.ObjectSchema< + serializers.DeleteSecretGroupResponse.Raw, + TrueFoundry.DeleteSecretGroupResponse +> = core.serialization.object({}); export declare namespace DeleteSecretGroupResponse { - export interface Raw { - } + export type Raw = {}; } diff --git a/src/serialization/types/DeleteTeamResponse.ts b/src/serialization/types/DeleteTeamResponse.ts index 7e18bc87..98f8ca46 100644 --- a/src/serialization/types/DeleteTeamResponse.ts +++ b/src/serialization/types/DeleteTeamResponse.ts @@ -1,12 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const DeleteTeamResponse: core.serialization.ObjectSchema = core.serialization.object({}); +export const DeleteTeamResponse: core.serialization.ObjectSchema< + serializers.DeleteTeamResponse.Raw, + TrueFoundry.DeleteTeamResponse +> = core.serialization.object({}); export declare namespace DeleteTeamResponse { - export interface Raw { - } + export type Raw = {}; } diff --git a/src/serialization/types/DeleteUserResponse.ts b/src/serialization/types/DeleteUserResponse.ts index 97f28215..c902b664 100644 --- a/src/serialization/types/DeleteUserResponse.ts +++ b/src/serialization/types/DeleteUserResponse.ts @@ -1,12 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const DeleteUserResponse: core.serialization.ObjectSchema = core.serialization.object({}); +export const DeleteUserResponse: core.serialization.ObjectSchema< + serializers.DeleteUserResponse.Raw, + TrueFoundry.DeleteUserResponse +> = core.serialization.object({}); export declare namespace DeleteUserResponse { - export interface Raw { - } + export type Raw = {}; } diff --git a/src/serialization/types/DeleteVirtualAccountResponse.ts b/src/serialization/types/DeleteVirtualAccountResponse.ts index 68c4547a..085afd48 100644 --- a/src/serialization/types/DeleteVirtualAccountResponse.ts +++ b/src/serialization/types/DeleteVirtualAccountResponse.ts @@ -1,12 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const DeleteVirtualAccountResponse: core.serialization.ObjectSchema = core.serialization.object({}); +export const DeleteVirtualAccountResponse: core.serialization.ObjectSchema< + serializers.DeleteVirtualAccountResponse.Raw, + TrueFoundry.DeleteVirtualAccountResponse +> = core.serialization.object({}); export declare namespace DeleteVirtualAccountResponse { - export interface Raw { - } + export type Raw = {}; } diff --git a/src/serialization/types/DeleteWorkspaceResponse.ts b/src/serialization/types/DeleteWorkspaceResponse.ts index 831b72e5..ef129ba2 100644 --- a/src/serialization/types/DeleteWorkspaceResponse.ts +++ b/src/serialization/types/DeleteWorkspaceResponse.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Workspace } from "./Workspace.js"; -export const DeleteWorkspaceResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": Workspace, - "message": core.serialization.string() - }); +export const DeleteWorkspaceResponse: core.serialization.ObjectSchema< + serializers.DeleteWorkspaceResponse.Raw, + TrueFoundry.DeleteWorkspaceResponse +> = core.serialization.object({ + data: Workspace, + message: core.serialization.string(), +}); export declare namespace DeleteWorkspaceResponse { export interface Raw { diff --git a/src/serialization/types/Deployment.ts b/src/serialization/types/Deployment.ts index 328fefba..619cddc9 100644 --- a/src/serialization/types/Deployment.ts +++ b/src/serialization/types/Deployment.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ApplicationSummary } from "./ApplicationSummary.js"; import { BuildInfo } from "./BuildInfo.js"; import { DeploymentManifest } from "./DeploymentManifest.js"; @@ -10,40 +10,41 @@ import { DeploymentStatus } from "./DeploymentStatus.js"; import { Recommendation } from "./Recommendation.js"; import { Subject } from "./Subject.js"; -export const Deployment: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string().optional(), - "version": core.serialization.number().optional(), - "fqn": core.serialization.string().optional(), - "applicationId": core.serialization.string().optional(), - "manifest": DeploymentManifest, - "application": ApplicationSummary.optional(), - "createdBySubject": Subject, - "createdAt": core.serialization.date().optional(), - "updatedAt": core.serialization.date().optional(), - "deploymentBuilds": core.serialization.list(BuildInfo).optional(), - "deploymentStatuses": core.serialization.list(DeploymentStatus).optional(), - "currentStatusId": core.serialization.string().optional(), - "currentStatus": DeploymentStatus.optional(), - "appliedRecommendations": core.serialization.list(Recommendation).optional(), - "createdBy": core.serialization.string().optional() +export const Deployment: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string().optionalNullable(), + version: core.serialization.number().optionalNullable(), + fqn: core.serialization.string().optionalNullable(), + applicationId: core.serialization.string().optionalNullable(), + manifest: DeploymentManifest, + application: ApplicationSummary.optionalNullable(), + createdBySubject: Subject, + createdAt: core.serialization.date().optionalNullable(), + updatedAt: core.serialization.date().optionalNullable(), + deploymentBuilds: core.serialization.list(BuildInfo).optionalNullable(), + deploymentStatuses: core.serialization.list(DeploymentStatus).optionalNullable(), + currentStatusId: core.serialization.string().optionalNullable(), + currentStatus: DeploymentStatus.optionalNullable(), + appliedRecommendations: core.serialization.list(Recommendation).optionalNullable(), + createdBy: core.serialization.string().optionalNullable(), }); export declare namespace Deployment { export interface Raw { - id?: string | null; - version?: number | null; - fqn?: string | null; - applicationId?: string | null; + id?: (string | null | undefined) | null; + version?: (number | null | undefined) | null; + fqn?: (string | null | undefined) | null; + applicationId?: (string | null | undefined) | null; manifest: DeploymentManifest.Raw; - application?: ApplicationSummary.Raw | null; + application?: (ApplicationSummary.Raw | null | undefined) | null; createdBySubject: Subject.Raw; - createdAt?: string | null; - updatedAt?: string | null; - deploymentBuilds?: BuildInfo.Raw[] | null; - deploymentStatuses?: DeploymentStatus.Raw[] | null; - currentStatusId?: string | null; - currentStatus?: DeploymentStatus.Raw | null; - appliedRecommendations?: Recommendation.Raw[] | null; - createdBy?: string | null; + createdAt?: (string | null | undefined) | null; + updatedAt?: (string | null | undefined) | null; + deploymentBuilds?: (BuildInfo.Raw[] | null | undefined) | null; + deploymentStatuses?: (DeploymentStatus.Raw[] | null | undefined) | null; + currentStatusId?: (string | null | undefined) | null; + currentStatus?: (DeploymentStatus.Raw | null | undefined) | null; + appliedRecommendations?: (Recommendation.Raw[] | null | undefined) | null; + createdBy?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/DeploymentBuild.ts b/src/serialization/types/DeploymentBuild.ts index a5559466..922062be 100644 --- a/src/serialization/types/DeploymentBuild.ts +++ b/src/serialization/types/DeploymentBuild.ts @@ -1,43 +1,46 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BuildInfo } from "./BuildInfo.js"; -import { BuildStatus } from "./BuildStatus.js"; +import { DeploymentBuildStatus } from "./DeploymentBuildStatus.js"; -export const DeploymentBuild: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string().optional(), - "deploymentId": core.serialization.string().optional(), - "componentName": core.serialization.string().optional(), - "build": BuildInfo.optional(), - "buildId": core.serialization.string().optional(), - "imageUri": core.serialization.string().optional(), - "name": core.serialization.string().optional(), - "status": BuildStatus.optional(), - "getLogsUrl": core.serialization.string().optional(), - "tailLogsUrl": core.serialization.string().optional(), - "logsStartTs": core.serialization.string().optional(), - "metadata": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - "createdAt": core.serialization.date().optional(), - "updatedAt": core.serialization.date().optional() - }); +export const DeploymentBuild: core.serialization.ObjectSchema< + serializers.DeploymentBuild.Raw, + TrueFoundry.DeploymentBuild +> = core.serialization.object({ + id: core.serialization.string().optionalNullable(), + deploymentId: core.serialization.string().optionalNullable(), + componentName: core.serialization.string().optionalNullable(), + build: BuildInfo.optionalNullable(), + buildId: core.serialization.string().optionalNullable(), + imageUri: core.serialization.string().optionalNullable(), + name: core.serialization.string().optionalNullable(), + status: DeploymentBuildStatus.optionalNullable(), + getLogsUrl: core.serialization.string().optionalNullable(), + tailLogsUrl: core.serialization.string().optionalNullable(), + logsStartTs: core.serialization.string().optionalNullable(), + metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optionalNullable(), + createdAt: core.serialization.date().optionalNullable(), + updatedAt: core.serialization.date().optionalNullable(), +}); export declare namespace DeploymentBuild { export interface Raw { - id?: string | null; - deploymentId?: string | null; - componentName?: string | null; - build?: BuildInfo.Raw | null; - buildId?: string | null; - imageUri?: string | null; - name?: string | null; - status?: BuildStatus.Raw | null; - getLogsUrl?: string | null; - tailLogsUrl?: string | null; - logsStartTs?: string | null; - metadata?: Record | null; - createdAt?: string | null; - updatedAt?: string | null; + id?: (string | null | undefined) | null; + deploymentId?: (string | null | undefined) | null; + componentName?: (string | null | undefined) | null; + build?: (BuildInfo.Raw | null | undefined) | null; + buildId?: (string | null | undefined) | null; + imageUri?: (string | null | undefined) | null; + name?: (string | null | undefined) | null; + status?: (DeploymentBuildStatus.Raw | null | undefined) | null; + getLogsUrl?: (string | null | undefined) | null; + tailLogsUrl?: (string | null | undefined) | null; + logsStartTs?: (string | null | undefined) | null; + metadata?: (Record | null | undefined) | null; + createdAt?: (string | null | undefined) | null; + updatedAt?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/DeploymentBuildStatus.ts b/src/serialization/types/DeploymentBuildStatus.ts new file mode 100644 index 00000000..b6abfc42 --- /dev/null +++ b/src/serialization/types/DeploymentBuildStatus.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const DeploymentBuildStatus: core.serialization.Schema< + serializers.DeploymentBuildStatus.Raw, + TrueFoundry.DeploymentBuildStatus +> = core.serialization.enum_(["STARTED", "SUCCEEDED", "FAILED"]); + +export declare namespace DeploymentBuildStatus { + export type Raw = "STARTED" | "SUCCEEDED" | "FAILED"; +} diff --git a/src/serialization/types/DeploymentManifest.ts b/src/serialization/types/DeploymentManifest.ts index 4c5c99df..bfed0527 100644 --- a/src/serialization/types/DeploymentManifest.ts +++ b/src/serialization/types/DeploymentManifest.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ApplicationSet } from "./ApplicationSet.js"; import { AsyncService } from "./AsyncService.js"; import { Codeserver } from "./Codeserver.js"; @@ -17,8 +17,38 @@ import { SshServer } from "./SshServer.js"; import { Volume } from "./Volume.js"; import { Workflow } from "./Workflow.js"; -export const DeploymentManifest: core.serialization.Schema = core.serialization.undiscriminatedUnion([Service, AsyncService, Job, Notebook, Codeserver, SshServer, RStudio, Helm, Volume, ApplicationSet, Workflow, SparkJob, Intercept]); +export const DeploymentManifest: core.serialization.Schema< + serializers.DeploymentManifest.Raw, + TrueFoundry.DeploymentManifest +> = core.serialization.undiscriminatedUnion([ + Service, + AsyncService, + Job, + Notebook, + Codeserver, + SshServer, + RStudio, + Helm, + Volume, + ApplicationSet, + Workflow, + SparkJob, + Intercept, +]); export declare namespace DeploymentManifest { - export type Raw = Service.Raw | AsyncService.Raw | Job.Raw | Notebook.Raw | Codeserver.Raw | SshServer.Raw | RStudio.Raw | Helm.Raw | Volume.Raw | ApplicationSet.Raw | Workflow.Raw | SparkJob.Raw | Intercept.Raw; + export type Raw = + | Service.Raw + | AsyncService.Raw + | Job.Raw + | Notebook.Raw + | Codeserver.Raw + | SshServer.Raw + | RStudio.Raw + | Helm.Raw + | Volume.Raw + | ApplicationSet.Raw + | Workflow.Raw + | SparkJob.Raw + | Intercept.Raw; } diff --git a/src/serialization/types/DeploymentStatus.ts b/src/serialization/types/DeploymentStatus.ts index 8945de15..c1ca3eaf 100644 --- a/src/serialization/types/DeploymentStatus.ts +++ b/src/serialization/types/DeploymentStatus.ts @@ -1,33 +1,36 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { DeploymentStatusValue } from "./DeploymentStatusValue.js"; import { DeploymentTransition } from "./DeploymentTransition.js"; -export const DeploymentStatus: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string().optional(), - "deploymentId": core.serialization.string().optional(), - "status": DeploymentStatusValue.optional(), - "state": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - "transition": DeploymentTransition.optional(), - "message": core.serialization.string().optional(), - "retryCount": core.serialization.number().optional(), - "createdAt": core.serialization.date().optional(), - "updatedAt": core.serialization.date().optional() - }); +export const DeploymentStatus: core.serialization.ObjectSchema< + serializers.DeploymentStatus.Raw, + TrueFoundry.DeploymentStatus +> = core.serialization.object({ + id: core.serialization.string().optionalNullable(), + deploymentId: core.serialization.string().optionalNullable(), + status: DeploymentStatusValue.optionalNullable(), + state: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optionalNullable(), + transition: DeploymentTransition.optionalNullable(), + message: core.serialization.string().optionalNullable(), + retryCount: core.serialization.number().optionalNullable(), + createdAt: core.serialization.date().optionalNullable(), + updatedAt: core.serialization.date().optionalNullable(), +}); export declare namespace DeploymentStatus { export interface Raw { - id?: string | null; - deploymentId?: string | null; - status?: DeploymentStatusValue.Raw | null; - state?: Record | null; - transition?: DeploymentTransition.Raw | null; - message?: string | null; - retryCount?: number | null; - createdAt?: string | null; - updatedAt?: string | null; + id?: (string | null | undefined) | null; + deploymentId?: (string | null | undefined) | null; + status?: (DeploymentStatusValue.Raw | null | undefined) | null; + state?: (Record | null | undefined) | null; + transition?: (DeploymentTransition.Raw | null | undefined) | null; + message?: (string | null | undefined) | null; + retryCount?: (number | null | undefined) | null; + createdAt?: (string | null | undefined) | null; + updatedAt?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/DeploymentStatusValue.ts b/src/serialization/types/DeploymentStatusValue.ts index e7745a27..903b0ac5 100644 --- a/src/serialization/types/DeploymentStatusValue.ts +++ b/src/serialization/types/DeploymentStatusValue.ts @@ -1,11 +1,41 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const DeploymentStatusValue: core.serialization.Schema = core.serialization.enum_(["INITIALIZED", "BUILD_SUCCESS", "BUILD_FAILED", "DEPLOY_FAILED", "DEPLOY_FAILED_WITH_RETRY", "DEPLOY_SUCCESS", "ROLLOUT_STARTED", "SET_TRAFFIC", "PAUSED", "FAILED", "CANCELLED", "REDEPLOY_STARTED", "BUILDING"]); +export const DeploymentStatusValue: core.serialization.Schema< + serializers.DeploymentStatusValue.Raw, + TrueFoundry.DeploymentStatusValue +> = core.serialization.enum_([ + "INITIALIZED", + "BUILD_SUCCESS", + "BUILD_FAILED", + "DEPLOY_FAILED", + "DEPLOY_FAILED_WITH_RETRY", + "DEPLOY_SUCCESS", + "ROLLOUT_STARTED", + "SET_TRAFFIC", + "PAUSED", + "FAILED", + "CANCELLED", + "REDEPLOY_STARTED", + "BUILDING", +]); export declare namespace DeploymentStatusValue { - export type Raw = "INITIALIZED" | "BUILD_SUCCESS" | "BUILD_FAILED" | "DEPLOY_FAILED" | "DEPLOY_FAILED_WITH_RETRY" | "DEPLOY_SUCCESS" | "ROLLOUT_STARTED" | "SET_TRAFFIC" | "PAUSED" | "FAILED" | "CANCELLED" | "REDEPLOY_STARTED" | "BUILDING"; + export type Raw = + | "INITIALIZED" + | "BUILD_SUCCESS" + | "BUILD_FAILED" + | "DEPLOY_FAILED" + | "DEPLOY_FAILED_WITH_RETRY" + | "DEPLOY_SUCCESS" + | "ROLLOUT_STARTED" + | "SET_TRAFFIC" + | "PAUSED" + | "FAILED" + | "CANCELLED" + | "REDEPLOY_STARTED" + | "BUILDING"; } diff --git a/src/serialization/types/DeploymentTransition.ts b/src/serialization/types/DeploymentTransition.ts index 6898bb2d..03caf745 100644 --- a/src/serialization/types/DeploymentTransition.ts +++ b/src/serialization/types/DeploymentTransition.ts @@ -1,10 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const DeploymentTransition: core.serialization.Schema = core.serialization.enum_(["BUILDING", "DEPLOYING", "REUSING_EXISTING_BUILD", "COMPONENTS_DEPLOYING", "WAITING", ""]); +export const DeploymentTransition: core.serialization.Schema< + serializers.DeploymentTransition.Raw, + TrueFoundry.DeploymentTransition +> = core.serialization.enum_([ + "BUILDING", + "DEPLOYING", + "REUSING_EXISTING_BUILD", + "COMPONENTS_DEPLOYING", + "WAITING", + "", +]); export declare namespace DeploymentTransition { export type Raw = "BUILDING" | "DEPLOYING" | "REUSING_EXISTING_BUILD" | "COMPONENTS_DEPLOYING" | "WAITING" | ""; diff --git a/src/serialization/types/DeveloperMessage.ts b/src/serialization/types/DeveloperMessage.ts index a16a63be..26d4440c 100644 --- a/src/serialization/types/DeveloperMessage.ts +++ b/src/serialization/types/DeveloperMessage.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { DeveloperMessageContent } from "./DeveloperMessageContent.js"; -export const DeveloperMessage: core.serialization.ObjectSchema = core.serialization.object({ - "role": core.serialization.stringLiteral("developer"), - "content": DeveloperMessageContent, - "name": core.serialization.string().optional() - }); +export const DeveloperMessage: core.serialization.ObjectSchema< + serializers.DeveloperMessage.Raw, + TrueFoundry.DeveloperMessage +> = core.serialization.object({ + role: core.serialization.stringLiteral("developer"), + content: DeveloperMessageContent, + name: core.serialization.string().optional(), +}); export declare namespace DeveloperMessage { export interface Raw { diff --git a/src/serialization/types/DeveloperMessageContent.ts b/src/serialization/types/DeveloperMessageContent.ts index 439add37..1bacd2b2 100644 --- a/src/serialization/types/DeveloperMessageContent.ts +++ b/src/serialization/types/DeveloperMessageContent.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BlobStorageReference } from "./BlobStorageReference.js"; -export const DeveloperMessageContent: core.serialization.Schema = core.serialization.undiscriminatedUnion([core.serialization.string(), BlobStorageReference]); +export const DeveloperMessageContent: core.serialization.Schema< + serializers.DeveloperMessageContent.Raw, + TrueFoundry.DeveloperMessageContent +> = core.serialization.undiscriminatedUnion([core.serialization.string(), BlobStorageReference]); export declare namespace DeveloperMessageContent { export type Raw = string | BlobStorageReference.Raw; diff --git a/src/serialization/types/DockerFileBuild.ts b/src/serialization/types/DockerFileBuild.ts index 199d2cb6..a0918b6d 100644 --- a/src/serialization/types/DockerFileBuild.ts +++ b/src/serialization/types/DockerFileBuild.ts @@ -1,19 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BuildSecret } from "./BuildSecret.js"; import { DockerFileBuildCommand } from "./DockerFileBuildCommand.js"; -export const DockerFileBuild: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("dockerfile"), - "dockerfilePath": core.serialization.property("dockerfile_path", core.serialization.string()), - "buildContextPath": core.serialization.property("build_context_path", core.serialization.string()), - "command": DockerFileBuildCommand.optional(), - "buildArgs": core.serialization.property("build_args", core.serialization.record(core.serialization.string(), core.serialization.string()).optional()), - "buildSecrets": core.serialization.property("build_secrets", core.serialization.list(BuildSecret).optional()) - }); +export const DockerFileBuild: core.serialization.ObjectSchema< + serializers.DockerFileBuild.Raw, + TrueFoundry.DockerFileBuild +> = core.serialization.object({ + type: core.serialization.stringLiteral("dockerfile"), + dockerfilePath: core.serialization.property("dockerfile_path", core.serialization.string()), + buildContextPath: core.serialization.property("build_context_path", core.serialization.string()), + command: DockerFileBuildCommand.optional(), + buildArgs: core.serialization.property( + "build_args", + core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), + ), + buildSecrets: core.serialization.property("build_secrets", core.serialization.list(BuildSecret).optional()), +}); export declare namespace DockerFileBuild { export interface Raw { diff --git a/src/serialization/types/DockerFileBuildCommand.ts b/src/serialization/types/DockerFileBuildCommand.ts index 4623c23b..3ca83e3b 100644 --- a/src/serialization/types/DockerFileBuildCommand.ts +++ b/src/serialization/types/DockerFileBuildCommand.ts @@ -1,10 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const DockerFileBuildCommand: core.serialization.Schema = core.serialization.undiscriminatedUnion([core.serialization.string(), core.serialization.list(core.serialization.string())]); +export const DockerFileBuildCommand: core.serialization.Schema< + serializers.DockerFileBuildCommand.Raw, + TrueFoundry.DockerFileBuildCommand +> = core.serialization.undiscriminatedUnion([ + core.serialization.string(), + core.serialization.list(core.serialization.string()), +]); export declare namespace DockerFileBuildCommand { export type Raw = string | string[]; diff --git a/src/serialization/types/DockerhubBasicAuth.ts b/src/serialization/types/DockerhubBasicAuth.ts index 575b7d8d..19037538 100644 --- a/src/serialization/types/DockerhubBasicAuth.ts +++ b/src/serialization/types/DockerhubBasicAuth.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const DockerhubBasicAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("basic-auth"), - "username": core.serialization.string(), - "password": core.serialization.string() - }); +export const DockerhubBasicAuth: core.serialization.ObjectSchema< + serializers.DockerhubBasicAuth.Raw, + TrueFoundry.DockerhubBasicAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("basic-auth"), + username: core.serialization.string(), + password: core.serialization.string(), +}); export declare namespace DockerhubBasicAuth { export interface Raw { diff --git a/src/serialization/types/DockerhubIntegrations.ts b/src/serialization/types/DockerhubIntegrations.ts index 648c39f8..82b102ae 100644 --- a/src/serialization/types/DockerhubIntegrations.ts +++ b/src/serialization/types/DockerhubIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { DockerhubRegistry } from "./DockerhubRegistry.js"; -export const DockerhubIntegrations: core.serialization.ObjectSchema = DockerhubRegistry; +export const DockerhubIntegrations: core.serialization.ObjectSchema< + serializers.DockerhubIntegrations.Raw, + TrueFoundry.DockerhubIntegrations +> = DockerhubRegistry; export declare namespace DockerhubIntegrations { export type Raw = DockerhubRegistry.Raw; diff --git a/src/serialization/types/DockerhubProviderAccount.ts b/src/serialization/types/DockerhubProviderAccount.ts index d7f865ea..3311fb7d 100644 --- a/src/serialization/types/DockerhubProviderAccount.ts +++ b/src/serialization/types/DockerhubProviderAccount.ts @@ -1,20 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { DockerhubBasicAuth } from "./DockerhubBasicAuth.js"; import { DockerhubIntegrations } from "./DockerhubIntegrations.js"; import { OwnedBy } from "./OwnedBy.js"; -export const DockerhubProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/dockerhub"), - "name": core.serialization.string(), - "accountName": core.serialization.property("account_name", core.serialization.string().optional()), - "authData": core.serialization.property("auth_data", DockerhubBasicAuth.optional()), - "integrations": core.serialization.list(DockerhubIntegrations), - "ownedBy": OwnedBy.optional() - }); +export const DockerhubProviderAccount: core.serialization.ObjectSchema< + serializers.DockerhubProviderAccount.Raw, + TrueFoundry.DockerhubProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/dockerhub"), + name: core.serialization.string(), + accountName: core.serialization.property("account_name", core.serialization.string().optional()), + authData: core.serialization.property("auth_data", DockerhubBasicAuth.optional()), + integrations: core.serialization.list(DockerhubIntegrations), + ownedBy: OwnedBy.optional(), +}); export declare namespace DockerhubProviderAccount { export interface Raw { diff --git a/src/serialization/types/DockerhubRegistry.ts b/src/serialization/types/DockerhubRegistry.ts index d75d8fa0..a4f9eceb 100644 --- a/src/serialization/types/DockerhubRegistry.ts +++ b/src/serialization/types/DockerhubRegistry.ts @@ -1,17 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { DockerhubBasicAuth } from "./DockerhubBasicAuth.js"; -export const DockerhubRegistry: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/docker-registry/dockerhub"), - "name": core.serialization.string(), - "registryUrl": core.serialization.property("registry_url", core.serialization.string()), - "authData": core.serialization.property("auth_data", DockerhubBasicAuth.optional()), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const DockerhubRegistry: core.serialization.ObjectSchema< + serializers.DockerhubRegistry.Raw, + TrueFoundry.DockerhubRegistry +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/docker-registry/dockerhub"), + name: core.serialization.string(), + registryUrl: core.serialization.property("registry_url", core.serialization.string()), + authData: core.serialization.property("auth_data", DockerhubBasicAuth.optional()), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace DockerhubRegistry { export interface Raw { diff --git a/src/serialization/types/DynamicVolumeConfig.ts b/src/serialization/types/DynamicVolumeConfig.ts index d37022f1..7c1a8868 100644 --- a/src/serialization/types/DynamicVolumeConfig.ts +++ b/src/serialization/types/DynamicVolumeConfig.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const DynamicVolumeConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("dynamic"), - "storageClass": core.serialization.property("storage_class", core.serialization.string()), - "size": core.serialization.number() - }); +export const DynamicVolumeConfig: core.serialization.ObjectSchema< + serializers.DynamicVolumeConfig.Raw, + TrueFoundry.DynamicVolumeConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("dynamic"), + storageClass: core.serialization.property("storage_class", core.serialization.string()), + size: core.serialization.number(), +}); export declare namespace DynamicVolumeConfig { export interface Raw { diff --git a/src/serialization/types/ElevenLabsApiKeyAuth.ts b/src/serialization/types/ElevenLabsApiKeyAuth.ts index 35ff7ace..a08fb83a 100644 --- a/src/serialization/types/ElevenLabsApiKeyAuth.ts +++ b/src/serialization/types/ElevenLabsApiKeyAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const ElevenLabsApiKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) - }); +export const ElevenLabsApiKeyAuth: core.serialization.ObjectSchema< + serializers.ElevenLabsApiKeyAuth.Raw, + TrueFoundry.ElevenLabsApiKeyAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), +}); export declare namespace ElevenLabsApiKeyAuth { export interface Raw { diff --git a/src/serialization/types/ElevenLabsModel.ts b/src/serialization/types/ElevenLabsModel.ts index aa21b11d..b1416ab5 100644 --- a/src/serialization/types/ElevenLabsModel.ts +++ b/src/serialization/types/ElevenLabsModel.ts @@ -1,19 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const ElevenLabsModel: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/model/elevenlabs"), - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const ElevenLabsModel: core.serialization.ObjectSchema< + serializers.ElevenLabsModel.Raw, + TrueFoundry.ElevenLabsModel +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/model/elevenlabs"), + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace ElevenLabsModel { export interface Raw { diff --git a/src/serialization/types/ElevenLabsProviderAccount.ts b/src/serialization/types/ElevenLabsProviderAccount.ts index 283490ff..2f27b6af 100644 --- a/src/serialization/types/ElevenLabsProviderAccount.ts +++ b/src/serialization/types/ElevenLabsProviderAccount.ts @@ -1,23 +1,26 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { ElevenLabsApiKeyAuth } from "./ElevenLabsApiKeyAuth.js"; import { ElevenLabsModel } from "./ElevenLabsModel.js"; import { OwnedBy } from "./OwnedBy.js"; -export const ElevenLabsProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/elevenlabs"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", ElevenLabsApiKeyAuth), - "baseUrl": core.serialization.property("base_url", core.serialization.string().optional()), - "integrations": core.serialization.list(ElevenLabsModel), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const ElevenLabsProviderAccount: core.serialization.ObjectSchema< + serializers.ElevenLabsProviderAccount.Raw, + TrueFoundry.ElevenLabsProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/elevenlabs"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", ElevenLabsApiKeyAuth), + baseUrl: core.serialization.property("base_url", core.serialization.string().optional()), + integrations: core.serialization.list(ElevenLabsModel), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace ElevenLabsProviderAccount { export interface Raw { diff --git a/src/serialization/types/Email.ts b/src/serialization/types/Email.ts index d95767df..567a08dd 100644 --- a/src/serialization/types/Email.ts +++ b/src/serialization/types/Email.ts @@ -1,13 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const Email: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("email"), - "notificationChannel": core.serialization.property("notification_channel", core.serialization.string()), - "toEmails": core.serialization.property("to_emails", core.serialization.list(core.serialization.string())) +export const Email: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("email"), + notificationChannel: core.serialization.property("notification_channel", core.serialization.string()), + toEmails: core.serialization.property("to_emails", core.serialization.list(core.serialization.string())), }); export declare namespace Email { diff --git a/src/serialization/types/EmailNotificationChannel.ts b/src/serialization/types/EmailNotificationChannel.ts index 3e0977f9..dc5f2ce5 100644 --- a/src/serialization/types/EmailNotificationChannel.ts +++ b/src/serialization/types/EmailNotificationChannel.ts @@ -1,17 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { SmtpCredentials } from "./SmtpCredentials.js"; -export const EmailNotificationChannel: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/notification-channel/email"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", SmtpCredentials), - "fromEmail": core.serialization.property("from_email", core.serialization.string()), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const EmailNotificationChannel: core.serialization.ObjectSchema< + serializers.EmailNotificationChannel.Raw, + TrueFoundry.EmailNotificationChannel +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/notification-channel/email"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", SmtpCredentials), + fromEmail: core.serialization.property("from_email", core.serialization.string()), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace EmailNotificationChannel { export interface Raw { diff --git a/src/serialization/types/EmptyResponse.ts b/src/serialization/types/EmptyResponse.ts index 0df87562..9f408228 100644 --- a/src/serialization/types/EmptyResponse.ts +++ b/src/serialization/types/EmptyResponse.ts @@ -1,12 +1,12 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const EmptyResponse: core.serialization.ObjectSchema = core.serialization.object({}); +export const EmptyResponse: core.serialization.ObjectSchema = + core.serialization.object({}); export declare namespace EmptyResponse { - export interface Raw { - } + export type Raw = {}; } diff --git a/src/serialization/types/Endpoint.ts b/src/serialization/types/Endpoint.ts index 80889edf..f458bf05 100644 --- a/src/serialization/types/Endpoint.ts +++ b/src/serialization/types/Endpoint.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const Endpoint: core.serialization.ObjectSchema = core.serialization.object({ - "host": core.serialization.string(), - "path": core.serialization.string().optional() +export const Endpoint: core.serialization.ObjectSchema = + core.serialization.object({ + host: core.serialization.string(), + path: core.serialization.string().optional(), }); export declare namespace Endpoint { diff --git a/src/serialization/types/EnforcingStrategy.ts b/src/serialization/types/EnforcingStrategy.ts index bb030f72..640f404d 100644 --- a/src/serialization/types/EnforcingStrategy.ts +++ b/src/serialization/types/EnforcingStrategy.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const EnforcingStrategy: core.serialization.Schema = core.serialization.enum_(["enforce_but_ignore_on_error", "enforce", "audit"]); +export const EnforcingStrategy: core.serialization.Schema< + serializers.EnforcingStrategy.Raw, + TrueFoundry.EnforcingStrategy +> = core.serialization.enum_(["enforce_but_ignore_on_error", "enforce", "audit"]); export declare namespace EnforcingStrategy { export type Raw = "enforce_but_ignore_on_error" | "enforce" | "audit"; diff --git a/src/serialization/types/EnkryptAiGuardrailConfig.ts b/src/serialization/types/EnkryptAiGuardrailConfig.ts index 6e0531e8..49a64bb9 100644 --- a/src/serialization/types/EnkryptAiGuardrailConfig.ts +++ b/src/serialization/types/EnkryptAiGuardrailConfig.ts @@ -1,23 +1,26 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { EnforcingStrategy } from "./EnforcingStrategy.js"; import { EnkryptAiGuardrailConfigConfig } from "./EnkryptAiGuardrailConfigConfig.js"; import { EnkryptAiGuardrailConfigOperation } from "./EnkryptAiGuardrailConfigOperation.js"; import { EnkryptAiKeyAuth } from "./EnkryptAiKeyAuth.js"; -export const EnkryptAiGuardrailConfig: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string().optional(), - "type": core.serialization.stringLiteral("integration/guardrail-config/enkrypt-ai"), - "authData": core.serialization.property("auth_data", EnkryptAiKeyAuth), - "operation": EnkryptAiGuardrailConfigOperation, - "priority": core.serialization.number().optional(), - "enforcingStrategy": core.serialization.property("enforcing_strategy", EnforcingStrategy), - "config": EnkryptAiGuardrailConfigConfig - }); +export const EnkryptAiGuardrailConfig: core.serialization.ObjectSchema< + serializers.EnkryptAiGuardrailConfig.Raw, + TrueFoundry.EnkryptAiGuardrailConfig +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + type: core.serialization.stringLiteral("integration/guardrail-config/enkrypt-ai"), + authData: core.serialization.property("auth_data", EnkryptAiKeyAuth), + operation: EnkryptAiGuardrailConfigOperation, + priority: core.serialization.number().optional(), + enforcingStrategy: core.serialization.property("enforcing_strategy", EnforcingStrategy), + config: EnkryptAiGuardrailConfigConfig, +}); export declare namespace EnkryptAiGuardrailConfig { export interface Raw { diff --git a/src/serialization/types/EnkryptAiGuardrailConfigConfig.ts b/src/serialization/types/EnkryptAiGuardrailConfigConfig.ts index 7ba47c85..0fc17e68 100644 --- a/src/serialization/types/EnkryptAiGuardrailConfigConfig.ts +++ b/src/serialization/types/EnkryptAiGuardrailConfigConfig.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const EnkryptAiGuardrailConfigConfig: core.serialization.ObjectSchema = core.serialization.object({ - "guardrailName": core.serialization.property("guardrail_name", core.serialization.string()) - }); +export const EnkryptAiGuardrailConfigConfig: core.serialization.ObjectSchema< + serializers.EnkryptAiGuardrailConfigConfig.Raw, + TrueFoundry.EnkryptAiGuardrailConfigConfig +> = core.serialization.object({ + guardrailName: core.serialization.property("guardrail_name", core.serialization.string()), +}); export declare namespace EnkryptAiGuardrailConfigConfig { export interface Raw { diff --git a/src/serialization/types/EnkryptAiGuardrailConfigOperation.ts b/src/serialization/types/EnkryptAiGuardrailConfigOperation.ts index de8bfbe6..61207a0e 100644 --- a/src/serialization/types/EnkryptAiGuardrailConfigOperation.ts +++ b/src/serialization/types/EnkryptAiGuardrailConfigOperation.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const EnkryptAiGuardrailConfigOperation: core.serialization.Schema = core.serialization.enum_(["validate", "mutate"]); +export const EnkryptAiGuardrailConfigOperation: core.serialization.Schema< + serializers.EnkryptAiGuardrailConfigOperation.Raw, + TrueFoundry.EnkryptAiGuardrailConfigOperation +> = core.serialization.enum_(["validate", "mutate"]); export declare namespace EnkryptAiGuardrailConfigOperation { export type Raw = "validate" | "mutate"; diff --git a/src/serialization/types/EnkryptAiKeyAuth.ts b/src/serialization/types/EnkryptAiKeyAuth.ts index 419a80f0..93fe23ad 100644 --- a/src/serialization/types/EnkryptAiKeyAuth.ts +++ b/src/serialization/types/EnkryptAiKeyAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const EnkryptAiKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) - }); +export const EnkryptAiKeyAuth: core.serialization.ObjectSchema< + serializers.EnkryptAiKeyAuth.Raw, + TrueFoundry.EnkryptAiKeyAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), +}); export declare namespace EnkryptAiKeyAuth { export interface Raw { diff --git a/src/serialization/types/Environment.ts b/src/serialization/types/Environment.ts index 4ef96387..4a1688f4 100644 --- a/src/serialization/types/Environment.ts +++ b/src/serialization/types/Environment.ts @@ -1,35 +1,36 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { EnvironmentColor } from "./EnvironmentColor.js"; import { EnvironmentManifest } from "./EnvironmentManifest.js"; import { EnvironmentOptimizeFor } from "./EnvironmentOptimizeFor.js"; import { Subject } from "./Subject.js"; -export const Environment: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string().optional(), - "priority": core.serialization.number().optional(), - "color": EnvironmentColor, - "tenantName": core.serialization.string(), - "createdBySubject": Subject, - "isProduction": core.serialization.boolean(), - "optimizeFor": EnvironmentOptimizeFor.optional(), - "manifest": EnvironmentManifest, - "createdBy": core.serialization.string().optional() +export const Environment: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string().optionalNullable(), + priority: core.serialization.number().optionalNullable(), + color: EnvironmentColor, + tenantName: core.serialization.string(), + createdBySubject: Subject, + isProduction: core.serialization.boolean(), + optimizeFor: EnvironmentOptimizeFor.optionalNullable(), + manifest: EnvironmentManifest, + createdBy: core.serialization.string().optionalNullable(), }); export declare namespace Environment { export interface Raw { - id?: string | null; - priority?: number | null; + id?: (string | null | undefined) | null; + priority?: (number | null | undefined) | null; color: EnvironmentColor.Raw; tenantName: string; createdBySubject: Subject.Raw; isProduction: boolean; - optimizeFor?: EnvironmentOptimizeFor.Raw | null; + optimizeFor?: (EnvironmentOptimizeFor.Raw | null | undefined) | null; manifest: EnvironmentManifest.Raw; - createdBy?: string | null; + createdBy?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/EnvironmentColor.ts b/src/serialization/types/EnvironmentColor.ts index 79bb0887..05b27009 100644 --- a/src/serialization/types/EnvironmentColor.ts +++ b/src/serialization/types/EnvironmentColor.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const EnvironmentColor: core.serialization.ObjectSchema = core.serialization.object({ - "colorHex": core.serialization.string().optional(), - "backgroundColorHex": core.serialization.string().optional(), - "color": core.serialization.string().optional(), - "backgroundColor": core.serialization.string().optional() - }); +export const EnvironmentColor: core.serialization.ObjectSchema< + serializers.EnvironmentColor.Raw, + TrueFoundry.EnvironmentColor +> = core.serialization.object({ + colorHex: core.serialization.string().optional(), + backgroundColorHex: core.serialization.string().optional(), + color: core.serialization.string().optional(), + backgroundColor: core.serialization.string().optional(), +}); export declare namespace EnvironmentColor { export interface Raw { diff --git a/src/serialization/types/EnvironmentManifest.ts b/src/serialization/types/EnvironmentManifest.ts index 5e610321..590aa17b 100644 --- a/src/serialization/types/EnvironmentManifest.ts +++ b/src/serialization/types/EnvironmentManifest.ts @@ -1,18 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { EnvironmentColor } from "./EnvironmentColor.js"; import { EnvironmentOptimizeFor } from "./EnvironmentOptimizeFor.js"; -export const EnvironmentManifest: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("environment"), - "name": core.serialization.string(), - "color": EnvironmentColor, - "isProduction": core.serialization.boolean(), - "optimizeFor": EnvironmentOptimizeFor - }); +export const EnvironmentManifest: core.serialization.ObjectSchema< + serializers.EnvironmentManifest.Raw, + TrueFoundry.EnvironmentManifest +> = core.serialization.object({ + type: core.serialization.stringLiteral("environment"), + name: core.serialization.string(), + color: EnvironmentColor, + isProduction: core.serialization.boolean(), + optimizeFor: EnvironmentOptimizeFor, +}); export declare namespace EnvironmentManifest { export interface Raw { diff --git a/src/serialization/types/EnvironmentOptimizeFor.ts b/src/serialization/types/EnvironmentOptimizeFor.ts index 3dd42256..2c80ab4b 100644 --- a/src/serialization/types/EnvironmentOptimizeFor.ts +++ b/src/serialization/types/EnvironmentOptimizeFor.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const EnvironmentOptimizeFor: core.serialization.Schema = core.serialization.enum_(["COST", "AVAILABILITY"]); +export const EnvironmentOptimizeFor: core.serialization.Schema< + serializers.EnvironmentOptimizeFor.Raw, + TrueFoundry.EnvironmentOptimizeFor +> = core.serialization.enum_(["COST", "AVAILABILITY"]); export declare namespace EnvironmentOptimizeFor { export type Raw = "COST" | "AVAILABILITY"; diff --git a/src/serialization/types/Event.ts b/src/serialization/types/Event.ts index c19044b0..62f1ba41 100644 --- a/src/serialization/types/Event.ts +++ b/src/serialization/types/Event.ts @@ -1,35 +1,36 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { EventChart } from "./EventChart.js"; import { EventInvolvedObject } from "./EventInvolvedObject.js"; -export const Event: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string().optional(), - "firstTimestamp": core.serialization.string().optional(), - "lastTimestamp": core.serialization.string(), - "involvedObject": EventInvolvedObject, - "type": core.serialization.string(), - "count": core.serialization.number(), - "reason": core.serialization.string(), - "message": core.serialization.string(), - "namespace": core.serialization.string().optional(), - "chart": EventChart +export const Event: core.serialization.ObjectSchema = + core.serialization.object({ + name: core.serialization.string().optionalNullable(), + firstTimestamp: core.serialization.string().optionalNullable(), + lastTimestamp: core.serialization.string(), + involvedObject: EventInvolvedObject, + type: core.serialization.string(), + count: core.serialization.number(), + reason: core.serialization.string(), + message: core.serialization.string(), + namespace: core.serialization.string().optionalNullable(), + chart: EventChart, }); export declare namespace Event { export interface Raw { - name?: string | null; - firstTimestamp?: string | null; + name?: (string | null | undefined) | null; + firstTimestamp?: (string | null | undefined) | null; lastTimestamp: string; involvedObject: EventInvolvedObject.Raw; type: string; count: number; reason: string; message: string; - namespace?: string | null; + namespace?: (string | null | undefined) | null; chart: EventChart.Raw; } } diff --git a/src/serialization/types/EventChart.ts b/src/serialization/types/EventChart.ts index 28454e47..4e9b50bb 100644 --- a/src/serialization/types/EventChart.ts +++ b/src/serialization/types/EventChart.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { EventChartCategory } from "./EventChartCategory.js"; -export const EventChart: core.serialization.ObjectSchema = core.serialization.object({ - "category": EventChartCategory +export const EventChart: core.serialization.ObjectSchema = + core.serialization.object({ + category: EventChartCategory, }); export declare namespace EventChart { diff --git a/src/serialization/types/EventChartCategory.ts b/src/serialization/types/EventChartCategory.ts index fb0d98e9..d9491f76 100644 --- a/src/serialization/types/EventChartCategory.ts +++ b/src/serialization/types/EventChartCategory.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const EventChartCategory: core.serialization.Schema = core.serialization.enum_(["ContainerTerminated", "ContainerOOM", "PodTerminated", "PodEvicted", "General"]); +export const EventChartCategory: core.serialization.Schema< + serializers.EventChartCategory.Raw, + TrueFoundry.EventChartCategory +> = core.serialization.enum_(["ContainerTerminated", "ContainerOOM", "PodTerminated", "PodEvicted", "General"]); export declare namespace EventChartCategory { export type Raw = "ContainerTerminated" | "ContainerOOM" | "PodTerminated" | "PodEvicted" | "General"; diff --git a/src/serialization/types/EventInvolvedObject.ts b/src/serialization/types/EventInvolvedObject.ts index b62ecb89..7cf8f045 100644 --- a/src/serialization/types/EventInvolvedObject.ts +++ b/src/serialization/types/EventInvolvedObject.ts @@ -1,23 +1,26 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const EventInvolvedObject: core.serialization.ObjectSchema = core.serialization.object({ - "kind": core.serialization.string(), - "name": core.serialization.string(), - "apiVersion": core.serialization.string().optional(), - "namespace": core.serialization.string().optional(), - "containerName": core.serialization.string().optional() - }); +export const EventInvolvedObject: core.serialization.ObjectSchema< + serializers.EventInvolvedObject.Raw, + TrueFoundry.EventInvolvedObject +> = core.serialization.object({ + kind: core.serialization.string(), + name: core.serialization.string(), + apiVersion: core.serialization.string().optionalNullable(), + namespace: core.serialization.string().optionalNullable(), + containerName: core.serialization.string().optionalNullable(), +}); export declare namespace EventInvolvedObject { export interface Raw { kind: string; name: string; - apiVersion?: string | null; - namespace?: string | null; - containerName?: string | null; + apiVersion?: (string | null | undefined) | null; + namespace?: (string | null | undefined) | null; + containerName?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/ExactMatchCacheConfig.ts b/src/serialization/types/ExactMatchCacheConfig.ts index 33cbfccf..39b68e92 100644 --- a/src/serialization/types/ExactMatchCacheConfig.ts +++ b/src/serialization/types/ExactMatchCacheConfig.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const ExactMatchCacheConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("exact-match"), - "namespace": core.serialization.string().optional(), - "ttl": core.serialization.number() - }); +export const ExactMatchCacheConfig: core.serialization.ObjectSchema< + serializers.ExactMatchCacheConfig.Raw, + TrueFoundry.ExactMatchCacheConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("exact-match"), + namespace: core.serialization.string().optional(), + ttl: core.serialization.number(), +}); export declare namespace ExactMatchCacheConfig { export interface Raw { diff --git a/src/serialization/types/ExternalBlobStorageSource.ts b/src/serialization/types/ExternalBlobStorageSource.ts index cf26f1f8..3f930851 100644 --- a/src/serialization/types/ExternalBlobStorageSource.ts +++ b/src/serialization/types/ExternalBlobStorageSource.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const ExternalBlobStorageSource: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("external"), - "uri": core.serialization.string() - }); +export const ExternalBlobStorageSource: core.serialization.ObjectSchema< + serializers.ExternalBlobStorageSource.Raw, + TrueFoundry.ExternalBlobStorageSource +> = core.serialization.object({ + type: core.serialization.stringLiteral("external"), + uri: core.serialization.string(), +}); export declare namespace ExternalBlobStorageSource { export interface Raw { diff --git a/src/serialization/types/ExternalIdentityProvider.ts b/src/serialization/types/ExternalIdentityProvider.ts new file mode 100644 index 00000000..3997d93d --- /dev/null +++ b/src/serialization/types/ExternalIdentityProvider.ts @@ -0,0 +1,33 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { Subject } from "./Subject.js"; + +export const ExternalIdentityProvider: core.serialization.ObjectSchema< + serializers.ExternalIdentityProvider.Raw, + TrueFoundry.ExternalIdentityProvider +> = core.serialization.object({ + id: core.serialization.string().optionalNullable(), + fqn: core.serialization.string(), + tenantName: core.serialization.string(), + manifest: core.serialization.record(core.serialization.string(), core.serialization.unknown()), + createdBySubject: Subject, + createdAt: core.serialization.date().optionalNullable(), + updatedAt: core.serialization.date().optionalNullable(), + accountId: core.serialization.string(), +}); + +export declare namespace ExternalIdentityProvider { + export interface Raw { + id?: (string | null | undefined) | null; + fqn: string; + tenantName: string; + manifest: Record; + createdBySubject: Subject.Raw; + createdAt?: (string | null | undefined) | null; + updatedAt?: (string | null | undefined) | null; + accountId: string; + } +} diff --git a/src/serialization/types/FastAiFramework.ts b/src/serialization/types/FastAiFramework.ts index c6cfb52d..a36bf088 100644 --- a/src/serialization/types/FastAiFramework.ts +++ b/src/serialization/types/FastAiFramework.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const FastAiFramework: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("fastai") - }); +export const FastAiFramework: core.serialization.ObjectSchema< + serializers.FastAiFramework.Raw, + TrueFoundry.FastAiFramework +> = core.serialization.object({ + type: core.serialization.stringLiteral("fastai"), +}); export declare namespace FastAiFramework { export interface Raw { diff --git a/src/serialization/types/FiddlerGuardType.ts b/src/serialization/types/FiddlerGuardType.ts index 37fee3af..ebf5d911 100644 --- a/src/serialization/types/FiddlerGuardType.ts +++ b/src/serialization/types/FiddlerGuardType.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const FiddlerGuardType: core.serialization.Schema = core.serialization.enum_(["fiddler-safety", "fiddler-response-faithfulness"]); +export const FiddlerGuardType: core.serialization.Schema< + serializers.FiddlerGuardType.Raw, + TrueFoundry.FiddlerGuardType +> = core.serialization.enum_(["fiddler-safety", "fiddler-response-faithfulness"]); export declare namespace FiddlerGuardType { export type Raw = "fiddler-safety" | "fiddler-response-faithfulness"; diff --git a/src/serialization/types/FiddlerGuardrailConfig.ts b/src/serialization/types/FiddlerGuardrailConfig.ts index 279e5f71..4c5b4476 100644 --- a/src/serialization/types/FiddlerGuardrailConfig.ts +++ b/src/serialization/types/FiddlerGuardrailConfig.ts @@ -1,21 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { EnforcingStrategy } from "./EnforcingStrategy.js"; import { FiddlerGuardrailConfigConfig } from "./FiddlerGuardrailConfigConfig.js"; import { FiddlerKeyAuth } from "./FiddlerKeyAuth.js"; -export const FiddlerGuardrailConfig: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string().optional(), - "type": core.serialization.stringLiteral("integration/guardrail-config/fiddler"), - "authData": core.serialization.property("auth_data", FiddlerKeyAuth), - "operation": core.serialization.stringLiteral("validate"), - "enforcingStrategy": core.serialization.property("enforcing_strategy", EnforcingStrategy), - "config": FiddlerGuardrailConfigConfig - }); +export const FiddlerGuardrailConfig: core.serialization.ObjectSchema< + serializers.FiddlerGuardrailConfig.Raw, + TrueFoundry.FiddlerGuardrailConfig +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + type: core.serialization.stringLiteral("integration/guardrail-config/fiddler"), + authData: core.serialization.property("auth_data", FiddlerKeyAuth), + operation: core.serialization.stringLiteral("validate"), + enforcingStrategy: core.serialization.property("enforcing_strategy", EnforcingStrategy), + config: FiddlerGuardrailConfigConfig, +}); export declare namespace FiddlerGuardrailConfig { export interface Raw { diff --git a/src/serialization/types/FiddlerGuardrailConfigConfig.ts b/src/serialization/types/FiddlerGuardrailConfigConfig.ts index 502300e8..697683f4 100644 --- a/src/serialization/types/FiddlerGuardrailConfigConfig.ts +++ b/src/serialization/types/FiddlerGuardrailConfigConfig.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { FiddlerGuardType } from "./FiddlerGuardType.js"; -export const FiddlerGuardrailConfigConfig: core.serialization.ObjectSchema = core.serialization.object({ - "guardType": core.serialization.property("guard_type", FiddlerGuardType), - "threshold": core.serialization.number().optional() - }); +export const FiddlerGuardrailConfigConfig: core.serialization.ObjectSchema< + serializers.FiddlerGuardrailConfigConfig.Raw, + TrueFoundry.FiddlerGuardrailConfigConfig +> = core.serialization.object({ + guardType: core.serialization.property("guard_type", FiddlerGuardType), + threshold: core.serialization.number().optional(), +}); export declare namespace FiddlerGuardrailConfigConfig { export interface Raw { diff --git a/src/serialization/types/FiddlerKeyAuth.ts b/src/serialization/types/FiddlerKeyAuth.ts index 4ee1367c..4c4963a8 100644 --- a/src/serialization/types/FiddlerKeyAuth.ts +++ b/src/serialization/types/FiddlerKeyAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const FiddlerKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) - }); +export const FiddlerKeyAuth: core.serialization.ObjectSchema< + serializers.FiddlerKeyAuth.Raw, + TrueFoundry.FiddlerKeyAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), +}); export declare namespace FiddlerKeyAuth { export interface Raw { diff --git a/src/serialization/types/FileInfo.ts b/src/serialization/types/FileInfo.ts index d2729f3e..d85b2340 100644 --- a/src/serialization/types/FileInfo.ts +++ b/src/serialization/types/FileInfo.ts @@ -1,23 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const FileInfo: core.serialization.ObjectSchema = core.serialization.object({ - "path": core.serialization.string(), - "isDir": core.serialization.property("is_dir", core.serialization.boolean()), - "fileSize": core.serialization.property("file_size", core.serialization.number().optional()), - "signedUrl": core.serialization.property("signed_url", core.serialization.string().optional()), - "lastModified": core.serialization.property("last_modified", core.serialization.date().optional()) +export const FileInfo: core.serialization.ObjectSchema = + core.serialization.object({ + path: core.serialization.string(), + isDir: core.serialization.property("is_dir", core.serialization.boolean()), + fileSize: core.serialization.property("file_size", core.serialization.number().optionalNullable()), + signedUrl: core.serialization.property("signed_url", core.serialization.string().optionalNullable()), + lastModified: core.serialization.property("last_modified", core.serialization.date().optionalNullable()), }); export declare namespace FileInfo { export interface Raw { path: string; is_dir: boolean; - file_size?: number | null; - signed_url?: string | null; - last_modified?: string | null; + file_size?: (number | null | undefined) | null; + signed_url?: (string | null | undefined) | null; + last_modified?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/FlyteLaunchPlan.ts b/src/serialization/types/FlyteLaunchPlan.ts index 57dc1bc9..6ac5f86a 100644 --- a/src/serialization/types/FlyteLaunchPlan.ts +++ b/src/serialization/types/FlyteLaunchPlan.ts @@ -1,16 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { FlyteLaunchPlanId } from "./FlyteLaunchPlanId.js"; import { FlyteLaunchPlanSpec } from "./FlyteLaunchPlanSpec.js"; -export const FlyteLaunchPlan: core.serialization.ObjectSchema = core.serialization.object({ - "id": FlyteLaunchPlanId, - "spec": FlyteLaunchPlanSpec, - "closure": core.serialization.unknown() - }); +export const FlyteLaunchPlan: core.serialization.ObjectSchema< + serializers.FlyteLaunchPlan.Raw, + TrueFoundry.FlyteLaunchPlan +> = core.serialization.object({ + id: FlyteLaunchPlanId, + spec: FlyteLaunchPlanSpec, + closure: core.serialization.unknown(), +}); export declare namespace FlyteLaunchPlan { export interface Raw { diff --git a/src/serialization/types/FlyteLaunchPlanId.ts b/src/serialization/types/FlyteLaunchPlanId.ts index 562372d4..1da9ed7e 100644 --- a/src/serialization/types/FlyteLaunchPlanId.ts +++ b/src/serialization/types/FlyteLaunchPlanId.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const FlyteLaunchPlanId: core.serialization.ObjectSchema = core.serialization.object({ - "resourceType": core.serialization.stringLiteral("LAUNCH_PLAN"), - "name": core.serialization.string() - }); +export const FlyteLaunchPlanId: core.serialization.ObjectSchema< + serializers.FlyteLaunchPlanId.Raw, + TrueFoundry.FlyteLaunchPlanId +> = core.serialization.object({ + resourceType: core.serialization.stringLiteral("LAUNCH_PLAN"), + name: core.serialization.string(), +}); export declare namespace FlyteLaunchPlanId { export interface Raw { diff --git a/src/serialization/types/FlyteLaunchPlanSpec.ts b/src/serialization/types/FlyteLaunchPlanSpec.ts index 612329bb..dfd4079e 100644 --- a/src/serialization/types/FlyteLaunchPlanSpec.ts +++ b/src/serialization/types/FlyteLaunchPlanSpec.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { FlyteWorkflowId } from "./FlyteWorkflowId.js"; -export const FlyteLaunchPlanSpec: core.serialization.ObjectSchema = core.serialization.object({ - "workflowId": FlyteWorkflowId - }); +export const FlyteLaunchPlanSpec: core.serialization.ObjectSchema< + serializers.FlyteLaunchPlanSpec.Raw, + TrueFoundry.FlyteLaunchPlanSpec +> = core.serialization.object({ + workflowId: FlyteWorkflowId, +}); export declare namespace FlyteLaunchPlanSpec { export interface Raw { diff --git a/src/serialization/types/FlyteTask.ts b/src/serialization/types/FlyteTask.ts index 22829a0a..89fced37 100644 --- a/src/serialization/types/FlyteTask.ts +++ b/src/serialization/types/FlyteTask.ts @@ -1,13 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { FlyteTaskTemplate } from "./FlyteTaskTemplate.js"; -export const FlyteTask: core.serialization.ObjectSchema = core.serialization.object({ - "template": FlyteTaskTemplate, - "description": core.serialization.unknown().optional() +export const FlyteTask: core.serialization.ObjectSchema = + core.serialization.object({ + template: FlyteTaskTemplate, + description: core.serialization.unknown().optional(), }); export declare namespace FlyteTask { diff --git a/src/serialization/types/FlyteTaskCustom.ts b/src/serialization/types/FlyteTaskCustom.ts index 0ee5fac3..faf7a5c1 100644 --- a/src/serialization/types/FlyteTaskCustom.ts +++ b/src/serialization/types/FlyteTaskCustom.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { FlyteTaskCustomTruefoundry } from "./FlyteTaskCustomTruefoundry.js"; -export const FlyteTaskCustom: core.serialization.ObjectSchema = core.serialization.object({ - "truefoundry": FlyteTaskCustomTruefoundry - }); +export const FlyteTaskCustom: core.serialization.ObjectSchema< + serializers.FlyteTaskCustom.Raw, + TrueFoundry.FlyteTaskCustom +> = core.serialization.object({ + truefoundry: FlyteTaskCustomTruefoundry, +}); export declare namespace FlyteTaskCustom { export interface Raw { diff --git a/src/serialization/types/FlyteTaskCustomTruefoundry.ts b/src/serialization/types/FlyteTaskCustomTruefoundry.ts index 4986662f..6dd25fa2 100644 --- a/src/serialization/types/FlyteTaskCustomTruefoundry.ts +++ b/src/serialization/types/FlyteTaskCustomTruefoundry.ts @@ -1,16 +1,30 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ContainerTaskConfig } from "./ContainerTaskConfig.js"; import { DatabricksJobTaskConfig } from "./DatabricksJobTaskConfig.js"; import { PySparkTaskConfig } from "./PySparkTaskConfig.js"; import { PythonTaskConfig } from "./PythonTaskConfig.js"; import { SnowflakeTaskConfig } from "./SnowflakeTaskConfig.js"; -export const FlyteTaskCustomTruefoundry: core.serialization.Schema = core.serialization.undiscriminatedUnion([PythonTaskConfig, ContainerTaskConfig, PySparkTaskConfig, DatabricksJobTaskConfig, SnowflakeTaskConfig]); +export const FlyteTaskCustomTruefoundry: core.serialization.Schema< + serializers.FlyteTaskCustomTruefoundry.Raw, + TrueFoundry.FlyteTaskCustomTruefoundry +> = core.serialization.undiscriminatedUnion([ + PythonTaskConfig, + ContainerTaskConfig, + PySparkTaskConfig, + DatabricksJobTaskConfig, + SnowflakeTaskConfig, +]); export declare namespace FlyteTaskCustomTruefoundry { - export type Raw = PythonTaskConfig.Raw | ContainerTaskConfig.Raw | PySparkTaskConfig.Raw | DatabricksJobTaskConfig.Raw | SnowflakeTaskConfig.Raw; + export type Raw = + | PythonTaskConfig.Raw + | ContainerTaskConfig.Raw + | PySparkTaskConfig.Raw + | DatabricksJobTaskConfig.Raw + | SnowflakeTaskConfig.Raw; } diff --git a/src/serialization/types/FlyteTaskId.ts b/src/serialization/types/FlyteTaskId.ts index 8b3a01b7..c39232b4 100644 --- a/src/serialization/types/FlyteTaskId.ts +++ b/src/serialization/types/FlyteTaskId.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const FlyteTaskId: core.serialization.ObjectSchema = core.serialization.object({ - "resourceType": core.serialization.stringLiteral("TASK"), - "name": core.serialization.string() +export const FlyteTaskId: core.serialization.ObjectSchema = + core.serialization.object({ + resourceType: core.serialization.stringLiteral("TASK"), + name: core.serialization.string(), }); export declare namespace FlyteTaskId { diff --git a/src/serialization/types/FlyteTaskTemplate.ts b/src/serialization/types/FlyteTaskTemplate.ts index 71e0cb9a..8907a72a 100644 --- a/src/serialization/types/FlyteTaskTemplate.ts +++ b/src/serialization/types/FlyteTaskTemplate.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { NativeSnowflakeFlyteTaskTemplate } from "./NativeSnowflakeFlyteTaskTemplate.js"; import { TruefoundryFlyteTaskTemplate } from "./TruefoundryFlyteTaskTemplate.js"; -export const FlyteTaskTemplate: core.serialization.Schema = core.serialization.undiscriminatedUnion([TruefoundryFlyteTaskTemplate, NativeSnowflakeFlyteTaskTemplate]); +export const FlyteTaskTemplate: core.serialization.Schema< + serializers.FlyteTaskTemplate.Raw, + TrueFoundry.FlyteTaskTemplate +> = core.serialization.undiscriminatedUnion([TruefoundryFlyteTaskTemplate, NativeSnowflakeFlyteTaskTemplate]); export declare namespace FlyteTaskTemplate { export type Raw = TruefoundryFlyteTaskTemplate.Raw | NativeSnowflakeFlyteTaskTemplate.Raw; diff --git a/src/serialization/types/FlyteWorkflow.ts b/src/serialization/types/FlyteWorkflow.ts index 4e989de2..df7c06bd 100644 --- a/src/serialization/types/FlyteWorkflow.ts +++ b/src/serialization/types/FlyteWorkflow.ts @@ -1,13 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { FlyteWorkflowTemplate } from "./FlyteWorkflowTemplate.js"; -export const FlyteWorkflow: core.serialization.ObjectSchema = core.serialization.object({ - "template": FlyteWorkflowTemplate, - "description": core.serialization.unknown().optional() +export const FlyteWorkflow: core.serialization.ObjectSchema = + core.serialization.object({ + template: FlyteWorkflowTemplate, + description: core.serialization.unknown().optional(), }); export declare namespace FlyteWorkflow { diff --git a/src/serialization/types/FlyteWorkflowId.ts b/src/serialization/types/FlyteWorkflowId.ts index 861b4d59..25329535 100644 --- a/src/serialization/types/FlyteWorkflowId.ts +++ b/src/serialization/types/FlyteWorkflowId.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const FlyteWorkflowId: core.serialization.ObjectSchema = core.serialization.object({ - "resourceType": core.serialization.stringLiteral("WORKFLOW"), - "name": core.serialization.string() - }); +export const FlyteWorkflowId: core.serialization.ObjectSchema< + serializers.FlyteWorkflowId.Raw, + TrueFoundry.FlyteWorkflowId +> = core.serialization.object({ + resourceType: core.serialization.stringLiteral("WORKFLOW"), + name: core.serialization.string(), +}); export declare namespace FlyteWorkflowId { export interface Raw { diff --git a/src/serialization/types/FlyteWorkflowTemplate.ts b/src/serialization/types/FlyteWorkflowTemplate.ts index c6e3fa58..d2d91ec3 100644 --- a/src/serialization/types/FlyteWorkflowTemplate.ts +++ b/src/serialization/types/FlyteWorkflowTemplate.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { FlyteWorkflowId } from "./FlyteWorkflowId.js"; -export const FlyteWorkflowTemplate: core.serialization.ObjectSchema = core.serialization.object({ - "id": FlyteWorkflowId - }); +export const FlyteWorkflowTemplate: core.serialization.ObjectSchema< + serializers.FlyteWorkflowTemplate.Raw, + TrueFoundry.FlyteWorkflowTemplate +> = core.serialization.object({ + id: FlyteWorkflowId, +}); export declare namespace FlyteWorkflowTemplate { export interface Raw { diff --git a/src/serialization/types/ForwardAction.ts b/src/serialization/types/ForwardAction.ts index ca362da7..0161a473 100644 --- a/src/serialization/types/ForwardAction.ts +++ b/src/serialization/types/ForwardAction.ts @@ -1,13 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const ForwardAction: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("forward"), - "serviceUri": core.serialization.property("service_uri", core.serialization.string()), - "port": core.serialization.number() +export const ForwardAction: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("forward"), + serviceUri: core.serialization.property("service_uri", core.serialization.string()), + port: core.serialization.number(), }); export declare namespace ForwardAction { diff --git a/src/serialization/types/Function.ts b/src/serialization/types/Function.ts index cfdcb0f2..b50a5548 100644 --- a/src/serialization/types/Function.ts +++ b/src/serialization/types/Function.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const Function: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "arguments": core.serialization.string() +export const Function: core.serialization.ObjectSchema = + core.serialization.object({ + name: core.serialization.string(), + arguments: core.serialization.string(), }); export declare namespace Function { diff --git a/src/serialization/types/FunctionSchema.ts b/src/serialization/types/FunctionSchema.ts index b46e1f9f..1e26dd01 100644 --- a/src/serialization/types/FunctionSchema.ts +++ b/src/serialization/types/FunctionSchema.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const FunctionSchema: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string().optional(), - "parameters": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - "strict": core.serialization.boolean().optional() - }); +export const FunctionSchema: core.serialization.ObjectSchema< + serializers.FunctionSchema.Raw, + TrueFoundry.FunctionSchema +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + parameters: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + strict: core.serialization.boolean().optional(), +}); export declare namespace FunctionSchema { export interface Raw { diff --git a/src/serialization/types/GatewayBudget.ts b/src/serialization/types/GatewayBudget.ts new file mode 100644 index 00000000..73a08dcc --- /dev/null +++ b/src/serialization/types/GatewayBudget.ts @@ -0,0 +1,32 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { GatewayBudgetManifest } from "./GatewayBudgetManifest.js"; +import { Subject } from "./Subject.js"; + +export const GatewayBudget: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string().optionalNullable(), + tenantName: core.serialization.string(), + name: core.serialization.string(), + type: core.serialization.string(), + manifest: GatewayBudgetManifest, + createdBySubject: Subject, + createdAt: core.serialization.date().optionalNullable(), + updatedAt: core.serialization.date().optionalNullable(), + }); + +export declare namespace GatewayBudget { + export interface Raw { + id?: (string | null | undefined) | null; + tenantName: string; + name: string; + type: string; + manifest: GatewayBudgetManifest.Raw; + createdBySubject: Subject.Raw; + createdAt?: (string | null | undefined) | null; + updatedAt?: (string | null | undefined) | null; + } +} diff --git a/src/serialization/types/GatewayBudgetManifest.ts b/src/serialization/types/GatewayBudgetManifest.ts new file mode 100644 index 00000000..79856c89 --- /dev/null +++ b/src/serialization/types/GatewayBudgetManifest.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { TeamBudgetConfig } from "./TeamBudgetConfig.js"; +import { TenantBudgetConfig } from "./TenantBudgetConfig.js"; + +export const GatewayBudgetManifest: core.serialization.Schema< + serializers.GatewayBudgetManifest.Raw, + TrueFoundry.GatewayBudgetManifest +> = core.serialization.undiscriminatedUnion([TenantBudgetConfig, TeamBudgetConfig]); + +export declare namespace GatewayBudgetManifest { + export type Raw = TenantBudgetConfig.Raw | TeamBudgetConfig.Raw; +} diff --git a/src/serialization/types/GatewayConfig.ts b/src/serialization/types/GatewayConfig.ts index 7a99fe0b..1637d827 100644 --- a/src/serialization/types/GatewayConfig.ts +++ b/src/serialization/types/GatewayConfig.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BudgetConfig } from "./BudgetConfig.js"; import { GatewayDataAccessConfig } from "./GatewayDataAccessConfig.js"; import { GatewayDataRoutingConfig } from "./GatewayDataRoutingConfig.js"; @@ -16,8 +16,34 @@ import { RateLimitConfig } from "./RateLimitConfig.js"; import { TeamBudgetConfig } from "./TeamBudgetConfig.js"; import { TenantBudgetConfig } from "./TenantBudgetConfig.js"; -export const GatewayConfig: core.serialization.Schema = core.serialization.undiscriminatedUnion([RateLimitConfig, LoadBalancingConfig, GuardrailsConfig, BudgetConfig, TenantBudgetConfig, TeamBudgetConfig, GatewayOtelConfig, GatewayMetadataConfig, GatewayLoggingConfig, GlobalSettings, GatewayDataAccessConfig, GatewayDataRoutingConfig]); +export const GatewayConfig: core.serialization.Schema = + core.serialization.undiscriminatedUnion([ + RateLimitConfig, + LoadBalancingConfig, + GuardrailsConfig, + BudgetConfig, + TenantBudgetConfig, + TeamBudgetConfig, + GatewayOtelConfig, + GatewayMetadataConfig, + GlobalSettings, + GatewayDataAccessConfig, + GatewayDataRoutingConfig, + GatewayLoggingConfig, + ]); export declare namespace GatewayConfig { - export type Raw = RateLimitConfig.Raw | LoadBalancingConfig.Raw | GuardrailsConfig.Raw | BudgetConfig.Raw | TenantBudgetConfig.Raw | TeamBudgetConfig.Raw | GatewayOtelConfig.Raw | GatewayMetadataConfig.Raw | GatewayLoggingConfig.Raw | GlobalSettings.Raw | GatewayDataAccessConfig.Raw | GatewayDataRoutingConfig.Raw; + export type Raw = + | RateLimitConfig.Raw + | LoadBalancingConfig.Raw + | GuardrailsConfig.Raw + | BudgetConfig.Raw + | TenantBudgetConfig.Raw + | TeamBudgetConfig.Raw + | GatewayOtelConfig.Raw + | GatewayMetadataConfig.Raw + | GlobalSettings.Raw + | GatewayDataAccessConfig.Raw + | GatewayDataRoutingConfig.Raw + | GatewayLoggingConfig.Raw; } diff --git a/src/serialization/types/GatewayConfiguration.ts b/src/serialization/types/GatewayConfiguration.ts index 1a6fcdde..a0bd890b 100644 --- a/src/serialization/types/GatewayConfiguration.ts +++ b/src/serialization/types/GatewayConfiguration.ts @@ -1,29 +1,32 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Config } from "./Config.js"; import { Subject } from "./Subject.js"; -export const GatewayConfiguration: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string().optional(), - "tenantName": core.serialization.string(), - "type": core.serialization.string(), - "manifest": Config, - "createdBySubject": Subject, - "createdAt": core.serialization.date().optional(), - "updatedAt": core.serialization.date().optional() - }); +export const GatewayConfiguration: core.serialization.ObjectSchema< + serializers.GatewayConfiguration.Raw, + TrueFoundry.GatewayConfiguration +> = core.serialization.object({ + id: core.serialization.string().optionalNullable(), + tenantName: core.serialization.string(), + type: core.serialization.string(), + manifest: Config, + createdBySubject: Subject, + createdAt: core.serialization.date().optionalNullable(), + updatedAt: core.serialization.date().optionalNullable(), +}); export declare namespace GatewayConfiguration { export interface Raw { - id?: string | null; + id?: (string | null | undefined) | null; tenantName: string; type: string; manifest: Config.Raw; createdBySubject: Subject.Raw; - createdAt?: string | null; - updatedAt?: string | null; + createdAt?: (string | null | undefined) | null; + updatedAt?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/GatewayDataAccessConfig.ts b/src/serialization/types/GatewayDataAccessConfig.ts index 038ec902..247d6aac 100644 --- a/src/serialization/types/GatewayDataAccessConfig.ts +++ b/src/serialization/types/GatewayDataAccessConfig.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { DataAccessRule } from "./DataAccessRule.js"; -export const GatewayDataAccessConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("gateway-data-access-config"), - "rules": core.serialization.list(DataAccessRule) - }); +export const GatewayDataAccessConfig: core.serialization.ObjectSchema< + serializers.GatewayDataAccessConfig.Raw, + TrueFoundry.GatewayDataAccessConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("gateway-data-access-config"), + rules: core.serialization.list(DataAccessRule), +}); export declare namespace GatewayDataAccessConfig { export interface Raw { diff --git a/src/serialization/types/GatewayDataCreatedByFilter.ts b/src/serialization/types/GatewayDataCreatedByFilter.ts index 68e9e0c7..6d02cf3f 100644 --- a/src/serialization/types/GatewayDataCreatedByFilter.ts +++ b/src/serialization/types/GatewayDataCreatedByFilter.ts @@ -1,19 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; +import { GatewayDataCreatedByFilterOperator } from "./GatewayDataCreatedByFilterOperator.js"; -export const GatewayDataCreatedByFilter: core.serialization.ObjectSchema = core.serialization.object({ - "field": core.serialization.stringLiteral("created_by"), - "operator": core.serialization.stringLiteral("IN"), - "value": core.serialization.list(core.serialization.string()) - }); +export const GatewayDataCreatedByFilter: core.serialization.ObjectSchema< + serializers.GatewayDataCreatedByFilter.Raw, + TrueFoundry.GatewayDataCreatedByFilter +> = core.serialization.object({ + field: core.serialization.stringLiteral("created_by"), + operator: GatewayDataCreatedByFilterOperator, + value: core.serialization.list(core.serialization.string()), +}); export declare namespace GatewayDataCreatedByFilter { export interface Raw { field: "created_by"; - operator: "IN"; + operator: GatewayDataCreatedByFilterOperator.Raw; value: string[]; } } diff --git a/src/serialization/types/GatewayDataCreatedByFilterOperator.ts b/src/serialization/types/GatewayDataCreatedByFilterOperator.ts new file mode 100644 index 00000000..961ed216 --- /dev/null +++ b/src/serialization/types/GatewayDataCreatedByFilterOperator.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const GatewayDataCreatedByFilterOperator: core.serialization.Schema< + serializers.GatewayDataCreatedByFilterOperator.Raw, + TrueFoundry.GatewayDataCreatedByFilterOperator +> = core.serialization.enum_(["IN", "NOT_IN"]); + +export declare namespace GatewayDataCreatedByFilterOperator { + export type Raw = "IN" | "NOT_IN"; +} diff --git a/src/serialization/types/GatewayDataMetadataFilter.ts b/src/serialization/types/GatewayDataMetadataFilter.ts index bd1c5ee4..4adfd352 100644 --- a/src/serialization/types/GatewayDataMetadataFilter.ts +++ b/src/serialization/types/GatewayDataMetadataFilter.ts @@ -1,21 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; +import { GatewayDataMetadataFilterOperator } from "./GatewayDataMetadataFilterOperator.js"; -export const GatewayDataMetadataFilter: core.serialization.ObjectSchema = core.serialization.object({ - "field": core.serialization.stringLiteral("metadata"), - "key": core.serialization.string(), - "operator": core.serialization.stringLiteral("IN"), - "value": core.serialization.list(core.serialization.string()) - }); +export const GatewayDataMetadataFilter: core.serialization.ObjectSchema< + serializers.GatewayDataMetadataFilter.Raw, + TrueFoundry.GatewayDataMetadataFilter +> = core.serialization.object({ + field: core.serialization.stringLiteral("metadata"), + key: core.serialization.string(), + operator: GatewayDataMetadataFilterOperator, + value: core.serialization.list(core.serialization.string()), +}); export declare namespace GatewayDataMetadataFilter { export interface Raw { field: "metadata"; key: string; - operator: "IN"; + operator: GatewayDataMetadataFilterOperator.Raw; value: string[]; } } diff --git a/src/serialization/types/GatewayDataMetadataFilterOperator.ts b/src/serialization/types/GatewayDataMetadataFilterOperator.ts new file mode 100644 index 00000000..530f4d57 --- /dev/null +++ b/src/serialization/types/GatewayDataMetadataFilterOperator.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const GatewayDataMetadataFilterOperator: core.serialization.Schema< + serializers.GatewayDataMetadataFilterOperator.Raw, + TrueFoundry.GatewayDataMetadataFilterOperator +> = core.serialization.enum_(["IN", "NOT_IN"]); + +export declare namespace GatewayDataMetadataFilterOperator { + export type Raw = "IN" | "NOT_IN"; +} diff --git a/src/serialization/types/GatewayDataRoutingConfig.ts b/src/serialization/types/GatewayDataRoutingConfig.ts index 6049dc9b..e42e7dab 100644 --- a/src/serialization/types/GatewayDataRoutingConfig.ts +++ b/src/serialization/types/GatewayDataRoutingConfig.ts @@ -1,21 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GatewayDataRoutingConfigDestination } from "./GatewayDataRoutingConfigDestination.js"; import { GatewayDataRoutingConfigDestinationStorage } from "./GatewayDataRoutingConfigDestinationStorage.js"; -export const GatewayDataRoutingConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("gateway-data-routing-config"), - "destinations": core.serialization.list(GatewayDataRoutingConfigDestination).optional(), - "default": GatewayDataRoutingConfigDestinationStorage - }); +export const GatewayDataRoutingConfig: core.serialization.ObjectSchema< + serializers.GatewayDataRoutingConfig.Raw, + TrueFoundry.GatewayDataRoutingConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("gateway-data-routing-config"), + destinations: core.serialization.list(GatewayDataRoutingConfigDestination).optional(), + default: GatewayDataRoutingConfigDestinationStorage, +}); export declare namespace GatewayDataRoutingConfig { export interface Raw { type: "gateway-data-routing-config"; destinations?: GatewayDataRoutingConfigDestination.Raw[] | null; - "default": GatewayDataRoutingConfigDestinationStorage.Raw; + default: GatewayDataRoutingConfigDestinationStorage.Raw; } } diff --git a/src/serialization/types/GatewayDataRoutingConfigDestination.ts b/src/serialization/types/GatewayDataRoutingConfigDestination.ts index 0cbc1dc7..626babaf 100644 --- a/src/serialization/types/GatewayDataRoutingConfigDestination.ts +++ b/src/serialization/types/GatewayDataRoutingConfigDestination.ts @@ -1,17 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GatewayDataRoutingConfigDestinationCondition } from "./GatewayDataRoutingConfigDestinationCondition.js"; import { GatewayDataRoutingConfigDestinationStorage } from "./GatewayDataRoutingConfigDestinationStorage.js"; -export const GatewayDataRoutingConfigDestination: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "enabled": core.serialization.boolean(), - "description": core.serialization.string().optional(), - "when": core.serialization.list(GatewayDataRoutingConfigDestinationCondition) - }).extend(GatewayDataRoutingConfigDestinationStorage); +export const GatewayDataRoutingConfigDestination: core.serialization.ObjectSchema< + serializers.GatewayDataRoutingConfigDestination.Raw, + TrueFoundry.GatewayDataRoutingConfigDestination +> = core.serialization + .object({ + name: core.serialization.string(), + enabled: core.serialization.boolean(), + description: core.serialization.string().optional(), + when: core.serialization.list(GatewayDataRoutingConfigDestinationCondition), + }) + .extend(GatewayDataRoutingConfigDestinationStorage); export declare namespace GatewayDataRoutingConfigDestination { export interface Raw extends GatewayDataRoutingConfigDestinationStorage.Raw { diff --git a/src/serialization/types/GatewayDataRoutingConfigDestinationCondition.ts b/src/serialization/types/GatewayDataRoutingConfigDestinationCondition.ts index 8a8140b6..b5aeeaf6 100644 --- a/src/serialization/types/GatewayDataRoutingConfigDestinationCondition.ts +++ b/src/serialization/types/GatewayDataRoutingConfigDestinationCondition.ts @@ -1,13 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GatewayDataRoutingConfigDestinationCreatedByCondition } from "./GatewayDataRoutingConfigDestinationCreatedByCondition.js"; import { GatewayDataRoutingConfigDestinationMetadataCondition } from "./GatewayDataRoutingConfigDestinationMetadataCondition.js"; -export const GatewayDataRoutingConfigDestinationCondition: core.serialization.Schema = core.serialization.undiscriminatedUnion([GatewayDataRoutingConfigDestinationMetadataCondition, GatewayDataRoutingConfigDestinationCreatedByCondition]); +export const GatewayDataRoutingConfigDestinationCondition: core.serialization.Schema< + serializers.GatewayDataRoutingConfigDestinationCondition.Raw, + TrueFoundry.GatewayDataRoutingConfigDestinationCondition +> = core.serialization.undiscriminatedUnion([ + GatewayDataRoutingConfigDestinationMetadataCondition, + GatewayDataRoutingConfigDestinationCreatedByCondition, +]); export declare namespace GatewayDataRoutingConfigDestinationCondition { - export type Raw = GatewayDataRoutingConfigDestinationMetadataCondition.Raw | GatewayDataRoutingConfigDestinationCreatedByCondition.Raw; + export type Raw = + | GatewayDataRoutingConfigDestinationMetadataCondition.Raw + | GatewayDataRoutingConfigDestinationCreatedByCondition.Raw; } diff --git a/src/serialization/types/GatewayDataRoutingConfigDestinationControlPlaneManagedStorage.ts b/src/serialization/types/GatewayDataRoutingConfigDestinationControlPlaneManagedStorage.ts index 32737e23..c4d6a9ec 100644 --- a/src/serialization/types/GatewayDataRoutingConfigDestinationControlPlaneManagedStorage.ts +++ b/src/serialization/types/GatewayDataRoutingConfigDestinationControlPlaneManagedStorage.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GatewayDataRoutingConfigDestinationControlPlaneManagedStorageRegion } from "./GatewayDataRoutingConfigDestinationControlPlaneManagedStorageRegion.js"; -export const GatewayDataRoutingConfigDestinationControlPlaneManagedStorage: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("controlplane-managed"), - "region": GatewayDataRoutingConfigDestinationControlPlaneManagedStorageRegion.optional() - }); +export const GatewayDataRoutingConfigDestinationControlPlaneManagedStorage: core.serialization.ObjectSchema< + serializers.GatewayDataRoutingConfigDestinationControlPlaneManagedStorage.Raw, + TrueFoundry.GatewayDataRoutingConfigDestinationControlPlaneManagedStorage +> = core.serialization.object({ + type: core.serialization.stringLiteral("controlplane-managed"), + region: GatewayDataRoutingConfigDestinationControlPlaneManagedStorageRegion.optional(), +}); export declare namespace GatewayDataRoutingConfigDestinationControlPlaneManagedStorage { export interface Raw { diff --git a/src/serialization/types/GatewayDataRoutingConfigDestinationControlPlaneManagedStorageRegion.ts b/src/serialization/types/GatewayDataRoutingConfigDestinationControlPlaneManagedStorageRegion.ts index a3c6be00..be1af082 100644 --- a/src/serialization/types/GatewayDataRoutingConfigDestinationControlPlaneManagedStorageRegion.ts +++ b/src/serialization/types/GatewayDataRoutingConfigDestinationControlPlaneManagedStorageRegion.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const GatewayDataRoutingConfigDestinationControlPlaneManagedStorageRegion: core.serialization.Schema = core.serialization.enum_(["us", "australia", "india"]); +export const GatewayDataRoutingConfigDestinationControlPlaneManagedStorageRegion: core.serialization.Schema< + serializers.GatewayDataRoutingConfigDestinationControlPlaneManagedStorageRegion.Raw, + TrueFoundry.GatewayDataRoutingConfigDestinationControlPlaneManagedStorageRegion +> = core.serialization.enum_(["us", "australia", "india"]); export declare namespace GatewayDataRoutingConfigDestinationControlPlaneManagedStorageRegion { export type Raw = "us" | "australia" | "india"; diff --git a/src/serialization/types/GatewayDataRoutingConfigDestinationCreatedByCondition.ts b/src/serialization/types/GatewayDataRoutingConfigDestinationCreatedByCondition.ts index eccd35dc..a897da75 100644 --- a/src/serialization/types/GatewayDataRoutingConfigDestinationCreatedByCondition.ts +++ b/src/serialization/types/GatewayDataRoutingConfigDestinationCreatedByCondition.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const GatewayDataRoutingConfigDestinationCreatedByCondition: core.serialization.ObjectSchema = core.serialization.object({ - "field": core.serialization.stringLiteral("created_by"), - "operator": core.serialization.stringLiteral("IN"), - "value": core.serialization.list(core.serialization.string()) - }); +export const GatewayDataRoutingConfigDestinationCreatedByCondition: core.serialization.ObjectSchema< + serializers.GatewayDataRoutingConfigDestinationCreatedByCondition.Raw, + TrueFoundry.GatewayDataRoutingConfigDestinationCreatedByCondition +> = core.serialization.object({ + field: core.serialization.stringLiteral("created_by"), + operator: core.serialization.stringLiteral("IN"), + value: core.serialization.list(core.serialization.string()), +}); export declare namespace GatewayDataRoutingConfigDestinationCreatedByCondition { export interface Raw { diff --git a/src/serialization/types/GatewayDataRoutingConfigDestinationCustomerManagedStorage.ts b/src/serialization/types/GatewayDataRoutingConfigDestinationCustomerManagedStorage.ts index 50d164c5..30231a32 100644 --- a/src/serialization/types/GatewayDataRoutingConfigDestinationCustomerManagedStorage.ts +++ b/src/serialization/types/GatewayDataRoutingConfigDestinationCustomerManagedStorage.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const GatewayDataRoutingConfigDestinationCustomerManagedStorage: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("customer-managed"), - "storageIntegrationFqn": core.serialization.property("storage_integration_fqn", core.serialization.string()) - }); +export const GatewayDataRoutingConfigDestinationCustomerManagedStorage: core.serialization.ObjectSchema< + serializers.GatewayDataRoutingConfigDestinationCustomerManagedStorage.Raw, + TrueFoundry.GatewayDataRoutingConfigDestinationCustomerManagedStorage +> = core.serialization.object({ + type: core.serialization.stringLiteral("customer-managed"), + storageIntegrationFqn: core.serialization.property("storage_integration_fqn", core.serialization.string()), +}); export declare namespace GatewayDataRoutingConfigDestinationCustomerManagedStorage { export interface Raw { diff --git a/src/serialization/types/GatewayDataRoutingConfigDestinationMetadataCondition.ts b/src/serialization/types/GatewayDataRoutingConfigDestinationMetadataCondition.ts index a825f460..0ec6b7d2 100644 --- a/src/serialization/types/GatewayDataRoutingConfigDestinationMetadataCondition.ts +++ b/src/serialization/types/GatewayDataRoutingConfigDestinationMetadataCondition.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const GatewayDataRoutingConfigDestinationMetadataCondition: core.serialization.ObjectSchema = core.serialization.object({ - "field": core.serialization.stringLiteral("metadata"), - "key": core.serialization.string(), - "operator": core.serialization.stringLiteral("IN"), - "value": core.serialization.list(core.serialization.string()) - }); +export const GatewayDataRoutingConfigDestinationMetadataCondition: core.serialization.ObjectSchema< + serializers.GatewayDataRoutingConfigDestinationMetadataCondition.Raw, + TrueFoundry.GatewayDataRoutingConfigDestinationMetadataCondition +> = core.serialization.object({ + field: core.serialization.stringLiteral("metadata"), + key: core.serialization.string(), + operator: core.serialization.stringLiteral("IN"), + value: core.serialization.list(core.serialization.string()), +}); export declare namespace GatewayDataRoutingConfigDestinationMetadataCondition { export interface Raw { diff --git a/src/serialization/types/GatewayDataRoutingConfigDestinationStorage.ts b/src/serialization/types/GatewayDataRoutingConfigDestinationStorage.ts index b850fabf..51830ce2 100644 --- a/src/serialization/types/GatewayDataRoutingConfigDestinationStorage.ts +++ b/src/serialization/types/GatewayDataRoutingConfigDestinationStorage.ts @@ -1,14 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GatewayDataRoutingConfigDestinationStorageStorage } from "./GatewayDataRoutingConfigDestinationStorageStorage.js"; -export const GatewayDataRoutingConfigDestinationStorage: core.serialization.ObjectSchema = core.serialization.object({ - "storage": GatewayDataRoutingConfigDestinationStorageStorage, - "tracesRetentionPeriodDays": core.serialization.property("traces_retention_period_days", core.serialization.number().optional()) - }); +export const GatewayDataRoutingConfigDestinationStorage: core.serialization.ObjectSchema< + serializers.GatewayDataRoutingConfigDestinationStorage.Raw, + TrueFoundry.GatewayDataRoutingConfigDestinationStorage +> = core.serialization.object({ + storage: GatewayDataRoutingConfigDestinationStorageStorage, + tracesRetentionPeriodDays: core.serialization.property( + "traces_retention_period_days", + core.serialization.number().optional(), + ), +}); export declare namespace GatewayDataRoutingConfigDestinationStorage { export interface Raw { diff --git a/src/serialization/types/GatewayDataRoutingConfigDestinationStorageStorage.ts b/src/serialization/types/GatewayDataRoutingConfigDestinationStorageStorage.ts index a72e9502..9559f864 100644 --- a/src/serialization/types/GatewayDataRoutingConfigDestinationStorageStorage.ts +++ b/src/serialization/types/GatewayDataRoutingConfigDestinationStorageStorage.ts @@ -1,13 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GatewayDataRoutingConfigDestinationControlPlaneManagedStorage } from "./GatewayDataRoutingConfigDestinationControlPlaneManagedStorage.js"; import { GatewayDataRoutingConfigDestinationCustomerManagedStorage } from "./GatewayDataRoutingConfigDestinationCustomerManagedStorage.js"; -export const GatewayDataRoutingConfigDestinationStorageStorage: core.serialization.Schema = core.serialization.undiscriminatedUnion([GatewayDataRoutingConfigDestinationControlPlaneManagedStorage, GatewayDataRoutingConfigDestinationCustomerManagedStorage]); +export const GatewayDataRoutingConfigDestinationStorageStorage: core.serialization.Schema< + serializers.GatewayDataRoutingConfigDestinationStorageStorage.Raw, + TrueFoundry.GatewayDataRoutingConfigDestinationStorageStorage +> = core.serialization.undiscriminatedUnion([ + GatewayDataRoutingConfigDestinationControlPlaneManagedStorage, + GatewayDataRoutingConfigDestinationCustomerManagedStorage, +]); export declare namespace GatewayDataRoutingConfigDestinationStorageStorage { - export type Raw = GatewayDataRoutingConfigDestinationControlPlaneManagedStorage.Raw | GatewayDataRoutingConfigDestinationCustomerManagedStorage.Raw; + export type Raw = + | GatewayDataRoutingConfigDestinationControlPlaneManagedStorage.Raw + | GatewayDataRoutingConfigDestinationCustomerManagedStorage.Raw; } diff --git a/src/serialization/types/GatewayDataType.ts b/src/serialization/types/GatewayDataType.ts index f60c0d70..05a72928 100644 --- a/src/serialization/types/GatewayDataType.ts +++ b/src/serialization/types/GatewayDataType.ts @@ -1,10 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const GatewayDataType: core.serialization.Schema = core.serialization.enum_(["traces", "metrics"]); +export const GatewayDataType: core.serialization.Schema = + core.serialization.enum_(["traces", "metrics"]); export declare namespace GatewayDataType { export type Raw = "traces" | "metrics"; diff --git a/src/serialization/types/GatewayInstallation.ts b/src/serialization/types/GatewayInstallation.ts new file mode 100644 index 00000000..4a833fd2 --- /dev/null +++ b/src/serialization/types/GatewayInstallation.ts @@ -0,0 +1,37 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { Subject } from "./Subject.js"; + +export const GatewayInstallation: core.serialization.ObjectSchema< + serializers.GatewayInstallation.Raw, + TrueFoundry.GatewayInstallation +> = core.serialization.object({ + id: core.serialization.string(), + serviceAccountId: core.serialization.string().optionalNullable(), + manifest: core.serialization.record(core.serialization.string(), core.serialization.unknown()), + enabled: core.serialization.boolean(), + tenantName: core.serialization.string(), + createdBySubject: Subject.optionalNullable(), + createdAt: core.serialization.date(), + updatedAt: core.serialization.date(), + isDefault: core.serialization.boolean(), + createdBy: core.serialization.string().optionalNullable(), +}); + +export declare namespace GatewayInstallation { + export interface Raw { + id: string; + serviceAccountId?: (string | null | undefined) | null; + manifest: Record; + enabled: boolean; + tenantName: string; + createdBySubject?: (Subject.Raw | null | undefined) | null; + createdAt: string; + updatedAt: string; + isDefault: boolean; + createdBy?: (string | null | undefined) | null; + } +} diff --git a/src/serialization/types/GatewayLoggingConfig.ts b/src/serialization/types/GatewayLoggingConfig.ts index 1a413e71..e830d9a8 100644 --- a/src/serialization/types/GatewayLoggingConfig.ts +++ b/src/serialization/types/GatewayLoggingConfig.ts @@ -1,20 +1,28 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; -import { GatewayLoggingRule } from "./GatewayLoggingRule.js"; +import type * as serializers from "../index.js"; +import { LoggingWhen } from "./LoggingWhen.js"; +import { Redaction } from "./Redaction.js"; -export const GatewayLoggingConfig: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "type": core.serialization.stringLiteral("gateway-logging-config"), - "rules": core.serialization.list(GatewayLoggingRule) - }); +export const GatewayLoggingConfig: core.serialization.ObjectSchema< + serializers.GatewayLoggingConfig.Raw, + TrueFoundry.GatewayLoggingConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("gateway-logging-config"), + name: core.serialization.string(), + when: LoggingWhen.optional(), + log: core.serialization.boolean(), + redactWith: core.serialization.property("redact_with", Redaction.optional()), +}); export declare namespace GatewayLoggingConfig { export interface Raw { - name: string; type: "gateway-logging-config"; - rules: GatewayLoggingRule.Raw[]; + name: string; + when?: LoggingWhen.Raw | null; + log: boolean; + redact_with?: Redaction.Raw | null; } } diff --git a/src/serialization/types/GatewayLoggingRule.ts b/src/serialization/types/GatewayLoggingRule.ts deleted file mode 100644 index 4e91fbf0..00000000 --- a/src/serialization/types/GatewayLoggingRule.ts +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; -import { GatewayLoggingWhen } from "./GatewayLoggingWhen.js"; - -export const GatewayLoggingRule: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string(), - "when": GatewayLoggingWhen, - "tracingProjectFqn": core.serialization.property("tracing_project_fqn", core.serialization.string()) - }); - -export declare namespace GatewayLoggingRule { - export interface Raw { - id: string; - when: GatewayLoggingWhen.Raw; - tracing_project_fqn: string; - } -} diff --git a/src/serialization/types/GatewayLoggingWhen.ts b/src/serialization/types/GatewayLoggingWhen.ts deleted file mode 100644 index 8de8d6f2..00000000 --- a/src/serialization/types/GatewayLoggingWhen.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; - -export const GatewayLoggingWhen: core.serialization.ObjectSchema = core.serialization.object({ - "subjects": core.serialization.list(core.serialization.string()).optional() - }); - -export declare namespace GatewayLoggingWhen { - export interface Raw { - subjects?: string[] | null; - } -} diff --git a/src/serialization/types/GatewayMetadataConfig.ts b/src/serialization/types/GatewayMetadataConfig.ts index d93dbb36..9053d31a 100644 --- a/src/serialization/types/GatewayMetadataConfig.ts +++ b/src/serialization/types/GatewayMetadataConfig.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GatewayMetadataRule } from "./GatewayMetadataRule.js"; -export const GatewayMetadataConfig: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "type": core.serialization.stringLiteral("gateway-metadata-config"), - "rules": core.serialization.list(GatewayMetadataRule) - }); +export const GatewayMetadataConfig: core.serialization.ObjectSchema< + serializers.GatewayMetadataConfig.Raw, + TrueFoundry.GatewayMetadataConfig +> = core.serialization.object({ + name: core.serialization.string(), + type: core.serialization.stringLiteral("gateway-metadata-config"), + rules: core.serialization.list(GatewayMetadataRule), +}); export declare namespace GatewayMetadataConfig { export interface Raw { diff --git a/src/serialization/types/GatewayMetadataRule.ts b/src/serialization/types/GatewayMetadataRule.ts index f82fb39e..c6bc6972 100644 --- a/src/serialization/types/GatewayMetadataRule.ts +++ b/src/serialization/types/GatewayMetadataRule.ts @@ -1,15 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GatewayMetadataWhen } from "./GatewayMetadataWhen.js"; -export const GatewayMetadataRule: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string(), - "when": GatewayMetadataWhen, - "metadataOverride": core.serialization.property("metadata_override", core.serialization.record(core.serialization.string(), core.serialization.string())) - }); +export const GatewayMetadataRule: core.serialization.ObjectSchema< + serializers.GatewayMetadataRule.Raw, + TrueFoundry.GatewayMetadataRule +> = core.serialization.object({ + id: core.serialization.string(), + when: GatewayMetadataWhen, + metadataOverride: core.serialization.property( + "metadata_override", + core.serialization.record(core.serialization.string(), core.serialization.string()), + ), +}); export declare namespace GatewayMetadataRule { export interface Raw { diff --git a/src/serialization/types/GatewayMetadataWhen.ts b/src/serialization/types/GatewayMetadataWhen.ts index fc738c24..8143ce0b 100644 --- a/src/serialization/types/GatewayMetadataWhen.ts +++ b/src/serialization/types/GatewayMetadataWhen.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const GatewayMetadataWhen: core.serialization.ObjectSchema = core.serialization.object({ - "subjects": core.serialization.list(core.serialization.string()).optional() - }); +export const GatewayMetadataWhen: core.serialization.ObjectSchema< + serializers.GatewayMetadataWhen.Raw, + TrueFoundry.GatewayMetadataWhen +> = core.serialization.object({ + subjects: core.serialization.list(core.serialization.string()).optional(), +}); export declare namespace GatewayMetadataWhen { export interface Raw { diff --git a/src/serialization/types/GatewayOtelConfig.ts b/src/serialization/types/GatewayOtelConfig.ts index fa6bac1a..1f8ec008 100644 --- a/src/serialization/types/GatewayOtelConfig.ts +++ b/src/serialization/types/GatewayOtelConfig.ts @@ -1,16 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GatewayOtelConfigOtelMetricsExporterConfig } from "./GatewayOtelConfigOtelMetricsExporterConfig.js"; import { GatewayOtelConfigOtelTracesExporterConfig } from "./GatewayOtelConfigOtelTracesExporterConfig.js"; -export const GatewayOtelConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("gateway-otel-config"), - "otelTracesExporterConfig": core.serialization.property("otel_traces_exporter_config", GatewayOtelConfigOtelTracesExporterConfig.optional()), - "otelMetricsExporterConfig": core.serialization.property("otel_metrics_exporter_config", GatewayOtelConfigOtelMetricsExporterConfig.optional()) - }); +export const GatewayOtelConfig: core.serialization.ObjectSchema< + serializers.GatewayOtelConfig.Raw, + TrueFoundry.GatewayOtelConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("gateway-otel-config"), + otelTracesExporterConfig: core.serialization.property( + "otel_traces_exporter_config", + GatewayOtelConfigOtelTracesExporterConfig.optional(), + ), + otelMetricsExporterConfig: core.serialization.property( + "otel_metrics_exporter_config", + GatewayOtelConfigOtelMetricsExporterConfig.optional(), + ), +}); export declare namespace GatewayOtelConfig { export interface Raw { diff --git a/src/serialization/types/GatewayOtelConfigOtelMetricsExporterConfig.ts b/src/serialization/types/GatewayOtelConfigOtelMetricsExporterConfig.ts index e8e91500..a4595835 100644 --- a/src/serialization/types/GatewayOtelConfigOtelMetricsExporterConfig.ts +++ b/src/serialization/types/GatewayOtelConfigOtelMetricsExporterConfig.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { OtelMetricsExporterGrpcConfig } from "./OtelMetricsExporterGrpcConfig.js"; import { OtelMetricsExporterHttpConfig } from "./OtelMetricsExporterHttpConfig.js"; -export const GatewayOtelConfigOtelMetricsExporterConfig: core.serialization.Schema = core.serialization.undiscriminatedUnion([OtelMetricsExporterHttpConfig, OtelMetricsExporterGrpcConfig]); +export const GatewayOtelConfigOtelMetricsExporterConfig: core.serialization.Schema< + serializers.GatewayOtelConfigOtelMetricsExporterConfig.Raw, + TrueFoundry.GatewayOtelConfigOtelMetricsExporterConfig +> = core.serialization.undiscriminatedUnion([OtelMetricsExporterHttpConfig, OtelMetricsExporterGrpcConfig]); export declare namespace GatewayOtelConfigOtelMetricsExporterConfig { export type Raw = OtelMetricsExporterHttpConfig.Raw | OtelMetricsExporterGrpcConfig.Raw; diff --git a/src/serialization/types/GatewayOtelConfigOtelTracesExporterConfig.ts b/src/serialization/types/GatewayOtelConfigOtelTracesExporterConfig.ts index 4dd5f2a0..8c6bfdd4 100644 --- a/src/serialization/types/GatewayOtelConfigOtelTracesExporterConfig.ts +++ b/src/serialization/types/GatewayOtelConfigOtelTracesExporterConfig.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { OtelTracesExporterGrpcConfig } from "./OtelTracesExporterGrpcConfig.js"; import { OtelTracesExporterHttpConfig } from "./OtelTracesExporterHttpConfig.js"; -export const GatewayOtelConfigOtelTracesExporterConfig: core.serialization.Schema = core.serialization.undiscriminatedUnion([OtelTracesExporterHttpConfig, OtelTracesExporterGrpcConfig]); +export const GatewayOtelConfigOtelTracesExporterConfig: core.serialization.Schema< + serializers.GatewayOtelConfigOtelTracesExporterConfig.Raw, + TrueFoundry.GatewayOtelConfigOtelTracesExporterConfig +> = core.serialization.undiscriminatedUnion([OtelTracesExporterHttpConfig, OtelTracesExporterGrpcConfig]); export declare namespace GatewayOtelConfigOtelTracesExporterConfig { export type Raw = OtelTracesExporterHttpConfig.Raw | OtelTracesExporterGrpcConfig.Raw; diff --git a/src/serialization/types/GatewayRequestMetadataFilter.ts b/src/serialization/types/GatewayRequestMetadataFilter.ts index 87f8f1d6..399823a9 100644 --- a/src/serialization/types/GatewayRequestMetadataFilter.ts +++ b/src/serialization/types/GatewayRequestMetadataFilter.ts @@ -1,16 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GatewayRequestMetadataFilterOperator } from "./GatewayRequestMetadataFilterOperator.js"; import { GatewayRequestMetadataFilterValue } from "./GatewayRequestMetadataFilterValue.js"; -export const GatewayRequestMetadataFilter: core.serialization.ObjectSchema = core.serialization.object({ - "gatewayRequestMetadataKey": core.serialization.string(), - "operator": GatewayRequestMetadataFilterOperator, - "value": GatewayRequestMetadataFilterValue - }); +export const GatewayRequestMetadataFilter: core.serialization.ObjectSchema< + serializers.GatewayRequestMetadataFilter.Raw, + TrueFoundry.GatewayRequestMetadataFilter +> = core.serialization.object({ + gatewayRequestMetadataKey: core.serialization.string(), + operator: GatewayRequestMetadataFilterOperator, + value: GatewayRequestMetadataFilterValue, +}); export declare namespace GatewayRequestMetadataFilter { export interface Raw { diff --git a/src/serialization/types/GatewayRequestMetadataFilterOperator.ts b/src/serialization/types/GatewayRequestMetadataFilterOperator.ts index 260d9755..54a96e5f 100644 --- a/src/serialization/types/GatewayRequestMetadataFilterOperator.ts +++ b/src/serialization/types/GatewayRequestMetadataFilterOperator.ts @@ -1,11 +1,53 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const GatewayRequestMetadataFilterOperator: core.serialization.Schema = core.serialization.enum_(["EQUAL", "NOT_EQUAL", "GREATER_THAN", "LESS_THAN", "GREATER_THAN_EQUAL", "LESS_THAN_EQUAL", "BETWEEN", "IN", "NOT_IN", "STRING_CONTAINS", "STRING_NOT_CONTAINS", "STRING_STARTS_WITH", "STRING_NOT_STARTS_WITH", "STRING_ENDS_WITH", "STRING_NOT_ENDS_WITH", "ARRAY_HAS_ANY", "ARRAY_HAS_NONE", "PRESENT", "IS_NULL"]); +export const GatewayRequestMetadataFilterOperator: core.serialization.Schema< + serializers.GatewayRequestMetadataFilterOperator.Raw, + TrueFoundry.GatewayRequestMetadataFilterOperator +> = core.serialization.enum_([ + "EQUAL", + "NOT_EQUAL", + "GREATER_THAN", + "LESS_THAN", + "GREATER_THAN_EQUAL", + "LESS_THAN_EQUAL", + "BETWEEN", + "IN", + "NOT_IN", + "STRING_CONTAINS", + "STRING_NOT_CONTAINS", + "STRING_STARTS_WITH", + "STRING_NOT_STARTS_WITH", + "STRING_ENDS_WITH", + "STRING_NOT_ENDS_WITH", + "ARRAY_HAS_ANY", + "ARRAY_HAS_NONE", + "PRESENT", + "IS_NULL", +]); export declare namespace GatewayRequestMetadataFilterOperator { - export type Raw = "EQUAL" | "NOT_EQUAL" | "GREATER_THAN" | "LESS_THAN" | "GREATER_THAN_EQUAL" | "LESS_THAN_EQUAL" | "BETWEEN" | "IN" | "NOT_IN" | "STRING_CONTAINS" | "STRING_NOT_CONTAINS" | "STRING_STARTS_WITH" | "STRING_NOT_STARTS_WITH" | "STRING_ENDS_WITH" | "STRING_NOT_ENDS_WITH" | "ARRAY_HAS_ANY" | "ARRAY_HAS_NONE" | "PRESENT" | "IS_NULL"; + export type Raw = + | "EQUAL" + | "NOT_EQUAL" + | "GREATER_THAN" + | "LESS_THAN" + | "GREATER_THAN_EQUAL" + | "LESS_THAN_EQUAL" + | "BETWEEN" + | "IN" + | "NOT_IN" + | "STRING_CONTAINS" + | "STRING_NOT_CONTAINS" + | "STRING_STARTS_WITH" + | "STRING_NOT_STARTS_WITH" + | "STRING_ENDS_WITH" + | "STRING_NOT_ENDS_WITH" + | "ARRAY_HAS_ANY" + | "ARRAY_HAS_NONE" + | "PRESENT" + | "IS_NULL"; } diff --git a/src/serialization/types/GatewayRequestMetadataFilterValue.ts b/src/serialization/types/GatewayRequestMetadataFilterValue.ts index a6915ac3..2a81cf6c 100644 --- a/src/serialization/types/GatewayRequestMetadataFilterValue.ts +++ b/src/serialization/types/GatewayRequestMetadataFilterValue.ts @@ -1,10 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const GatewayRequestMetadataFilterValue: core.serialization.Schema = core.serialization.undiscriminatedUnion([core.serialization.string(), core.serialization.list(core.serialization.string())]); +export const GatewayRequestMetadataFilterValue: core.serialization.Schema< + serializers.GatewayRequestMetadataFilterValue.Raw, + TrueFoundry.GatewayRequestMetadataFilterValue +> = core.serialization.undiscriminatedUnion([ + core.serialization.string(), + core.serialization.list(core.serialization.string()), +]); export declare namespace GatewayRequestMetadataFilterValue { export type Raw = string | string[]; diff --git a/src/serialization/types/GcpApiKeyAuth.ts b/src/serialization/types/GcpApiKeyAuth.ts index 7e35d97e..8cebc9d2 100644 --- a/src/serialization/types/GcpApiKeyAuth.ts +++ b/src/serialization/types/GcpApiKeyAuth.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const GcpApiKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.string() +export const GcpApiKeyAuth: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.string(), }); export declare namespace GcpApiKeyAuth { diff --git a/src/serialization/types/GcpGcr.ts b/src/serialization/types/GcpGcr.ts index 2d57a543..d3f1747d 100644 --- a/src/serialization/types/GcpGcr.ts +++ b/src/serialization/types/GcpGcr.ts @@ -1,16 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GcpKeyFileAuth } from "./GcpKeyFileAuth.js"; -export const GcpGcr: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/docker-registry/gcp/gcr"), - "name": core.serialization.string(), - "registryUrl": core.serialization.property("registry_url", core.serialization.string()), - "authData": core.serialization.property("auth_data", GcpKeyFileAuth.optional()), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) +export const GcpGcr: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("integration/docker-registry/gcp/gcr"), + name: core.serialization.string(), + registryUrl: core.serialization.property("registry_url", core.serialization.string()), + authData: core.serialization.property("auth_data", GcpKeyFileAuth.optional()), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace GcpGcr { diff --git a/src/serialization/types/GcpGcs.ts b/src/serialization/types/GcpGcs.ts index 9f9ce05e..56c0035d 100644 --- a/src/serialization/types/GcpGcs.ts +++ b/src/serialization/types/GcpGcs.ts @@ -1,16 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GcpKeyFileAuth } from "./GcpKeyFileAuth.js"; -export const GcpGcs: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/blob-storage/gcp/gcs"), - "name": core.serialization.string(), - "storageRoot": core.serialization.property("storage_root", core.serialization.string()), - "authData": core.serialization.property("auth_data", GcpKeyFileAuth.optional()), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) +export const GcpGcs: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("integration/blob-storage/gcp/gcs"), + name: core.serialization.string(), + storageRoot: core.serialization.property("storage_root", core.serialization.string()), + authData: core.serialization.property("auth_data", GcpKeyFileAuth.optional()), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace GcpGcs { diff --git a/src/serialization/types/GcpGkeIntegration.ts b/src/serialization/types/GcpGkeIntegration.ts index 24339354..873012a3 100644 --- a/src/serialization/types/GcpGkeIntegration.ts +++ b/src/serialization/types/GcpGkeIntegration.ts @@ -1,25 +1,31 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; +import { GcpGkeIntegrationLocation } from "./GcpGkeIntegrationLocation.js"; import { GcpKeyFileAuth } from "./GcpKeyFileAuth.js"; -import { GcpRegion } from "./GcpRegion.js"; -export const GcpGkeIntegration: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/cluster/gcp/gke-standard"), - "name": core.serialization.string(), - "location": GcpRegion, - "clusterName": core.serialization.property("cluster_name", core.serialization.string()), - "authData": core.serialization.property("auth_data", GcpKeyFileAuth.optional()), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const GcpGkeIntegration: core.serialization.ObjectSchema< + serializers.GcpGkeIntegration.Raw, + TrueFoundry.GcpGkeIntegration +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/cluster/gcp/gke-standard"), + name: core.serialization.string(), + location: GcpGkeIntegrationLocation, + clusterName: core.serialization.property("cluster_name", core.serialization.string()), + authData: core.serialization.property("auth_data", GcpKeyFileAuth.optional()), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace GcpGkeIntegration { export interface Raw { type: "integration/cluster/gcp/gke-standard"; name: string; - location: GcpRegion.Raw; + location: GcpGkeIntegrationLocation.Raw; cluster_name: string; auth_data?: GcpKeyFileAuth.Raw | null; authorized_subjects?: string[] | null; diff --git a/src/serialization/types/GcpGkeIntegrationLocation.ts b/src/serialization/types/GcpGkeIntegrationLocation.ts new file mode 100644 index 00000000..bfd9deb8 --- /dev/null +++ b/src/serialization/types/GcpGkeIntegrationLocation.ts @@ -0,0 +1,363 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const GcpGkeIntegrationLocation: core.serialization.Schema< + serializers.GcpGkeIntegrationLocation.Raw, + TrueFoundry.GcpGkeIntegrationLocation +> = core.serialization.enum_([ + "global", + "africa-south1", + "asia-east1", + "asia-east2", + "asia-northeast1", + "asia-northeast2", + "asia-northeast3", + "asia-south1", + "asia-south2", + "asia-southeast1", + "asia-southeast2", + "asia-southeast3", + "australia-southeast1", + "australia-southeast2", + "europe-central2", + "europe-north1", + "europe-north2", + "europe-southwest1", + "europe-west1", + "europe-west2", + "europe-west3", + "europe-west4", + "europe-west6", + "europe-west8", + "europe-west9", + "europe-west10", + "europe-west12", + "me-central1", + "me-central2", + "me-west1", + "northamerica-northeast1", + "northamerica-northeast2", + "northamerica-south1", + "southamerica-east1", + "southamerica-west1", + "us-central1", + "us-east1", + "us-east4", + "us-east5", + "us-south1", + "us-west1", + "us-west2", + "us-west3", + "us-west4", + "africa-south1-a", + "africa-south1-b", + "africa-south1-c", + "asia-east1-a", + "asia-east1-b", + "asia-east1-c", + "asia-east2-a", + "asia-east2-b", + "asia-east2-c", + "asia-northeast1-a", + "asia-northeast1-b", + "asia-northeast1-c", + "asia-northeast2-a", + "asia-northeast2-b", + "asia-northeast2-c", + "asia-northeast3-a", + "asia-northeast3-b", + "asia-northeast3-c", + "asia-south1-a", + "asia-south1-b", + "asia-south1-c", + "asia-south2-a", + "asia-south2-b", + "asia-south2-c", + "asia-southeast1-a", + "asia-southeast1-b", + "asia-southeast1-c", + "asia-southeast2-a", + "asia-southeast2-b", + "asia-southeast2-c", + "asia-southeast3-a", + "asia-southeast3-b", + "asia-southeast3-c", + "australia-southeast1-a", + "australia-southeast1-b", + "australia-southeast1-c", + "australia-southeast2-a", + "australia-southeast2-b", + "australia-southeast2-c", + "europe-central2-a", + "europe-central2-b", + "europe-central2-c", + "europe-north1-a", + "europe-north1-b", + "europe-north1-c", + "europe-north2-a", + "europe-north2-b", + "europe-north2-c", + "europe-southwest1-a", + "europe-southwest1-b", + "europe-southwest1-c", + "europe-west1-b", + "europe-west1-c", + "europe-west1-d", + "europe-west2-a", + "europe-west2-b", + "europe-west2-c", + "europe-west3-a", + "europe-west3-b", + "europe-west3-c", + "europe-west4-a", + "europe-west4-b", + "europe-west4-c", + "europe-west6-a", + "europe-west6-b", + "europe-west6-c", + "europe-west8-a", + "europe-west8-b", + "europe-west8-c", + "europe-west9-a", + "europe-west9-b", + "europe-west9-c", + "europe-west10-a", + "europe-west10-b", + "europe-west10-c", + "europe-west12-a", + "europe-west12-b", + "europe-west12-c", + "me-central1-a", + "me-central1-b", + "me-central1-c", + "me-central2-a", + "me-central2-b", + "me-central2-c", + "me-west1-a", + "me-west1-b", + "me-west1-c", + "northamerica-northeast1-a", + "northamerica-northeast1-b", + "northamerica-northeast1-c", + "northamerica-northeast2-a", + "northamerica-northeast2-b", + "northamerica-northeast2-c", + "northamerica-south1-a", + "northamerica-south1-b", + "northamerica-south1-c", + "southamerica-east1-a", + "southamerica-east1-b", + "southamerica-east1-c", + "southamerica-west1-a", + "southamerica-west1-b", + "southamerica-west1-c", + "us-central1-a", + "us-central1-b", + "us-central1-c", + "us-central1-f", + "us-east1-b", + "us-east1-c", + "us-east1-d", + "us-east4-a", + "us-east4-b", + "us-east4-c", + "us-east5-a", + "us-east5-b", + "us-east5-c", + "us-south1-a", + "us-south1-b", + "us-south1-c", + "us-west1-a", + "us-west1-b", + "us-west1-c", + "us-west2-a", + "us-west2-b", + "us-west2-c", + "us-west3-a", + "us-west3-b", + "us-west3-c", + "us-west4-a", + "us-west4-b", + "us-west4-c", +]); + +export declare namespace GcpGkeIntegrationLocation { + export type Raw = + | "global" + | "africa-south1" + | "asia-east1" + | "asia-east2" + | "asia-northeast1" + | "asia-northeast2" + | "asia-northeast3" + | "asia-south1" + | "asia-south2" + | "asia-southeast1" + | "asia-southeast2" + | "asia-southeast3" + | "australia-southeast1" + | "australia-southeast2" + | "europe-central2" + | "europe-north1" + | "europe-north2" + | "europe-southwest1" + | "europe-west1" + | "europe-west2" + | "europe-west3" + | "europe-west4" + | "europe-west6" + | "europe-west8" + | "europe-west9" + | "europe-west10" + | "europe-west12" + | "me-central1" + | "me-central2" + | "me-west1" + | "northamerica-northeast1" + | "northamerica-northeast2" + | "northamerica-south1" + | "southamerica-east1" + | "southamerica-west1" + | "us-central1" + | "us-east1" + | "us-east4" + | "us-east5" + | "us-south1" + | "us-west1" + | "us-west2" + | "us-west3" + | "us-west4" + | "africa-south1-a" + | "africa-south1-b" + | "africa-south1-c" + | "asia-east1-a" + | "asia-east1-b" + | "asia-east1-c" + | "asia-east2-a" + | "asia-east2-b" + | "asia-east2-c" + | "asia-northeast1-a" + | "asia-northeast1-b" + | "asia-northeast1-c" + | "asia-northeast2-a" + | "asia-northeast2-b" + | "asia-northeast2-c" + | "asia-northeast3-a" + | "asia-northeast3-b" + | "asia-northeast3-c" + | "asia-south1-a" + | "asia-south1-b" + | "asia-south1-c" + | "asia-south2-a" + | "asia-south2-b" + | "asia-south2-c" + | "asia-southeast1-a" + | "asia-southeast1-b" + | "asia-southeast1-c" + | "asia-southeast2-a" + | "asia-southeast2-b" + | "asia-southeast2-c" + | "asia-southeast3-a" + | "asia-southeast3-b" + | "asia-southeast3-c" + | "australia-southeast1-a" + | "australia-southeast1-b" + | "australia-southeast1-c" + | "australia-southeast2-a" + | "australia-southeast2-b" + | "australia-southeast2-c" + | "europe-central2-a" + | "europe-central2-b" + | "europe-central2-c" + | "europe-north1-a" + | "europe-north1-b" + | "europe-north1-c" + | "europe-north2-a" + | "europe-north2-b" + | "europe-north2-c" + | "europe-southwest1-a" + | "europe-southwest1-b" + | "europe-southwest1-c" + | "europe-west1-b" + | "europe-west1-c" + | "europe-west1-d" + | "europe-west2-a" + | "europe-west2-b" + | "europe-west2-c" + | "europe-west3-a" + | "europe-west3-b" + | "europe-west3-c" + | "europe-west4-a" + | "europe-west4-b" + | "europe-west4-c" + | "europe-west6-a" + | "europe-west6-b" + | "europe-west6-c" + | "europe-west8-a" + | "europe-west8-b" + | "europe-west8-c" + | "europe-west9-a" + | "europe-west9-b" + | "europe-west9-c" + | "europe-west10-a" + | "europe-west10-b" + | "europe-west10-c" + | "europe-west12-a" + | "europe-west12-b" + | "europe-west12-c" + | "me-central1-a" + | "me-central1-b" + | "me-central1-c" + | "me-central2-a" + | "me-central2-b" + | "me-central2-c" + | "me-west1-a" + | "me-west1-b" + | "me-west1-c" + | "northamerica-northeast1-a" + | "northamerica-northeast1-b" + | "northamerica-northeast1-c" + | "northamerica-northeast2-a" + | "northamerica-northeast2-b" + | "northamerica-northeast2-c" + | "northamerica-south1-a" + | "northamerica-south1-b" + | "northamerica-south1-c" + | "southamerica-east1-a" + | "southamerica-east1-b" + | "southamerica-east1-c" + | "southamerica-west1-a" + | "southamerica-west1-b" + | "southamerica-west1-c" + | "us-central1-a" + | "us-central1-b" + | "us-central1-c" + | "us-central1-f" + | "us-east1-b" + | "us-east1-c" + | "us-east1-d" + | "us-east4-a" + | "us-east4-b" + | "us-east4-c" + | "us-east5-a" + | "us-east5-b" + | "us-east5-c" + | "us-south1-a" + | "us-south1-b" + | "us-south1-c" + | "us-west1-a" + | "us-west1-b" + | "us-west1-c" + | "us-west2-a" + | "us-west2-b" + | "us-west2-c" + | "us-west3-a" + | "us-west3-b" + | "us-west3-c" + | "us-west4-a" + | "us-west4-b" + | "us-west4-c"; +} diff --git a/src/serialization/types/GcpGsm.ts b/src/serialization/types/GcpGsm.ts index 6ca56561..571f0bc7 100644 --- a/src/serialization/types/GcpGsm.ts +++ b/src/serialization/types/GcpGsm.ts @@ -1,15 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GcpKeyFileAuth } from "./GcpKeyFileAuth.js"; -export const GcpGsm: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/secret-store/gcp/gsm"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", GcpKeyFileAuth.optional()), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) +export const GcpGsm: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("integration/secret-store/gcp/gsm"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", GcpKeyFileAuth.optional()), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace GcpGsm { diff --git a/src/serialization/types/GcpIntegrations.ts b/src/serialization/types/GcpIntegrations.ts index 27ff4130..1fa10bed 100644 --- a/src/serialization/types/GcpIntegrations.ts +++ b/src/serialization/types/GcpIntegrations.ts @@ -1,14 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GcpGcr } from "./GcpGcr.js"; import { GcpGcs } from "./GcpGcs.js"; import { GcpGkeIntegration } from "./GcpGkeIntegration.js"; import { GcpGsm } from "./GcpGsm.js"; -export const GcpIntegrations: core.serialization.Schema = core.serialization.undiscriminatedUnion([GcpGcr, GcpGcs, GcpGsm, GcpGkeIntegration]); +export const GcpIntegrations: core.serialization.Schema = + core.serialization.undiscriminatedUnion([GcpGcr, GcpGcs, GcpGsm, GcpGkeIntegration]); export declare namespace GcpIntegrations { export type Raw = GcpGcr.Raw | GcpGcs.Raw | GcpGsm.Raw | GcpGkeIntegration.Raw; diff --git a/src/serialization/types/GcpKeyFileAuth.ts b/src/serialization/types/GcpKeyFileAuth.ts index d0e61145..8bc7ffee 100644 --- a/src/serialization/types/GcpKeyFileAuth.ts +++ b/src/serialization/types/GcpKeyFileAuth.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GcpKeyFileAuthKeyFileContent } from "./GcpKeyFileAuthKeyFileContent.js"; -export const GcpKeyFileAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("key-file"), - "keyFileContent": core.serialization.property("key_file_content", GcpKeyFileAuthKeyFileContent) - }); +export const GcpKeyFileAuth: core.serialization.ObjectSchema< + serializers.GcpKeyFileAuth.Raw, + TrueFoundry.GcpKeyFileAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("key-file"), + keyFileContent: core.serialization.property("key_file_content", GcpKeyFileAuthKeyFileContent), +}); export declare namespace GcpKeyFileAuth { export interface Raw { diff --git a/src/serialization/types/GcpKeyFileAuthKeyFileContent.ts b/src/serialization/types/GcpKeyFileAuthKeyFileContent.ts index 5bca3daf..93d54cce 100644 --- a/src/serialization/types/GcpKeyFileAuthKeyFileContent.ts +++ b/src/serialization/types/GcpKeyFileAuthKeyFileContent.ts @@ -1,10 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const GcpKeyFileAuthKeyFileContent: core.serialization.Schema = core.serialization.undiscriminatedUnion([core.serialization.string(), core.serialization.record(core.serialization.string(), core.serialization.unknown())]); +export const GcpKeyFileAuthKeyFileContent: core.serialization.Schema< + serializers.GcpKeyFileAuthKeyFileContent.Raw, + TrueFoundry.GcpKeyFileAuthKeyFileContent +> = core.serialization.undiscriminatedUnion([ + core.serialization.string(), + core.serialization.record(core.serialization.string(), core.serialization.unknown()), +]); export declare namespace GcpKeyFileAuthKeyFileContent { export type Raw = string | Record; diff --git a/src/serialization/types/GcpProviderAccount.ts b/src/serialization/types/GcpProviderAccount.ts index 7d2fdbbc..66e1d2d7 100644 --- a/src/serialization/types/GcpProviderAccount.ts +++ b/src/serialization/types/GcpProviderAccount.ts @@ -1,20 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GcpIntegrations } from "./GcpIntegrations.js"; import { GcpKeyFileAuth } from "./GcpKeyFileAuth.js"; import { OwnedBy } from "./OwnedBy.js"; -export const GcpProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/gcp"), - "name": core.serialization.string(), - "projectId": core.serialization.property("project_id", core.serialization.string().optional()), - "authData": core.serialization.property("auth_data", GcpKeyFileAuth.optional()), - "integrations": core.serialization.list(GcpIntegrations), - "ownedBy": OwnedBy.optional() - }); +export const GcpProviderAccount: core.serialization.ObjectSchema< + serializers.GcpProviderAccount.Raw, + TrueFoundry.GcpProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/gcp"), + name: core.serialization.string(), + projectId: core.serialization.property("project_id", core.serialization.string().optional()), + authData: core.serialization.property("auth_data", GcpKeyFileAuth.optional()), + integrations: core.serialization.list(GcpIntegrations), + ownedBy: OwnedBy.optional(), +}); export declare namespace GcpProviderAccount { export interface Raw { diff --git a/src/serialization/types/GcpRegion.ts b/src/serialization/types/GcpRegion.ts index d1533141..d1b2627f 100644 --- a/src/serialization/types/GcpRegion.ts +++ b/src/serialization/types/GcpRegion.ts @@ -1,11 +1,101 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const GcpRegion: core.serialization.Schema = core.serialization.enum_(["global", "northamerica-northeast1", "northamerica-northeast2", "southamerica-east1", "us-central1", "us-east1", "us-east4", "us-east5", "us-south1", "us-west1", "us-west2", "us-west3", "us-west4", "asia-east1", "asia-east2", "asia-northeast1", "asia-northeast2", "asia-northeast3", "asia-south1", "asia-south2", "asia-southeast1", "asia-southeast2", "australia-southeast1", "australia-southeast2", "europe-central2", "europe-north1", "europe-southwest1", "europe-west1", "europe-west2", "europe-west3", "europe-west4", "europe-west6", "europe-west8", "europe-west9", "me-central1", "me-central2", "me-west1"]); +export const GcpRegion: core.serialization.Schema = + core.serialization.enum_([ + "global", + "africa-south1", + "asia-east1", + "asia-east2", + "asia-northeast1", + "asia-northeast2", + "asia-northeast3", + "asia-south1", + "asia-south2", + "asia-southeast1", + "asia-southeast2", + "asia-southeast3", + "australia-southeast1", + "australia-southeast2", + "europe-central2", + "europe-north1", + "europe-north2", + "europe-southwest1", + "europe-west1", + "europe-west2", + "europe-west3", + "europe-west4", + "europe-west6", + "europe-west8", + "europe-west9", + "europe-west10", + "europe-west12", + "me-central1", + "me-central2", + "me-west1", + "northamerica-northeast1", + "northamerica-northeast2", + "northamerica-south1", + "southamerica-east1", + "southamerica-west1", + "us-central1", + "us-east1", + "us-east4", + "us-east5", + "us-south1", + "us-west1", + "us-west2", + "us-west3", + "us-west4", + ]); export declare namespace GcpRegion { - export type Raw = "global" | "northamerica-northeast1" | "northamerica-northeast2" | "southamerica-east1" | "us-central1" | "us-east1" | "us-east4" | "us-east5" | "us-south1" | "us-west1" | "us-west2" | "us-west3" | "us-west4" | "asia-east1" | "asia-east2" | "asia-northeast1" | "asia-northeast2" | "asia-northeast3" | "asia-south1" | "asia-south2" | "asia-southeast1" | "asia-southeast2" | "australia-southeast1" | "australia-southeast2" | "europe-central2" | "europe-north1" | "europe-southwest1" | "europe-west1" | "europe-west2" | "europe-west3" | "europe-west4" | "europe-west6" | "europe-west8" | "europe-west9" | "me-central1" | "me-central2" | "me-west1"; + export type Raw = + | "global" + | "africa-south1" + | "asia-east1" + | "asia-east2" + | "asia-northeast1" + | "asia-northeast2" + | "asia-northeast3" + | "asia-south1" + | "asia-south2" + | "asia-southeast1" + | "asia-southeast2" + | "asia-southeast3" + | "australia-southeast1" + | "australia-southeast2" + | "europe-central2" + | "europe-north1" + | "europe-north2" + | "europe-southwest1" + | "europe-west1" + | "europe-west2" + | "europe-west3" + | "europe-west4" + | "europe-west6" + | "europe-west8" + | "europe-west9" + | "europe-west10" + | "europe-west12" + | "me-central1" + | "me-central2" + | "me-west1" + | "northamerica-northeast1" + | "northamerica-northeast2" + | "northamerica-south1" + | "southamerica-east1" + | "southamerica-west1" + | "us-central1" + | "us-east1" + | "us-east4" + | "us-east5" + | "us-south1" + | "us-west1" + | "us-west2" + | "us-west3" + | "us-west4"; } diff --git a/src/serialization/types/GcpTpu.ts b/src/serialization/types/GcpTpu.ts index 0ec54b0b..8ade5603 100644 --- a/src/serialization/types/GcpTpu.ts +++ b/src/serialization/types/GcpTpu.ts @@ -1,13 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const GcpTpu: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("gcp_tpu"), - "name": core.serialization.string(), - "topology": core.serialization.string() +export const GcpTpu: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("gcp_tpu"), + name: core.serialization.string(), + topology: core.serialization.string(), }); export declare namespace GcpTpu { diff --git a/src/serialization/types/GeminiModel.ts b/src/serialization/types/GeminiModel.ts index 0ae6aac1..908fe8c5 100644 --- a/src/serialization/types/GeminiModel.ts +++ b/src/serialization/types/GeminiModel.ts @@ -1,18 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const GeminiModel: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/model/gemini"), - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) +export const GeminiModel: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("integration/model/gemini"), + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace GeminiModel { diff --git a/src/serialization/types/GenericSecretStoreIntegration.ts b/src/serialization/types/GenericSecretStoreIntegration.ts index d47bbc12..f498103c 100644 --- a/src/serialization/types/GenericSecretStoreIntegration.ts +++ b/src/serialization/types/GenericSecretStoreIntegration.ts @@ -1,17 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { CustomHeaderAuth } from "./CustomHeaderAuth.js"; -export const GenericSecretStoreIntegration: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/secret-store/custom/generic"), - "name": core.serialization.string(), - "baseUrl": core.serialization.property("base_url", core.serialization.string()), - "authData": core.serialization.property("auth_data", CustomHeaderAuth), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const GenericSecretStoreIntegration: core.serialization.ObjectSchema< + serializers.GenericSecretStoreIntegration.Raw, + TrueFoundry.GenericSecretStoreIntegration +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/secret-store/custom/generic"), + name: core.serialization.string(), + baseUrl: core.serialization.property("base_url", core.serialization.string()), + authData: core.serialization.property("auth_data", CustomHeaderAuth), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace GenericSecretStoreIntegration { export interface Raw { diff --git a/src/serialization/types/GetAgentIdentityTokenResponse.ts b/src/serialization/types/GetAgentIdentityTokenResponse.ts new file mode 100644 index 00000000..75b6d74b --- /dev/null +++ b/src/serialization/types/GetAgentIdentityTokenResponse.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const GetAgentIdentityTokenResponse: core.serialization.ObjectSchema< + serializers.GetAgentIdentityTokenResponse.Raw, + TrueFoundry.GetAgentIdentityTokenResponse +> = core.serialization.object({ + token: core.serialization.string(), +}); + +export declare namespace GetAgentIdentityTokenResponse { + export interface Raw { + token: string; + } +} diff --git a/src/serialization/types/GetAgentResponse.ts b/src/serialization/types/GetAgentResponse.ts index af9e3066..ba305fed 100644 --- a/src/serialization/types/GetAgentResponse.ts +++ b/src/serialization/types/GetAgentResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Agent } from "./Agent.js"; -export const GetAgentResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": Agent - }); +export const GetAgentResponse: core.serialization.ObjectSchema< + serializers.GetAgentResponse.Raw, + TrueFoundry.GetAgentResponse +> = core.serialization.object({ + data: Agent, +}); export declare namespace GetAgentResponse { export interface Raw { diff --git a/src/serialization/types/GetAgentSkillResponse.ts b/src/serialization/types/GetAgentSkillResponse.ts index c77e771b..4b360e51 100644 --- a/src/serialization/types/GetAgentSkillResponse.ts +++ b/src/serialization/types/GetAgentSkillResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AgentSkill } from "./AgentSkill.js"; -export const GetAgentSkillResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": AgentSkill - }); +export const GetAgentSkillResponse: core.serialization.ObjectSchema< + serializers.GetAgentSkillResponse.Raw, + TrueFoundry.GetAgentSkillResponse +> = core.serialization.object({ + data: AgentSkill, +}); export declare namespace GetAgentSkillResponse { export interface Raw { diff --git a/src/serialization/types/GetAgentSkillVersionResponse.ts b/src/serialization/types/GetAgentSkillVersionResponse.ts index 01c357b1..6608dd69 100644 --- a/src/serialization/types/GetAgentSkillVersionResponse.ts +++ b/src/serialization/types/GetAgentSkillVersionResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AgentSkillVersion } from "./AgentSkillVersion.js"; -export const GetAgentSkillVersionResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": AgentSkillVersion - }); +export const GetAgentSkillVersionResponse: core.serialization.ObjectSchema< + serializers.GetAgentSkillVersionResponse.Raw, + TrueFoundry.GetAgentSkillVersionResponse +> = core.serialization.object({ + data: AgentSkillVersion, +}); export declare namespace GetAgentSkillVersionResponse { export interface Raw { diff --git a/src/serialization/types/GetAgentVersionResponse.ts b/src/serialization/types/GetAgentVersionResponse.ts index 6e0cc4d7..e9b22492 100644 --- a/src/serialization/types/GetAgentVersionResponse.ts +++ b/src/serialization/types/GetAgentVersionResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AgentVersion } from "./AgentVersion.js"; -export const GetAgentVersionResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": AgentVersion - }); +export const GetAgentVersionResponse: core.serialization.ObjectSchema< + serializers.GetAgentVersionResponse.Raw, + TrueFoundry.GetAgentVersionResponse +> = core.serialization.object({ + data: AgentVersion, +}); export declare namespace GetAgentVersionResponse { export interface Raw { diff --git a/src/serialization/types/GetAlertsResponse.ts b/src/serialization/types/GetAlertsResponse.ts index bee3ef8a..88c809bb 100644 --- a/src/serialization/types/GetAlertsResponse.ts +++ b/src/serialization/types/GetAlertsResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Alert } from "./Alert.js"; -export const GetAlertsResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.record(core.serialization.string(), core.serialization.list(Alert)) - }); +export const GetAlertsResponse: core.serialization.ObjectSchema< + serializers.GetAlertsResponse.Raw, + TrueFoundry.GetAlertsResponse +> = core.serialization.object({ + data: core.serialization.record(core.serialization.string(), core.serialization.list(Alert)), +}); export declare namespace GetAlertsResponse { export interface Raw { diff --git a/src/serialization/types/GetApplicationDeploymentResponse.ts b/src/serialization/types/GetApplicationDeploymentResponse.ts index 54d34e16..58ee198f 100644 --- a/src/serialization/types/GetApplicationDeploymentResponse.ts +++ b/src/serialization/types/GetApplicationDeploymentResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Deployment } from "./Deployment.js"; -export const GetApplicationDeploymentResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": Deployment - }); +export const GetApplicationDeploymentResponse: core.serialization.ObjectSchema< + serializers.GetApplicationDeploymentResponse.Raw, + TrueFoundry.GetApplicationDeploymentResponse +> = core.serialization.object({ + data: Deployment, +}); export declare namespace GetApplicationDeploymentResponse { export interface Raw { diff --git a/src/serialization/types/GetApplicationResponse.ts b/src/serialization/types/GetApplicationResponse.ts index cd25ae2a..0c108f16 100644 --- a/src/serialization/types/GetApplicationResponse.ts +++ b/src/serialization/types/GetApplicationResponse.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; import * as serializers from "../index.js"; -export const GetApplicationResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.lazyObject(() => serializers.Application) - }); +export const GetApplicationResponse: core.serialization.ObjectSchema< + serializers.GetApplicationResponse.Raw, + TrueFoundry.GetApplicationResponse +> = core.serialization.object({ + data: core.serialization.lazyObject(() => serializers.Application), +}); export declare namespace GetApplicationResponse { export interface Raw { diff --git a/src/serialization/types/GetArtifactResponse.ts b/src/serialization/types/GetArtifactResponse.ts index fbd23bfb..a4097521 100644 --- a/src/serialization/types/GetArtifactResponse.ts +++ b/src/serialization/types/GetArtifactResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Artifact } from "./Artifact.js"; -export const GetArtifactResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": Artifact - }); +export const GetArtifactResponse: core.serialization.ObjectSchema< + serializers.GetArtifactResponse.Raw, + TrueFoundry.GetArtifactResponse +> = core.serialization.object({ + data: Artifact, +}); export declare namespace GetArtifactResponse { export interface Raw { diff --git a/src/serialization/types/GetArtifactVersionResponse.ts b/src/serialization/types/GetArtifactVersionResponse.ts index fec3112c..8b98914c 100644 --- a/src/serialization/types/GetArtifactVersionResponse.ts +++ b/src/serialization/types/GetArtifactVersionResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ArtifactVersion } from "./ArtifactVersion.js"; -export const GetArtifactVersionResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": ArtifactVersion - }); +export const GetArtifactVersionResponse: core.serialization.ObjectSchema< + serializers.GetArtifactVersionResponse.Raw, + TrueFoundry.GetArtifactVersionResponse +> = core.serialization.object({ + data: ArtifactVersion, +}); export declare namespace GetArtifactVersionResponse { export interface Raw { diff --git a/src/serialization/types/GetAuthenticatedVcsurlResponse.ts b/src/serialization/types/GetAuthenticatedVcsurlResponse.ts index 2d4b9056..947d8ae4 100644 --- a/src/serialization/types/GetAuthenticatedVcsurlResponse.ts +++ b/src/serialization/types/GetAuthenticatedVcsurlResponse.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const GetAuthenticatedVcsurlResponse: core.serialization.ObjectSchema = core.serialization.object({ - "authenticatedUrl": core.serialization.property("authenticatedURL", core.serialization.string()) - }); +export const GetAuthenticatedVcsurlResponse: core.serialization.ObjectSchema< + serializers.GetAuthenticatedVcsurlResponse.Raw, + TrueFoundry.GetAuthenticatedVcsurlResponse +> = core.serialization.object({ + authenticatedUrl: core.serialization.property("authenticatedURL", core.serialization.string()), +}); export declare namespace GetAuthenticatedVcsurlResponse { export interface Raw { diff --git a/src/serialization/types/GetAutoProvisioningStateResponse.ts b/src/serialization/types/GetAutoProvisioningStateResponse.ts index de12a96c..c67f96af 100644 --- a/src/serialization/types/GetAutoProvisioningStateResponse.ts +++ b/src/serialization/types/GetAutoProvisioningStateResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const GetAutoProvisioningStateResponse: core.serialization.ObjectSchema = core.serialization.object({ - "state": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() - }); +export const GetAutoProvisioningStateResponse: core.serialization.ObjectSchema< + serializers.GetAutoProvisioningStateResponse.Raw, + TrueFoundry.GetAutoProvisioningStateResponse +> = core.serialization.object({ + state: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optionalNullable(), +}); export declare namespace GetAutoProvisioningStateResponse { export interface Raw { - state?: Record | null; + state?: (Record | null | undefined) | null; } } diff --git a/src/serialization/types/GetChartsResponse.ts b/src/serialization/types/GetChartsResponse.ts index b686f241..84a5e3ea 100644 --- a/src/serialization/types/GetChartsResponse.ts +++ b/src/serialization/types/GetChartsResponse.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Graph } from "./Graph.js"; -export const GetChartsResponse: core.serialization.ObjectSchema = core.serialization.object({ - "step": core.serialization.string(), - "graphs": core.serialization.list(Graph) - }); +export const GetChartsResponse: core.serialization.ObjectSchema< + serializers.GetChartsResponse.Raw, + TrueFoundry.GetChartsResponse +> = core.serialization.object({ + step: core.serialization.string(), + graphs: core.serialization.list(Graph), +}); export declare namespace GetChartsResponse { export interface Raw { diff --git a/src/serialization/types/GetClusterResponse.ts b/src/serialization/types/GetClusterResponse.ts index b76dc342..90100abe 100644 --- a/src/serialization/types/GetClusterResponse.ts +++ b/src/serialization/types/GetClusterResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Cluster } from "./Cluster.js"; -export const GetClusterResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": Cluster - }); +export const GetClusterResponse: core.serialization.ObjectSchema< + serializers.GetClusterResponse.Raw, + TrueFoundry.GetClusterResponse +> = core.serialization.object({ + data: Cluster, +}); export declare namespace GetClusterResponse { export interface Raw { diff --git a/src/serialization/types/GetDataDirectoryResponse.ts b/src/serialization/types/GetDataDirectoryResponse.ts index 11e0a5b2..8379cde2 100644 --- a/src/serialization/types/GetDataDirectoryResponse.ts +++ b/src/serialization/types/GetDataDirectoryResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { DataDirectory } from "./DataDirectory.js"; -export const GetDataDirectoryResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": DataDirectory - }); +export const GetDataDirectoryResponse: core.serialization.ObjectSchema< + serializers.GetDataDirectoryResponse.Raw, + TrueFoundry.GetDataDirectoryResponse +> = core.serialization.object({ + data: DataDirectory, +}); export declare namespace GetDataDirectoryResponse { export interface Raw { diff --git a/src/serialization/types/GetDockerRegistryCredentialsResponse.ts b/src/serialization/types/GetDockerRegistryCredentialsResponse.ts index b07dc45a..dc94942e 100644 --- a/src/serialization/types/GetDockerRegistryCredentialsResponse.ts +++ b/src/serialization/types/GetDockerRegistryCredentialsResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const GetDockerRegistryCredentialsResponse: core.serialization.ObjectSchema = core.serialization.object({ - "fqn": core.serialization.string(), - "registryUrl": core.serialization.string(), - "username": core.serialization.string(), - "password": core.serialization.string() - }); +export const GetDockerRegistryCredentialsResponse: core.serialization.ObjectSchema< + serializers.GetDockerRegistryCredentialsResponse.Raw, + TrueFoundry.GetDockerRegistryCredentialsResponse +> = core.serialization.object({ + fqn: core.serialization.string(), + registryUrl: core.serialization.string(), + username: core.serialization.string(), + password: core.serialization.string(), +}); export declare namespace GetDockerRegistryCredentialsResponse { export interface Raw { diff --git a/src/serialization/types/GetEnvironmentResponse.ts b/src/serialization/types/GetEnvironmentResponse.ts index 41585130..7fdfd997 100644 --- a/src/serialization/types/GetEnvironmentResponse.ts +++ b/src/serialization/types/GetEnvironmentResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Environment } from "./Environment.js"; -export const GetEnvironmentResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": Environment - }); +export const GetEnvironmentResponse: core.serialization.ObjectSchema< + serializers.GetEnvironmentResponse.Raw, + TrueFoundry.GetEnvironmentResponse +> = core.serialization.object({ + data: Environment, +}); export declare namespace GetEnvironmentResponse { export interface Raw { diff --git a/src/serialization/types/GetEventsResponse.ts b/src/serialization/types/GetEventsResponse.ts index fb9496c5..a68da48d 100644 --- a/src/serialization/types/GetEventsResponse.ts +++ b/src/serialization/types/GetEventsResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Event } from "./Event.js"; -export const GetEventsResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(Event) - }); +export const GetEventsResponse: core.serialization.ObjectSchema< + serializers.GetEventsResponse.Raw, + TrueFoundry.GetEventsResponse +> = core.serialization.object({ + data: core.serialization.list(Event), +}); export declare namespace GetEventsResponse { export interface Raw { diff --git a/src/serialization/types/GetJobRunResponse.ts b/src/serialization/types/GetJobRunResponse.ts index afda6fea..53cadf42 100644 --- a/src/serialization/types/GetJobRunResponse.ts +++ b/src/serialization/types/GetJobRunResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { JobRun } from "./JobRun.js"; -export const GetJobRunResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": JobRun - }); +export const GetJobRunResponse: core.serialization.ObjectSchema< + serializers.GetJobRunResponse.Raw, + TrueFoundry.GetJobRunResponse +> = core.serialization.object({ + data: JobRun, +}); export declare namespace GetJobRunResponse { export interface Raw { diff --git a/src/serialization/types/GetLogsResponse.ts b/src/serialization/types/GetLogsResponse.ts index ae83ec23..364e33d5 100644 --- a/src/serialization/types/GetLogsResponse.ts +++ b/src/serialization/types/GetLogsResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Log } from "./Log.js"; -export const GetLogsResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(Log) - }); +export const GetLogsResponse: core.serialization.ObjectSchema< + serializers.GetLogsResponse.Raw, + TrueFoundry.GetLogsResponse +> = core.serialization.object({ + data: core.serialization.list(Log), +}); export declare namespace GetLogsResponse { export interface Raw { diff --git a/src/serialization/types/GetMetricHistoryResponse.ts b/src/serialization/types/GetMetricHistoryResponse.ts index 6da438b9..a16e119b 100644 --- a/src/serialization/types/GetMetricHistoryResponse.ts +++ b/src/serialization/types/GetMetricHistoryResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Metric } from "./Metric.js"; -export const GetMetricHistoryResponse: core.serialization.ObjectSchema = core.serialization.object({ - "metrics": core.serialization.list(Metric) - }); +export const GetMetricHistoryResponse: core.serialization.ObjectSchema< + serializers.GetMetricHistoryResponse.Raw, + TrueFoundry.GetMetricHistoryResponse +> = core.serialization.object({ + metrics: core.serialization.list(Metric), +}); export declare namespace GetMetricHistoryResponse { export interface Raw { diff --git a/src/serialization/types/GetMlRepoResponse.ts b/src/serialization/types/GetMlRepoResponse.ts index 3b2c9d61..8806852d 100644 --- a/src/serialization/types/GetMlRepoResponse.ts +++ b/src/serialization/types/GetMlRepoResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { MlRepo } from "./MlRepo.js"; -export const GetMlRepoResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": MlRepo - }); +export const GetMlRepoResponse: core.serialization.ObjectSchema< + serializers.GetMlRepoResponse.Raw, + TrueFoundry.GetMlRepoResponse +> = core.serialization.object({ + data: MlRepo, +}); export declare namespace GetMlRepoResponse { export interface Raw { diff --git a/src/serialization/types/GetModelResponse.ts b/src/serialization/types/GetModelResponse.ts index 5b46af2d..5f928aeb 100644 --- a/src/serialization/types/GetModelResponse.ts +++ b/src/serialization/types/GetModelResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Model } from "./Model.js"; -export const GetModelResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": Model - }); +export const GetModelResponse: core.serialization.ObjectSchema< + serializers.GetModelResponse.Raw, + TrueFoundry.GetModelResponse +> = core.serialization.object({ + data: Model, +}); export declare namespace GetModelResponse { export interface Raw { diff --git a/src/serialization/types/GetModelVersionResponse.ts b/src/serialization/types/GetModelVersionResponse.ts index e0402619..7bb63b2d 100644 --- a/src/serialization/types/GetModelVersionResponse.ts +++ b/src/serialization/types/GetModelVersionResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelVersion } from "./ModelVersion.js"; -export const GetModelVersionResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": ModelVersion - }); +export const GetModelVersionResponse: core.serialization.ObjectSchema< + serializers.GetModelVersionResponse.Raw, + TrueFoundry.GetModelVersionResponse +> = core.serialization.object({ + data: ModelVersion, +}); export declare namespace GetModelVersionResponse { export interface Raw { diff --git a/src/serialization/types/GetOrCreatePersonalAccessTokenResponse.ts b/src/serialization/types/GetOrCreatePersonalAccessTokenResponse.ts index 2f007912..23c3c928 100644 --- a/src/serialization/types/GetOrCreatePersonalAccessTokenResponse.ts +++ b/src/serialization/types/GetOrCreatePersonalAccessTokenResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { VirtualAccount } from "./VirtualAccount.js"; -export const GetOrCreatePersonalAccessTokenResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": VirtualAccount, - "token": core.serialization.string(), - "created": core.serialization.boolean() - }); +export const GetOrCreatePersonalAccessTokenResponse: core.serialization.ObjectSchema< + serializers.GetOrCreatePersonalAccessTokenResponse.Raw, + TrueFoundry.GetOrCreatePersonalAccessTokenResponse +> = core.serialization.object({ + data: VirtualAccount, + token: core.serialization.string(), + created: core.serialization.boolean(), +}); export declare namespace GetOrCreatePersonalAccessTokenResponse { export interface Raw { diff --git a/src/serialization/types/GetPromptResponse.ts b/src/serialization/types/GetPromptResponse.ts index 0907ab0b..92848a71 100644 --- a/src/serialization/types/GetPromptResponse.ts +++ b/src/serialization/types/GetPromptResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Prompt } from "./Prompt.js"; -export const GetPromptResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": Prompt - }); +export const GetPromptResponse: core.serialization.ObjectSchema< + serializers.GetPromptResponse.Raw, + TrueFoundry.GetPromptResponse +> = core.serialization.object({ + data: Prompt, +}); export declare namespace GetPromptResponse { export interface Raw { diff --git a/src/serialization/types/GetPromptVersionResponse.ts b/src/serialization/types/GetPromptVersionResponse.ts index 0ff98253..2397b912 100644 --- a/src/serialization/types/GetPromptVersionResponse.ts +++ b/src/serialization/types/GetPromptVersionResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { PromptVersion } from "./PromptVersion.js"; -export const GetPromptVersionResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": PromptVersion - }); +export const GetPromptVersionResponse: core.serialization.ObjectSchema< + serializers.GetPromptVersionResponse.Raw, + TrueFoundry.GetPromptVersionResponse +> = core.serialization.object({ + data: PromptVersion, +}); export declare namespace GetPromptVersionResponse { export interface Raw { diff --git a/src/serialization/types/GetRunResponse.ts b/src/serialization/types/GetRunResponse.ts index 2bb87e3d..73423f7d 100644 --- a/src/serialization/types/GetRunResponse.ts +++ b/src/serialization/types/GetRunResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Run } from "./Run.js"; -export const GetRunResponse: core.serialization.ObjectSchema = core.serialization.object({ - "run": Run - }); +export const GetRunResponse: core.serialization.ObjectSchema< + serializers.GetRunResponse.Raw, + TrueFoundry.GetRunResponse +> = core.serialization.object({ + run: Run, +}); export declare namespace GetRunResponse { export interface Raw { diff --git a/src/serialization/types/GetSecretGroupResponse.ts b/src/serialization/types/GetSecretGroupResponse.ts index 5b5e187c..cf4fe9f8 100644 --- a/src/serialization/types/GetSecretGroupResponse.ts +++ b/src/serialization/types/GetSecretGroupResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { SecretGroup } from "./SecretGroup.js"; -export const GetSecretGroupResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": SecretGroup - }); +export const GetSecretGroupResponse: core.serialization.ObjectSchema< + serializers.GetSecretGroupResponse.Raw, + TrueFoundry.GetSecretGroupResponse +> = core.serialization.object({ + data: SecretGroup, +}); export declare namespace GetSecretGroupResponse { export interface Raw { diff --git a/src/serialization/types/GetSecretResponse.ts b/src/serialization/types/GetSecretResponse.ts index 4175f106..f2bbc7c6 100644 --- a/src/serialization/types/GetSecretResponse.ts +++ b/src/serialization/types/GetSecretResponse.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; import * as serializers from "../index.js"; -export const GetSecretResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.lazyObject(() => serializers.Secret) - }); +export const GetSecretResponse: core.serialization.ObjectSchema< + serializers.GetSecretResponse.Raw, + TrueFoundry.GetSecretResponse +> = core.serialization.object({ + data: core.serialization.lazyObject(() => serializers.Secret), +}); export declare namespace GetSecretResponse { export interface Raw { diff --git a/src/serialization/types/GetSignedUrLsRequest.ts b/src/serialization/types/GetSignedUrLsRequest.ts index 3ee759dc..18ffdea0 100644 --- a/src/serialization/types/GetSignedUrLsRequest.ts +++ b/src/serialization/types/GetSignedUrLsRequest.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Operation } from "./Operation.js"; -export const GetSignedUrLsRequest: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string(), - "paths": core.serialization.list(core.serialization.string()), - "operation": Operation - }); +export const GetSignedUrLsRequest: core.serialization.ObjectSchema< + serializers.GetSignedUrLsRequest.Raw, + TrueFoundry.GetSignedUrLsRequest +> = core.serialization.object({ + id: core.serialization.string(), + paths: core.serialization.list(core.serialization.string()), + operation: Operation, +}); export declare namespace GetSignedUrLsRequest { export interface Raw { diff --git a/src/serialization/types/GetSignedUrLsResponse.ts b/src/serialization/types/GetSignedUrLsResponse.ts index cb971a61..46f82912 100644 --- a/src/serialization/types/GetSignedUrLsResponse.ts +++ b/src/serialization/types/GetSignedUrLsResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { SignedUrl } from "./SignedUrl.js"; -export const GetSignedUrLsResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(SignedUrl) - }); +export const GetSignedUrLsResponse: core.serialization.ObjectSchema< + serializers.GetSignedUrLsResponse.Raw, + TrueFoundry.GetSignedUrLsResponse +> = core.serialization.object({ + data: core.serialization.list(SignedUrl), +}); export declare namespace GetSignedUrLsResponse { export interface Raw { diff --git a/src/serialization/types/GetSuggestedDeploymentEndpointResponse.ts b/src/serialization/types/GetSuggestedDeploymentEndpointResponse.ts index 86111195..dcd9e2d8 100644 --- a/src/serialization/types/GetSuggestedDeploymentEndpointResponse.ts +++ b/src/serialization/types/GetSuggestedDeploymentEndpointResponse.ts @@ -1,20 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ClusterGateway } from "./ClusterGateway.js"; -export const GetSuggestedDeploymentEndpointResponse: core.serialization.ObjectSchema = core.serialization.object({ - "host": core.serialization.string(), - "path": core.serialization.string().optional(), - "gateway": ClusterGateway.optional() - }); +export const GetSuggestedDeploymentEndpointResponse: core.serialization.ObjectSchema< + serializers.GetSuggestedDeploymentEndpointResponse.Raw, + TrueFoundry.GetSuggestedDeploymentEndpointResponse +> = core.serialization.object({ + host: core.serialization.string(), + path: core.serialization.string().optionalNullable(), + gateway: ClusterGateway.optionalNullable(), +}); export declare namespace GetSuggestedDeploymentEndpointResponse { export interface Raw { host: string; - path?: string | null; - gateway?: ClusterGateway.Raw | null; + path?: (string | null | undefined) | null; + gateway?: (ClusterGateway.Raw | null | undefined) | null; } } diff --git a/src/serialization/types/GetTeamPermissionsResponse.ts b/src/serialization/types/GetTeamPermissionsResponse.ts index fdc3ff85..7f13073b 100644 --- a/src/serialization/types/GetTeamPermissionsResponse.ts +++ b/src/serialization/types/GetTeamPermissionsResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { SubjectPermission } from "./SubjectPermission.js"; -export const GetTeamPermissionsResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(SubjectPermission) - }); +export const GetTeamPermissionsResponse: core.serialization.ObjectSchema< + serializers.GetTeamPermissionsResponse.Raw, + TrueFoundry.GetTeamPermissionsResponse +> = core.serialization.object({ + data: core.serialization.list(SubjectPermission), +}); export declare namespace GetTeamPermissionsResponse { export interface Raw { diff --git a/src/serialization/types/GetTeamResponse.ts b/src/serialization/types/GetTeamResponse.ts index b0c09bdc..c9bb3f5f 100644 --- a/src/serialization/types/GetTeamResponse.ts +++ b/src/serialization/types/GetTeamResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Team } from "./Team.js"; -export const GetTeamResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": Team - }); +export const GetTeamResponse: core.serialization.ObjectSchema< + serializers.GetTeamResponse.Raw, + TrueFoundry.GetTeamResponse +> = core.serialization.object({ + data: Team, +}); export declare namespace GetTeamResponse { export interface Raw { diff --git a/src/serialization/types/GetTokenForVirtualAccountResponse.ts b/src/serialization/types/GetTokenForVirtualAccountResponse.ts index b121269a..d7521517 100644 --- a/src/serialization/types/GetTokenForVirtualAccountResponse.ts +++ b/src/serialization/types/GetTokenForVirtualAccountResponse.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const GetTokenForVirtualAccountResponse: core.serialization.ObjectSchema = core.serialization.object({ - "token": core.serialization.string() - }); +export const GetTokenForVirtualAccountResponse: core.serialization.ObjectSchema< + serializers.GetTokenForVirtualAccountResponse.Raw, + TrueFoundry.GetTokenForVirtualAccountResponse +> = core.serialization.object({ + token: core.serialization.string(), +}); export declare namespace GetTokenForVirtualAccountResponse { export interface Raw { diff --git a/src/serialization/types/GetUserPermissionsResponse.ts b/src/serialization/types/GetUserPermissionsResponse.ts index 6e23e985..ff55dbe9 100644 --- a/src/serialization/types/GetUserPermissionsResponse.ts +++ b/src/serialization/types/GetUserPermissionsResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { SubjectPermission } from "./SubjectPermission.js"; -export const GetUserPermissionsResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(SubjectPermission) - }); +export const GetUserPermissionsResponse: core.serialization.ObjectSchema< + serializers.GetUserPermissionsResponse.Raw, + TrueFoundry.GetUserPermissionsResponse +> = core.serialization.object({ + data: core.serialization.list(SubjectPermission), +}); export declare namespace GetUserPermissionsResponse { export interface Raw { diff --git a/src/serialization/types/GetUserResourcesResponse.ts b/src/serialization/types/GetUserResourcesResponse.ts index 7080f62d..4224baf0 100644 --- a/src/serialization/types/GetUserResourcesResponse.ts +++ b/src/serialization/types/GetUserResourcesResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { UserResource } from "./UserResource.js"; -export const GetUserResourcesResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(UserResource) - }); +export const GetUserResourcesResponse: core.serialization.ObjectSchema< + serializers.GetUserResourcesResponse.Raw, + TrueFoundry.GetUserResourcesResponse +> = core.serialization.object({ + data: core.serialization.list(UserResource), +}); export declare namespace GetUserResourcesResponse { export interface Raw { diff --git a/src/serialization/types/GetUserResponse.ts b/src/serialization/types/GetUserResponse.ts index 452e267d..4f3c6a07 100644 --- a/src/serialization/types/GetUserResponse.ts +++ b/src/serialization/types/GetUserResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { User } from "./User.js"; -export const GetUserResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": User - }); +export const GetUserResponse: core.serialization.ObjectSchema< + serializers.GetUserResponse.Raw, + TrueFoundry.GetUserResponse +> = core.serialization.object({ + data: User, +}); export declare namespace GetUserResponse { export interface Raw { diff --git a/src/serialization/types/GetUserTeamsResponse.ts b/src/serialization/types/GetUserTeamsResponse.ts index 92ac4ed8..ee364568 100644 --- a/src/serialization/types/GetUserTeamsResponse.ts +++ b/src/serialization/types/GetUserTeamsResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { UserTeamInfo } from "./UserTeamInfo.js"; -export const GetUserTeamsResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(UserTeamInfo) - }); +export const GetUserTeamsResponse: core.serialization.ObjectSchema< + serializers.GetUserTeamsResponse.Raw, + TrueFoundry.GetUserTeamsResponse +> = core.serialization.object({ + data: core.serialization.list(UserTeamInfo), +}); export declare namespace GetUserTeamsResponse { export interface Raw { diff --git a/src/serialization/types/GetVirtualAccountResponse.ts b/src/serialization/types/GetVirtualAccountResponse.ts index ffff05da..f2d3f8ad 100644 --- a/src/serialization/types/GetVirtualAccountResponse.ts +++ b/src/serialization/types/GetVirtualAccountResponse.ts @@ -1,18 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { VirtualAccount } from "./VirtualAccount.js"; -export const GetVirtualAccountResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": VirtualAccount, - "token": core.serialization.string().optional() - }); +export const GetVirtualAccountResponse: core.serialization.ObjectSchema< + serializers.GetVirtualAccountResponse.Raw, + TrueFoundry.GetVirtualAccountResponse +> = core.serialization.object({ + data: VirtualAccount, + token: core.serialization.string().optionalNullable(), +}); export declare namespace GetVirtualAccountResponse { export interface Raw { data: VirtualAccount.Raw; - token?: string | null; + token?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/GetWorkspaceResponse.ts b/src/serialization/types/GetWorkspaceResponse.ts index 77fabd76..5b061d06 100644 --- a/src/serialization/types/GetWorkspaceResponse.ts +++ b/src/serialization/types/GetWorkspaceResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Workspace } from "./Workspace.js"; -export const GetWorkspaceResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": Workspace - }); +export const GetWorkspaceResponse: core.serialization.ObjectSchema< + serializers.GetWorkspaceResponse.Raw, + TrueFoundry.GetWorkspaceResponse +> = core.serialization.object({ + data: Workspace, +}); export declare namespace GetWorkspaceResponse { export interface Raw { diff --git a/src/serialization/types/GitHelmRepo.ts b/src/serialization/types/GitHelmRepo.ts index 937811bf..b9e16145 100644 --- a/src/serialization/types/GitHelmRepo.ts +++ b/src/serialization/types/GitHelmRepo.ts @@ -1,15 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const GitHelmRepo: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("git-helm-repo"), - "repoUrl": core.serialization.property("repo_url", core.serialization.string()), - "revision": core.serialization.string(), - "path": core.serialization.string(), - "valueFiles": core.serialization.property("value_files", core.serialization.list(core.serialization.string()).optional()) +export const GitHelmRepo: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("git-helm-repo"), + repoUrl: core.serialization.property("repo_url", core.serialization.string()), + revision: core.serialization.string(), + path: core.serialization.string(), + valueFiles: core.serialization.property( + "value_files", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace GitHelmRepo { diff --git a/src/serialization/types/GitRepositoryExistsResponse.ts b/src/serialization/types/GitRepositoryExistsResponse.ts index cd73214c..449d0578 100644 --- a/src/serialization/types/GitRepositoryExistsResponse.ts +++ b/src/serialization/types/GitRepositoryExistsResponse.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const GitRepositoryExistsResponse: core.serialization.ObjectSchema = core.serialization.object({ - "exists": core.serialization.boolean(), - "id": core.serialization.string().optional() - }); +export const GitRepositoryExistsResponse: core.serialization.ObjectSchema< + serializers.GitRepositoryExistsResponse.Raw, + TrueFoundry.GitRepositoryExistsResponse +> = core.serialization.object({ + exists: core.serialization.boolean(), + id: core.serialization.string().optionalNullable(), +}); export declare namespace GitRepositoryExistsResponse { export interface Raw { exists: boolean; - id?: string | null; + id?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/GitSource.ts b/src/serialization/types/GitSource.ts index 3b134abd..933e11ae 100644 --- a/src/serialization/types/GitSource.ts +++ b/src/serialization/types/GitSource.ts @@ -1,14 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const GitSource: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("git"), - "repoUrl": core.serialization.property("repo_url", core.serialization.string()), - "ref": core.serialization.string(), - "branchName": core.serialization.property("branch_name", core.serialization.string().optional()) +export const GitSource: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("git"), + repoUrl: core.serialization.property("repo_url", core.serialization.string()), + ref: core.serialization.string(), + branchName: core.serialization.property("branch_name", core.serialization.string().optional()), }); export declare namespace GitSource { diff --git a/src/serialization/types/GithubIntegration.ts b/src/serialization/types/GithubIntegration.ts index d79e0b16..c07d8307 100644 --- a/src/serialization/types/GithubIntegration.ts +++ b/src/serialization/types/GithubIntegration.ts @@ -1,17 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GithubIntegrationAuthData } from "./GithubIntegrationAuthData.js"; -export const GithubIntegration: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/vcs/github"), - "name": core.serialization.string(), - "accountName": core.serialization.property("account_name", core.serialization.string()), - "authData": core.serialization.property("auth_data", GithubIntegrationAuthData.optional()), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const GithubIntegration: core.serialization.ObjectSchema< + serializers.GithubIntegration.Raw, + TrueFoundry.GithubIntegration +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/vcs/github"), + name: core.serialization.string(), + accountName: core.serialization.property("account_name", core.serialization.string()), + authData: core.serialization.property("auth_data", GithubIntegrationAuthData.optional()), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace GithubIntegration { export interface Raw { diff --git a/src/serialization/types/GithubIntegrationAuthData.ts b/src/serialization/types/GithubIntegrationAuthData.ts index 360a5703..dff379d7 100644 --- a/src/serialization/types/GithubIntegrationAuthData.ts +++ b/src/serialization/types/GithubIntegrationAuthData.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { VcsoAuthAuthData } from "./VcsoAuthAuthData.js"; import { VcsTokenAuthData } from "./VcsTokenAuthData.js"; -export const GithubIntegrationAuthData: core.serialization.Schema = core.serialization.undiscriminatedUnion([VcsoAuthAuthData, VcsTokenAuthData]); +export const GithubIntegrationAuthData: core.serialization.Schema< + serializers.GithubIntegrationAuthData.Raw, + TrueFoundry.GithubIntegrationAuthData +> = core.serialization.undiscriminatedUnion([VcsoAuthAuthData, VcsTokenAuthData]); export declare namespace GithubIntegrationAuthData { export type Raw = VcsoAuthAuthData.Raw | VcsTokenAuthData.Raw; diff --git a/src/serialization/types/GithubProviderAccount.ts b/src/serialization/types/GithubProviderAccount.ts index e00aa5b3..6ce652a9 100644 --- a/src/serialization/types/GithubProviderAccount.ts +++ b/src/serialization/types/GithubProviderAccount.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GithubIntegration } from "./GithubIntegration.js"; import { OwnedBy } from "./OwnedBy.js"; -export const GithubProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/github"), - "name": core.serialization.string(), - "integrations": core.serialization.list(GithubIntegration), - "ownedBy": OwnedBy.optional() - }); +export const GithubProviderAccount: core.serialization.ObjectSchema< + serializers.GithubProviderAccount.Raw, + TrueFoundry.GithubProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/github"), + name: core.serialization.string(), + integrations: core.serialization.list(GithubIntegration), + ownedBy: OwnedBy.optional(), +}); export declare namespace GithubProviderAccount { export interface Raw { diff --git a/src/serialization/types/GitlabIntegration.ts b/src/serialization/types/GitlabIntegration.ts index b701420a..2f79e67e 100644 --- a/src/serialization/types/GitlabIntegration.ts +++ b/src/serialization/types/GitlabIntegration.ts @@ -1,17 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GitlabIntegrationAuthData } from "./GitlabIntegrationAuthData.js"; -export const GitlabIntegration: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/vcs/gitlab"), - "name": core.serialization.string(), - "accountName": core.serialization.property("account_name", core.serialization.string()), - "authData": core.serialization.property("auth_data", GitlabIntegrationAuthData.optional()), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const GitlabIntegration: core.serialization.ObjectSchema< + serializers.GitlabIntegration.Raw, + TrueFoundry.GitlabIntegration +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/vcs/gitlab"), + name: core.serialization.string(), + accountName: core.serialization.property("account_name", core.serialization.string()), + authData: core.serialization.property("auth_data", GitlabIntegrationAuthData.optional()), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace GitlabIntegration { export interface Raw { diff --git a/src/serialization/types/GitlabIntegrationAuthData.ts b/src/serialization/types/GitlabIntegrationAuthData.ts index 72d66ec3..4af5ed05 100644 --- a/src/serialization/types/GitlabIntegrationAuthData.ts +++ b/src/serialization/types/GitlabIntegrationAuthData.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { VcsoAuthAuthData } from "./VcsoAuthAuthData.js"; import { VcsTokenAuthData } from "./VcsTokenAuthData.js"; -export const GitlabIntegrationAuthData: core.serialization.Schema = core.serialization.undiscriminatedUnion([VcsoAuthAuthData, VcsTokenAuthData]); +export const GitlabIntegrationAuthData: core.serialization.Schema< + serializers.GitlabIntegrationAuthData.Raw, + TrueFoundry.GitlabIntegrationAuthData +> = core.serialization.undiscriminatedUnion([VcsoAuthAuthData, VcsTokenAuthData]); export declare namespace GitlabIntegrationAuthData { export type Raw = VcsoAuthAuthData.Raw | VcsTokenAuthData.Raw; diff --git a/src/serialization/types/GitlabProviderAccount.ts b/src/serialization/types/GitlabProviderAccount.ts index ef2bcc2d..0be254e5 100644 --- a/src/serialization/types/GitlabProviderAccount.ts +++ b/src/serialization/types/GitlabProviderAccount.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GitlabIntegration } from "./GitlabIntegration.js"; import { OwnedBy } from "./OwnedBy.js"; -export const GitlabProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/gitlab"), - "name": core.serialization.string(), - "integrations": core.serialization.list(GitlabIntegration), - "ownedBy": OwnedBy.optional() - }); +export const GitlabProviderAccount: core.serialization.ObjectSchema< + serializers.GitlabProviderAccount.Raw, + TrueFoundry.GitlabProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/gitlab"), + name: core.serialization.string(), + integrations: core.serialization.list(GitlabIntegration), + ownedBy: OwnedBy.optional(), +}); export declare namespace GitlabProviderAccount { export interface Raw { diff --git a/src/serialization/types/GlobalSettings.ts b/src/serialization/types/GlobalSettings.ts index 606dc38e..9a5060d5 100644 --- a/src/serialization/types/GlobalSettings.ts +++ b/src/serialization/types/GlobalSettings.ts @@ -1,20 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GuardrailSettings } from "./GuardrailSettings.js"; import { LoggingMode } from "./LoggingMode.js"; import { RetryConfig } from "./RetryConfig.js"; import { SemanticCacheSettings } from "./SemanticCacheSettings.js"; -export const GlobalSettings: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("gateway-global-settings"), - "retrySettings": core.serialization.property("retry_settings", RetryConfig.optional()), - "loggingSettings": core.serialization.property("logging_settings", LoggingMode.optional()), - "semanticCacheSettings": core.serialization.property("semantic_cache_settings", SemanticCacheSettings.optional()), - "guardrailSettings": core.serialization.property("guardrail_settings", GuardrailSettings.optional()) - }); +export const GlobalSettings: core.serialization.ObjectSchema< + serializers.GlobalSettings.Raw, + TrueFoundry.GlobalSettings +> = core.serialization.object({ + type: core.serialization.stringLiteral("gateway-global-settings"), + retrySettings: core.serialization.property("retry_settings", RetryConfig.optional()), + loggingSettings: core.serialization.property("logging_settings", LoggingMode.optional()), + semanticCacheSettings: core.serialization.property("semantic_cache_settings", SemanticCacheSettings.optional()), + guardrailSettings: core.serialization.property("guardrail_settings", GuardrailSettings.optional()), +}); export declare namespace GlobalSettings { export interface Raw { diff --git a/src/serialization/types/GluonFramework.ts b/src/serialization/types/GluonFramework.ts index 8b2a3f8a..8f03a39e 100644 --- a/src/serialization/types/GluonFramework.ts +++ b/src/serialization/types/GluonFramework.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const GluonFramework: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("gluon") - }); +export const GluonFramework: core.serialization.ObjectSchema< + serializers.GluonFramework.Raw, + TrueFoundry.GluonFramework +> = core.serialization.object({ + type: core.serialization.stringLiteral("gluon"), +}); export declare namespace GluonFramework { export interface Raw { diff --git a/src/serialization/types/GoogleGeminiProviderAccount.ts b/src/serialization/types/GoogleGeminiProviderAccount.ts index c6eb5a53..6d512901 100644 --- a/src/serialization/types/GoogleGeminiProviderAccount.ts +++ b/src/serialization/types/GoogleGeminiProviderAccount.ts @@ -1,22 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { GcpApiKeyAuth } from "./GcpApiKeyAuth.js"; import { GeminiModel } from "./GeminiModel.js"; import { OwnedBy } from "./OwnedBy.js"; -export const GoogleGeminiProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/google-gemini"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", GcpApiKeyAuth), - "integrations": core.serialization.list(GeminiModel), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const GoogleGeminiProviderAccount: core.serialization.ObjectSchema< + serializers.GoogleGeminiProviderAccount.Raw, + TrueFoundry.GoogleGeminiProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/google-gemini"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", GcpApiKeyAuth), + integrations: core.serialization.list(GeminiModel), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace GoogleGeminiProviderAccount { export interface Raw { diff --git a/src/serialization/types/GoogleModelArmorApiKeyAuth.ts b/src/serialization/types/GoogleModelArmorApiKeyAuth.ts index 1fc3cd43..dd6bb537 100644 --- a/src/serialization/types/GoogleModelArmorApiKeyAuth.ts +++ b/src/serialization/types/GoogleModelArmorApiKeyAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const GoogleModelArmorApiKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) - }); +export const GoogleModelArmorApiKeyAuth: core.serialization.ObjectSchema< + serializers.GoogleModelArmorApiKeyAuth.Raw, + TrueFoundry.GoogleModelArmorApiKeyAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), +}); export declare namespace GoogleModelArmorApiKeyAuth { export interface Raw { diff --git a/src/serialization/types/GoogleModelArmorGuardrailConfig.ts b/src/serialization/types/GoogleModelArmorGuardrailConfig.ts index ff682eae..56c7922f 100644 --- a/src/serialization/types/GoogleModelArmorGuardrailConfig.ts +++ b/src/serialization/types/GoogleModelArmorGuardrailConfig.ts @@ -1,23 +1,26 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { EnforcingStrategy } from "./EnforcingStrategy.js"; import { GoogleModelArmorGuardrailConfigAuthData } from "./GoogleModelArmorGuardrailConfigAuthData.js"; import { GoogleModelArmorGuardrailConfigConfig } from "./GoogleModelArmorGuardrailConfigConfig.js"; import { GoogleModelArmorGuardrailConfigOperation } from "./GoogleModelArmorGuardrailConfigOperation.js"; -export const GoogleModelArmorGuardrailConfig: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string().optional(), - "type": core.serialization.stringLiteral("integration/guardrail-config/google-model-armor"), - "authData": core.serialization.property("auth_data", GoogleModelArmorGuardrailConfigAuthData), - "operation": GoogleModelArmorGuardrailConfigOperation, - "priority": core.serialization.number().optional(), - "enforcingStrategy": core.serialization.property("enforcing_strategy", EnforcingStrategy), - "config": GoogleModelArmorGuardrailConfigConfig - }); +export const GoogleModelArmorGuardrailConfig: core.serialization.ObjectSchema< + serializers.GoogleModelArmorGuardrailConfig.Raw, + TrueFoundry.GoogleModelArmorGuardrailConfig +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + type: core.serialization.stringLiteral("integration/guardrail-config/google-model-armor"), + authData: core.serialization.property("auth_data", GoogleModelArmorGuardrailConfigAuthData), + operation: GoogleModelArmorGuardrailConfigOperation, + priority: core.serialization.number().optional(), + enforcingStrategy: core.serialization.property("enforcing_strategy", EnforcingStrategy), + config: GoogleModelArmorGuardrailConfigConfig, +}); export declare namespace GoogleModelArmorGuardrailConfig { export interface Raw { diff --git a/src/serialization/types/GoogleModelArmorGuardrailConfigAuthData.ts b/src/serialization/types/GoogleModelArmorGuardrailConfigAuthData.ts index 56634e4c..04139524 100644 --- a/src/serialization/types/GoogleModelArmorGuardrailConfigAuthData.ts +++ b/src/serialization/types/GoogleModelArmorGuardrailConfigAuthData.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GoogleModelArmorApiKeyAuth } from "./GoogleModelArmorApiKeyAuth.js"; import { GoogleModelArmorKeyFileAuth } from "./GoogleModelArmorKeyFileAuth.js"; -export const GoogleModelArmorGuardrailConfigAuthData: core.serialization.Schema = core.serialization.undiscriminatedUnion([GoogleModelArmorApiKeyAuth, GoogleModelArmorKeyFileAuth]); +export const GoogleModelArmorGuardrailConfigAuthData: core.serialization.Schema< + serializers.GoogleModelArmorGuardrailConfigAuthData.Raw, + TrueFoundry.GoogleModelArmorGuardrailConfigAuthData +> = core.serialization.undiscriminatedUnion([GoogleModelArmorApiKeyAuth, GoogleModelArmorKeyFileAuth]); export declare namespace GoogleModelArmorGuardrailConfigAuthData { export type Raw = GoogleModelArmorApiKeyAuth.Raw | GoogleModelArmorKeyFileAuth.Raw; diff --git a/src/serialization/types/GoogleModelArmorGuardrailConfigConfig.ts b/src/serialization/types/GoogleModelArmorGuardrailConfigConfig.ts index a05fa94c..5141d2a2 100644 --- a/src/serialization/types/GoogleModelArmorGuardrailConfigConfig.ts +++ b/src/serialization/types/GoogleModelArmorGuardrailConfigConfig.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GcpRegion } from "./GcpRegion.js"; -export const GoogleModelArmorGuardrailConfigConfig: core.serialization.ObjectSchema = core.serialization.object({ - "projectId": core.serialization.property("project_id", core.serialization.string()), - "location": GcpRegion, - "templateId": core.serialization.property("template_id", core.serialization.string()) - }); +export const GoogleModelArmorGuardrailConfigConfig: core.serialization.ObjectSchema< + serializers.GoogleModelArmorGuardrailConfigConfig.Raw, + TrueFoundry.GoogleModelArmorGuardrailConfigConfig +> = core.serialization.object({ + projectId: core.serialization.property("project_id", core.serialization.string()), + location: GcpRegion, + templateId: core.serialization.property("template_id", core.serialization.string()), +}); export declare namespace GoogleModelArmorGuardrailConfigConfig { export interface Raw { diff --git a/src/serialization/types/GoogleModelArmorGuardrailConfigOperation.ts b/src/serialization/types/GoogleModelArmorGuardrailConfigOperation.ts index 612596bf..f75c744d 100644 --- a/src/serialization/types/GoogleModelArmorGuardrailConfigOperation.ts +++ b/src/serialization/types/GoogleModelArmorGuardrailConfigOperation.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const GoogleModelArmorGuardrailConfigOperation: core.serialization.Schema = core.serialization.enum_(["validate", "mutate"]); +export const GoogleModelArmorGuardrailConfigOperation: core.serialization.Schema< + serializers.GoogleModelArmorGuardrailConfigOperation.Raw, + TrueFoundry.GoogleModelArmorGuardrailConfigOperation +> = core.serialization.enum_(["validate", "mutate"]); export declare namespace GoogleModelArmorGuardrailConfigOperation { export type Raw = "validate" | "mutate"; diff --git a/src/serialization/types/GoogleModelArmorKeyFileAuth.ts b/src/serialization/types/GoogleModelArmorKeyFileAuth.ts index eec2976d..77d40091 100644 --- a/src/serialization/types/GoogleModelArmorKeyFileAuth.ts +++ b/src/serialization/types/GoogleModelArmorKeyFileAuth.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GoogleModelArmorKeyFileAuthKeyFileContent } from "./GoogleModelArmorKeyFileAuthKeyFileContent.js"; -export const GoogleModelArmorKeyFileAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("key-file"), - "keyFileContent": core.serialization.property("key_file_content", GoogleModelArmorKeyFileAuthKeyFileContent) - }); +export const GoogleModelArmorKeyFileAuth: core.serialization.ObjectSchema< + serializers.GoogleModelArmorKeyFileAuth.Raw, + TrueFoundry.GoogleModelArmorKeyFileAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("key-file"), + keyFileContent: core.serialization.property("key_file_content", GoogleModelArmorKeyFileAuthKeyFileContent), +}); export declare namespace GoogleModelArmorKeyFileAuth { export interface Raw { diff --git a/src/serialization/types/GoogleModelArmorKeyFileAuthKeyFileContent.ts b/src/serialization/types/GoogleModelArmorKeyFileAuthKeyFileContent.ts index 540e2672..c8f5b92a 100644 --- a/src/serialization/types/GoogleModelArmorKeyFileAuthKeyFileContent.ts +++ b/src/serialization/types/GoogleModelArmorKeyFileAuthKeyFileContent.ts @@ -1,10 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const GoogleModelArmorKeyFileAuthKeyFileContent: core.serialization.Schema = core.serialization.undiscriminatedUnion([core.serialization.string(), core.serialization.record(core.serialization.string(), core.serialization.unknown())]); +export const GoogleModelArmorKeyFileAuthKeyFileContent: core.serialization.Schema< + serializers.GoogleModelArmorKeyFileAuthKeyFileContent.Raw, + TrueFoundry.GoogleModelArmorKeyFileAuthKeyFileContent +> = core.serialization.undiscriminatedUnion([ + core.serialization.string(), + core.serialization.record(core.serialization.string(), core.serialization.unknown()), +]); export declare namespace GoogleModelArmorKeyFileAuthKeyFileContent { export type Raw = string | Record; diff --git a/src/serialization/types/GoogleVertexProviderAccount.ts b/src/serialization/types/GoogleVertexProviderAccount.ts index 10f7e1f2..1875402b 100644 --- a/src/serialization/types/GoogleVertexProviderAccount.ts +++ b/src/serialization/types/GoogleVertexProviderAccount.ts @@ -1,25 +1,29 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { GoogleVertexProviderAccountAuthData } from "./GoogleVertexProviderAccountAuthData.js"; import { OwnedBy } from "./OwnedBy.js"; import { VertexModel } from "./VertexModel.js"; import { VertexRegion } from "./VertexRegion.js"; -export const GoogleVertexProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/google-vertex"), - "name": core.serialization.string(), - "projectId": core.serialization.property("project_id", core.serialization.string()), - "region": VertexRegion, - "authData": core.serialization.property("auth_data", GoogleVertexProviderAccountAuthData.optional()), - "integrations": core.serialization.list(VertexModel), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const GoogleVertexProviderAccount: core.serialization.ObjectSchema< + serializers.GoogleVertexProviderAccount.Raw, + TrueFoundry.GoogleVertexProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/google-vertex"), + name: core.serialization.string(), + projectId: core.serialization.property("project_id", core.serialization.string()), + region: VertexRegion, + authData: core.serialization.property("auth_data", GoogleVertexProviderAccountAuthData.optional()), + baseUrl: core.serialization.property("base_url", core.serialization.string().optional()), + integrations: core.serialization.list(VertexModel), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace GoogleVertexProviderAccount { export interface Raw { @@ -28,6 +32,7 @@ export declare namespace GoogleVertexProviderAccount { project_id: string; region: VertexRegion.Raw; auth_data?: GoogleVertexProviderAccountAuthData.Raw | null; + base_url?: string | null; integrations: VertexModel.Raw[]; collaborators?: Collaborator.Raw[] | null; ownedBy?: OwnedBy.Raw | null; diff --git a/src/serialization/types/GoogleVertexProviderAccountAuthData.ts b/src/serialization/types/GoogleVertexProviderAccountAuthData.ts index 75563ee6..449cdaa0 100644 --- a/src/serialization/types/GoogleVertexProviderAccountAuthData.ts +++ b/src/serialization/types/GoogleVertexProviderAccountAuthData.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { VertexKeyFileAuth } from "./VertexKeyFileAuth.js"; import { VertexWifFileAuth } from "./VertexWifFileAuth.js"; -export const GoogleVertexProviderAccountAuthData: core.serialization.Schema = core.serialization.undiscriminatedUnion([VertexKeyFileAuth, VertexWifFileAuth]); +export const GoogleVertexProviderAccountAuthData: core.serialization.Schema< + serializers.GoogleVertexProviderAccountAuthData.Raw, + TrueFoundry.GoogleVertexProviderAccountAuthData +> = core.serialization.undiscriminatedUnion([VertexKeyFileAuth, VertexWifFileAuth]); export declare namespace GoogleVertexProviderAccountAuthData { export type Raw = VertexKeyFileAuth.Raw | VertexWifFileAuth.Raw; diff --git a/src/serialization/types/Graph.ts b/src/serialization/types/Graph.ts index 9057d7a9..8ae033ac 100644 --- a/src/serialization/types/Graph.ts +++ b/src/serialization/types/Graph.ts @@ -1,16 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GraphChartType } from "./GraphChartType.js"; -export const Graph: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string(), - "chart": core.serialization.string(), - "chartType": GraphChartType, - "params": core.serialization.string() +export const Graph: core.serialization.ObjectSchema = + core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string(), + chart: core.serialization.string(), + chartType: GraphChartType, + params: core.serialization.string(), }); export declare namespace Graph { diff --git a/src/serialization/types/GraphChartType.ts b/src/serialization/types/GraphChartType.ts index 88bc8dc3..cf1f8a91 100644 --- a/src/serialization/types/GraphChartType.ts +++ b/src/serialization/types/GraphChartType.ts @@ -1,11 +1,31 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const GraphChartType: core.serialization.Schema = core.serialization.enum_(["line", "vertical_line", "stacked_bar", "stacked_area", "bubble", "horizontal_bar", "horizontal_stacked_bar", "horizontal_box_plot", "bar_list"]); +export const GraphChartType: core.serialization.Schema = + core.serialization.enum_([ + "line", + "vertical_line", + "stacked_bar", + "stacked_area", + "bubble", + "horizontal_bar", + "horizontal_stacked_bar", + "horizontal_box_plot", + "bar_list", + ]); export declare namespace GraphChartType { - export type Raw = "line" | "vertical_line" | "stacked_bar" | "stacked_area" | "bubble" | "horizontal_bar" | "horizontal_stacked_bar" | "horizontal_box_plot" | "bar_list"; + export type Raw = + | "line" + | "vertical_line" + | "stacked_bar" + | "stacked_area" + | "bubble" + | "horizontal_bar" + | "horizontal_stacked_bar" + | "horizontal_box_plot" + | "bar_list"; } diff --git a/src/serialization/types/GraySwanCygnalApiKeyAuth.ts b/src/serialization/types/GraySwanCygnalApiKeyAuth.ts index acc821fd..b03f7b4c 100644 --- a/src/serialization/types/GraySwanCygnalApiKeyAuth.ts +++ b/src/serialization/types/GraySwanCygnalApiKeyAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const GraySwanCygnalApiKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) - }); +export const GraySwanCygnalApiKeyAuth: core.serialization.ObjectSchema< + serializers.GraySwanCygnalApiKeyAuth.Raw, + TrueFoundry.GraySwanCygnalApiKeyAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), +}); export declare namespace GraySwanCygnalApiKeyAuth { export interface Raw { diff --git a/src/serialization/types/GraySwanCygnalGuardrailConfig.ts b/src/serialization/types/GraySwanCygnalGuardrailConfig.ts index 13adef31..854f7cea 100644 --- a/src/serialization/types/GraySwanCygnalGuardrailConfig.ts +++ b/src/serialization/types/GraySwanCygnalGuardrailConfig.ts @@ -1,21 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { EnforcingStrategy } from "./EnforcingStrategy.js"; import { GraySwanCygnalApiKeyAuth } from "./GraySwanCygnalApiKeyAuth.js"; import { GraySwanCygnalGuardrailConfigConfig } from "./GraySwanCygnalGuardrailConfigConfig.js"; -export const GraySwanCygnalGuardrailConfig: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string().optional(), - "type": core.serialization.stringLiteral("integration/guardrail-config/grayswan-cygnal"), - "authData": core.serialization.property("auth_data", GraySwanCygnalApiKeyAuth), - "operation": core.serialization.stringLiteral("validate"), - "enforcingStrategy": core.serialization.property("enforcing_strategy", EnforcingStrategy), - "config": GraySwanCygnalGuardrailConfigConfig - }); +export const GraySwanCygnalGuardrailConfig: core.serialization.ObjectSchema< + serializers.GraySwanCygnalGuardrailConfig.Raw, + TrueFoundry.GraySwanCygnalGuardrailConfig +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + type: core.serialization.stringLiteral("integration/guardrail-config/grayswan-cygnal"), + authData: core.serialization.property("auth_data", GraySwanCygnalApiKeyAuth), + operation: core.serialization.stringLiteral("validate"), + enforcingStrategy: core.serialization.property("enforcing_strategy", EnforcingStrategy), + config: GraySwanCygnalGuardrailConfigConfig, +}); export declare namespace GraySwanCygnalGuardrailConfig { export interface Raw { diff --git a/src/serialization/types/GraySwanCygnalGuardrailConfigConfig.ts b/src/serialization/types/GraySwanCygnalGuardrailConfigConfig.ts index d5faad3e..1cba2a04 100644 --- a/src/serialization/types/GraySwanCygnalGuardrailConfigConfig.ts +++ b/src/serialization/types/GraySwanCygnalGuardrailConfigConfig.ts @@ -1,16 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GraySwanCygnalGuardrailConfigConfigReasoningMode } from "./GraySwanCygnalGuardrailConfigConfigReasoningMode.js"; -export const GraySwanCygnalGuardrailConfigConfig: core.serialization.ObjectSchema = core.serialization.object({ - "baseUrl": core.serialization.property("base_url", core.serialization.string().optional()), - "policyIds": core.serialization.property("policy_ids", core.serialization.list(core.serialization.string()).optional()), - "rules": core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), - "reasoningMode": core.serialization.property("reasoning_mode", GraySwanCygnalGuardrailConfigConfigReasoningMode) - }); +export const GraySwanCygnalGuardrailConfigConfig: core.serialization.ObjectSchema< + serializers.GraySwanCygnalGuardrailConfigConfig.Raw, + TrueFoundry.GraySwanCygnalGuardrailConfigConfig +> = core.serialization.object({ + baseUrl: core.serialization.property("base_url", core.serialization.string().optional()), + policyIds: core.serialization.property( + "policy_ids", + core.serialization.list(core.serialization.string()).optional(), + ), + rules: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), + reasoningMode: core.serialization.property("reasoning_mode", GraySwanCygnalGuardrailConfigConfigReasoningMode), +}); export declare namespace GraySwanCygnalGuardrailConfigConfig { export interface Raw { diff --git a/src/serialization/types/GraySwanCygnalGuardrailConfigConfigReasoningMode.ts b/src/serialization/types/GraySwanCygnalGuardrailConfigConfigReasoningMode.ts index e7d24b23..d1c2734d 100644 --- a/src/serialization/types/GraySwanCygnalGuardrailConfigConfigReasoningMode.ts +++ b/src/serialization/types/GraySwanCygnalGuardrailConfigConfigReasoningMode.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const GraySwanCygnalGuardrailConfigConfigReasoningMode: core.serialization.Schema = core.serialization.enum_(["off", "hybrid", "thinking"]); +export const GraySwanCygnalGuardrailConfigConfigReasoningMode: core.serialization.Schema< + serializers.GraySwanCygnalGuardrailConfigConfigReasoningMode.Raw, + TrueFoundry.GraySwanCygnalGuardrailConfigConfigReasoningMode +> = core.serialization.enum_(["off", "hybrid", "thinking"]); export declare namespace GraySwanCygnalGuardrailConfigConfigReasoningMode { export type Raw = "off" | "hybrid" | "thinking"; diff --git a/src/serialization/types/GroqIntegrations.ts b/src/serialization/types/GroqIntegrations.ts index 3ea40620..1d6bbf4a 100644 --- a/src/serialization/types/GroqIntegrations.ts +++ b/src/serialization/types/GroqIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { GroqModel } from "./GroqModel.js"; -export const GroqIntegrations: core.serialization.ObjectSchema = GroqModel; +export const GroqIntegrations: core.serialization.ObjectSchema< + serializers.GroqIntegrations.Raw, + TrueFoundry.GroqIntegrations +> = GroqModel; export declare namespace GroqIntegrations { export type Raw = GroqModel.Raw; diff --git a/src/serialization/types/GroqKeyAuth.ts b/src/serialization/types/GroqKeyAuth.ts index 40a29efb..b9ee0e4f 100644 --- a/src/serialization/types/GroqKeyAuth.ts +++ b/src/serialization/types/GroqKeyAuth.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const GroqKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) +export const GroqKeyAuth: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), }); export declare namespace GroqKeyAuth { diff --git a/src/serialization/types/GroqModel.ts b/src/serialization/types/GroqModel.ts index 0032ad86..2f60133b 100644 --- a/src/serialization/types/GroqModel.ts +++ b/src/serialization/types/GroqModel.ts @@ -1,18 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const GroqModel: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/model/groq"), - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) +export const GroqModel: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("integration/model/groq"), + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace GroqModel { diff --git a/src/serialization/types/GroqProviderAccount.ts b/src/serialization/types/GroqProviderAccount.ts index 72e3f0e9..e222c7f9 100644 --- a/src/serialization/types/GroqProviderAccount.ts +++ b/src/serialization/types/GroqProviderAccount.ts @@ -1,22 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { GroqIntegrations } from "./GroqIntegrations.js"; import { GroqKeyAuth } from "./GroqKeyAuth.js"; import { OwnedBy } from "./OwnedBy.js"; -export const GroqProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/groq"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", GroqKeyAuth), - "integrations": core.serialization.list(GroqIntegrations), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const GroqProviderAccount: core.serialization.ObjectSchema< + serializers.GroqProviderAccount.Raw, + TrueFoundry.GroqProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/groq"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", GroqKeyAuth), + integrations: core.serialization.list(GroqIntegrations), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace GroqProviderAccount { export interface Raw { diff --git a/src/serialization/types/GuardrailConfigGroup.ts b/src/serialization/types/GuardrailConfigGroup.ts index 096e2bfb..688071ba 100644 --- a/src/serialization/types/GuardrailConfigGroup.ts +++ b/src/serialization/types/GuardrailConfigGroup.ts @@ -1,19 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { GuardrailConfigIntegrations } from "./GuardrailConfigIntegrations.js"; import { OwnedBy } from "./OwnedBy.js"; -export const GuardrailConfigGroup: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/guardrail-config-group"), - "name": core.serialization.string(), - "collaborators": core.serialization.list(Collaborator).optional(), - "integrations": core.serialization.list(GuardrailConfigIntegrations), - "ownedBy": OwnedBy.optional() - }); +export const GuardrailConfigGroup: core.serialization.ObjectSchema< + serializers.GuardrailConfigGroup.Raw, + TrueFoundry.GuardrailConfigGroup +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/guardrail-config-group"), + name: core.serialization.string(), + collaborators: core.serialization.list(Collaborator).optional(), + integrations: core.serialization.list(GuardrailConfigIntegrations), + ownedBy: OwnedBy.optional(), +}); export declare namespace GuardrailConfigGroup { export interface Raw { diff --git a/src/serialization/types/GuardrailConfigIntegrations.ts b/src/serialization/types/GuardrailConfigIntegrations.ts index df68bf7e..cf90d756 100644 --- a/src/serialization/types/GuardrailConfigIntegrations.ts +++ b/src/serialization/types/GuardrailConfigIntegrations.ts @@ -1,14 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AktoGuardrailConfig } from "./AktoGuardrailConfig.js"; import { AwsBedrockGuardrailConfig } from "./AwsBedrockGuardrailConfig.js"; import { AzureContentSafetyGuardrailConfig } from "./AzureContentSafetyGuardrailConfig.js"; import { AzurePiiGuardrailConfig } from "./AzurePiiGuardrailConfig.js"; import { AzurePromptShieldGuardrailConfig } from "./AzurePromptShieldGuardrailConfig.js"; +import { CalypsoAiGuardrailConfig } from "./CalypsoAiGuardrailConfig.js"; import { CedarGuardrailConfig } from "./CedarGuardrailConfig.js"; +import { CiscoAiDefenseGuardrailConfig } from "./CiscoAiDefenseGuardrailConfig.js"; import { CodeSafetyLinterGuardrailConfig } from "./CodeSafetyLinterGuardrailConfig.js"; import { CrowdStrikeAidrGuardrailConfig } from "./CrowdStrikeAidrGuardrailConfig.js"; import { CustomGuardrailConfig } from "./CustomGuardrailConfig.js"; @@ -16,6 +18,7 @@ import { EnkryptAiGuardrailConfig } from "./EnkryptAiGuardrailConfig.js"; import { FiddlerGuardrailConfig } from "./FiddlerGuardrailConfig.js"; import { GoogleModelArmorGuardrailConfig } from "./GoogleModelArmorGuardrailConfig.js"; import { GraySwanCygnalGuardrailConfig } from "./GraySwanCygnalGuardrailConfig.js"; +import { NomaSecurityGuardrailConfig } from "./NomaSecurityGuardrailConfig.js"; import { OpaGuardrailConfig } from "./OpaGuardrailConfig.js"; import { OpenAiModerationsGuardrailConfig } from "./OpenAiModerationsGuardrailConfig.js"; import { PaloAltoPrismaAirsGuardrailConfig } from "./PaloAltoPrismaAirsGuardrailConfig.js"; @@ -29,8 +32,68 @@ import { TfyPiiGuardrailConfig } from "./TfyPiiGuardrailConfig.js"; import { TfyPromptInjectionGuardrailConfig } from "./TfyPromptInjectionGuardrailConfig.js"; import { TrojAiGuardrailConfig } from "./TrojAiGuardrailConfig.js"; -export const GuardrailConfigIntegrations: core.serialization.Schema = core.serialization.undiscriminatedUnion([OpenAiModerationsGuardrailConfig, AwsBedrockGuardrailConfig, CustomGuardrailConfig, AzurePiiGuardrailConfig, AzureContentSafetyGuardrailConfig, AzurePromptShieldGuardrailConfig, EnkryptAiGuardrailConfig, PaloAltoPrismaAirsGuardrailConfig, FiddlerGuardrailConfig, CrowdStrikeAidrGuardrailConfig, PatronusGuardrailConfig, SecretDetectionGuardrailConfig, CodeSafetyLinterGuardrailConfig, SqlSanitizerGuardrailConfig, RegexGuardrailConfig, TfyContentModerationGuardrailConfig, TfyPiiGuardrailConfig, TfyPromptInjectionGuardrailConfig, TfyMetadataGuardrailConfig, CedarGuardrailConfig, OpaGuardrailConfig, GoogleModelArmorGuardrailConfig, GraySwanCygnalGuardrailConfig, AktoGuardrailConfig, TrojAiGuardrailConfig]); +export const GuardrailConfigIntegrations: core.serialization.Schema< + serializers.GuardrailConfigIntegrations.Raw, + TrueFoundry.GuardrailConfigIntegrations +> = core.serialization.undiscriminatedUnion([ + OpenAiModerationsGuardrailConfig, + AwsBedrockGuardrailConfig, + CustomGuardrailConfig, + AzurePiiGuardrailConfig, + AzureContentSafetyGuardrailConfig, + AzurePromptShieldGuardrailConfig, + EnkryptAiGuardrailConfig, + PaloAltoPrismaAirsGuardrailConfig, + FiddlerGuardrailConfig, + CiscoAiDefenseGuardrailConfig, + CrowdStrikeAidrGuardrailConfig, + PatronusGuardrailConfig, + SecretDetectionGuardrailConfig, + CodeSafetyLinterGuardrailConfig, + SqlSanitizerGuardrailConfig, + RegexGuardrailConfig, + TfyContentModerationGuardrailConfig, + TfyPiiGuardrailConfig, + TfyPromptInjectionGuardrailConfig, + TfyMetadataGuardrailConfig, + CedarGuardrailConfig, + OpaGuardrailConfig, + GoogleModelArmorGuardrailConfig, + GraySwanCygnalGuardrailConfig, + NomaSecurityGuardrailConfig, + CalypsoAiGuardrailConfig, + AktoGuardrailConfig, + TrojAiGuardrailConfig, +]); export declare namespace GuardrailConfigIntegrations { - export type Raw = OpenAiModerationsGuardrailConfig.Raw | AwsBedrockGuardrailConfig.Raw | CustomGuardrailConfig.Raw | AzurePiiGuardrailConfig.Raw | AzureContentSafetyGuardrailConfig.Raw | AzurePromptShieldGuardrailConfig.Raw | EnkryptAiGuardrailConfig.Raw | PaloAltoPrismaAirsGuardrailConfig.Raw | FiddlerGuardrailConfig.Raw | CrowdStrikeAidrGuardrailConfig.Raw | PatronusGuardrailConfig.Raw | SecretDetectionGuardrailConfig.Raw | CodeSafetyLinterGuardrailConfig.Raw | SqlSanitizerGuardrailConfig.Raw | RegexGuardrailConfig.Raw | TfyContentModerationGuardrailConfig.Raw | TfyPiiGuardrailConfig.Raw | TfyPromptInjectionGuardrailConfig.Raw | TfyMetadataGuardrailConfig.Raw | CedarGuardrailConfig.Raw | OpaGuardrailConfig.Raw | GoogleModelArmorGuardrailConfig.Raw | GraySwanCygnalGuardrailConfig.Raw | AktoGuardrailConfig.Raw | TrojAiGuardrailConfig.Raw; + export type Raw = + | OpenAiModerationsGuardrailConfig.Raw + | AwsBedrockGuardrailConfig.Raw + | CustomGuardrailConfig.Raw + | AzurePiiGuardrailConfig.Raw + | AzureContentSafetyGuardrailConfig.Raw + | AzurePromptShieldGuardrailConfig.Raw + | EnkryptAiGuardrailConfig.Raw + | PaloAltoPrismaAirsGuardrailConfig.Raw + | FiddlerGuardrailConfig.Raw + | CiscoAiDefenseGuardrailConfig.Raw + | CrowdStrikeAidrGuardrailConfig.Raw + | PatronusGuardrailConfig.Raw + | SecretDetectionGuardrailConfig.Raw + | CodeSafetyLinterGuardrailConfig.Raw + | SqlSanitizerGuardrailConfig.Raw + | RegexGuardrailConfig.Raw + | TfyContentModerationGuardrailConfig.Raw + | TfyPiiGuardrailConfig.Raw + | TfyPromptInjectionGuardrailConfig.Raw + | TfyMetadataGuardrailConfig.Raw + | CedarGuardrailConfig.Raw + | OpaGuardrailConfig.Raw + | GoogleModelArmorGuardrailConfig.Raw + | GraySwanCygnalGuardrailConfig.Raw + | NomaSecurityGuardrailConfig.Raw + | CalypsoAiGuardrailConfig.Raw + | AktoGuardrailConfig.Raw + | TrojAiGuardrailConfig.Raw; } diff --git a/src/serialization/types/GuardrailSettings.ts b/src/serialization/types/GuardrailSettings.ts index 50c35d3b..ad414a4b 100644 --- a/src/serialization/types/GuardrailSettings.ts +++ b/src/serialization/types/GuardrailSettings.ts @@ -1,13 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const GuardrailSettings: core.serialization.ObjectSchema = core.serialization.object({ - "timeoutMs": core.serialization.property("timeout_ms", core.serialization.number().optional()), - "enableParallelExecution": core.serialization.property("enable_parallel_execution", core.serialization.boolean().optional()) - }); +export const GuardrailSettings: core.serialization.ObjectSchema< + serializers.GuardrailSettings.Raw, + TrueFoundry.GuardrailSettings +> = core.serialization.object({ + timeoutMs: core.serialization.property("timeout_ms", core.serialization.number().optional()), + enableParallelExecution: core.serialization.property( + "enable_parallel_execution", + core.serialization.boolean().optional(), + ), +}); export declare namespace GuardrailSettings { export interface Raw { diff --git a/src/serialization/types/Guardrails.ts b/src/serialization/types/Guardrails.ts index 4db72375..5a2e34e5 100644 --- a/src/serialization/types/Guardrails.ts +++ b/src/serialization/types/Guardrails.ts @@ -1,12 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const Guardrails: core.serialization.ObjectSchema = core.serialization.object({ - "inputGuardrails": core.serialization.property("input_guardrails", core.serialization.list(core.serialization.string()).optional()), - "outputGuardrails": core.serialization.property("output_guardrails", core.serialization.list(core.serialization.string()).optional()) +export const Guardrails: core.serialization.ObjectSchema = + core.serialization.object({ + inputGuardrails: core.serialization.property( + "input_guardrails", + core.serialization.list(core.serialization.string()).optional(), + ), + outputGuardrails: core.serialization.property( + "output_guardrails", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace Guardrails { diff --git a/src/serialization/types/GuardrailsConfig.ts b/src/serialization/types/GuardrailsConfig.ts index f38e808f..d0d3083d 100644 --- a/src/serialization/types/GuardrailsConfig.ts +++ b/src/serialization/types/GuardrailsConfig.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GuardrailsRule } from "./GuardrailsRule.js"; -export const GuardrailsConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("gateway-guardrails-config"), - "rules": core.serialization.list(GuardrailsRule) - }); +export const GuardrailsConfig: core.serialization.ObjectSchema< + serializers.GuardrailsConfig.Raw, + TrueFoundry.GuardrailsConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("gateway-guardrails-config"), + rules: core.serialization.list(GuardrailsRule), +}); export declare namespace GuardrailsConfig { export interface Raw { diff --git a/src/serialization/types/GuardrailsRule.ts b/src/serialization/types/GuardrailsRule.ts index 73b66972..7f77036d 100644 --- a/src/serialization/types/GuardrailsRule.ts +++ b/src/serialization/types/GuardrailsRule.ts @@ -1,19 +1,34 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GuardrailsWhen } from "./GuardrailsWhen.js"; -export const GuardrailsRule: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string(), - "when": GuardrailsWhen, - "llmInputGuardrails": core.serialization.property("llm_input_guardrails", core.serialization.list(core.serialization.string())), - "llmOutputGuardrails": core.serialization.property("llm_output_guardrails", core.serialization.list(core.serialization.string())), - "mcpToolPreInvokeGuardrails": core.serialization.property("mcp_tool_pre_invoke_guardrails", core.serialization.list(core.serialization.string())), - "mcpToolPostInvokeGuardrails": core.serialization.property("mcp_tool_post_invoke_guardrails", core.serialization.list(core.serialization.string())), - "customErrorMessage": core.serialization.property("custom_error_message", core.serialization.string().optional()) - }); +export const GuardrailsRule: core.serialization.ObjectSchema< + serializers.GuardrailsRule.Raw, + TrueFoundry.GuardrailsRule +> = core.serialization.object({ + id: core.serialization.string(), + when: GuardrailsWhen, + llmInputGuardrails: core.serialization.property( + "llm_input_guardrails", + core.serialization.list(core.serialization.string()), + ), + llmOutputGuardrails: core.serialization.property( + "llm_output_guardrails", + core.serialization.list(core.serialization.string()), + ), + mcpToolPreInvokeGuardrails: core.serialization.property( + "mcp_tool_pre_invoke_guardrails", + core.serialization.list(core.serialization.string()), + ), + mcpToolPostInvokeGuardrails: core.serialization.property( + "mcp_tool_post_invoke_guardrails", + core.serialization.list(core.serialization.string()), + ), + customErrorMessage: core.serialization.property("custom_error_message", core.serialization.string().optional()), +}); export declare namespace GuardrailsRule { export interface Raw { diff --git a/src/serialization/types/GuardrailsWhen.ts b/src/serialization/types/GuardrailsWhen.ts index a7a0e448..517b8700 100644 --- a/src/serialization/types/GuardrailsWhen.ts +++ b/src/serialization/types/GuardrailsWhen.ts @@ -1,16 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { SubjectConditionGroup } from "./SubjectConditionGroup.js"; import { TargetConditionGroup } from "./TargetConditionGroup.js"; -export const GuardrailsWhen: core.serialization.ObjectSchema = core.serialization.object({ - "target": TargetConditionGroup.optional(), - "subjects": SubjectConditionGroup.optional(), - "metadata": core.serialization.record(core.serialization.string(), core.serialization.string()).optional() - }); +export const GuardrailsWhen: core.serialization.ObjectSchema< + serializers.GuardrailsWhen.Raw, + TrueFoundry.GuardrailsWhen +> = core.serialization.object({ + target: TargetConditionGroup.optional(), + subjects: SubjectConditionGroup.optional(), + metadata: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), +}); export declare namespace GuardrailsWhen { export interface Raw { diff --git a/src/serialization/types/H2OFramework.ts b/src/serialization/types/H2OFramework.ts index cbb11e76..b14477da 100644 --- a/src/serialization/types/H2OFramework.ts +++ b/src/serialization/types/H2OFramework.ts @@ -1,11 +1,12 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const H2OFramework: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("h2o") +export const H2OFramework: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("h2o"), }); export declare namespace H2OFramework { diff --git a/src/serialization/types/HashicorpAppRoleAuth.ts b/src/serialization/types/HashicorpAppRoleAuth.ts index 9904f430..8520a0dc 100644 --- a/src/serialization/types/HashicorpAppRoleAuth.ts +++ b/src/serialization/types/HashicorpAppRoleAuth.ts @@ -1,19 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const HashicorpAppRoleAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("approle"), - "roleId": core.serialization.property("role_id", core.serialization.string()), - "secretId": core.serialization.property("secret_id", core.serialization.string()) - }); +export const HashicorpAppRoleAuth: core.serialization.ObjectSchema< + serializers.HashicorpAppRoleAuth.Raw, + TrueFoundry.HashicorpAppRoleAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("approle"), + roleId: core.serialization.property("role_id", core.serialization.string()), + secretId: core.serialization.property("secret_id", core.serialization.string()), + rolePath: core.serialization.property("role_path", core.serialization.string().optional()), +}); export declare namespace HashicorpAppRoleAuth { export interface Raw { type: "approle"; role_id: string; secret_id: string; + role_path?: string | null; } } diff --git a/src/serialization/types/HashicorpIntegrations.ts b/src/serialization/types/HashicorpIntegrations.ts index 93f57311..5f8b9731 100644 --- a/src/serialization/types/HashicorpIntegrations.ts +++ b/src/serialization/types/HashicorpIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { HashicorpVaultIntegration } from "./HashicorpVaultIntegration.js"; -export const HashicorpIntegrations: core.serialization.ObjectSchema = HashicorpVaultIntegration; +export const HashicorpIntegrations: core.serialization.ObjectSchema< + serializers.HashicorpIntegrations.Raw, + TrueFoundry.HashicorpIntegrations +> = HashicorpVaultIntegration; export declare namespace HashicorpIntegrations { export type Raw = HashicorpVaultIntegration.Raw; diff --git a/src/serialization/types/HashicorpProviderAccount.ts b/src/serialization/types/HashicorpProviderAccount.ts index 16dd1d0e..5a9db9ab 100644 --- a/src/serialization/types/HashicorpProviderAccount.ts +++ b/src/serialization/types/HashicorpProviderAccount.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { HashicorpIntegrations } from "./HashicorpIntegrations.js"; import { OwnedBy } from "./OwnedBy.js"; -export const HashicorpProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/hashicorp"), - "name": core.serialization.string(), - "integrations": core.serialization.list(HashicorpIntegrations), - "ownedBy": OwnedBy.optional() - }); +export const HashicorpProviderAccount: core.serialization.ObjectSchema< + serializers.HashicorpProviderAccount.Raw, + TrueFoundry.HashicorpProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/hashicorp"), + name: core.serialization.string(), + integrations: core.serialization.list(HashicorpIntegrations), + ownedBy: OwnedBy.optional(), +}); export declare namespace HashicorpProviderAccount { export interface Raw { diff --git a/src/serialization/types/HashicorpTokenAuth.ts b/src/serialization/types/HashicorpTokenAuth.ts index eb3b5ed6..9029e305 100644 --- a/src/serialization/types/HashicorpTokenAuth.ts +++ b/src/serialization/types/HashicorpTokenAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const HashicorpTokenAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("token"), - "token": core.serialization.string() - }); +export const HashicorpTokenAuth: core.serialization.ObjectSchema< + serializers.HashicorpTokenAuth.Raw, + TrueFoundry.HashicorpTokenAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("token"), + token: core.serialization.string(), +}); export declare namespace HashicorpTokenAuth { export interface Raw { diff --git a/src/serialization/types/HashicorpVaultIntegration.ts b/src/serialization/types/HashicorpVaultIntegration.ts index 91951017..e9d19ae9 100644 --- a/src/serialization/types/HashicorpVaultIntegration.ts +++ b/src/serialization/types/HashicorpVaultIntegration.ts @@ -1,20 +1,26 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { HashicorpVaultIntegrationAuthData } from "./HashicorpVaultIntegrationAuthData.js"; -export const HashicorpVaultIntegration: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/secret-store/hashicorp/vault"), - "name": core.serialization.string(), - "vaultUrl": core.serialization.property("vault_url", core.serialization.string()), - "kvMountPath": core.serialization.property("kv_mount_path", core.serialization.string()), - "rootPath": core.serialization.property("root_path", core.serialization.string().optional()), - "authData": core.serialization.property("auth_data", HashicorpVaultIntegrationAuthData), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()), - "namespace": core.serialization.string().optional() - }); +export const HashicorpVaultIntegration: core.serialization.ObjectSchema< + serializers.HashicorpVaultIntegration.Raw, + TrueFoundry.HashicorpVaultIntegration +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/secret-store/hashicorp/vault"), + name: core.serialization.string(), + vaultUrl: core.serialization.property("vault_url", core.serialization.string()), + kvMountPath: core.serialization.property("kv_mount_path", core.serialization.string()), + rootPath: core.serialization.property("root_path", core.serialization.string().optional()), + authData: core.serialization.property("auth_data", HashicorpVaultIntegrationAuthData), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), + namespace: core.serialization.string().optional(), +}); export declare namespace HashicorpVaultIntegration { export interface Raw { diff --git a/src/serialization/types/HashicorpVaultIntegrationAuthData.ts b/src/serialization/types/HashicorpVaultIntegrationAuthData.ts index e08fa224..ff3ad167 100644 --- a/src/serialization/types/HashicorpVaultIntegrationAuthData.ts +++ b/src/serialization/types/HashicorpVaultIntegrationAuthData.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { HashicorpAppRoleAuth } from "./HashicorpAppRoleAuth.js"; import { HashicorpTokenAuth } from "./HashicorpTokenAuth.js"; -export const HashicorpVaultIntegrationAuthData: core.serialization.Schema = core.serialization.undiscriminatedUnion([HashicorpTokenAuth, HashicorpAppRoleAuth]); +export const HashicorpVaultIntegrationAuthData: core.serialization.Schema< + serializers.HashicorpVaultIntegrationAuthData.Raw, + TrueFoundry.HashicorpVaultIntegrationAuthData +> = core.serialization.undiscriminatedUnion([HashicorpTokenAuth, HashicorpAppRoleAuth]); export declare namespace HashicorpVaultIntegrationAuthData { export type Raw = HashicorpTokenAuth.Raw | HashicorpAppRoleAuth.Raw; diff --git a/src/serialization/types/HeaderMatch.ts b/src/serialization/types/HeaderMatch.ts index 5e583194..b4e56c32 100644 --- a/src/serialization/types/HeaderMatch.ts +++ b/src/serialization/types/HeaderMatch.ts @@ -1,13 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const HeaderMatch: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("header"), - "name": core.serialization.string(), - "exactMatch": core.serialization.property("exact_match", core.serialization.string()) +export const HeaderMatch: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("header"), + name: core.serialization.string(), + exactMatch: core.serialization.property("exact_match", core.serialization.string()), }); export declare namespace HeaderMatch { diff --git a/src/serialization/types/HeaderRoutingConfig.ts b/src/serialization/types/HeaderRoutingConfig.ts index 71991091..2a96cbff 100644 --- a/src/serialization/types/HeaderRoutingConfig.ts +++ b/src/serialization/types/HeaderRoutingConfig.ts @@ -1,14 +1,27 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; +import { ComplexityBasedLoadBalancing } from "./ComplexityBasedLoadBalancing.js"; import { LatencyBasedLoadBalancing } from "./LatencyBasedLoadBalancing.js"; import { PriorityBasedLoadBalancing } from "./PriorityBasedLoadBalancing.js"; import { WeightBasedLoadBalancing } from "./WeightBasedLoadBalancing.js"; -export const HeaderRoutingConfig: core.serialization.Schema = core.serialization.undiscriminatedUnion([WeightBasedLoadBalancing, LatencyBasedLoadBalancing, PriorityBasedLoadBalancing]); +export const HeaderRoutingConfig: core.serialization.Schema< + serializers.HeaderRoutingConfig.Raw, + TrueFoundry.HeaderRoutingConfig +> = core.serialization.undiscriminatedUnion([ + WeightBasedLoadBalancing, + LatencyBasedLoadBalancing, + PriorityBasedLoadBalancing, + ComplexityBasedLoadBalancing, +]); export declare namespace HeaderRoutingConfig { - export type Raw = WeightBasedLoadBalancing.Raw | LatencyBasedLoadBalancing.Raw | PriorityBasedLoadBalancing.Raw; + export type Raw = + | WeightBasedLoadBalancing.Raw + | LatencyBasedLoadBalancing.Raw + | PriorityBasedLoadBalancing.Raw + | ComplexityBasedLoadBalancing.Raw; } diff --git a/src/serialization/types/HeadersOverride.ts b/src/serialization/types/HeadersOverride.ts index b0e1514a..d9c50b11 100644 --- a/src/serialization/types/HeadersOverride.ts +++ b/src/serialization/types/HeadersOverride.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const HeadersOverride: core.serialization.ObjectSchema = core.serialization.object({ - "remove": core.serialization.list(core.serialization.string()).optional(), - "set": core.serialization.record(core.serialization.string(), core.serialization.string()).optional() - }); +export const HeadersOverride: core.serialization.ObjectSchema< + serializers.HeadersOverride.Raw, + TrueFoundry.HeadersOverride +> = core.serialization.object({ + remove: core.serialization.list(core.serialization.string()).optional(), + set: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), +}); export declare namespace HeadersOverride { export interface Raw { diff --git a/src/serialization/types/HealthProbe.ts b/src/serialization/types/HealthProbe.ts index a193e44a..f3b656a9 100644 --- a/src/serialization/types/HealthProbe.ts +++ b/src/serialization/types/HealthProbe.ts @@ -1,17 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { HttpProbe } from "./HttpProbe.js"; -export const HealthProbe: core.serialization.ObjectSchema = core.serialization.object({ - "config": HttpProbe, - "initialDelaySeconds": core.serialization.property("initial_delay_seconds", core.serialization.number().optional()), - "periodSeconds": core.serialization.property("period_seconds", core.serialization.number().optional()), - "timeoutSeconds": core.serialization.property("timeout_seconds", core.serialization.number().optional()), - "successThreshold": core.serialization.property("success_threshold", core.serialization.number().optional()), - "failureThreshold": core.serialization.property("failure_threshold", core.serialization.number().optional()) +export const HealthProbe: core.serialization.ObjectSchema = + core.serialization.object({ + config: HttpProbe, + initialDelaySeconds: core.serialization.property( + "initial_delay_seconds", + core.serialization.number().optional(), + ), + periodSeconds: core.serialization.property("period_seconds", core.serialization.number().optional()), + timeoutSeconds: core.serialization.property("timeout_seconds", core.serialization.number().optional()), + successThreshold: core.serialization.property("success_threshold", core.serialization.number().optional()), + failureThreshold: core.serialization.property("failure_threshold", core.serialization.number().optional()), }); export declare namespace HealthProbe { diff --git a/src/serialization/types/Helm.ts b/src/serialization/types/Helm.ts index 452cadae..e17cad4c 100644 --- a/src/serialization/types/Helm.ts +++ b/src/serialization/types/Helm.ts @@ -1,21 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { HelmSource } from "./HelmSource.js"; import { Kustomize } from "./Kustomize.js"; export const Helm: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("helm"), - "name": core.serialization.string(), - "labels": core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), - "source": HelmSource, - "values": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - "kustomize": Kustomize.optional(), - "ignoreDifferences": core.serialization.list(core.serialization.record(core.serialization.string(), core.serialization.unknown())).optional(), - "workspaceFqn": core.serialization.property("workspace_fqn", core.serialization.string().optional()) - }); + type: core.serialization.stringLiteral("helm"), + name: core.serialization.string(), + labels: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), + source: HelmSource, + values: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + kustomize: Kustomize.optional(), + ignoreDifferences: core.serialization + .list(core.serialization.record(core.serialization.string(), core.serialization.unknown())) + .optional(), + workspaceFqn: core.serialization.property("workspace_fqn", core.serialization.string().optional()), +}); export declare namespace Helm { export interface Raw { diff --git a/src/serialization/types/HelmRepo.ts b/src/serialization/types/HelmRepo.ts index ed576a3b..216c5bd7 100644 --- a/src/serialization/types/HelmRepo.ts +++ b/src/serialization/types/HelmRepo.ts @@ -1,15 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const HelmRepo: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("helm-repo"), - "repoUrl": core.serialization.property("repo_url", core.serialization.string()), - "integrationFqn": core.serialization.property("integration_fqn", core.serialization.string().optional()), - "chart": core.serialization.string(), - "version": core.serialization.string() +export const HelmRepo: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("helm-repo"), + repoUrl: core.serialization.property("repo_url", core.serialization.string()), + integrationFqn: core.serialization.property("integration_fqn", core.serialization.string().optional()), + chart: core.serialization.string(), + version: core.serialization.string(), }); export declare namespace HelmRepo { diff --git a/src/serialization/types/HelmSource.ts b/src/serialization/types/HelmSource.ts index 72d2519c..3d01f5a7 100644 --- a/src/serialization/types/HelmSource.ts +++ b/src/serialization/types/HelmSource.ts @@ -1,13 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GitHelmRepo } from "./GitHelmRepo.js"; import { HelmRepo } from "./HelmRepo.js"; import { OciRepo } from "./OciRepo.js"; -export const HelmSource: core.serialization.Schema = core.serialization.undiscriminatedUnion([HelmRepo, OciRepo, GitHelmRepo]); +export const HelmSource: core.serialization.Schema = + core.serialization.undiscriminatedUnion([HelmRepo, OciRepo, GitHelmRepo]); export declare namespace HelmSource { export type Raw = HelmRepo.Raw | OciRepo.Raw | GitHelmRepo.Raw; diff --git a/src/serialization/types/HeuristicClassificationStrategy.ts b/src/serialization/types/HeuristicClassificationStrategy.ts new file mode 100644 index 00000000..aad644c8 --- /dev/null +++ b/src/serialization/types/HeuristicClassificationStrategy.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const HeuristicClassificationStrategy: core.serialization.ObjectSchema< + serializers.HeuristicClassificationStrategy.Raw, + TrueFoundry.HeuristicClassificationStrategy +> = core.serialization.object({ + type: core.serialization.stringLiteral("heuristic"), +}); + +export declare namespace HeuristicClassificationStrategy { + export interface Raw { + type: "heuristic"; + } +} diff --git a/src/serialization/types/HeuristicFallbackStrategy.ts b/src/serialization/types/HeuristicFallbackStrategy.ts new file mode 100644 index 00000000..0892a572 --- /dev/null +++ b/src/serialization/types/HeuristicFallbackStrategy.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const HeuristicFallbackStrategy: core.serialization.ObjectSchema< + serializers.HeuristicFallbackStrategy.Raw, + TrueFoundry.HeuristicFallbackStrategy +> = core.serialization.object({ + type: core.serialization.stringLiteral("heuristic"), +}); + +export declare namespace HeuristicFallbackStrategy { + export interface Raw { + type: "heuristic"; + } +} diff --git a/src/serialization/types/HostedA2AAgent.ts b/src/serialization/types/HostedA2AAgent.ts index bb41c856..81175a9d 100644 --- a/src/serialization/types/HostedA2AAgent.ts +++ b/src/serialization/types/HostedA2AAgent.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const HostedA2AAgent: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("hosted-a2a-agent"), - "agentCardUrl": core.serialization.property("agent_card_url", core.serialization.string()), - "headers": core.serialization.record(core.serialization.string(), core.serialization.string()).optional() - }); +export const HostedA2AAgent: core.serialization.ObjectSchema< + serializers.HostedA2AAgent.Raw, + TrueFoundry.HostedA2AAgent +> = core.serialization.object({ + type: core.serialization.stringLiteral("hosted-a2a-agent"), + agentCardUrl: core.serialization.property("agent_card_url", core.serialization.string()), + headers: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), +}); export declare namespace HostedA2AAgent { export interface Raw { diff --git a/src/serialization/types/HttpError.ts b/src/serialization/types/HttpError.ts index 0d6345ce..01715b17 100644 --- a/src/serialization/types/HttpError.ts +++ b/src/serialization/types/HttpError.ts @@ -1,22 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { HttpErrorCode } from "./HttpErrorCode.js"; -export const HttpError: core.serialization.ObjectSchema = core.serialization.object({ - "statusCode": core.serialization.number(), - "message": core.serialization.string(), - "code": HttpErrorCode.optional(), - "details": core.serialization.list(core.serialization.record(core.serialization.string(), core.serialization.unknown())).optional() +export const HttpError: core.serialization.ObjectSchema = + core.serialization.object({ + statusCode: core.serialization.number(), + message: core.serialization.string(), + code: HttpErrorCode.optionalNullable(), + details: core.serialization + .list(core.serialization.record(core.serialization.string(), core.serialization.unknown())) + .optionalNullable(), }); export declare namespace HttpError { export interface Raw { statusCode: number; message: string; - code?: HttpErrorCode.Raw | null; - details?: Record[] | null; + code?: (HttpErrorCode.Raw | null | undefined) | null; + details?: (Record[] | null | undefined) | null; } } diff --git a/src/serialization/types/HttpErrorCode.ts b/src/serialization/types/HttpErrorCode.ts index f6403145..b7d36a2f 100644 --- a/src/serialization/types/HttpErrorCode.ts +++ b/src/serialization/types/HttpErrorCode.ts @@ -1,10 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const HttpErrorCode: core.serialization.Schema = core.serialization.undiscriminatedUnion([core.serialization.number(), core.serialization.string()]); +export const HttpErrorCode: core.serialization.Schema = + core.serialization.undiscriminatedUnion([core.serialization.number(), core.serialization.string()]); export declare namespace HttpErrorCode { export type Raw = number | string; diff --git a/src/serialization/types/HttpProbe.ts b/src/serialization/types/HttpProbe.ts index bc9277e4..c0ee2801 100644 --- a/src/serialization/types/HttpProbe.ts +++ b/src/serialization/types/HttpProbe.ts @@ -1,15 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const HttpProbe: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("http"), - "path": core.serialization.string(), - "port": core.serialization.number(), - "host": core.serialization.string().optional(), - "scheme": core.serialization.string().optional() +export const HttpProbe: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("http"), + path: core.serialization.string(), + port: core.serialization.number(), + host: core.serialization.string().optional(), + scheme: core.serialization.string().optional(), }); export declare namespace HttpProbe { diff --git a/src/serialization/types/HuggingfaceArtifactSource.ts b/src/serialization/types/HuggingfaceArtifactSource.ts index e4142ab4..5e62b547 100644 --- a/src/serialization/types/HuggingfaceArtifactSource.ts +++ b/src/serialization/types/HuggingfaceArtifactSource.ts @@ -1,16 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const HuggingfaceArtifactSource: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("huggingface-hub"), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "revision": core.serialization.string(), - "ignorePatterns": core.serialization.property("ignore_patterns", core.serialization.list(core.serialization.string())), - "downloadPathEnvVariable": core.serialization.property("download_path_env_variable", core.serialization.string()) - }); +export const HuggingfaceArtifactSource: core.serialization.ObjectSchema< + serializers.HuggingfaceArtifactSource.Raw, + TrueFoundry.HuggingfaceArtifactSource +> = core.serialization.object({ + type: core.serialization.stringLiteral("huggingface-hub"), + modelId: core.serialization.property("model_id", core.serialization.string()), + revision: core.serialization.string(), + ignorePatterns: core.serialization.property( + "ignore_patterns", + core.serialization.list(core.serialization.string()), + ), + downloadPathEnvVariable: core.serialization.property("download_path_env_variable", core.serialization.string()), +}); export declare namespace HuggingfaceArtifactSource { export interface Raw { diff --git a/src/serialization/types/IChange.ts b/src/serialization/types/IChange.ts index 85bee99f..960cb8a0 100644 --- a/src/serialization/types/IChange.ts +++ b/src/serialization/types/IChange.ts @@ -1,24 +1,27 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; import * as serializers from "../index.js"; -import { IChangeOperation } from "./IChangeOperation.js"; +import { IChangeType } from "./IChangeType.js"; -export const IChange: core.serialization.ObjectSchema = core.serialization.object({ - "type": IChangeOperation, - "key": core.serialization.string(), - "value": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - "oldValue": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - "changes": core.serialization.list(core.serialization.lazyObject(() => serializers.IChange)).optional() +export const IChange: core.serialization.ObjectSchema = + core.serialization.object({ + type: IChangeType, + key: core.serialization.string(), + value: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optionalNullable(), + oldValue: core.serialization + .record(core.serialization.string(), core.serialization.unknown()) + .optionalNullable(), + changes: core.serialization.list(core.serialization.lazyObject(() => serializers.IChange)).optionalNullable(), }); export declare namespace IChange { export interface Raw { - type: IChangeOperation.Raw; + type: IChangeType.Raw; key: string; - value?: Record | null; - oldValue?: Record | null; - changes?: serializers.IChange.Raw[] | null; + value?: (Record | null | undefined) | null; + oldValue?: (Record | null | undefined) | null; + changes?: (serializers.IChange.Raw[] | null | undefined) | null; } } diff --git a/src/serialization/types/IChangeOperation.ts b/src/serialization/types/IChangeOperation.ts deleted file mode 100644 index ad80f925..00000000 --- a/src/serialization/types/IChangeOperation.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; - -export const IChangeOperation: core.serialization.Schema = core.serialization.enum_(["REMOVE", "ADD", "UPDATE"]); - -export declare namespace IChangeOperation { - export type Raw = "REMOVE" | "ADD" | "UPDATE"; -} diff --git a/src/serialization/types/IChangeType.ts b/src/serialization/types/IChangeType.ts new file mode 100644 index 00000000..24b79491 --- /dev/null +++ b/src/serialization/types/IChangeType.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const IChangeType: core.serialization.Schema = + core.serialization.enum_(["REMOVE", "ADD", "UPDATE"]); + +export declare namespace IChangeType { + export type Raw = "REMOVE" | "ADD" | "UPDATE"; +} diff --git a/src/serialization/types/IdentityProviderBackedIdentity.ts b/src/serialization/types/IdentityProviderBackedIdentity.ts index 96283d47..56af3d78 100644 --- a/src/serialization/types/IdentityProviderBackedIdentity.ts +++ b/src/serialization/types/IdentityProviderBackedIdentity.ts @@ -1,18 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AgentIdentityProviderMapping } from "./AgentIdentityProviderMapping.js"; -export const IdentityProviderBackedIdentity: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("idp-backed"), - "identityProviderMapping": core.serialization.property("identity_provider_mapping", core.serialization.list(AgentIdentityProviderMapping)) - }); +export const IdentityProviderBackedIdentity: core.serialization.ObjectSchema< + serializers.IdentityProviderBackedIdentity.Raw, + TrueFoundry.IdentityProviderBackedIdentity +> = core.serialization.object({ + type: core.serialization.stringLiteral("identity-provider-backed"), + identityProviderMapping: core.serialization.property( + "identity_provider_mapping", + core.serialization.list(AgentIdentityProviderMapping), + ), +}); export declare namespace IdentityProviderBackedIdentity { export interface Raw { - type: "idp-backed"; + type: "identity-provider-backed"; identity_provider_mapping: AgentIdentityProviderMapping.Raw[]; } } diff --git a/src/serialization/types/IdentityProviderMapping.ts b/src/serialization/types/IdentityProviderMapping.ts index c7b6515b..7dcbffcf 100644 --- a/src/serialization/types/IdentityProviderMapping.ts +++ b/src/serialization/types/IdentityProviderMapping.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const IdentityProviderMapping: core.serialization.ObjectSchema = core.serialization.object({ - "identityProvider": core.serialization.property("identity_provider", core.serialization.string()), - "value": core.serialization.string() - }); +export const IdentityProviderMapping: core.serialization.ObjectSchema< + serializers.IdentityProviderMapping.Raw, + TrueFoundry.IdentityProviderMapping +> = core.serialization.object({ + identityProvider: core.serialization.property("identity_provider", core.serialization.string()), + value: core.serialization.string(), +}); export declare namespace IdentityProviderMapping { export interface Raw { diff --git a/src/serialization/types/Image.ts b/src/serialization/types/Image.ts index 7e1d221f..ded3fbd0 100644 --- a/src/serialization/types/Image.ts +++ b/src/serialization/types/Image.ts @@ -1,15 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ImageCommand } from "./ImageCommand.js"; -export const Image: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("image"), - "imageUri": core.serialization.property("image_uri", core.serialization.string()), - "dockerRegistry": core.serialization.property("docker_registry", core.serialization.string().optional()), - "command": ImageCommand.optional() +export const Image: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("image"), + imageUri: core.serialization.property("image_uri", core.serialization.string()), + dockerRegistry: core.serialization.property("docker_registry", core.serialization.string().optional()), + command: ImageCommand.optional(), }); export declare namespace Image { diff --git a/src/serialization/types/ImageCommand.ts b/src/serialization/types/ImageCommand.ts index 96f0e41e..1d37c125 100644 --- a/src/serialization/types/ImageCommand.ts +++ b/src/serialization/types/ImageCommand.ts @@ -1,10 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const ImageCommand: core.serialization.Schema = core.serialization.undiscriminatedUnion([core.serialization.string(), core.serialization.list(core.serialization.string())]); +export const ImageCommand: core.serialization.Schema = + core.serialization.undiscriminatedUnion([ + core.serialization.string(), + core.serialization.list(core.serialization.string()), + ]); export declare namespace ImageCommand { export type Raw = string | string[]; diff --git a/src/serialization/types/ImageContentPart.ts b/src/serialization/types/ImageContentPart.ts index 032ebbee..44e3d289 100644 --- a/src/serialization/types/ImageContentPart.ts +++ b/src/serialization/types/ImageContentPart.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ImageContentPartImageUrl } from "./ImageContentPartImageUrl.js"; -export const ImageContentPart: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("image_url"), - "imageUrl": core.serialization.property("image_url", ImageContentPartImageUrl) - }); +export const ImageContentPart: core.serialization.ObjectSchema< + serializers.ImageContentPart.Raw, + TrueFoundry.ImageContentPart +> = core.serialization.object({ + type: core.serialization.stringLiteral("image_url"), + imageUrl: core.serialization.property("image_url", ImageContentPartImageUrl), +}); export declare namespace ImageContentPart { export interface Raw { diff --git a/src/serialization/types/ImageContentPartImageUrl.ts b/src/serialization/types/ImageContentPartImageUrl.ts index f5283701..58847b99 100644 --- a/src/serialization/types/ImageContentPartImageUrl.ts +++ b/src/serialization/types/ImageContentPartImageUrl.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ImageContentPartImageUrlUrl } from "./ImageContentPartImageUrlUrl.js"; -export const ImageContentPartImageUrl: core.serialization.ObjectSchema = core.serialization.object({ - "url": ImageContentPartImageUrlUrl, - "detail": core.serialization.string().optional() - }); +export const ImageContentPartImageUrl: core.serialization.ObjectSchema< + serializers.ImageContentPartImageUrl.Raw, + TrueFoundry.ImageContentPartImageUrl +> = core.serialization.object({ + url: ImageContentPartImageUrlUrl, + detail: core.serialization.string().optional(), +}); export declare namespace ImageContentPartImageUrl { export interface Raw { diff --git a/src/serialization/types/ImageContentPartImageUrlUrl.ts b/src/serialization/types/ImageContentPartImageUrlUrl.ts index 9cf3170a..398e4323 100644 --- a/src/serialization/types/ImageContentPartImageUrlUrl.ts +++ b/src/serialization/types/ImageContentPartImageUrlUrl.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BlobStorageReference } from "./BlobStorageReference.js"; -export const ImageContentPartImageUrlUrl: core.serialization.Schema = core.serialization.undiscriminatedUnion([core.serialization.string(), BlobStorageReference]); +export const ImageContentPartImageUrlUrl: core.serialization.Schema< + serializers.ImageContentPartImageUrlUrl.Raw, + TrueFoundry.ImageContentPartImageUrlUrl +> = core.serialization.undiscriminatedUnion([core.serialization.string(), BlobStorageReference]); export declare namespace ImageContentPartImageUrlUrl { export type Raw = string | BlobStorageReference.Raw; diff --git a/src/serialization/types/InNotIn.ts b/src/serialization/types/InNotIn.ts new file mode 100644 index 00000000..e1d14e5c --- /dev/null +++ b/src/serialization/types/InNotIn.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const InNotIn: core.serialization.ObjectSchema = + core.serialization.object({ + in: core.serialization.list(core.serialization.string()).optional(), + notIn: core.serialization.property("not_in", core.serialization.list(core.serialization.string()).optional()), + }); + +export declare namespace InNotIn { + export interface Raw { + in?: string[] | null; + not_in?: string[] | null; + } +} diff --git a/src/serialization/types/InNotInOperator.ts b/src/serialization/types/InNotInOperator.ts index c1e84b4a..3d4802f8 100644 --- a/src/serialization/types/InNotInOperator.ts +++ b/src/serialization/types/InNotInOperator.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { InNotInOperatorCondition } from "./InNotInOperatorCondition.js"; -export const InNotInOperator: core.serialization.ObjectSchema = core.serialization.object({ - "condition": InNotInOperatorCondition, - "values": core.serialization.list(core.serialization.string()) - }); +export const InNotInOperator: core.serialization.ObjectSchema< + serializers.InNotInOperator.Raw, + TrueFoundry.InNotInOperator +> = core.serialization.object({ + condition: InNotInOperatorCondition, + values: core.serialization.list(core.serialization.string()), +}); export declare namespace InNotInOperator { export interface Raw { diff --git a/src/serialization/types/InNotInOperatorCondition.ts b/src/serialization/types/InNotInOperatorCondition.ts index 5345b138..78799321 100644 --- a/src/serialization/types/InNotInOperatorCondition.ts +++ b/src/serialization/types/InNotInOperatorCondition.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const InNotInOperatorCondition: core.serialization.Schema = core.serialization.enum_(["in", "not_in"]); +export const InNotInOperatorCondition: core.serialization.Schema< + serializers.InNotInOperatorCondition.Raw, + TrueFoundry.InNotInOperatorCondition +> = core.serialization.enum_(["in", "not_in"]); export declare namespace InNotInOperatorCondition { export type Raw = "in" | "not_in"; diff --git a/src/serialization/types/InferMethodName.ts b/src/serialization/types/InferMethodName.ts index 958e5548..6bed68e7 100644 --- a/src/serialization/types/InferMethodName.ts +++ b/src/serialization/types/InferMethodName.ts @@ -1,10 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const InferMethodName: core.serialization.Schema = core.serialization.enum_(["predict", "predict_proba"]); +export const InferMethodName: core.serialization.Schema = + core.serialization.enum_(["predict", "predict_proba"]); export declare namespace InferMethodName { export type Raw = "predict" | "predict_proba"; diff --git a/src/serialization/types/InfraProviderAccount.ts b/src/serialization/types/InfraProviderAccount.ts index c45428e5..83864586 100644 --- a/src/serialization/types/InfraProviderAccount.ts +++ b/src/serialization/types/InfraProviderAccount.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsProviderAccount } from "./AwsProviderAccount.js"; import { AzureProviderAccount } from "./AzureProviderAccount.js"; import { BitbucketProviderAccount } from "./BitbucketProviderAccount.js"; @@ -21,8 +21,46 @@ import { TrueFoundryProviderAccount } from "./TrueFoundryProviderAccount.js"; import { TtlProviderAccount } from "./TtlProviderAccount.js"; import { WebhookProviderAccount } from "./WebhookProviderAccount.js"; -export const InfraProviderAccount: core.serialization.Schema = core.serialization.undiscriminatedUnion([AwsProviderAccount, AzureProviderAccount, GcpProviderAccount, DockerhubProviderAccount, BitbucketProviderAccount, CustomProviderAccount, GithubProviderAccount, GitlabProviderAccount, JfrogProviderAccount, TtlProviderAccount, TrueFoundryProviderAccount, QuayProviderAccount, SlackProviderAccount, WebhookProviderAccount, PagerDutyProviderAccount, MsTeamsProviderAccount, HashicorpProviderAccount]); +export const InfraProviderAccount: core.serialization.Schema< + serializers.InfraProviderAccount.Raw, + TrueFoundry.InfraProviderAccount +> = core.serialization.undiscriminatedUnion([ + AwsProviderAccount, + AzureProviderAccount, + GcpProviderAccount, + DockerhubProviderAccount, + BitbucketProviderAccount, + CustomProviderAccount, + GithubProviderAccount, + GitlabProviderAccount, + JfrogProviderAccount, + TtlProviderAccount, + TrueFoundryProviderAccount, + QuayProviderAccount, + SlackProviderAccount, + WebhookProviderAccount, + PagerDutyProviderAccount, + MsTeamsProviderAccount, + HashicorpProviderAccount, +]); export declare namespace InfraProviderAccount { - export type Raw = AwsProviderAccount.Raw | AzureProviderAccount.Raw | GcpProviderAccount.Raw | DockerhubProviderAccount.Raw | BitbucketProviderAccount.Raw | CustomProviderAccount.Raw | GithubProviderAccount.Raw | GitlabProviderAccount.Raw | JfrogProviderAccount.Raw | TtlProviderAccount.Raw | TrueFoundryProviderAccount.Raw | QuayProviderAccount.Raw | SlackProviderAccount.Raw | WebhookProviderAccount.Raw | PagerDutyProviderAccount.Raw | MsTeamsProviderAccount.Raw | HashicorpProviderAccount.Raw; + export type Raw = + | AwsProviderAccount.Raw + | AzureProviderAccount.Raw + | GcpProviderAccount.Raw + | DockerhubProviderAccount.Raw + | BitbucketProviderAccount.Raw + | CustomProviderAccount.Raw + | GithubProviderAccount.Raw + | GitlabProviderAccount.Raw + | JfrogProviderAccount.Raw + | TtlProviderAccount.Raw + | TrueFoundryProviderAccount.Raw + | QuayProviderAccount.Raw + | SlackProviderAccount.Raw + | WebhookProviderAccount.Raw + | PagerDutyProviderAccount.Raw + | MsTeamsProviderAccount.Raw + | HashicorpProviderAccount.Raw; } diff --git a/src/serialization/types/IngressControllerConfig.ts b/src/serialization/types/IngressControllerConfig.ts index 1501ba5d..3ce55bc4 100644 --- a/src/serialization/types/IngressControllerConfig.ts +++ b/src/serialization/types/IngressControllerConfig.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const IngressControllerConfig: core.serialization.ObjectSchema = core.serialization.object({ - "ingressClassName": core.serialization.property("ingress_class_name", core.serialization.string()), - "tlsEnabled": core.serialization.property("tls_enabled", core.serialization.boolean().optional()) - }); +export const IngressControllerConfig: core.serialization.ObjectSchema< + serializers.IngressControllerConfig.Raw, + TrueFoundry.IngressControllerConfig +> = core.serialization.object({ + ingressClassName: core.serialization.property("ingress_class_name", core.serialization.string()), + tlsEnabled: core.serialization.property("tls_enabled", core.serialization.boolean().optional()), +}); export declare namespace IngressControllerConfig { export interface Raw { diff --git a/src/serialization/types/InlineSpecSource.ts b/src/serialization/types/InlineSpecSource.ts index 0068551c..c722c2b5 100644 --- a/src/serialization/types/InlineSpecSource.ts +++ b/src/serialization/types/InlineSpecSource.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { InlineSpecSourceOpenapiSpec } from "./InlineSpecSourceOpenapiSpec.js"; -export const InlineSpecSource: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("inline"), - "openapiSpec": core.serialization.property("openapi_spec", InlineSpecSourceOpenapiSpec) - }); +export const InlineSpecSource: core.serialization.ObjectSchema< + serializers.InlineSpecSource.Raw, + TrueFoundry.InlineSpecSource +> = core.serialization.object({ + type: core.serialization.stringLiteral("inline"), + openapiSpec: core.serialization.property("openapi_spec", InlineSpecSourceOpenapiSpec), +}); export declare namespace InlineSpecSource { export interface Raw { diff --git a/src/serialization/types/InlineSpecSourceOpenapiSpec.ts b/src/serialization/types/InlineSpecSourceOpenapiSpec.ts index bb094223..688add0d 100644 --- a/src/serialization/types/InlineSpecSourceOpenapiSpec.ts +++ b/src/serialization/types/InlineSpecSourceOpenapiSpec.ts @@ -1,10 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const InlineSpecSourceOpenapiSpec: core.serialization.Schema = core.serialization.undiscriminatedUnion([core.serialization.record(core.serialization.string(), core.serialization.unknown()), core.serialization.string()]); +export const InlineSpecSourceOpenapiSpec: core.serialization.Schema< + serializers.InlineSpecSourceOpenapiSpec.Raw, + TrueFoundry.InlineSpecSourceOpenapiSpec +> = core.serialization.undiscriminatedUnion([ + core.serialization.record(core.serialization.string(), core.serialization.unknown()), + core.serialization.string(), +]); export declare namespace InlineSpecSourceOpenapiSpec { export type Raw = Record | string; diff --git a/src/serialization/types/InputOutputBasedCostMetricValue.ts b/src/serialization/types/InputOutputBasedCostMetricValue.ts index de0f6177..b6028ce8 100644 --- a/src/serialization/types/InputOutputBasedCostMetricValue.ts +++ b/src/serialization/types/InputOutputBasedCostMetricValue.ts @@ -1,21 +1,30 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { NonNegativeFloat } from "./NonNegativeFloat.js"; import { PrivatePricingTier } from "./PrivatePricingTier.js"; -export const InputOutputBasedCostMetricValue: core.serialization.ObjectSchema = core.serialization.object({ - "input": NonNegativeFloat, - "output": NonNegativeFloat, - "cacheRead": core.serialization.property("cache_read", NonNegativeFloat.optional()), - "cacheWrite": core.serialization.property("cache_write", NonNegativeFloat.optional()), - "inputTiers": core.serialization.property("input_tiers", core.serialization.list(PrivatePricingTier).optional()), - "outputTiers": core.serialization.property("output_tiers", core.serialization.list(PrivatePricingTier).optional()), - "cacheReadTiers": core.serialization.property("cache_read_tiers", core.serialization.list(PrivatePricingTier).optional()), - "cacheWriteTiers": core.serialization.property("cache_write_tiers", core.serialization.list(PrivatePricingTier).optional()) - }); +export const InputOutputBasedCostMetricValue: core.serialization.ObjectSchema< + serializers.InputOutputBasedCostMetricValue.Raw, + TrueFoundry.InputOutputBasedCostMetricValue +> = core.serialization.object({ + input: NonNegativeFloat, + output: NonNegativeFloat, + cacheRead: core.serialization.property("cache_read", NonNegativeFloat.optional()), + cacheWrite: core.serialization.property("cache_write", NonNegativeFloat.optional()), + inputTiers: core.serialization.property("input_tiers", core.serialization.list(PrivatePricingTier).optional()), + outputTiers: core.serialization.property("output_tiers", core.serialization.list(PrivatePricingTier).optional()), + cacheReadTiers: core.serialization.property( + "cache_read_tiers", + core.serialization.list(PrivatePricingTier).optional(), + ), + cacheWriteTiers: core.serialization.property( + "cache_write_tiers", + core.serialization.list(PrivatePricingTier).optional(), + ), +}); export declare namespace InputOutputBasedCostMetricValue { export interface Raw { diff --git a/src/serialization/types/Intercept.ts b/src/serialization/types/Intercept.ts index 47a314a8..bf06f4e5 100644 --- a/src/serialization/types/Intercept.ts +++ b/src/serialization/types/Intercept.ts @@ -1,14 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { InterceptRulesItem } from "./InterceptRulesItem.js"; -export const Intercept: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("intercept"), - "name": core.serialization.string(), - "rules": core.serialization.list(InterceptRulesItem) +export const Intercept: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("intercept"), + name: core.serialization.string(), + rules: core.serialization.list(InterceptRulesItem), }); export declare namespace Intercept { diff --git a/src/serialization/types/InterceptRulesItem.ts b/src/serialization/types/InterceptRulesItem.ts index 44845e8a..89afd9ae 100644 --- a/src/serialization/types/InterceptRulesItem.ts +++ b/src/serialization/types/InterceptRulesItem.ts @@ -1,16 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { HeaderMatch } from "./HeaderMatch.js"; import { InterceptRulesItemAction } from "./InterceptRulesItemAction.js"; -export const InterceptRulesItem: core.serialization.ObjectSchema = core.serialization.object({ - "port": core.serialization.number(), - "match": HeaderMatch.optional(), - "action": InterceptRulesItemAction - }); +export const InterceptRulesItem: core.serialization.ObjectSchema< + serializers.InterceptRulesItem.Raw, + TrueFoundry.InterceptRulesItem +> = core.serialization.object({ + port: core.serialization.number(), + match: HeaderMatch.optional(), + action: InterceptRulesItemAction, +}); export declare namespace InterceptRulesItem { export interface Raw { diff --git a/src/serialization/types/InterceptRulesItemAction.ts b/src/serialization/types/InterceptRulesItemAction.ts index 41977fb0..32df91dc 100644 --- a/src/serialization/types/InterceptRulesItemAction.ts +++ b/src/serialization/types/InterceptRulesItemAction.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ForwardAction } from "./ForwardAction.js"; import { MirrorAction } from "./MirrorAction.js"; -export const InterceptRulesItemAction: core.serialization.Schema = core.serialization.undiscriminatedUnion([ForwardAction, MirrorAction]); +export const InterceptRulesItemAction: core.serialization.Schema< + serializers.InterceptRulesItemAction.Raw, + TrueFoundry.InterceptRulesItemAction +> = core.serialization.undiscriminatedUnion([ForwardAction, MirrorAction]); export declare namespace InterceptRulesItemAction { export type Raw = ForwardAction.Raw | MirrorAction.Raw; diff --git a/src/serialization/types/InternalArtifactVersion.ts b/src/serialization/types/InternalArtifactVersion.ts index 44ca8c3c..60daffef 100644 --- a/src/serialization/types/InternalArtifactVersion.ts +++ b/src/serialization/types/InternalArtifactVersion.ts @@ -1,43 +1,52 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ArtifactManifest } from "./ArtifactManifest.js"; import { Subject } from "./Subject.js"; -export const InternalArtifactVersion: core.serialization.ObjectSchema = core.serialization.object({ - "createdAt": core.serialization.property("created_at", core.serialization.date().optional()), - "updatedAt": core.serialization.property("updated_at", core.serialization.date().optional()), - "manifest": ArtifactManifest, - "id": core.serialization.string(), - "fqn": core.serialization.string(), - "createdBySubject": core.serialization.property("created_by_subject", Subject), - "mlRepoId": core.serialization.property("ml_repo_id", core.serialization.string()), - "usageCodeSnippet": core.serialization.property("usage_code_snippet", core.serialization.string().optional()), - "tags": core.serialization.list(core.serialization.string()).optional(), - "artifactId": core.serialization.property("artifact_id", core.serialization.string()), - "artifactSize": core.serialization.property("artifact_size", core.serialization.number().optional()), - "artifactFqn": core.serialization.property("artifact_fqn", core.serialization.string()), - "artifactMetadata": core.serialization.property("artifact_metadata", core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional()), - "internalMetadata": core.serialization.property("internal_metadata", core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional()) - }); +export const InternalArtifactVersion: core.serialization.ObjectSchema< + serializers.InternalArtifactVersion.Raw, + TrueFoundry.InternalArtifactVersion +> = core.serialization.object({ + createdAt: core.serialization.property("created_at", core.serialization.date().optionalNullable()), + updatedAt: core.serialization.property("updated_at", core.serialization.date().optionalNullable()), + manifest: ArtifactManifest, + id: core.serialization.string(), + fqn: core.serialization.string(), + createdBySubject: core.serialization.property("created_by_subject", Subject), + mlRepoId: core.serialization.property("ml_repo_id", core.serialization.string()), + usageCodeSnippet: core.serialization.property("usage_code_snippet", core.serialization.string().optionalNullable()), + tags: core.serialization.list(core.serialization.string()).optionalNullable(), + artifactId: core.serialization.property("artifact_id", core.serialization.string()), + artifactSize: core.serialization.property("artifact_size", core.serialization.number().optionalNullable()), + artifactFqn: core.serialization.property("artifact_fqn", core.serialization.string()), + artifactMetadata: core.serialization.property( + "artifact_metadata", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optionalNullable(), + ), + internalMetadata: core.serialization.property( + "internal_metadata", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optionalNullable(), + ), +}); export declare namespace InternalArtifactVersion { export interface Raw { - created_at?: string | null; - updated_at?: string | null; + created_at?: (string | null | undefined) | null; + updated_at?: (string | null | undefined) | null; manifest: ArtifactManifest.Raw; id: string; fqn: string; created_by_subject: Subject.Raw; ml_repo_id: string; - usage_code_snippet?: string | null; - tags?: string[] | null; + usage_code_snippet?: (string | null | undefined) | null; + tags?: (string[] | null | undefined) | null; artifact_id: string; - artifact_size?: number | null; + artifact_size?: (number | null | undefined) | null; artifact_fqn: string; - artifact_metadata?: Record | null; - internal_metadata?: Record | null; + artifact_metadata?: (Record | null | undefined) | null; + internal_metadata?: (Record | null | undefined) | null; } } diff --git a/src/serialization/types/InternalListArtifactVersionsResponse.ts b/src/serialization/types/InternalListArtifactVersionsResponse.ts index f712716a..62c07033 100644 --- a/src/serialization/types/InternalListArtifactVersionsResponse.ts +++ b/src/serialization/types/InternalListArtifactVersionsResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { InternalListArtifactVersionsResponseDataItem } from "./InternalListArtifactVersionsResponseDataItem.js"; import { Pagination } from "./Pagination.js"; -export const InternalListArtifactVersionsResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(InternalListArtifactVersionsResponseDataItem), - "pagination": Pagination - }); +export const InternalListArtifactVersionsResponse: core.serialization.ObjectSchema< + serializers.InternalListArtifactVersionsResponse.Raw, + TrueFoundry.InternalListArtifactVersionsResponse +> = core.serialization.object({ + data: core.serialization.list(InternalListArtifactVersionsResponseDataItem), + pagination: Pagination, +}); export declare namespace InternalListArtifactVersionsResponse { export interface Raw { diff --git a/src/serialization/types/InternalListArtifactVersionsResponseDataItem.ts b/src/serialization/types/InternalListArtifactVersionsResponseDataItem.ts index a7ca9d59..6dfe2c00 100644 --- a/src/serialization/types/InternalListArtifactVersionsResponseDataItem.ts +++ b/src/serialization/types/InternalListArtifactVersionsResponseDataItem.ts @@ -1,15 +1,27 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AgentSkillVersion } from "./AgentSkillVersion.js"; import { InternalArtifactVersion } from "./InternalArtifactVersion.js"; import { InternalModelVersion } from "./InternalModelVersion.js"; import { PromptVersion } from "./PromptVersion.js"; -export const InternalListArtifactVersionsResponseDataItem: core.serialization.Schema = core.serialization.undiscriminatedUnion([InternalArtifactVersion, InternalModelVersion, AgentSkillVersion, PromptVersion]); +export const InternalListArtifactVersionsResponseDataItem: core.serialization.Schema< + serializers.InternalListArtifactVersionsResponseDataItem.Raw, + TrueFoundry.InternalListArtifactVersionsResponseDataItem +> = core.serialization.undiscriminatedUnion([ + InternalArtifactVersion, + InternalModelVersion, + AgentSkillVersion, + PromptVersion, +]); export declare namespace InternalListArtifactVersionsResponseDataItem { - export type Raw = InternalArtifactVersion.Raw | InternalModelVersion.Raw | AgentSkillVersion.Raw | PromptVersion.Raw; + export type Raw = + | InternalArtifactVersion.Raw + | InternalModelVersion.Raw + | AgentSkillVersion.Raw + | PromptVersion.Raw; } diff --git a/src/serialization/types/InternalModelVersion.ts b/src/serialization/types/InternalModelVersion.ts index 8120731b..8d604d97 100644 --- a/src/serialization/types/InternalModelVersion.ts +++ b/src/serialization/types/InternalModelVersion.ts @@ -1,44 +1,47 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Metric } from "./Metric.js"; import { ModelManifest } from "./ModelManifest.js"; import { Subject } from "./Subject.js"; -export const InternalModelVersion: core.serialization.ObjectSchema = core.serialization.object({ - "createdAt": core.serialization.property("created_at", core.serialization.date().optional()), - "updatedAt": core.serialization.property("updated_at", core.serialization.date().optional()), - "manifest": ModelManifest, - "id": core.serialization.string(), - "fqn": core.serialization.string(), - "createdBySubject": core.serialization.property("created_by_subject", Subject), - "mlRepoId": core.serialization.property("ml_repo_id", core.serialization.string()), - "usageCodeSnippet": core.serialization.property("usage_code_snippet", core.serialization.string().optional()), - "tags": core.serialization.list(core.serialization.string()).optional(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "metrics": core.serialization.list(Metric).optional(), - "deployable": core.serialization.boolean().optional(), - "artifactSize": core.serialization.property("artifact_size", core.serialization.number().optional()), - "artifactFqn": core.serialization.property("artifact_fqn", core.serialization.string()) - }); +export const InternalModelVersion: core.serialization.ObjectSchema< + serializers.InternalModelVersion.Raw, + TrueFoundry.InternalModelVersion +> = core.serialization.object({ + createdAt: core.serialization.property("created_at", core.serialization.date().optionalNullable()), + updatedAt: core.serialization.property("updated_at", core.serialization.date().optionalNullable()), + manifest: ModelManifest, + id: core.serialization.string(), + fqn: core.serialization.string(), + createdBySubject: core.serialization.property("created_by_subject", Subject), + mlRepoId: core.serialization.property("ml_repo_id", core.serialization.string()), + usageCodeSnippet: core.serialization.property("usage_code_snippet", core.serialization.string().optionalNullable()), + tags: core.serialization.list(core.serialization.string()).optional(), + modelId: core.serialization.property("model_id", core.serialization.string()), + metrics: core.serialization.list(Metric).optionalNullable(), + deployable: core.serialization.boolean().optionalNullable(), + artifactSize: core.serialization.property("artifact_size", core.serialization.number().optionalNullable()), + artifactFqn: core.serialization.property("artifact_fqn", core.serialization.string()), +}); export declare namespace InternalModelVersion { export interface Raw { - created_at?: string | null; - updated_at?: string | null; + created_at?: (string | null | undefined) | null; + updated_at?: (string | null | undefined) | null; manifest: ModelManifest.Raw; id: string; fqn: string; created_by_subject: Subject.Raw; ml_repo_id: string; - usage_code_snippet?: string | null; + usage_code_snippet?: (string | null | undefined) | null; tags?: string[] | null; model_id: string; - metrics?: Metric.Raw[] | null; - deployable?: boolean | null; - artifact_size?: number | null; + metrics?: (Metric.Raw[] | null | undefined) | null; + deployable?: (boolean | null | undefined) | null; + artifact_size?: (number | null | undefined) | null; artifact_fqn: string; } } diff --git a/src/serialization/types/InviteUserResponse.ts b/src/serialization/types/InviteUserResponse.ts index b0f90072..faf58c07 100644 --- a/src/serialization/types/InviteUserResponse.ts +++ b/src/serialization/types/InviteUserResponse.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const InviteUserResponse: core.serialization.ObjectSchema = core.serialization.object({ - "link": core.serialization.string() - }); +export const InviteUserResponse: core.serialization.ObjectSchema< + serializers.InviteUserResponse.Raw, + TrueFoundry.InviteUserResponse +> = core.serialization.object({ + link: core.serialization.string(), +}); export declare namespace InviteUserResponse { export interface Raw { diff --git a/src/serialization/types/IsClusterConnectedResponse.ts b/src/serialization/types/IsClusterConnectedResponse.ts index 1807ed3d..713be32c 100644 --- a/src/serialization/types/IsClusterConnectedResponse.ts +++ b/src/serialization/types/IsClusterConnectedResponse.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const IsClusterConnectedResponse: core.serialization.ObjectSchema = core.serialization.object({ - "isConnected": core.serialization.boolean() - }); +export const IsClusterConnectedResponse: core.serialization.ObjectSchema< + serializers.IsClusterConnectedResponse.Raw, + TrueFoundry.IsClusterConnectedResponse +> = core.serialization.object({ + isConnected: core.serialization.boolean(), +}); export declare namespace IsClusterConnectedResponse { export interface Raw { diff --git a/src/serialization/types/JFrogIntegrations.ts b/src/serialization/types/JFrogIntegrations.ts index 207835a6..b9255c52 100644 --- a/src/serialization/types/JFrogIntegrations.ts +++ b/src/serialization/types/JFrogIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { JfrogArtifactsRegistry } from "./JfrogArtifactsRegistry.js"; -export const JFrogIntegrations: core.serialization.ObjectSchema = JfrogArtifactsRegistry; +export const JFrogIntegrations: core.serialization.ObjectSchema< + serializers.JFrogIntegrations.Raw, + TrueFoundry.JFrogIntegrations +> = JfrogArtifactsRegistry; export declare namespace JFrogIntegrations { export type Raw = JfrogArtifactsRegistry.Raw; diff --git a/src/serialization/types/JfrogArtifactsRegistry.ts b/src/serialization/types/JfrogArtifactsRegistry.ts index d50bb188..75b0a582 100644 --- a/src/serialization/types/JfrogArtifactsRegistry.ts +++ b/src/serialization/types/JfrogArtifactsRegistry.ts @@ -1,17 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { JfrogBasicAuth } from "./JfrogBasicAuth.js"; -export const JfrogArtifactsRegistry: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/docker-registry/jfrog"), - "name": core.serialization.string(), - "registryUrl": core.serialization.property("registry_url", core.serialization.string()), - "authData": core.serialization.property("auth_data", JfrogBasicAuth.optional()), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const JfrogArtifactsRegistry: core.serialization.ObjectSchema< + serializers.JfrogArtifactsRegistry.Raw, + TrueFoundry.JfrogArtifactsRegistry +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/docker-registry/jfrog"), + name: core.serialization.string(), + registryUrl: core.serialization.property("registry_url", core.serialization.string()), + authData: core.serialization.property("auth_data", JfrogBasicAuth.optional()), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace JfrogArtifactsRegistry { export interface Raw { diff --git a/src/serialization/types/JfrogBasicAuth.ts b/src/serialization/types/JfrogBasicAuth.ts index ae5ce386..796458ec 100644 --- a/src/serialization/types/JfrogBasicAuth.ts +++ b/src/serialization/types/JfrogBasicAuth.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const JfrogBasicAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("basic-auth"), - "username": core.serialization.string(), - "password": core.serialization.string() - }); +export const JfrogBasicAuth: core.serialization.ObjectSchema< + serializers.JfrogBasicAuth.Raw, + TrueFoundry.JfrogBasicAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("basic-auth"), + username: core.serialization.string(), + password: core.serialization.string(), +}); export declare namespace JfrogBasicAuth { export interface Raw { diff --git a/src/serialization/types/JfrogProviderAccount.ts b/src/serialization/types/JfrogProviderAccount.ts index 48f19833..c2201ef6 100644 --- a/src/serialization/types/JfrogProviderAccount.ts +++ b/src/serialization/types/JfrogProviderAccount.ts @@ -1,20 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; -import { JfrogBasicAuth } from "./JfrogBasicAuth.js"; +import type * as serializers from "../index.js"; import { JFrogIntegrations } from "./JFrogIntegrations.js"; +import { JfrogBasicAuth } from "./JfrogBasicAuth.js"; import { OwnedBy } from "./OwnedBy.js"; -export const JfrogProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/jfrog"), - "name": core.serialization.string(), - "accountName": core.serialization.property("account_name", core.serialization.string().optional()), - "authData": core.serialization.property("auth_data", JfrogBasicAuth.optional()), - "integrations": core.serialization.list(JFrogIntegrations), - "ownedBy": OwnedBy.optional() - }); +export const JfrogProviderAccount: core.serialization.ObjectSchema< + serializers.JfrogProviderAccount.Raw, + TrueFoundry.JfrogProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/jfrog"), + name: core.serialization.string(), + accountName: core.serialization.property("account_name", core.serialization.string().optional()), + authData: core.serialization.property("auth_data", JfrogBasicAuth.optional()), + integrations: core.serialization.list(JFrogIntegrations), + ownedBy: OwnedBy.optional(), +}); export declare namespace JfrogProviderAccount { export interface Raw { diff --git a/src/serialization/types/Job.ts b/src/serialization/types/Job.ts index c859ae42..62d0a221 100644 --- a/src/serialization/types/Job.ts +++ b/src/serialization/types/Job.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { JobAlert } from "./JobAlert.js"; import { JobImage } from "./JobImage.js"; import { JobMountsItem } from "./JobMountsItem.js"; @@ -12,24 +12,26 @@ import { Param } from "./Param.js"; import { Resources } from "./Resources.js"; export const Job: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("job"), - "name": core.serialization.string(), - "image": JobImage, - "trigger": JobTrigger, - "triggerOnDeploy": core.serialization.property("trigger_on_deploy", core.serialization.boolean().optional()), - "params": core.serialization.list(Param).optional(), - "env": core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), - "resources": Resources.optional(), - "alerts": core.serialization.list(JobAlert).optional(), - "retries": core.serialization.number().optional(), - "timeout": core.serialization.number().optional(), - "concurrencyLimit": core.serialization.property("concurrency_limit", core.serialization.number().optional()), - "serviceAccount": core.serialization.property("service_account", core.serialization.string().optional()), - "mounts": core.serialization.list(JobMountsItem).optional(), - "labels": core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), - "kustomize": Kustomize.optional(), - "workspaceFqn": core.serialization.property("workspace_fqn", core.serialization.string().optional()) - }); + type: core.serialization.stringLiteral("job"), + name: core.serialization.string(), + image: JobImage, + trigger: JobTrigger, + triggerOnDeploy: core.serialization.property("trigger_on_deploy", core.serialization.boolean().optional()), + params: core.serialization.list(Param).optional(), + env: core.serialization + .record(core.serialization.string(), core.serialization.string().nullable()) + .optionalNullable(), + resources: Resources.optional(), + alerts: core.serialization.list(JobAlert).optional(), + retries: core.serialization.number().optional(), + timeout: core.serialization.number().optional(), + concurrencyLimit: core.serialization.property("concurrency_limit", core.serialization.number().optional()), + serviceAccount: core.serialization.property("service_account", core.serialization.string().optional()), + mounts: core.serialization.list(JobMountsItem).optional(), + labels: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), + kustomize: Kustomize.optional(), + workspaceFqn: core.serialization.property("workspace_fqn", core.serialization.string().optional()), +}); export declare namespace Job { export interface Raw { @@ -39,7 +41,7 @@ export declare namespace Job { trigger: JobTrigger.Raw; trigger_on_deploy?: boolean | null; params?: Param.Raw[] | null; - env?: Record | null; + env?: (Record | null | undefined) | null; resources?: Resources.Raw | null; alerts?: JobAlert.Raw[] | null; retries?: number | null; diff --git a/src/serialization/types/JobAlert.ts b/src/serialization/types/JobAlert.ts index e979e70e..73db8c57 100644 --- a/src/serialization/types/JobAlert.ts +++ b/src/serialization/types/JobAlert.ts @@ -1,17 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { NotificationTarget } from "./NotificationTarget.js"; -export const JobAlert: core.serialization.ObjectSchema = core.serialization.object({ - "notificationChannel": core.serialization.property("notification_channel", core.serialization.string().optional()), - "toEmails": core.serialization.property("to_emails", core.serialization.list(core.serialization.string()).optional()), - "notificationTarget": core.serialization.property("notification_target", NotificationTarget.optional()), - "onStart": core.serialization.property("on_start", core.serialization.boolean().optional()), - "onCompletion": core.serialization.property("on_completion", core.serialization.boolean().optional()), - "onFailure": core.serialization.property("on_failure", core.serialization.boolean().optional()) +export const JobAlert: core.serialization.ObjectSchema = + core.serialization.object({ + notificationChannel: core.serialization.property( + "notification_channel", + core.serialization.string().optional(), + ), + toEmails: core.serialization.property( + "to_emails", + core.serialization.list(core.serialization.string()).optional(), + ), + notificationTarget: core.serialization.property("notification_target", NotificationTarget.optional()), + onStart: core.serialization.property("on_start", core.serialization.boolean().optional()), + onCompletion: core.serialization.property("on_completion", core.serialization.boolean().optional()), + onFailure: core.serialization.property("on_failure", core.serialization.boolean().optional()), }); export declare namespace JobAlert { diff --git a/src/serialization/types/JobImage.ts b/src/serialization/types/JobImage.ts index fef423e5..39109303 100644 --- a/src/serialization/types/JobImage.ts +++ b/src/serialization/types/JobImage.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Build } from "./Build.js"; import { Image } from "./Image.js"; -export const JobImage: core.serialization.Schema = core.serialization.undiscriminatedUnion([Build, Image]); +export const JobImage: core.serialization.Schema = + core.serialization.undiscriminatedUnion([Build, Image]); export declare namespace JobImage { export type Raw = Build.Raw | Image.Raw; diff --git a/src/serialization/types/JobMountsItem.ts b/src/serialization/types/JobMountsItem.ts index 1b202093..c912914d 100644 --- a/src/serialization/types/JobMountsItem.ts +++ b/src/serialization/types/JobMountsItem.ts @@ -1,13 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { SecretMount } from "./SecretMount.js"; import { StringDataMount } from "./StringDataMount.js"; import { VolumeMount } from "./VolumeMount.js"; -export const JobMountsItem: core.serialization.Schema = core.serialization.undiscriminatedUnion([SecretMount, StringDataMount, VolumeMount]); +export const JobMountsItem: core.serialization.Schema = + core.serialization.undiscriminatedUnion([SecretMount, StringDataMount, VolumeMount]); export declare namespace JobMountsItem { export type Raw = SecretMount.Raw | StringDataMount.Raw | VolumeMount.Raw; diff --git a/src/serialization/types/JobRun.ts b/src/serialization/types/JobRun.ts index bce0106a..f93adb6b 100644 --- a/src/serialization/types/JobRun.ts +++ b/src/serialization/types/JobRun.ts @@ -1,30 +1,31 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { JobRunStatus } from "./JobRunStatus.js"; import { Subject } from "./Subject.js"; -export const JobRun: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string(), - "name": core.serialization.string(), - "applicationName": core.serialization.string(), - "deploymentVersion": core.serialization.string(), - "createdAt": core.serialization.number(), - "endTime": core.serialization.number().optional(), - "duration": core.serialization.number().optional(), - "command": core.serialization.string(), - "totalRetries": core.serialization.number(), - "error": core.serialization.string().optional(), - "status": JobRunStatus, - "triggeredBy": core.serialization.string().optional(), - "triggeredBySubject": Subject.optional(), - "exitCode": core.serialization.number().optional(), - "sparkUi": core.serialization.string().optional(), - "applicationId": core.serialization.string().optional(), - "deploymentId": core.serialization.string().optional(), - "tenantName": core.serialization.string().optional() +export const JobRun: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string(), + name: core.serialization.string(), + applicationName: core.serialization.string(), + deploymentVersion: core.serialization.string(), + createdAt: core.serialization.number(), + endTime: core.serialization.number().optionalNullable(), + duration: core.serialization.number().optionalNullable(), + command: core.serialization.string(), + totalRetries: core.serialization.number(), + error: core.serialization.string().optionalNullable(), + status: JobRunStatus, + triggeredBy: core.serialization.string().optionalNullable(), + triggeredBySubject: Subject.optionalNullable(), + exitCode: core.serialization.number().optionalNullable(), + sparkUi: core.serialization.string().optionalNullable(), + applicationId: core.serialization.string().optionalNullable(), + deploymentId: core.serialization.string().optionalNullable(), + tenantName: core.serialization.string().optionalNullable(), }); export declare namespace JobRun { @@ -34,18 +35,18 @@ export declare namespace JobRun { applicationName: string; deploymentVersion: string; createdAt: number; - endTime?: number | null; - duration?: number | null; + endTime?: (number | null | undefined) | null; + duration?: (number | null | undefined) | null; command: string; totalRetries: number; - error?: string | null; + error?: (string | null | undefined) | null; status: JobRunStatus.Raw; - triggeredBy?: string | null; - triggeredBySubject?: Subject.Raw | null; - exitCode?: number | null; - sparkUi?: string | null; - applicationId?: string | null; - deploymentId?: string | null; - tenantName?: string | null; + triggeredBy?: (string | null | undefined) | null; + triggeredBySubject?: (Subject.Raw | null | undefined) | null; + exitCode?: (number | null | undefined) | null; + sparkUi?: (string | null | undefined) | null; + applicationId?: (string | null | undefined) | null; + deploymentId?: (string | null | undefined) | null; + tenantName?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/JobRunStatus.ts b/src/serialization/types/JobRunStatus.ts index dc19ec2b..70677260 100644 --- a/src/serialization/types/JobRunStatus.ts +++ b/src/serialization/types/JobRunStatus.ts @@ -1,11 +1,31 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const JobRunStatus: core.serialization.Schema = core.serialization.enum_(["CREATED", "SCHEDULED", "RUNNING", "FINISHED", "FAILED", "TERMINATION_REQUESTED", "TERMINATING", "TERMINATED", "UNKNOWN"]); +export const JobRunStatus: core.serialization.Schema = + core.serialization.enum_([ + "CREATED", + "SCHEDULED", + "RUNNING", + "FINISHED", + "FAILED", + "TERMINATION_REQUESTED", + "TERMINATING", + "TERMINATED", + "UNKNOWN", + ]); export declare namespace JobRunStatus { - export type Raw = "CREATED" | "SCHEDULED" | "RUNNING" | "FINISHED" | "FAILED" | "TERMINATION_REQUESTED" | "TERMINATING" | "TERMINATED" | "UNKNOWN"; + export type Raw = + | "CREATED" + | "SCHEDULED" + | "RUNNING" + | "FINISHED" + | "FAILED" + | "TERMINATION_REQUESTED" + | "TERMINATING" + | "TERMINATED" + | "UNKNOWN"; } diff --git a/src/serialization/types/JobRunsSortBy.ts b/src/serialization/types/JobRunsSortBy.ts index b75d2812..140e1308 100644 --- a/src/serialization/types/JobRunsSortBy.ts +++ b/src/serialization/types/JobRunsSortBy.ts @@ -1,10 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const JobRunsSortBy: core.serialization.Schema = core.serialization.enum_(["startTime", "duration", "deploymentVersion", "triggeredBy", "status"]); +export const JobRunsSortBy: core.serialization.Schema = + core.serialization.enum_(["startTime", "duration", "deploymentVersion", "triggeredBy", "status"]); export declare namespace JobRunsSortBy { export type Raw = "startTime" | "duration" | "deploymentVersion" | "triggeredBy" | "status"; diff --git a/src/serialization/types/JobTrigger.ts b/src/serialization/types/JobTrigger.ts index 25ef2bbd..caa0580f 100644 --- a/src/serialization/types/JobTrigger.ts +++ b/src/serialization/types/JobTrigger.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Manual } from "./Manual.js"; import { Schedule } from "./Schedule.js"; -export const JobTrigger: core.serialization.Schema = core.serialization.undiscriminatedUnion([Manual, Schedule]); +export const JobTrigger: core.serialization.Schema = + core.serialization.undiscriminatedUnion([Manual, Schedule]); export declare namespace JobTrigger { export type Raw = Manual.Raw | Schedule.Raw; diff --git a/src/serialization/types/JobTriggerInput.ts b/src/serialization/types/JobTriggerInput.ts index 447da337..02585273 100644 --- a/src/serialization/types/JobTriggerInput.ts +++ b/src/serialization/types/JobTriggerInput.ts @@ -1,18 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { JobTriggerInputCommand } from "./JobTriggerInputCommand.js"; -export const JobTriggerInput: core.serialization.ObjectSchema = core.serialization.object({ - "command": JobTriggerInputCommand.optional(), - "params": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() - }); +export const JobTriggerInput: core.serialization.ObjectSchema< + serializers.JobTriggerInput.Raw, + TrueFoundry.JobTriggerInput +> = core.serialization.object({ + command: JobTriggerInputCommand.optionalNullable(), + params: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optionalNullable(), +}); export declare namespace JobTriggerInput { export interface Raw { - command?: JobTriggerInputCommand.Raw | null; - params?: Record | null; + command?: (JobTriggerInputCommand.Raw | null | undefined) | null; + params?: (Record | null | undefined) | null; } } diff --git a/src/serialization/types/JobTriggerInputCommand.ts b/src/serialization/types/JobTriggerInputCommand.ts index f80c1898..a98086f1 100644 --- a/src/serialization/types/JobTriggerInputCommand.ts +++ b/src/serialization/types/JobTriggerInputCommand.ts @@ -1,10 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const JobTriggerInputCommand: core.serialization.Schema = core.serialization.undiscriminatedUnion([core.serialization.string(), core.serialization.list(core.serialization.string())]); +export const JobTriggerInputCommand: core.serialization.Schema< + serializers.JobTriggerInputCommand.Raw, + TrueFoundry.JobTriggerInputCommand +> = core.serialization.undiscriminatedUnion([ + core.serialization.string(), + core.serialization.list(core.serialization.string()), +]); export declare namespace JobTriggerInputCommand { export type Raw = string | string[]; diff --git a/src/serialization/types/JsonObjectResponseFormat.ts b/src/serialization/types/JsonObjectResponseFormat.ts index 04a71f9d..56e10dba 100644 --- a/src/serialization/types/JsonObjectResponseFormat.ts +++ b/src/serialization/types/JsonObjectResponseFormat.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const JsonObjectResponseFormat: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("json_object") - }); +export const JsonObjectResponseFormat: core.serialization.ObjectSchema< + serializers.JsonObjectResponseFormat.Raw, + TrueFoundry.JsonObjectResponseFormat +> = core.serialization.object({ + type: core.serialization.stringLiteral("json_object"), +}); export declare namespace JsonObjectResponseFormat { export interface Raw { diff --git a/src/serialization/types/JsonSchema.ts b/src/serialization/types/JsonSchema.ts index 1298f0f6..eb91447c 100644 --- a/src/serialization/types/JsonSchema.ts +++ b/src/serialization/types/JsonSchema.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const JsonSchema: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "schema": core.serialization.record(core.serialization.string(), core.serialization.unknown()) +export const JsonSchema: core.serialization.ObjectSchema = + core.serialization.object({ + name: core.serialization.string(), + schema: core.serialization.record(core.serialization.string(), core.serialization.unknown()), }); export declare namespace JsonSchema { diff --git a/src/serialization/types/JsonSchemaResponseFormat.ts b/src/serialization/types/JsonSchemaResponseFormat.ts index 577da93d..7e106c22 100644 --- a/src/serialization/types/JsonSchemaResponseFormat.ts +++ b/src/serialization/types/JsonSchemaResponseFormat.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { JsonSchema } from "./JsonSchema.js"; -export const JsonSchemaResponseFormat: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("json_schema"), - "jsonSchema": core.serialization.property("json_schema", JsonSchema) - }); +export const JsonSchemaResponseFormat: core.serialization.ObjectSchema< + serializers.JsonSchemaResponseFormat.Raw, + TrueFoundry.JsonSchemaResponseFormat +> = core.serialization.object({ + type: core.serialization.stringLiteral("json_schema"), + jsonSchema: core.serialization.property("json_schema", JsonSchema), +}); export declare namespace JsonSchemaResponseFormat { export interface Raw { diff --git a/src/serialization/types/Jwt.ts b/src/serialization/types/Jwt.ts index 30373e94..68af87d3 100644 --- a/src/serialization/types/Jwt.ts +++ b/src/serialization/types/Jwt.ts @@ -1,27 +1,27 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { JwtTokenType } from "./JwtTokenType.js"; export const Jwt: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string(), - "subjectType": core.serialization.string(), - "subjectId": core.serialization.string(), - "metadata": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - "expiry": core.serialization.date(), - "tokenType": JwtTokenType, - "createdAt": core.serialization.date(), - "updatedAt": core.serialization.date() - }); + id: core.serialization.string(), + subjectType: core.serialization.string(), + subjectId: core.serialization.string(), + metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optionalNullable(), + expiry: core.serialization.date(), + tokenType: JwtTokenType, + createdAt: core.serialization.date(), + updatedAt: core.serialization.date(), +}); export declare namespace Jwt { export interface Raw { id: string; subjectType: string; subjectId: string; - metadata?: Record | null; + metadata?: (Record | null | undefined) | null; expiry: string; tokenType: JwtTokenType.Raw; createdAt: string; diff --git a/src/serialization/types/JwtAuthConfig.ts b/src/serialization/types/JwtAuthConfig.ts index df5544e0..1ecae5c7 100644 --- a/src/serialization/types/JwtAuthConfig.ts +++ b/src/serialization/types/JwtAuthConfig.ts @@ -1,16 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { JwtAuthConfigClaimsItem } from "./JwtAuthConfigClaimsItem.js"; -export const JwtAuthConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("jwt_auth"), - "integrationFqn": core.serialization.property("integration_fqn", core.serialization.string()), - "enableLogin": core.serialization.property("enable_login", core.serialization.boolean().optional()), - "claims": core.serialization.list(JwtAuthConfigClaimsItem).optional(), - "bypassAuthPaths": core.serialization.property("bypass_auth_paths", core.serialization.list(core.serialization.string()).optional()) +export const JwtAuthConfig: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("jwt_auth"), + integrationFqn: core.serialization.property("integration_fqn", core.serialization.string()), + enableLogin: core.serialization.property("enable_login", core.serialization.boolean().optional()), + claims: core.serialization.list(JwtAuthConfigClaimsItem).optional(), + bypassAuthPaths: core.serialization.property( + "bypass_auth_paths", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace JwtAuthConfig { diff --git a/src/serialization/types/JwtAuthConfigClaimsItem.ts b/src/serialization/types/JwtAuthConfigClaimsItem.ts index 4badb74a..a70a2c16 100644 --- a/src/serialization/types/JwtAuthConfigClaimsItem.ts +++ b/src/serialization/types/JwtAuthConfigClaimsItem.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const JwtAuthConfigClaimsItem: core.serialization.ObjectSchema = core.serialization.object({ - "key": core.serialization.string(), - "values": core.serialization.list(core.serialization.string()) - }); +export const JwtAuthConfigClaimsItem: core.serialization.ObjectSchema< + serializers.JwtAuthConfigClaimsItem.Raw, + TrueFoundry.JwtAuthConfigClaimsItem +> = core.serialization.object({ + key: core.serialization.string(), + values: core.serialization.list(core.serialization.string()), +}); export declare namespace JwtAuthConfigClaimsItem { export interface Raw { diff --git a/src/serialization/types/JwtTokenType.ts b/src/serialization/types/JwtTokenType.ts index b4514db4..721090d0 100644 --- a/src/serialization/types/JwtTokenType.ts +++ b/src/serialization/types/JwtTokenType.ts @@ -1,10 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const JwtTokenType: core.serialization.Schema = core.serialization.enum_(["jwt", "opaque"]); +export const JwtTokenType: core.serialization.Schema = + core.serialization.enum_(["jwt", "opaque"]); export declare namespace JwtTokenType { export type Raw = "jwt" | "opaque"; diff --git a/src/serialization/types/KafkaInputConfig.ts b/src/serialization/types/KafkaInputConfig.ts index 228d8beb..f91a8bf6 100644 --- a/src/serialization/types/KafkaInputConfig.ts +++ b/src/serialization/types/KafkaInputConfig.ts @@ -1,19 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { KafkaSaslAuth } from "./KafkaSaslAuth.js"; -export const KafkaInputConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("kafka"), - "bootstrapServers": core.serialization.property("bootstrap_servers", core.serialization.string()), - "topicName": core.serialization.property("topic_name", core.serialization.string()), - "consumerGroup": core.serialization.property("consumer_group", core.serialization.string()), - "tls": core.serialization.boolean(), - "waitTimeSeconds": core.serialization.property("wait_time_seconds", core.serialization.number().optional()), - "auth": KafkaSaslAuth.optional() - }); +export const KafkaInputConfig: core.serialization.ObjectSchema< + serializers.KafkaInputConfig.Raw, + TrueFoundry.KafkaInputConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("kafka"), + bootstrapServers: core.serialization.property("bootstrap_servers", core.serialization.string()), + topicName: core.serialization.property("topic_name", core.serialization.string()), + consumerGroup: core.serialization.property("consumer_group", core.serialization.string()), + tls: core.serialization.boolean(), + waitTimeSeconds: core.serialization.property("wait_time_seconds", core.serialization.number().optional()), + auth: KafkaSaslAuth.optional(), +}); export declare namespace KafkaInputConfig { export interface Raw { diff --git a/src/serialization/types/KafkaMetricConfig.ts b/src/serialization/types/KafkaMetricConfig.ts index 414e47f5..f65e601e 100644 --- a/src/serialization/types/KafkaMetricConfig.ts +++ b/src/serialization/types/KafkaMetricConfig.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const KafkaMetricConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("kafka"), - "lagThreshold": core.serialization.property("lag_threshold", core.serialization.number()) - }); +export const KafkaMetricConfig: core.serialization.ObjectSchema< + serializers.KafkaMetricConfig.Raw, + TrueFoundry.KafkaMetricConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("kafka"), + lagThreshold: core.serialization.property("lag_threshold", core.serialization.number()), +}); export declare namespace KafkaMetricConfig { export interface Raw { diff --git a/src/serialization/types/KafkaOutputConfig.ts b/src/serialization/types/KafkaOutputConfig.ts index 2ef7c671..e7e76484 100644 --- a/src/serialization/types/KafkaOutputConfig.ts +++ b/src/serialization/types/KafkaOutputConfig.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { KafkaSaslAuth } from "./KafkaSaslAuth.js"; -export const KafkaOutputConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("kafka"), - "bootstrapServers": core.serialization.property("bootstrap_servers", core.serialization.string()), - "topicName": core.serialization.property("topic_name", core.serialization.string()), - "tls": core.serialization.boolean(), - "auth": KafkaSaslAuth.optional() - }); +export const KafkaOutputConfig: core.serialization.ObjectSchema< + serializers.KafkaOutputConfig.Raw, + TrueFoundry.KafkaOutputConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("kafka"), + bootstrapServers: core.serialization.property("bootstrap_servers", core.serialization.string()), + topicName: core.serialization.property("topic_name", core.serialization.string()), + tls: core.serialization.boolean(), + auth: KafkaSaslAuth.optional(), +}); export declare namespace KafkaOutputConfig { export interface Raw { diff --git a/src/serialization/types/KafkaSaslAuth.ts b/src/serialization/types/KafkaSaslAuth.ts index c22b9aef..26f69405 100644 --- a/src/serialization/types/KafkaSaslAuth.ts +++ b/src/serialization/types/KafkaSaslAuth.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const KafkaSaslAuth: core.serialization.ObjectSchema = core.serialization.object({ - "username": core.serialization.string(), - "password": core.serialization.string() +export const KafkaSaslAuth: core.serialization.ObjectSchema = + core.serialization.object({ + username: core.serialization.string(), + password: core.serialization.string(), }); export declare namespace KafkaSaslAuth { diff --git a/src/serialization/types/KerasFramework.ts b/src/serialization/types/KerasFramework.ts index 1ef76d81..9b91ef37 100644 --- a/src/serialization/types/KerasFramework.ts +++ b/src/serialization/types/KerasFramework.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const KerasFramework: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("keras") - }); +export const KerasFramework: core.serialization.ObjectSchema< + serializers.KerasFramework.Raw, + TrueFoundry.KerasFramework +> = core.serialization.object({ + type: core.serialization.stringLiteral("keras"), +}); export declare namespace KerasFramework { export interface Raw { diff --git a/src/serialization/types/KeyPresenceSpec.ts b/src/serialization/types/KeyPresenceSpec.ts index 8caa7346..c0474a31 100644 --- a/src/serialization/types/KeyPresenceSpec.ts +++ b/src/serialization/types/KeyPresenceSpec.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const KeyPresenceSpec: core.serialization.ObjectSchema = core.serialization.object({ - "required": core.serialization.booleanLiteral(true).optional() - }); +export const KeyPresenceSpec: core.serialization.ObjectSchema< + serializers.KeyPresenceSpec.Raw, + TrueFoundry.KeyPresenceSpec +> = core.serialization.object({ + required: core.serialization.booleanLiteral(true).optional(), +}); export declare namespace KeyPresenceSpec { export interface Raw { diff --git a/src/serialization/types/KeySpec.ts b/src/serialization/types/KeySpec.ts index 9290cf72..63b7e9fb 100644 --- a/src/serialization/types/KeySpec.ts +++ b/src/serialization/types/KeySpec.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { KeyPresenceSpec } from "./KeyPresenceSpec.js"; import { KeyValueSpec } from "./KeyValueSpec.js"; -export const KeySpec: core.serialization.Schema = core.serialization.undiscriminatedUnion([KeyPresenceSpec, KeyValueSpec]); +export const KeySpec: core.serialization.Schema = + core.serialization.undiscriminatedUnion([KeyPresenceSpec, KeyValueSpec]); export declare namespace KeySpec { export type Raw = KeyPresenceSpec.Raw | KeyValueSpec.Raw; diff --git a/src/serialization/types/KeyValueSpec.ts b/src/serialization/types/KeyValueSpec.ts index c86e0bec..d543af17 100644 --- a/src/serialization/types/KeyValueSpec.ts +++ b/src/serialization/types/KeyValueSpec.ts @@ -1,13 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ValueConstraint } from "./ValueConstraint.js"; -export const KeyValueSpec: core.serialization.ObjectSchema = core.serialization.object({ - "required": core.serialization.boolean(), - "value": ValueConstraint +export const KeyValueSpec: core.serialization.ObjectSchema = + core.serialization.object({ + required: core.serialization.boolean(), + value: ValueConstraint, }); export declare namespace KeyValueSpec { diff --git a/src/serialization/types/Kustomize.ts b/src/serialization/types/Kustomize.ts index 97212304..86b4b225 100644 --- a/src/serialization/types/Kustomize.ts +++ b/src/serialization/types/Kustomize.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const Kustomize: core.serialization.ObjectSchema = core.serialization.object({ - "patch": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - "additions": core.serialization.list(core.serialization.record(core.serialization.string(), core.serialization.unknown())).optional() +export const Kustomize: core.serialization.ObjectSchema = + core.serialization.object({ + patch: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + additions: core.serialization + .list(core.serialization.record(core.serialization.string(), core.serialization.unknown())) + .optional(), }); export declare namespace Kustomize { diff --git a/src/serialization/types/LatencyBasedLoadBalanceTarget.ts b/src/serialization/types/LatencyBasedLoadBalanceTarget.ts index 36cd881f..b0adcb3e 100644 --- a/src/serialization/types/LatencyBasedLoadBalanceTarget.ts +++ b/src/serialization/types/LatencyBasedLoadBalanceTarget.ts @@ -1,20 +1,32 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { HeadersOverride } from "./HeadersOverride.js"; import { RetryConfig } from "./RetryConfig.js"; -export const LatencyBasedLoadBalanceTarget: core.serialization.ObjectSchema = core.serialization.object({ - "target": core.serialization.string(), - "retryConfig": core.serialization.property("retry_config", RetryConfig.optional()), - "fallbackStatusCodes": core.serialization.property("fallback_status_codes", core.serialization.list(core.serialization.string()).optional()), - "fallbackCandidate": core.serialization.property("fallback_candidate", core.serialization.boolean().optional()), - "overrideParams": core.serialization.property("override_params", core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional()), - "headersOverride": core.serialization.property("headers_override", HeadersOverride.optional()), - "metadataMatch": core.serialization.property("metadata_match", core.serialization.record(core.serialization.string(), core.serialization.string()).optional()) - }); +export const LatencyBasedLoadBalanceTarget: core.serialization.ObjectSchema< + serializers.LatencyBasedLoadBalanceTarget.Raw, + TrueFoundry.LatencyBasedLoadBalanceTarget +> = core.serialization.object({ + target: core.serialization.string(), + retryConfig: core.serialization.property("retry_config", RetryConfig.optional()), + fallbackStatusCodes: core.serialization.property( + "fallback_status_codes", + core.serialization.list(core.serialization.string()).optional(), + ), + fallbackCandidate: core.serialization.property("fallback_candidate", core.serialization.boolean().optional()), + overrideParams: core.serialization.property( + "override_params", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + ), + headersOverride: core.serialization.property("headers_override", HeadersOverride.optional()), + metadataMatch: core.serialization.property( + "metadata_match", + core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), + ), +}); export declare namespace LatencyBasedLoadBalanceTarget { export interface Raw { diff --git a/src/serialization/types/LatencyBasedLoadBalancing.ts b/src/serialization/types/LatencyBasedLoadBalancing.ts index f3faa956..1d65838b 100644 --- a/src/serialization/types/LatencyBasedLoadBalancing.ts +++ b/src/serialization/types/LatencyBasedLoadBalancing.ts @@ -1,14 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { LatencyBasedLoadBalanceTarget } from "./LatencyBasedLoadBalanceTarget.js"; -export const LatencyBasedLoadBalancing: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("latency-based-routing"), - "loadBalanceTargets": core.serialization.property("load_balance_targets", core.serialization.list(LatencyBasedLoadBalanceTarget)) - }); +export const LatencyBasedLoadBalancing: core.serialization.ObjectSchema< + serializers.LatencyBasedLoadBalancing.Raw, + TrueFoundry.LatencyBasedLoadBalancing +> = core.serialization.object({ + type: core.serialization.stringLiteral("latency-based-routing"), + loadBalanceTargets: core.serialization.property( + "load_balance_targets", + core.serialization.list(LatencyBasedLoadBalanceTarget), + ), +}); export declare namespace LatencyBasedLoadBalancing { export interface Raw { diff --git a/src/serialization/types/LatencyBasedLoadBalancingRule.ts b/src/serialization/types/LatencyBasedLoadBalancingRule.ts index 9b695955..d7e6d5f5 100644 --- a/src/serialization/types/LatencyBasedLoadBalancingRule.ts +++ b/src/serialization/types/LatencyBasedLoadBalancingRule.ts @@ -1,15 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { LatencyBasedLoadBalancing } from "./LatencyBasedLoadBalancing.js"; import { LoadBalancingWhen } from "./LoadBalancingWhen.js"; -export const LatencyBasedLoadBalancingRule: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string(), - "when": LoadBalancingWhen - }).extend(LatencyBasedLoadBalancing); +export const LatencyBasedLoadBalancingRule: core.serialization.ObjectSchema< + serializers.LatencyBasedLoadBalancingRule.Raw, + TrueFoundry.LatencyBasedLoadBalancingRule +> = core.serialization + .object({ + id: core.serialization.string(), + when: LoadBalancingWhen, + }) + .extend(LatencyBasedLoadBalancing); export declare namespace LatencyBasedLoadBalancingRule { export interface Raw extends LatencyBasedLoadBalancing.Raw { diff --git a/src/serialization/types/LegacyAgentManifest.ts b/src/serialization/types/LegacyAgentManifest.ts index 52e3926f..f80c21fc 100644 --- a/src/serialization/types/LegacyAgentManifest.ts +++ b/src/serialization/types/LegacyAgentManifest.ts @@ -1,22 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AgentSource } from "./AgentSource.js"; import { Collaborator } from "./Collaborator.js"; import { OwnedBy } from "./OwnedBy.js"; import { SampleAgentInput } from "./SampleAgentInput.js"; -export const LegacyAgentManifest: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("agent"), - "name": core.serialization.string(), - "description": core.serialization.string(), - "source": AgentSource, - "collaborators": core.serialization.list(Collaborator), - "sampleInputs": core.serialization.property("sample_inputs", core.serialization.list(SampleAgentInput).optional()), - "ownedBy": OwnedBy.optional() - }); +export const LegacyAgentManifest: core.serialization.ObjectSchema< + serializers.LegacyAgentManifest.Raw, + TrueFoundry.LegacyAgentManifest +> = core.serialization.object({ + type: core.serialization.stringLiteral("agent"), + name: core.serialization.string(), + description: core.serialization.string(), + source: AgentSource, + collaborators: core.serialization.list(Collaborator), + sampleInputs: core.serialization.property("sample_inputs", core.serialization.list(SampleAgentInput).optional()), + ownedBy: OwnedBy.optional(), +}); export declare namespace LegacyAgentManifest { export interface Raw { diff --git a/src/serialization/types/LibraryName.ts b/src/serialization/types/LibraryName.ts index a3a5e9ac..db3891c3 100644 --- a/src/serialization/types/LibraryName.ts +++ b/src/serialization/types/LibraryName.ts @@ -1,10 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const LibraryName: core.serialization.Schema = core.serialization.enum_(["transformers", "sentence-transformers", "diffusers"]); +export const LibraryName: core.serialization.Schema = + core.serialization.enum_(["transformers", "sentence-transformers", "diffusers"]); export declare namespace LibraryName { export type Raw = "transformers" | "sentence-transformers" | "diffusers"; diff --git a/src/serialization/types/LightGbmFramework.ts b/src/serialization/types/LightGbmFramework.ts index f784f3cc..a9ba1e20 100644 --- a/src/serialization/types/LightGbmFramework.ts +++ b/src/serialization/types/LightGbmFramework.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const LightGbmFramework: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("lightgbm") - }); +export const LightGbmFramework: core.serialization.ObjectSchema< + serializers.LightGbmFramework.Raw, + TrueFoundry.LightGbmFramework +> = core.serialization.object({ + type: core.serialization.stringLiteral("lightgbm"), +}); export declare namespace LightGbmFramework { export interface Raw { diff --git a/src/serialization/types/ListAgentSkillVersionsResponse.ts b/src/serialization/types/ListAgentSkillVersionsResponse.ts index 96f39b77..4a9bdb5f 100644 --- a/src/serialization/types/ListAgentSkillVersionsResponse.ts +++ b/src/serialization/types/ListAgentSkillVersionsResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AgentSkillVersion } from "./AgentSkillVersion.js"; import { Pagination } from "./Pagination.js"; -export const ListAgentSkillVersionsResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(AgentSkillVersion), - "pagination": Pagination - }); +export const ListAgentSkillVersionsResponse: core.serialization.ObjectSchema< + serializers.ListAgentSkillVersionsResponse.Raw, + TrueFoundry.ListAgentSkillVersionsResponse +> = core.serialization.object({ + data: core.serialization.list(AgentSkillVersion), + pagination: Pagination, +}); export declare namespace ListAgentSkillVersionsResponse { export interface Raw { diff --git a/src/serialization/types/ListAgentSkillsResponse.ts b/src/serialization/types/ListAgentSkillsResponse.ts index 8f288bce..31b11478 100644 --- a/src/serialization/types/ListAgentSkillsResponse.ts +++ b/src/serialization/types/ListAgentSkillsResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AgentSkill } from "./AgentSkill.js"; import { Pagination } from "./Pagination.js"; -export const ListAgentSkillsResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(AgentSkill), - "pagination": Pagination - }); +export const ListAgentSkillsResponse: core.serialization.ObjectSchema< + serializers.ListAgentSkillsResponse.Raw, + TrueFoundry.ListAgentSkillsResponse +> = core.serialization.object({ + data: core.serialization.list(AgentSkill), + pagination: Pagination, +}); export declare namespace ListAgentSkillsResponse { export interface Raw { diff --git a/src/serialization/types/ListAgentVersionsResponse.ts b/src/serialization/types/ListAgentVersionsResponse.ts index 744a4fbf..0efd1598 100644 --- a/src/serialization/types/ListAgentVersionsResponse.ts +++ b/src/serialization/types/ListAgentVersionsResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AgentVersion } from "./AgentVersion.js"; import { Pagination } from "./Pagination.js"; -export const ListAgentVersionsResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(AgentVersion), - "pagination": Pagination - }); +export const ListAgentVersionsResponse: core.serialization.ObjectSchema< + serializers.ListAgentVersionsResponse.Raw, + TrueFoundry.ListAgentVersionsResponse +> = core.serialization.object({ + data: core.serialization.list(AgentVersion), + pagination: Pagination, +}); export declare namespace ListAgentVersionsResponse { export interface Raw { diff --git a/src/serialization/types/ListAgentsResponse.ts b/src/serialization/types/ListAgentsResponse.ts index 80536465..60de6790 100644 --- a/src/serialization/types/ListAgentsResponse.ts +++ b/src/serialization/types/ListAgentsResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Agent } from "./Agent.js"; import { Pagination } from "./Pagination.js"; -export const ListAgentsResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(Agent), - "pagination": Pagination - }); +export const ListAgentsResponse: core.serialization.ObjectSchema< + serializers.ListAgentsResponse.Raw, + TrueFoundry.ListAgentsResponse +> = core.serialization.object({ + data: core.serialization.list(Agent), + pagination: Pagination, +}); export declare namespace ListAgentsResponse { export interface Raw { diff --git a/src/serialization/types/ListApplicationDeploymentsResponse.ts b/src/serialization/types/ListApplicationDeploymentsResponse.ts index 20a79171..f129e2fb 100644 --- a/src/serialization/types/ListApplicationDeploymentsResponse.ts +++ b/src/serialization/types/ListApplicationDeploymentsResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Deployment } from "./Deployment.js"; import { Pagination } from "./Pagination.js"; -export const ListApplicationDeploymentsResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(Deployment), - "pagination": Pagination - }); +export const ListApplicationDeploymentsResponse: core.serialization.ObjectSchema< + serializers.ListApplicationDeploymentsResponse.Raw, + TrueFoundry.ListApplicationDeploymentsResponse +> = core.serialization.object({ + data: core.serialization.list(Deployment), + pagination: Pagination, +}); export declare namespace ListApplicationDeploymentsResponse { export interface Raw { diff --git a/src/serialization/types/ListApplicationsResponse.ts b/src/serialization/types/ListApplicationsResponse.ts index 603aded6..3b4b9a31 100644 --- a/src/serialization/types/ListApplicationsResponse.ts +++ b/src/serialization/types/ListApplicationsResponse.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; import * as serializers from "../index.js"; import { Pagination } from "./Pagination.js"; -export const ListApplicationsResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(core.serialization.lazyObject(() => serializers.Application)), - "pagination": Pagination - }); +export const ListApplicationsResponse: core.serialization.ObjectSchema< + serializers.ListApplicationsResponse.Raw, + TrueFoundry.ListApplicationsResponse +> = core.serialization.object({ + data: core.serialization.list(core.serialization.lazyObject(() => serializers.Application)), + pagination: Pagination, +}); export declare namespace ListApplicationsResponse { export interface Raw { diff --git a/src/serialization/types/ListArtifactVersionsResponse.ts b/src/serialization/types/ListArtifactVersionsResponse.ts index a7049a10..00c9b6c7 100644 --- a/src/serialization/types/ListArtifactVersionsResponse.ts +++ b/src/serialization/types/ListArtifactVersionsResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ArtifactVersion } from "./ArtifactVersion.js"; import { Pagination } from "./Pagination.js"; -export const ListArtifactVersionsResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(ArtifactVersion), - "pagination": Pagination - }); +export const ListArtifactVersionsResponse: core.serialization.ObjectSchema< + serializers.ListArtifactVersionsResponse.Raw, + TrueFoundry.ListArtifactVersionsResponse +> = core.serialization.object({ + data: core.serialization.list(ArtifactVersion), + pagination: Pagination, +}); export declare namespace ListArtifactVersionsResponse { export interface Raw { diff --git a/src/serialization/types/ListArtifactsResponse.ts b/src/serialization/types/ListArtifactsResponse.ts index daab2119..53822c6f 100644 --- a/src/serialization/types/ListArtifactsResponse.ts +++ b/src/serialization/types/ListArtifactsResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Artifact } from "./Artifact.js"; import { Pagination } from "./Pagination.js"; -export const ListArtifactsResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(Artifact), - "pagination": Pagination - }); +export const ListArtifactsResponse: core.serialization.ObjectSchema< + serializers.ListArtifactsResponse.Raw, + TrueFoundry.ListArtifactsResponse +> = core.serialization.object({ + data: core.serialization.list(Artifact), + pagination: Pagination, +}); export declare namespace ListArtifactsResponse { export interface Raw { diff --git a/src/serialization/types/ListBudgetsResponse.ts b/src/serialization/types/ListBudgetsResponse.ts new file mode 100644 index 00000000..06efef71 --- /dev/null +++ b/src/serialization/types/ListBudgetsResponse.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { GatewayBudget } from "./GatewayBudget.js"; + +export const ListBudgetsResponse: core.serialization.ObjectSchema< + serializers.ListBudgetsResponse.Raw, + TrueFoundry.ListBudgetsResponse +> = core.serialization.object({ + data: core.serialization.list(GatewayBudget), +}); + +export declare namespace ListBudgetsResponse { + export interface Raw { + data: GatewayBudget.Raw[]; + } +} diff --git a/src/serialization/types/ListClusterAddonsResponse.ts b/src/serialization/types/ListClusterAddonsResponse.ts index eb5fcb54..5d9db802 100644 --- a/src/serialization/types/ListClusterAddonsResponse.ts +++ b/src/serialization/types/ListClusterAddonsResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AddonComponent } from "./AddonComponent.js"; import { Pagination } from "./Pagination.js"; -export const ListClusterAddonsResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(AddonComponent), - "pagination": Pagination - }); +export const ListClusterAddonsResponse: core.serialization.ObjectSchema< + serializers.ListClusterAddonsResponse.Raw, + TrueFoundry.ListClusterAddonsResponse +> = core.serialization.object({ + data: core.serialization.list(AddonComponent), + pagination: Pagination, +}); export declare namespace ListClusterAddonsResponse { export interface Raw { diff --git a/src/serialization/types/ListClustersResponse.ts b/src/serialization/types/ListClustersResponse.ts index e9baf61c..4eacc099 100644 --- a/src/serialization/types/ListClustersResponse.ts +++ b/src/serialization/types/ListClustersResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Cluster } from "./Cluster.js"; import { Pagination } from "./Pagination.js"; -export const ListClustersResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(Cluster), - "pagination": Pagination - }); +export const ListClustersResponse: core.serialization.ObjectSchema< + serializers.ListClustersResponse.Raw, + TrueFoundry.ListClustersResponse +> = core.serialization.object({ + data: core.serialization.list(Cluster), + pagination: Pagination, +}); export declare namespace ListClustersResponse { export interface Raw { diff --git a/src/serialization/types/ListDataDirectoriesResponse.ts b/src/serialization/types/ListDataDirectoriesResponse.ts index 2dc1a0c6..9fa067a0 100644 --- a/src/serialization/types/ListDataDirectoriesResponse.ts +++ b/src/serialization/types/ListDataDirectoriesResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { DataDirectory } from "./DataDirectory.js"; import { Pagination } from "./Pagination.js"; -export const ListDataDirectoriesResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(DataDirectory), - "pagination": Pagination - }); +export const ListDataDirectoriesResponse: core.serialization.ObjectSchema< + serializers.ListDataDirectoriesResponse.Raw, + TrueFoundry.ListDataDirectoriesResponse +> = core.serialization.object({ + data: core.serialization.list(DataDirectory), + pagination: Pagination, +}); export declare namespace ListDataDirectoriesResponse { export interface Raw { diff --git a/src/serialization/types/ListEnvironmentsResponse.ts b/src/serialization/types/ListEnvironmentsResponse.ts index d9255972..ec0190f5 100644 --- a/src/serialization/types/ListEnvironmentsResponse.ts +++ b/src/serialization/types/ListEnvironmentsResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Environment } from "./Environment.js"; import { Pagination } from "./Pagination.js"; -export const ListEnvironmentsResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(Environment), - "pagination": Pagination - }); +export const ListEnvironmentsResponse: core.serialization.ObjectSchema< + serializers.ListEnvironmentsResponse.Raw, + TrueFoundry.ListEnvironmentsResponse +> = core.serialization.object({ + data: core.serialization.list(Environment), + pagination: Pagination, +}); export declare namespace ListEnvironmentsResponse { export interface Raw { diff --git a/src/serialization/types/ListFilesRequest.ts b/src/serialization/types/ListFilesRequest.ts index 4112361e..4cb18672 100644 --- a/src/serialization/types/ListFilesRequest.ts +++ b/src/serialization/types/ListFilesRequest.ts @@ -1,21 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const ListFilesRequest: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string(), - "path": core.serialization.string().optional(), - "limit": core.serialization.number().optional(), - "pageToken": core.serialization.string().optional() - }); +export const ListFilesRequest: core.serialization.ObjectSchema< + serializers.ListFilesRequest.Raw, + TrueFoundry.ListFilesRequest +> = core.serialization.object({ + id: core.serialization.string(), + path: core.serialization.string().optionalNullable(), + limit: core.serialization.number().optionalNullable(), + pageToken: core.serialization.string().optionalNullable(), +}); export declare namespace ListFilesRequest { export interface Raw { id: string; - path?: string | null; - limit?: number | null; - pageToken?: string | null; + path?: (string | null | undefined) | null; + limit?: (number | null | undefined) | null; + pageToken?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/ListFilesResponse.ts b/src/serialization/types/ListFilesResponse.ts index 37e1e8c0..c3313dd2 100644 --- a/src/serialization/types/ListFilesResponse.ts +++ b/src/serialization/types/ListFilesResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { FileInfo } from "./FileInfo.js"; import { TokenPagination } from "./TokenPagination.js"; -export const ListFilesResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(FileInfo), - "pagination": TokenPagination - }); +export const ListFilesResponse: core.serialization.ObjectSchema< + serializers.ListFilesResponse.Raw, + TrueFoundry.ListFilesResponse +> = core.serialization.object({ + data: core.serialization.list(FileInfo), + pagination: TokenPagination, +}); export declare namespace ListFilesResponse { export interface Raw { diff --git a/src/serialization/types/ListJobRunResponse.ts b/src/serialization/types/ListJobRunResponse.ts index c89101f3..02f41450 100644 --- a/src/serialization/types/ListJobRunResponse.ts +++ b/src/serialization/types/ListJobRunResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { JobRun } from "./JobRun.js"; import { Pagination } from "./Pagination.js"; -export const ListJobRunResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(JobRun), - "pagination": Pagination - }); +export const ListJobRunResponse: core.serialization.ObjectSchema< + serializers.ListJobRunResponse.Raw, + TrueFoundry.ListJobRunResponse +> = core.serialization.object({ + data: core.serialization.list(JobRun), + pagination: Pagination, +}); export declare namespace ListJobRunResponse { export interface Raw { diff --git a/src/serialization/types/ListMetricHistoryResponse.ts b/src/serialization/types/ListMetricHistoryResponse.ts index 67b144e1..fda82bd8 100644 --- a/src/serialization/types/ListMetricHistoryResponse.ts +++ b/src/serialization/types/ListMetricHistoryResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { MetricCollection } from "./MetricCollection.js"; -export const ListMetricHistoryResponse: core.serialization.ObjectSchema = core.serialization.object({ - "metricCollections": core.serialization.property("metric_collections", core.serialization.list(MetricCollection)) - }); +export const ListMetricHistoryResponse: core.serialization.ObjectSchema< + serializers.ListMetricHistoryResponse.Raw, + TrueFoundry.ListMetricHistoryResponse +> = core.serialization.object({ + metricCollections: core.serialization.property("metric_collections", core.serialization.list(MetricCollection)), +}); export declare namespace ListMetricHistoryResponse { export interface Raw { diff --git a/src/serialization/types/ListMlReposResponse.ts b/src/serialization/types/ListMlReposResponse.ts index 32cddf85..d4dc1c0c 100644 --- a/src/serialization/types/ListMlReposResponse.ts +++ b/src/serialization/types/ListMlReposResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { MlRepo } from "./MlRepo.js"; import { Pagination } from "./Pagination.js"; -export const ListMlReposResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(MlRepo), - "pagination": Pagination - }); +export const ListMlReposResponse: core.serialization.ObjectSchema< + serializers.ListMlReposResponse.Raw, + TrueFoundry.ListMlReposResponse +> = core.serialization.object({ + data: core.serialization.list(MlRepo), + pagination: Pagination, +}); export declare namespace ListMlReposResponse { export interface Raw { diff --git a/src/serialization/types/ListModelVersionsResponse.ts b/src/serialization/types/ListModelVersionsResponse.ts index 598be116..327b830e 100644 --- a/src/serialization/types/ListModelVersionsResponse.ts +++ b/src/serialization/types/ListModelVersionsResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelVersion } from "./ModelVersion.js"; import { Pagination } from "./Pagination.js"; -export const ListModelVersionsResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(ModelVersion), - "pagination": Pagination - }); +export const ListModelVersionsResponse: core.serialization.ObjectSchema< + serializers.ListModelVersionsResponse.Raw, + TrueFoundry.ListModelVersionsResponse +> = core.serialization.object({ + data: core.serialization.list(ModelVersion), + pagination: Pagination, +}); export declare namespace ListModelVersionsResponse { export interface Raw { diff --git a/src/serialization/types/ListModelsResponse.ts b/src/serialization/types/ListModelsResponse.ts index 1bd1ed9e..623b4465 100644 --- a/src/serialization/types/ListModelsResponse.ts +++ b/src/serialization/types/ListModelsResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Model } from "./Model.js"; import { Pagination } from "./Pagination.js"; -export const ListModelsResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(Model), - "pagination": Pagination - }); +export const ListModelsResponse: core.serialization.ObjectSchema< + serializers.ListModelsResponse.Raw, + TrueFoundry.ListModelsResponse +> = core.serialization.object({ + data: core.serialization.list(Model), + pagination: Pagination, +}); export declare namespace ListModelsResponse { export interface Raw { diff --git a/src/serialization/types/ListPersonalAccessTokenResponse.ts b/src/serialization/types/ListPersonalAccessTokenResponse.ts index 6117af4f..2c6b569c 100644 --- a/src/serialization/types/ListPersonalAccessTokenResponse.ts +++ b/src/serialization/types/ListPersonalAccessTokenResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Pagination } from "./Pagination.js"; import { VirtualAccount } from "./VirtualAccount.js"; -export const ListPersonalAccessTokenResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(VirtualAccount), - "pagination": Pagination - }); +export const ListPersonalAccessTokenResponse: core.serialization.ObjectSchema< + serializers.ListPersonalAccessTokenResponse.Raw, + TrueFoundry.ListPersonalAccessTokenResponse +> = core.serialization.object({ + data: core.serialization.list(VirtualAccount), + pagination: Pagination, +}); export declare namespace ListPersonalAccessTokenResponse { export interface Raw { diff --git a/src/serialization/types/ListPromptVersionsResponse.ts b/src/serialization/types/ListPromptVersionsResponse.ts index 45fa37fa..9af3953f 100644 --- a/src/serialization/types/ListPromptVersionsResponse.ts +++ b/src/serialization/types/ListPromptVersionsResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Pagination } from "./Pagination.js"; import { PromptVersion } from "./PromptVersion.js"; -export const ListPromptVersionsResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(PromptVersion), - "pagination": Pagination - }); +export const ListPromptVersionsResponse: core.serialization.ObjectSchema< + serializers.ListPromptVersionsResponse.Raw, + TrueFoundry.ListPromptVersionsResponse +> = core.serialization.object({ + data: core.serialization.list(PromptVersion), + pagination: Pagination, +}); export declare namespace ListPromptVersionsResponse { export interface Raw { diff --git a/src/serialization/types/ListPromptsResponse.ts b/src/serialization/types/ListPromptsResponse.ts index 7cd8897e..13a2d7fd 100644 --- a/src/serialization/types/ListPromptsResponse.ts +++ b/src/serialization/types/ListPromptsResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Pagination } from "./Pagination.js"; import { Prompt } from "./Prompt.js"; -export const ListPromptsResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(Prompt), - "pagination": Pagination - }); +export const ListPromptsResponse: core.serialization.ObjectSchema< + serializers.ListPromptsResponse.Raw, + TrueFoundry.ListPromptsResponse +> = core.serialization.object({ + data: core.serialization.list(Prompt), + pagination: Pagination, +}); export declare namespace ListPromptsResponse { export interface Raw { diff --git a/src/serialization/types/ListSecretGroupResponse.ts b/src/serialization/types/ListSecretGroupResponse.ts index 010b834e..c782202b 100644 --- a/src/serialization/types/ListSecretGroupResponse.ts +++ b/src/serialization/types/ListSecretGroupResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Pagination } from "./Pagination.js"; import { SecretGroup } from "./SecretGroup.js"; -export const ListSecretGroupResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(SecretGroup), - "pagination": Pagination - }); +export const ListSecretGroupResponse: core.serialization.ObjectSchema< + serializers.ListSecretGroupResponse.Raw, + TrueFoundry.ListSecretGroupResponse +> = core.serialization.object({ + data: core.serialization.list(SecretGroup), + pagination: Pagination, +}); export declare namespace ListSecretGroupResponse { export interface Raw { diff --git a/src/serialization/types/ListSecretsResponse.ts b/src/serialization/types/ListSecretsResponse.ts index 574b1e40..8c598965 100644 --- a/src/serialization/types/ListSecretsResponse.ts +++ b/src/serialization/types/ListSecretsResponse.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; import * as serializers from "../index.js"; import { Pagination } from "./Pagination.js"; -export const ListSecretsResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(core.serialization.lazyObject(() => serializers.Secret)), - "pagination": Pagination - }); +export const ListSecretsResponse: core.serialization.ObjectSchema< + serializers.ListSecretsResponse.Raw, + TrueFoundry.ListSecretsResponse +> = core.serialization.object({ + data: core.serialization.list(core.serialization.lazyObject(() => serializers.Secret)), + pagination: Pagination, +}); export declare namespace ListSecretsResponse { export interface Raw { diff --git a/src/serialization/types/ListTeamManagersResponse.ts b/src/serialization/types/ListTeamManagersResponse.ts index 2d7b792a..542377f4 100644 --- a/src/serialization/types/ListTeamManagersResponse.ts +++ b/src/serialization/types/ListTeamManagersResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Pagination } from "./Pagination.js"; import { TeamSubjectRow } from "./TeamSubjectRow.js"; -export const ListTeamManagersResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(TeamSubjectRow), - "pagination": Pagination - }); +export const ListTeamManagersResponse: core.serialization.ObjectSchema< + serializers.ListTeamManagersResponse.Raw, + TrueFoundry.ListTeamManagersResponse +> = core.serialization.object({ + data: core.serialization.list(TeamSubjectRow), + pagination: Pagination, +}); export declare namespace ListTeamManagersResponse { export interface Raw { diff --git a/src/serialization/types/ListTeamMembersResponse.ts b/src/serialization/types/ListTeamMembersResponse.ts index 9c754f7e..f81537fd 100644 --- a/src/serialization/types/ListTeamMembersResponse.ts +++ b/src/serialization/types/ListTeamMembersResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Pagination } from "./Pagination.js"; import { TeamSubjectRow } from "./TeamSubjectRow.js"; -export const ListTeamMembersResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(TeamSubjectRow), - "pagination": Pagination - }); +export const ListTeamMembersResponse: core.serialization.ObjectSchema< + serializers.ListTeamMembersResponse.Raw, + TrueFoundry.ListTeamMembersResponse +> = core.serialization.object({ + data: core.serialization.list(TeamSubjectRow), + pagination: Pagination, +}); export declare namespace ListTeamMembersResponse { export interface Raw { diff --git a/src/serialization/types/ListTeamsResponse.ts b/src/serialization/types/ListTeamsResponse.ts index f1d67974..f1389697 100644 --- a/src/serialization/types/ListTeamsResponse.ts +++ b/src/serialization/types/ListTeamsResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Pagination } from "./Pagination.js"; import { Team } from "./Team.js"; -export const ListTeamsResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(Team), - "pagination": Pagination - }); +export const ListTeamsResponse: core.serialization.ObjectSchema< + serializers.ListTeamsResponse.Raw, + TrueFoundry.ListTeamsResponse +> = core.serialization.object({ + data: core.serialization.list(Team), + pagination: Pagination, +}); export declare namespace ListTeamsResponse { export interface Raw { diff --git a/src/serialization/types/ListUsersResponse.ts b/src/serialization/types/ListUsersResponse.ts index 42307aed..92e82250 100644 --- a/src/serialization/types/ListUsersResponse.ts +++ b/src/serialization/types/ListUsersResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Pagination } from "./Pagination.js"; import { User } from "./User.js"; -export const ListUsersResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(User), - "pagination": Pagination - }); +export const ListUsersResponse: core.serialization.ObjectSchema< + serializers.ListUsersResponse.Raw, + TrueFoundry.ListUsersResponse +> = core.serialization.object({ + data: core.serialization.list(User), + pagination: Pagination, +}); export declare namespace ListUsersResponse { export interface Raw { diff --git a/src/serialization/types/ListVirtualAccountResponse.ts b/src/serialization/types/ListVirtualAccountResponse.ts index dc80bf9c..5ce815b1 100644 --- a/src/serialization/types/ListVirtualAccountResponse.ts +++ b/src/serialization/types/ListVirtualAccountResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Pagination } from "./Pagination.js"; import { VirtualAccount } from "./VirtualAccount.js"; -export const ListVirtualAccountResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(VirtualAccount), - "pagination": Pagination - }); +export const ListVirtualAccountResponse: core.serialization.ObjectSchema< + serializers.ListVirtualAccountResponse.Raw, + TrueFoundry.ListVirtualAccountResponse +> = core.serialization.object({ + data: core.serialization.list(VirtualAccount), + pagination: Pagination, +}); export declare namespace ListVirtualAccountResponse { export interface Raw { diff --git a/src/serialization/types/ListWorkspacesResponse.ts b/src/serialization/types/ListWorkspacesResponse.ts index b859f77c..4db432c3 100644 --- a/src/serialization/types/ListWorkspacesResponse.ts +++ b/src/serialization/types/ListWorkspacesResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Pagination } from "./Pagination.js"; import { Workspace } from "./Workspace.js"; -export const ListWorkspacesResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(Workspace), - "pagination": Pagination - }); +export const ListWorkspacesResponse: core.serialization.ObjectSchema< + serializers.ListWorkspacesResponse.Raw, + TrueFoundry.ListWorkspacesResponse +> = core.serialization.object({ + data: core.serialization.list(Workspace), + pagination: Pagination, +}); export declare namespace ListWorkspacesResponse { export interface Raw { diff --git a/src/serialization/types/LlmClassificationStrategy.ts b/src/serialization/types/LlmClassificationStrategy.ts new file mode 100644 index 00000000..bfc53cd5 --- /dev/null +++ b/src/serialization/types/LlmClassificationStrategy.ts @@ -0,0 +1,28 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { LlmClassificationStrategyFallbackStrategy } from "./LlmClassificationStrategyFallbackStrategy.js"; + +export const LlmClassificationStrategy: core.serialization.ObjectSchema< + serializers.LlmClassificationStrategy.Raw, + TrueFoundry.LlmClassificationStrategy +> = core.serialization.object({ + type: core.serialization.stringLiteral("llm-classifier"), + model: core.serialization.string(), + timeoutMs: core.serialization.property("timeout_ms", core.serialization.number().optional()), + fallbackStrategy: core.serialization.property( + "fallback_strategy", + LlmClassificationStrategyFallbackStrategy.optional(), + ), +}); + +export declare namespace LlmClassificationStrategy { + export interface Raw { + type: "llm-classifier"; + model: string; + timeout_ms?: number | null; + fallback_strategy?: LlmClassificationStrategyFallbackStrategy.Raw | null; + } +} diff --git a/src/serialization/types/LlmClassificationStrategyFallbackStrategy.ts b/src/serialization/types/LlmClassificationStrategyFallbackStrategy.ts new file mode 100644 index 00000000..51c1fdbd --- /dev/null +++ b/src/serialization/types/LlmClassificationStrategyFallbackStrategy.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { HeuristicFallbackStrategy } from "./HeuristicFallbackStrategy.js"; +import { StaticFallbackStrategy } from "./StaticFallbackStrategy.js"; + +export const LlmClassificationStrategyFallbackStrategy: core.serialization.Schema< + serializers.LlmClassificationStrategyFallbackStrategy.Raw, + TrueFoundry.LlmClassificationStrategyFallbackStrategy +> = core.serialization.undiscriminatedUnion([HeuristicFallbackStrategy, StaticFallbackStrategy]); + +export declare namespace LlmClassificationStrategyFallbackStrategy { + export type Raw = HeuristicFallbackStrategy.Raw | StaticFallbackStrategy.Raw; +} diff --git a/src/serialization/types/LoadBalanceTarget.ts b/src/serialization/types/LoadBalanceTarget.ts index 3f91ca26..4fbaeca3 100644 --- a/src/serialization/types/LoadBalanceTarget.ts +++ b/src/serialization/types/LoadBalanceTarget.ts @@ -1,21 +1,33 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { HeadersOverride } from "./HeadersOverride.js"; import { RetryConfig } from "./RetryConfig.js"; -export const LoadBalanceTarget: core.serialization.ObjectSchema = core.serialization.object({ - "target": core.serialization.string(), - "weight": core.serialization.number(), - "retryConfig": core.serialization.property("retry_config", RetryConfig.optional()), - "fallbackStatusCodes": core.serialization.property("fallback_status_codes", core.serialization.list(core.serialization.string()).optional()), - "fallbackCandidate": core.serialization.property("fallback_candidate", core.serialization.boolean().optional()), - "overrideParams": core.serialization.property("override_params", core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional()), - "headersOverride": core.serialization.property("headers_override", HeadersOverride.optional()), - "metadataMatch": core.serialization.property("metadata_match", core.serialization.record(core.serialization.string(), core.serialization.string()).optional()) - }); +export const LoadBalanceTarget: core.serialization.ObjectSchema< + serializers.LoadBalanceTarget.Raw, + TrueFoundry.LoadBalanceTarget +> = core.serialization.object({ + target: core.serialization.string(), + weight: core.serialization.number(), + retryConfig: core.serialization.property("retry_config", RetryConfig.optional()), + fallbackStatusCodes: core.serialization.property( + "fallback_status_codes", + core.serialization.list(core.serialization.string()).optional(), + ), + fallbackCandidate: core.serialization.property("fallback_candidate", core.serialization.boolean().optional()), + overrideParams: core.serialization.property( + "override_params", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + ), + headersOverride: core.serialization.property("headers_override", HeadersOverride.optional()), + metadataMatch: core.serialization.property( + "metadata_match", + core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), + ), +}); export declare namespace LoadBalanceTarget { export interface Raw { diff --git a/src/serialization/types/LoadBalancingConfig.ts b/src/serialization/types/LoadBalancingConfig.ts index a9c32208..beaa284c 100644 --- a/src/serialization/types/LoadBalancingConfig.ts +++ b/src/serialization/types/LoadBalancingConfig.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { LoadBalancingRule } from "./LoadBalancingRule.js"; -export const LoadBalancingConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("gateway-load-balancing-config"), - "rules": core.serialization.list(LoadBalancingRule) - }); +export const LoadBalancingConfig: core.serialization.ObjectSchema< + serializers.LoadBalancingConfig.Raw, + TrueFoundry.LoadBalancingConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("gateway-load-balancing-config"), + rules: core.serialization.list(LoadBalancingRule), +}); export declare namespace LoadBalancingConfig { export interface Raw { diff --git a/src/serialization/types/LoadBalancingRule.ts b/src/serialization/types/LoadBalancingRule.ts index bb90a1c7..21dbb8a9 100644 --- a/src/serialization/types/LoadBalancingRule.ts +++ b/src/serialization/types/LoadBalancingRule.ts @@ -1,14 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { LatencyBasedLoadBalancingRule } from "./LatencyBasedLoadBalancingRule.js"; import { PriorityBasedLoadBalancingRule } from "./PriorityBasedLoadBalancingRule.js"; import { WeightBasedLoadBalancingRule } from "./WeightBasedLoadBalancingRule.js"; -export const LoadBalancingRule: core.serialization.Schema = core.serialization.undiscriminatedUnion([WeightBasedLoadBalancingRule, LatencyBasedLoadBalancingRule, PriorityBasedLoadBalancingRule]); +export const LoadBalancingRule: core.serialization.Schema< + serializers.LoadBalancingRule.Raw, + TrueFoundry.LoadBalancingRule +> = core.serialization.undiscriminatedUnion([ + WeightBasedLoadBalancingRule, + LatencyBasedLoadBalancingRule, + PriorityBasedLoadBalancingRule, +]); export declare namespace LoadBalancingRule { - export type Raw = WeightBasedLoadBalancingRule.Raw | LatencyBasedLoadBalancingRule.Raw | PriorityBasedLoadBalancingRule.Raw; + export type Raw = + | WeightBasedLoadBalancingRule.Raw + | LatencyBasedLoadBalancingRule.Raw + | PriorityBasedLoadBalancingRule.Raw; } diff --git a/src/serialization/types/LoadBalancingWhen.ts b/src/serialization/types/LoadBalancingWhen.ts index 091ee8a0..b8c6610a 100644 --- a/src/serialization/types/LoadBalancingWhen.ts +++ b/src/serialization/types/LoadBalancingWhen.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const LoadBalancingWhen: core.serialization.ObjectSchema = core.serialization.object({ - "subjects": core.serialization.list(core.serialization.string()).optional(), - "models": core.serialization.list(core.serialization.string()).optional(), - "metadata": core.serialization.record(core.serialization.string(), core.serialization.string()).optional() - }); +export const LoadBalancingWhen: core.serialization.ObjectSchema< + serializers.LoadBalancingWhen.Raw, + TrueFoundry.LoadBalancingWhen +> = core.serialization.object({ + subjects: core.serialization.list(core.serialization.string()).optional(), + models: core.serialization.list(core.serialization.string()).optional(), + metadata: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), +}); export declare namespace LoadBalancingWhen { export interface Raw { diff --git a/src/serialization/types/LocalArtifactSource.ts b/src/serialization/types/LocalArtifactSource.ts index 39cf9981..4d565865 100644 --- a/src/serialization/types/LocalArtifactSource.ts +++ b/src/serialization/types/LocalArtifactSource.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ArtifactPath } from "./ArtifactPath.js"; -export const LocalArtifactSource: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("local"), - "paths": core.serialization.list(ArtifactPath) - }); +export const LocalArtifactSource: core.serialization.ObjectSchema< + serializers.LocalArtifactSource.Raw, + TrueFoundry.LocalArtifactSource +> = core.serialization.object({ + type: core.serialization.stringLiteral("local"), + paths: core.serialization.list(ArtifactPath), +}); export declare namespace LocalArtifactSource { export interface Raw { diff --git a/src/serialization/types/LocalModelSource.ts b/src/serialization/types/LocalModelSource.ts index 9dd38594..ed8fe188 100644 --- a/src/serialization/types/LocalModelSource.ts +++ b/src/serialization/types/LocalModelSource.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const LocalModelSource: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("local"), - "fileOrFolder": core.serialization.property("file_or_folder", core.serialization.string()) - }); +export const LocalModelSource: core.serialization.ObjectSchema< + serializers.LocalModelSource.Raw, + TrueFoundry.LocalModelSource +> = core.serialization.object({ + type: core.serialization.stringLiteral("local"), + fileOrFolder: core.serialization.property("file_or_folder", core.serialization.string()), +}); export declare namespace LocalModelSource { export interface Raw { diff --git a/src/serialization/types/LocalSource.ts b/src/serialization/types/LocalSource.ts index afba715f..0411b1f6 100644 --- a/src/serialization/types/LocalSource.ts +++ b/src/serialization/types/LocalSource.ts @@ -1,13 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const LocalSource: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("local"), - "projectRootPath": core.serialization.property("project_root_path", core.serialization.string()), - "localBuild": core.serialization.property("local_build", core.serialization.boolean()) +export const LocalSource: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("local"), + projectRootPath: core.serialization.property("project_root_path", core.serialization.string()), + localBuild: core.serialization.property("local_build", core.serialization.boolean()), }); export declare namespace LocalSource { diff --git a/src/serialization/types/Log.ts b/src/serialization/types/Log.ts index ce38e50f..dd18b0d1 100644 --- a/src/serialization/types/Log.ts +++ b/src/serialization/types/Log.ts @@ -1,23 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; export const Log: core.serialization.ObjectSchema = core.serialization.object({ - "jobName": core.serialization.property("job_name", core.serialization.string().optional()), - "log": core.serialization.string(), - "stream": core.serialization.string(), - "time": core.serialization.string(), - "containerName": core.serialization.string().optional() - }); + jobName: core.serialization.property("job_name", core.serialization.string().optionalNullable()), + log: core.serialization.string(), + stream: core.serialization.string(), + time: core.serialization.string(), + containerName: core.serialization.string().optionalNullable(), +}); export declare namespace Log { export interface Raw { - job_name?: string | null; + job_name?: (string | null | undefined) | null; log: string; stream: string; time: string; - containerName?: string | null; + containerName?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/LoggingConfig.ts b/src/serialization/types/LoggingConfig.ts index 3548cc7a..9eeea6cf 100644 --- a/src/serialization/types/LoggingConfig.ts +++ b/src/serialization/types/LoggingConfig.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const LoggingConfig: core.serialization.ObjectSchema = core.serialization.object({ - "enabled": core.serialization.boolean(), - "tracingProjectFqn": core.serialization.property("tracing_project_fqn", core.serialization.string().optional()) +export const LoggingConfig: core.serialization.ObjectSchema = + core.serialization.object({ + enabled: core.serialization.boolean(), + tracingProjectFqn: core.serialization.property("tracing_project_fqn", core.serialization.string().optional()), }); export declare namespace LoggingConfig { diff --git a/src/serialization/types/LoggingMode.ts b/src/serialization/types/LoggingMode.ts index 018c1fa4..e86f89e7 100644 --- a/src/serialization/types/LoggingMode.ts +++ b/src/serialization/types/LoggingMode.ts @@ -1,13 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { LoggingModeAlways } from "./LoggingModeAlways.js"; import { LoggingModeHeaderControlled } from "./LoggingModeHeaderControlled.js"; import { LoggingModeNever } from "./LoggingModeNever.js"; -export const LoggingMode: core.serialization.Schema = core.serialization.undiscriminatedUnion([LoggingModeAlways, LoggingModeNever, LoggingModeHeaderControlled]); +export const LoggingMode: core.serialization.Schema = + core.serialization.undiscriminatedUnion([LoggingModeAlways, LoggingModeNever, LoggingModeHeaderControlled]); export declare namespace LoggingMode { export type Raw = LoggingModeAlways.Raw | LoggingModeNever.Raw | LoggingModeHeaderControlled.Raw; diff --git a/src/serialization/types/LoggingModeAlways.ts b/src/serialization/types/LoggingModeAlways.ts index 92c1c801..9e14559d 100644 --- a/src/serialization/types/LoggingModeAlways.ts +++ b/src/serialization/types/LoggingModeAlways.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const LoggingModeAlways: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("always") - }); +export const LoggingModeAlways: core.serialization.ObjectSchema< + serializers.LoggingModeAlways.Raw, + TrueFoundry.LoggingModeAlways +> = core.serialization.object({ + type: core.serialization.stringLiteral("always"), +}); export declare namespace LoggingModeAlways { export interface Raw { diff --git a/src/serialization/types/LoggingModeHeaderControlled.ts b/src/serialization/types/LoggingModeHeaderControlled.ts index fc631bf2..169f37cc 100644 --- a/src/serialization/types/LoggingModeHeaderControlled.ts +++ b/src/serialization/types/LoggingModeHeaderControlled.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const LoggingModeHeaderControlled: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("header_controlled"), - "logBodyByDefault": core.serialization.property("log_body_by_default", core.serialization.boolean()) - }); +export const LoggingModeHeaderControlled: core.serialization.ObjectSchema< + serializers.LoggingModeHeaderControlled.Raw, + TrueFoundry.LoggingModeHeaderControlled +> = core.serialization.object({ + type: core.serialization.stringLiteral("header_controlled"), + logBodyByDefault: core.serialization.property("log_body_by_default", core.serialization.boolean()), +}); export declare namespace LoggingModeHeaderControlled { export interface Raw { diff --git a/src/serialization/types/LoggingModeNever.ts b/src/serialization/types/LoggingModeNever.ts index 362dbf8e..4dd157b4 100644 --- a/src/serialization/types/LoggingModeNever.ts +++ b/src/serialization/types/LoggingModeNever.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const LoggingModeNever: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("never") - }); +export const LoggingModeNever: core.serialization.ObjectSchema< + serializers.LoggingModeNever.Raw, + TrueFoundry.LoggingModeNever +> = core.serialization.object({ + type: core.serialization.stringLiteral("never"), +}); export declare namespace LoggingModeNever { export interface Raw { diff --git a/src/serialization/types/LoggingWhen.ts b/src/serialization/types/LoggingWhen.ts new file mode 100644 index 00000000..a4b49af1 --- /dev/null +++ b/src/serialization/types/LoggingWhen.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { InNotIn } from "./InNotIn.js"; + +export const LoggingWhen: core.serialization.ObjectSchema = + core.serialization.object({ + subjects: InNotIn.optional(), + models: InNotIn.optional(), + metadata: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), + }); + +export declare namespace LoggingWhen { + export interface Raw { + subjects?: InNotIn.Raw | null; + models?: InNotIn.Raw | null; + metadata?: Record | null; + } +} diff --git a/src/serialization/types/LogsResponse.ts b/src/serialization/types/LogsResponse.ts index 2ba80634..661c3e69 100644 --- a/src/serialization/types/LogsResponse.ts +++ b/src/serialization/types/LogsResponse.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Log } from "./Log.js"; -export const LogsResponse: core.serialization.ObjectSchema = core.serialization.object({ - "logs": core.serialization.list(Log) +export const LogsResponse: core.serialization.ObjectSchema = + core.serialization.object({ + logs: core.serialization.list(Log), }); export declare namespace LogsResponse { diff --git a/src/serialization/types/LogsSearchFilterType.ts b/src/serialization/types/LogsSearchFilterType.ts index f8c93db8..b0fad8d1 100644 --- a/src/serialization/types/LogsSearchFilterType.ts +++ b/src/serialization/types/LogsSearchFilterType.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const LogsSearchFilterType: core.serialization.Schema = core.serialization.enum_(["regex", "substring", "ignore_case_substring"]); +export const LogsSearchFilterType: core.serialization.Schema< + serializers.LogsSearchFilterType.Raw, + TrueFoundry.LogsSearchFilterType +> = core.serialization.enum_(["regex", "substring", "ignore_case_substring"]); export declare namespace LogsSearchFilterType { export type Raw = "regex" | "substring" | "ignore_case_substring"; diff --git a/src/serialization/types/LogsSearchOperatorType.ts b/src/serialization/types/LogsSearchOperatorType.ts index b5c0d3c2..fca2e543 100644 --- a/src/serialization/types/LogsSearchOperatorType.ts +++ b/src/serialization/types/LogsSearchOperatorType.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const LogsSearchOperatorType: core.serialization.Schema = core.serialization.enum_(["equal", "not_equal"]); +export const LogsSearchOperatorType: core.serialization.Schema< + serializers.LogsSearchOperatorType.Raw, + TrueFoundry.LogsSearchOperatorType +> = core.serialization.enum_(["equal", "not_equal"]); export declare namespace LogsSearchOperatorType { export type Raw = "equal" | "not_equal"; diff --git a/src/serialization/types/LogsSortingDirection.ts b/src/serialization/types/LogsSortingDirection.ts index 43503114..64b156ba 100644 --- a/src/serialization/types/LogsSortingDirection.ts +++ b/src/serialization/types/LogsSortingDirection.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const LogsSortingDirection: core.serialization.Schema = core.serialization.enum_(["asc", "desc"]); +export const LogsSortingDirection: core.serialization.Schema< + serializers.LogsSortingDirection.Raw, + TrueFoundry.LogsSortingDirection +> = core.serialization.enum_(["asc", "desc"]); export declare namespace LogsSortingDirection { export type Raw = "asc" | "desc"; diff --git a/src/serialization/types/Manual.ts b/src/serialization/types/Manual.ts index 75322b5e..5513d631 100644 --- a/src/serialization/types/Manual.ts +++ b/src/serialization/types/Manual.ts @@ -1,11 +1,12 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const Manual: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("manual") +export const Manual: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("manual"), }); export declare namespace Manual { diff --git a/src/serialization/types/McpServer.ts b/src/serialization/types/McpServer.ts new file mode 100644 index 00000000..f9aec5c1 --- /dev/null +++ b/src/serialization/types/McpServer.ts @@ -0,0 +1,44 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { McpServerAuthStatusInfo } from "./McpServerAuthStatusInfo.js"; +import { Subject } from "./Subject.js"; + +export const McpServer: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string().optionalNullable(), + fqn: core.serialization.string(), + manifest: core.serialization.record(core.serialization.string(), core.serialization.unknown()), + createdBySubject: Subject, + accountId: core.serialization.string(), + tools: core.serialization + .list(core.serialization.record(core.serialization.string(), core.serialization.unknown())) + .optionalNullable(), + specEndpoints: core.serialization + .list(core.serialization.record(core.serialization.string(), core.serialization.unknown())) + .optionalNullable(), + createdAt: core.serialization.date().optionalNullable(), + updatedAt: core.serialization.date().optionalNullable(), + proxyUrl: core.serialization.string().optionalNullable(), + authStatus: McpServerAuthStatusInfo.optionalNullable(), + isAuthOverrideSupported: core.serialization.boolean().optionalNullable(), + }); + +export declare namespace McpServer { + export interface Raw { + id?: (string | null | undefined) | null; + fqn: string; + manifest: Record; + createdBySubject: Subject.Raw; + accountId: string; + tools?: (Record[] | null | undefined) | null; + specEndpoints?: (Record[] | null | undefined) | null; + createdAt?: (string | null | undefined) | null; + updatedAt?: (string | null | undefined) | null; + proxyUrl?: (string | null | undefined) | null; + authStatus?: (McpServerAuthStatusInfo.Raw | null | undefined) | null; + isAuthOverrideSupported?: (boolean | null | undefined) | null; + } +} diff --git a/src/serialization/types/McpServerAuth.ts b/src/serialization/types/McpServerAuth.ts index 1662a468..9aff169d 100644 --- a/src/serialization/types/McpServerAuth.ts +++ b/src/serialization/types/McpServerAuth.ts @@ -1,13 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { McpServerHeaderAuth } from "./McpServerHeaderAuth.js"; import { McpServerOAuth2 } from "./McpServerOAuth2.js"; import { McpServerPassthrough } from "./McpServerPassthrough.js"; -export const McpServerAuth: core.serialization.Schema = core.serialization.undiscriminatedUnion([McpServerHeaderAuth, McpServerOAuth2, McpServerPassthrough]); +export const McpServerAuth: core.serialization.Schema = + core.serialization.undiscriminatedUnion([McpServerHeaderAuth, McpServerOAuth2, McpServerPassthrough]); export declare namespace McpServerAuth { export type Raw = McpServerHeaderAuth.Raw | McpServerOAuth2.Raw | McpServerPassthrough.Raw; diff --git a/src/serialization/types/McpServerAuthStatusInfo.ts b/src/serialization/types/McpServerAuthStatusInfo.ts new file mode 100644 index 00000000..abc429e2 --- /dev/null +++ b/src/serialization/types/McpServerAuthStatusInfo.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { McpServerAuthStatusInfoMethod } from "./McpServerAuthStatusInfoMethod.js"; +import { McpServerAuthStatusInfoStatus } from "./McpServerAuthStatusInfoStatus.js"; + +export const McpServerAuthStatusInfo: core.serialization.ObjectSchema< + serializers.McpServerAuthStatusInfo.Raw, + TrueFoundry.McpServerAuthStatusInfo +> = core.serialization.object({ + status: McpServerAuthStatusInfoStatus, + method: McpServerAuthStatusInfoMethod.optionalNullable(), + message: core.serialization.string().optionalNullable(), +}); + +export declare namespace McpServerAuthStatusInfo { + export interface Raw { + status: McpServerAuthStatusInfoStatus.Raw; + method?: (McpServerAuthStatusInfoMethod.Raw | null | undefined) | null; + message?: (string | null | undefined) | null; + } +} diff --git a/src/serialization/types/McpServerAuthStatusInfoMethod.ts b/src/serialization/types/McpServerAuthStatusInfoMethod.ts new file mode 100644 index 00000000..ca65bfbc --- /dev/null +++ b/src/serialization/types/McpServerAuthStatusInfoMethod.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const McpServerAuthStatusInfoMethod: core.serialization.Schema< + serializers.McpServerAuthStatusInfoMethod.Raw, + TrueFoundry.McpServerAuthStatusInfoMethod +> = core.serialization.enum_(["oauth", "auth-override"]); + +export declare namespace McpServerAuthStatusInfoMethod { + export type Raw = "oauth" | "auth-override"; +} diff --git a/src/serialization/types/McpServerAuthStatusInfoStatus.ts b/src/serialization/types/McpServerAuthStatusInfoStatus.ts new file mode 100644 index 00000000..8a4d8071 --- /dev/null +++ b/src/serialization/types/McpServerAuthStatusInfoStatus.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const McpServerAuthStatusInfoStatus: core.serialization.Schema< + serializers.McpServerAuthStatusInfoStatus.Raw, + TrueFoundry.McpServerAuthStatusInfoStatus +> = core.serialization.enum_(["authenticated", "unauthenticated"]); + +export declare namespace McpServerAuthStatusInfoStatus { + export type Raw = "authenticated" | "unauthenticated"; +} diff --git a/src/serialization/types/McpServerEnvAuth.ts b/src/serialization/types/McpServerEnvAuth.ts index ae93a4bc..51652797 100644 --- a/src/serialization/types/McpServerEnvAuth.ts +++ b/src/serialization/types/McpServerEnvAuth.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { McpServerEnvAuthAuthLevel } from "./McpServerEnvAuthAuthLevel.js"; -export const McpServerEnvAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("env"), - "env": core.serialization.record(core.serialization.string(), core.serialization.string()), - "authLevel": core.serialization.property("auth_level", McpServerEnvAuthAuthLevel.optional()) - }); +export const McpServerEnvAuth: core.serialization.ObjectSchema< + serializers.McpServerEnvAuth.Raw, + TrueFoundry.McpServerEnvAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("env"), + env: core.serialization.record(core.serialization.string(), core.serialization.string()), + authLevel: core.serialization.property("auth_level", McpServerEnvAuthAuthLevel.optional()), +}); export declare namespace McpServerEnvAuth { export interface Raw { diff --git a/src/serialization/types/McpServerEnvAuthAuthLevel.ts b/src/serialization/types/McpServerEnvAuthAuthLevel.ts index 9c68a432..9bd2a549 100644 --- a/src/serialization/types/McpServerEnvAuthAuthLevel.ts +++ b/src/serialization/types/McpServerEnvAuthAuthLevel.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const McpServerEnvAuthAuthLevel: core.serialization.Schema = core.serialization.enum_(["global", "per_user"]); +export const McpServerEnvAuthAuthLevel: core.serialization.Schema< + serializers.McpServerEnvAuthAuthLevel.Raw, + TrueFoundry.McpServerEnvAuthAuthLevel +> = core.serialization.enum_(["global", "per_user"]); export declare namespace McpServerEnvAuthAuthLevel { export type Raw = "global" | "per_user"; diff --git a/src/serialization/types/McpServerHeaderAuth.ts b/src/serialization/types/McpServerHeaderAuth.ts index 9f44f165..e8b83ead 100644 --- a/src/serialization/types/McpServerHeaderAuth.ts +++ b/src/serialization/types/McpServerHeaderAuth.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { McpServerHeaderAuthAuthLevel } from "./McpServerHeaderAuthAuthLevel.js"; -export const McpServerHeaderAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("header"), - "headers": core.serialization.record(core.serialization.string(), core.serialization.string()), - "authLevel": core.serialization.property("auth_level", McpServerHeaderAuthAuthLevel) - }); +export const McpServerHeaderAuth: core.serialization.ObjectSchema< + serializers.McpServerHeaderAuth.Raw, + TrueFoundry.McpServerHeaderAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("header"), + headers: core.serialization.record(core.serialization.string(), core.serialization.string()), + authLevel: core.serialization.property("auth_level", McpServerHeaderAuthAuthLevel), +}); export declare namespace McpServerHeaderAuth { export interface Raw { diff --git a/src/serialization/types/McpServerHeaderAuthAuthLevel.ts b/src/serialization/types/McpServerHeaderAuthAuthLevel.ts index 1eff3979..f4d715dd 100644 --- a/src/serialization/types/McpServerHeaderAuthAuthLevel.ts +++ b/src/serialization/types/McpServerHeaderAuthAuthLevel.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const McpServerHeaderAuthAuthLevel: core.serialization.Schema = core.serialization.enum_(["global", "per_user"]); +export const McpServerHeaderAuthAuthLevel: core.serialization.Schema< + serializers.McpServerHeaderAuthAuthLevel.Raw, + TrueFoundry.McpServerHeaderAuthAuthLevel +> = core.serialization.enum_(["global", "per_user"]); export declare namespace McpServerHeaderAuthAuthLevel { export type Raw = "global" | "per_user"; diff --git a/src/serialization/types/McpServerHeaderOverrideAuth.ts b/src/serialization/types/McpServerHeaderOverrideAuth.ts index 2da03989..a5fd3076 100644 --- a/src/serialization/types/McpServerHeaderOverrideAuth.ts +++ b/src/serialization/types/McpServerHeaderOverrideAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const McpServerHeaderOverrideAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("header"), - "headers": core.serialization.record(core.serialization.string(), core.serialization.string()) - }); +export const McpServerHeaderOverrideAuth: core.serialization.ObjectSchema< + serializers.McpServerHeaderOverrideAuth.Raw, + TrueFoundry.McpServerHeaderOverrideAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("header"), + headers: core.serialization.record(core.serialization.string(), core.serialization.string()), +}); export declare namespace McpServerHeaderOverrideAuth { export interface Raw { diff --git a/src/serialization/types/McpServerIntegration.ts b/src/serialization/types/McpServerIntegration.ts index f75f7df6..878923e5 100644 --- a/src/serialization/types/McpServerIntegration.ts +++ b/src/serialization/types/McpServerIntegration.ts @@ -1,20 +1,26 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { McpServerAuth } from "./McpServerAuth.js"; import { McpServerIntegrationTransport } from "./McpServerIntegrationTransport.js"; -export const McpServerIntegration: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/mcp-server/remote"), - "name": core.serialization.string(), - "description": core.serialization.string(), - "url": core.serialization.string(), - "transport": McpServerIntegrationTransport, - "authData": core.serialization.property("auth_data", McpServerAuth.optional()), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const McpServerIntegration: core.serialization.ObjectSchema< + serializers.McpServerIntegration.Raw, + TrueFoundry.McpServerIntegration +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/mcp-server/remote"), + name: core.serialization.string(), + description: core.serialization.string(), + url: core.serialization.string(), + transport: McpServerIntegrationTransport, + authData: core.serialization.property("auth_data", McpServerAuth.optional()), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace McpServerIntegration { export interface Raw { diff --git a/src/serialization/types/McpServerIntegrationTransport.ts b/src/serialization/types/McpServerIntegrationTransport.ts index b3cd0c57..692b2e40 100644 --- a/src/serialization/types/McpServerIntegrationTransport.ts +++ b/src/serialization/types/McpServerIntegrationTransport.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const McpServerIntegrationTransport: core.serialization.Schema = core.serialization.enum_(["streamable-http", "sse"]); +export const McpServerIntegrationTransport: core.serialization.Schema< + serializers.McpServerIntegrationTransport.Raw, + TrueFoundry.McpServerIntegrationTransport +> = core.serialization.enum_(["streamable-http", "sse"]); export declare namespace McpServerIntegrationTransport { export type Raw = "streamable-http" | "sse"; diff --git a/src/serialization/types/McpServerIntegrations.ts b/src/serialization/types/McpServerIntegrations.ts index f15b0a3a..fe737194 100644 --- a/src/serialization/types/McpServerIntegrations.ts +++ b/src/serialization/types/McpServerIntegrations.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { McpServerIntegration } from "./McpServerIntegration.js"; import { VirtualMcpServerIntegration } from "./VirtualMcpServerIntegration.js"; -export const McpServerIntegrations: core.serialization.Schema = core.serialization.undiscriminatedUnion([McpServerIntegration, VirtualMcpServerIntegration]); +export const McpServerIntegrations: core.serialization.Schema< + serializers.McpServerIntegrations.Raw, + TrueFoundry.McpServerIntegrations +> = core.serialization.undiscriminatedUnion([McpServerIntegration, VirtualMcpServerIntegration]); export declare namespace McpServerIntegrations { export type Raw = McpServerIntegration.Raw | VirtualMcpServerIntegration.Raw; diff --git a/src/serialization/types/McpServerManifest.ts b/src/serialization/types/McpServerManifest.ts index 47a1c529..e731a0fa 100644 --- a/src/serialization/types/McpServerManifest.ts +++ b/src/serialization/types/McpServerManifest.ts @@ -1,16 +1,30 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { OpenApimcpServerManifest } from "./OpenApimcpServerManifest.js"; import { RemoteMcpServerManifest } from "./RemoteMcpServerManifest.js"; import { StdioMcpServerManifest } from "./StdioMcpServerManifest.js"; import { TfyManagedMcpServerManifest } from "./TfyManagedMcpServerManifest.js"; import { VirtualMcpServerManifest } from "./VirtualMcpServerManifest.js"; -export const McpServerManifest: core.serialization.Schema = core.serialization.undiscriminatedUnion([RemoteMcpServerManifest, VirtualMcpServerManifest, OpenApimcpServerManifest, StdioMcpServerManifest, TfyManagedMcpServerManifest]); +export const McpServerManifest: core.serialization.Schema< + serializers.McpServerManifest.Raw, + TrueFoundry.McpServerManifest +> = core.serialization.undiscriminatedUnion([ + RemoteMcpServerManifest, + VirtualMcpServerManifest, + OpenApimcpServerManifest, + StdioMcpServerManifest, + TfyManagedMcpServerManifest, +]); export declare namespace McpServerManifest { - export type Raw = RemoteMcpServerManifest.Raw | VirtualMcpServerManifest.Raw | OpenApimcpServerManifest.Raw | StdioMcpServerManifest.Raw | TfyManagedMcpServerManifest.Raw; + export type Raw = + | RemoteMcpServerManifest.Raw + | VirtualMcpServerManifest.Raw + | OpenApimcpServerManifest.Raw + | StdioMcpServerManifest.Raw + | TfyManagedMcpServerManifest.Raw; } diff --git a/src/serialization/types/McpServerOAuth2.ts b/src/serialization/types/McpServerOAuth2.ts index bed6aa75..21172897 100644 --- a/src/serialization/types/McpServerOAuth2.ts +++ b/src/serialization/types/McpServerOAuth2.ts @@ -1,42 +1,62 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { McpServerOAuth2GrantType } from "./McpServerOAuth2GrantType.js"; import { McpServerOAuth2JwtSource } from "./McpServerOAuth2JwtSource.js"; import { McpServerOAuth2Provider } from "./McpServerOAuth2Provider.js"; import { McpServerOAuth2ProviderAuth0Settings } from "./McpServerOAuth2ProviderAuth0Settings.js"; +import { McpServerOAuth2ProviderOktaIdJagSettings } from "./McpServerOAuth2ProviderOktaIdJagSettings.js"; +import { McpServerOAuth2ProviderOktaSettings } from "./McpServerOAuth2ProviderOktaSettings.js"; -export const McpServerOAuth2: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("oauth2"), - "grantType": core.serialization.property("grant_type", McpServerOAuth2GrantType), - "authorizationUrl": core.serialization.property("authorization_url", core.serialization.string().optional()), - "tokenUrl": core.serialization.property("token_url", core.serialization.string()), - "clientId": core.serialization.property("client_id", core.serialization.string().optional()), - "clientSecret": core.serialization.property("client_secret", core.serialization.string().optional()), - "registrationUrl": core.serialization.property("registration_url", core.serialization.string().optional()), - "introspectionUrl": core.serialization.property("introspection_url", core.serialization.string().optional()), - "provider": McpServerOAuth2Provider, - "codeChallengeMethodsSupported": core.serialization.property("code_challenge_methods_supported", core.serialization.list(core.serialization.stringLiteral("S256")).optional()), - "jwtSource": core.serialization.property("jwt_source", McpServerOAuth2JwtSource), - "scopes": core.serialization.list(core.serialization.string()).optional(), - "additionalTokenParams": core.serialization.property("additional_token_params", core.serialization.record(core.serialization.string(), core.serialization.string()).optional()) - }).extend(McpServerOAuth2ProviderAuth0Settings); +export const McpServerOAuth2: core.serialization.ObjectSchema< + serializers.McpServerOAuth2.Raw, + TrueFoundry.McpServerOAuth2 +> = core.serialization + .object({ + type: core.serialization.stringLiteral("oauth2"), + grantType: core.serialization.property("grant_type", McpServerOAuth2GrantType), + authorizationUrl: core.serialization.property("authorization_url", core.serialization.string().optional()), + tokenUrl: core.serialization.property("token_url", core.serialization.string().optional()), + clientId: core.serialization.property("client_id", core.serialization.string().optional()), + clientSecret: core.serialization.property("client_secret", core.serialization.string().optional()), + registrationUrl: core.serialization.property("registration_url", core.serialization.string().optional()), + introspectionUrl: core.serialization.property("introspection_url", core.serialization.string().optional()), + includeResource: core.serialization.property("include_resource", core.serialization.boolean().optional()), + provider: McpServerOAuth2Provider, + codeChallengeMethodsSupported: core.serialization.property( + "code_challenge_methods_supported", + core.serialization.list(core.serialization.stringLiteral("S256")).optional(), + ), + jwtSource: core.serialization.property("jwt_source", McpServerOAuth2JwtSource.optional()), + scopes: core.serialization.list(core.serialization.string()).optional(), + additionalTokenParams: core.serialization.property( + "additional_token_params", + core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), + ), + }) + .extend(McpServerOAuth2ProviderAuth0Settings) + .extend(McpServerOAuth2ProviderOktaSettings) + .extend(McpServerOAuth2ProviderOktaIdJagSettings); export declare namespace McpServerOAuth2 { - export interface Raw extends McpServerOAuth2ProviderAuth0Settings.Raw { + export interface Raw + extends McpServerOAuth2ProviderAuth0Settings.Raw, + McpServerOAuth2ProviderOktaSettings.Raw, + McpServerOAuth2ProviderOktaIdJagSettings.Raw { type: "oauth2"; grant_type: McpServerOAuth2GrantType.Raw; authorization_url?: string | null; - token_url: string; + token_url?: string | null; client_id?: string | null; client_secret?: string | null; registration_url?: string | null; introspection_url?: string | null; + include_resource?: boolean | null; provider: McpServerOAuth2Provider.Raw; code_challenge_methods_supported?: "S256"[] | null; - jwt_source: McpServerOAuth2JwtSource.Raw; + jwt_source?: McpServerOAuth2JwtSource.Raw | null; scopes?: string[] | null; additional_token_params?: Record | null; } diff --git a/src/serialization/types/McpServerOAuth2GrantType.ts b/src/serialization/types/McpServerOAuth2GrantType.ts index 9779bbbc..46f4bc3e 100644 --- a/src/serialization/types/McpServerOAuth2GrantType.ts +++ b/src/serialization/types/McpServerOAuth2GrantType.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const McpServerOAuth2GrantType: core.serialization.Schema = core.serialization.enum_(["authorization_code", "client_credentials"]); +export const McpServerOAuth2GrantType: core.serialization.Schema< + serializers.McpServerOAuth2GrantType.Raw, + TrueFoundry.McpServerOAuth2GrantType +> = core.serialization.enum_(["authorization_code", "client_credentials", "token_exchange", "id_jag"]); export declare namespace McpServerOAuth2GrantType { - export type Raw = "authorization_code" | "client_credentials"; + export type Raw = "authorization_code" | "client_credentials" | "token_exchange" | "id_jag"; } diff --git a/src/serialization/types/McpServerOAuth2JwtSource.ts b/src/serialization/types/McpServerOAuth2JwtSource.ts index 207fb224..fd15c292 100644 --- a/src/serialization/types/McpServerOAuth2JwtSource.ts +++ b/src/serialization/types/McpServerOAuth2JwtSource.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const McpServerOAuth2JwtSource: core.serialization.Schema = core.serialization.enum_(["access_token", "id_token"]); +export const McpServerOAuth2JwtSource: core.serialization.Schema< + serializers.McpServerOAuth2JwtSource.Raw, + TrueFoundry.McpServerOAuth2JwtSource +> = core.serialization.enum_(["access_token", "id_token"]); export declare namespace McpServerOAuth2JwtSource { export type Raw = "access_token" | "id_token"; diff --git a/src/serialization/types/McpServerOAuth2Provider.ts b/src/serialization/types/McpServerOAuth2Provider.ts index 7bef4420..61bef1b3 100644 --- a/src/serialization/types/McpServerOAuth2Provider.ts +++ b/src/serialization/types/McpServerOAuth2Provider.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const McpServerOAuth2Provider: core.serialization.Schema = core.serialization.enum_(["custom", "auth0", "okta"]); +export const McpServerOAuth2Provider: core.serialization.Schema< + serializers.McpServerOAuth2Provider.Raw, + TrueFoundry.McpServerOAuth2Provider +> = core.serialization.enum_(["custom", "auth0", "okta"]); export declare namespace McpServerOAuth2Provider { export type Raw = "custom" | "auth0" | "okta"; diff --git a/src/serialization/types/McpServerOAuth2ProviderAuth0Settings.ts b/src/serialization/types/McpServerOAuth2ProviderAuth0Settings.ts index db855cd6..afed0a57 100644 --- a/src/serialization/types/McpServerOAuth2ProviderAuth0Settings.ts +++ b/src/serialization/types/McpServerOAuth2ProviderAuth0Settings.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const McpServerOAuth2ProviderAuth0Settings: core.serialization.ObjectSchema = core.serialization.object({ - "useOrganization": core.serialization.property("use_organization", core.serialization.boolean().optional()), - "defaultOrganization": core.serialization.property("default_organization", core.serialization.string().optional()) - }); +export const McpServerOAuth2ProviderAuth0Settings: core.serialization.ObjectSchema< + serializers.McpServerOAuth2ProviderAuth0Settings.Raw, + TrueFoundry.McpServerOAuth2ProviderAuth0Settings +> = core.serialization.object({ + useOrganization: core.serialization.property("use_organization", core.serialization.boolean().optional()), + defaultOrganization: core.serialization.property("default_organization", core.serialization.string().optional()), +}); export declare namespace McpServerOAuth2ProviderAuth0Settings { export interface Raw { diff --git a/src/serialization/types/McpServerOAuth2ProviderOktaIdJagSettings.ts b/src/serialization/types/McpServerOAuth2ProviderOktaIdJagSettings.ts new file mode 100644 index 00000000..8c02884c --- /dev/null +++ b/src/serialization/types/McpServerOAuth2ProviderOktaIdJagSettings.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const McpServerOAuth2ProviderOktaIdJagSettings: core.serialization.ObjectSchema< + serializers.McpServerOAuth2ProviderOktaIdJagSettings.Raw, + TrueFoundry.McpServerOAuth2ProviderOktaIdJagSettings +> = core.serialization.object({ + issuerUri: core.serialization.property("issuer_uri", core.serialization.string().optional()), +}); + +export declare namespace McpServerOAuth2ProviderOktaIdJagSettings { + export interface Raw { + issuer_uri?: string | null; + } +} diff --git a/src/serialization/types/McpServerOAuth2ProviderOktaSettings.ts b/src/serialization/types/McpServerOAuth2ProviderOktaSettings.ts new file mode 100644 index 00000000..5fe52dc2 --- /dev/null +++ b/src/serialization/types/McpServerOAuth2ProviderOktaSettings.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const McpServerOAuth2ProviderOktaSettings: core.serialization.ObjectSchema< + serializers.McpServerOAuth2ProviderOktaSettings.Raw, + TrueFoundry.McpServerOAuth2ProviderOktaSettings +> = core.serialization.object({ + audience: core.serialization.string().optional(), +}); + +export declare namespace McpServerOAuth2ProviderOktaSettings { + export interface Raw { + audience?: string | null; + } +} diff --git a/src/serialization/types/McpServerPassthrough.ts b/src/serialization/types/McpServerPassthrough.ts index 104db464..335fe2cf 100644 --- a/src/serialization/types/McpServerPassthrough.ts +++ b/src/serialization/types/McpServerPassthrough.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const McpServerPassthrough: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("passthrough") - }); +export const McpServerPassthrough: core.serialization.ObjectSchema< + serializers.McpServerPassthrough.Raw, + TrueFoundry.McpServerPassthrough +> = core.serialization.object({ + type: core.serialization.stringLiteral("passthrough"), +}); export declare namespace McpServerPassthrough { export interface Raw { diff --git a/src/serialization/types/McpServerProviderAccount.ts b/src/serialization/types/McpServerProviderAccount.ts index 5517c3c1..cf8cc098 100644 --- a/src/serialization/types/McpServerProviderAccount.ts +++ b/src/serialization/types/McpServerProviderAccount.ts @@ -1,19 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { McpServerIntegrations } from "./McpServerIntegrations.js"; import { OwnedBy } from "./OwnedBy.js"; -export const McpServerProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/mcp-server-group"), - "name": core.serialization.string(), - "collaborators": core.serialization.list(Collaborator), - "integrations": core.serialization.list(McpServerIntegrations), - "ownedBy": OwnedBy.optional() - }); +export const McpServerProviderAccount: core.serialization.ObjectSchema< + serializers.McpServerProviderAccount.Raw, + TrueFoundry.McpServerProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/mcp-server-group"), + name: core.serialization.string(), + collaborators: core.serialization.list(Collaborator), + integrations: core.serialization.list(McpServerIntegrations), + ownedBy: OwnedBy.optional(), +}); export declare namespace McpServerProviderAccount { export interface Raw { diff --git a/src/serialization/types/McpServerSource.ts b/src/serialization/types/McpServerSource.ts index f052cac3..928c5105 100644 --- a/src/serialization/types/McpServerSource.ts +++ b/src/serialization/types/McpServerSource.ts @@ -1,15 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { McpServerHeaderOverrideAuth } from "./McpServerHeaderOverrideAuth.js"; -export const McpServerSource: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "enabledTools": core.serialization.property("enabled_tools", core.serialization.list(core.serialization.string()).optional()), - "authData": core.serialization.property("auth_data", McpServerHeaderOverrideAuth.optional()) - }); +export const McpServerSource: core.serialization.ObjectSchema< + serializers.McpServerSource.Raw, + TrueFoundry.McpServerSource +> = core.serialization.object({ + name: core.serialization.string(), + enabledTools: core.serialization.property( + "enabled_tools", + core.serialization.list(core.serialization.string()).optional(), + ), + authData: core.serialization.property("auth_data", McpServerHeaderOverrideAuth.optional()), +}); export declare namespace McpServerSource { export interface Raw { diff --git a/src/serialization/types/McpServerToolDetails.ts b/src/serialization/types/McpServerToolDetails.ts index 8a3f105a..fc91c064 100644 --- a/src/serialization/types/McpServerToolDetails.ts +++ b/src/serialization/types/McpServerToolDetails.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const McpServerToolDetails: core.serialization.ObjectSchema = core.serialization.object({ - "mcpServerIntegrationId": core.serialization.property("mcp_server_integration_id", core.serialization.string()), - "toolName": core.serialization.property("tool_name", core.serialization.string()) - }); +export const McpServerToolDetails: core.serialization.ObjectSchema< + serializers.McpServerToolDetails.Raw, + TrueFoundry.McpServerToolDetails +> = core.serialization.object({ + mcpServerIntegrationId: core.serialization.property("mcp_server_integration_id", core.serialization.string()), + toolName: core.serialization.property("tool_name", core.serialization.string()), +}); export declare namespace McpServerToolDetails { export interface Raw { diff --git a/src/serialization/types/McpServerWithFqn.ts b/src/serialization/types/McpServerWithFqn.ts index b597eacd..5f387f74 100644 --- a/src/serialization/types/McpServerWithFqn.ts +++ b/src/serialization/types/McpServerWithFqn.ts @@ -1,16 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { McpTool } from "./McpTool.js"; -export const McpServerWithFqn: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("mcp-server-fqn"), - "integrationFqn": core.serialization.property("integration_fqn", core.serialization.string()), - "enableAllTools": core.serialization.property("enable_all_tools", core.serialization.boolean()), - "tools": core.serialization.list(McpTool).optional() - }); +export const McpServerWithFqn: core.serialization.ObjectSchema< + serializers.McpServerWithFqn.Raw, + TrueFoundry.McpServerWithFqn +> = core.serialization.object({ + type: core.serialization.stringLiteral("mcp-server-fqn"), + integrationFqn: core.serialization.property("integration_fqn", core.serialization.string()), + enableAllTools: core.serialization.property("enable_all_tools", core.serialization.boolean()), + tools: core.serialization.list(McpTool).optional(), +}); export declare namespace McpServerWithFqn { export interface Raw { diff --git a/src/serialization/types/McpServerWithUrl.ts b/src/serialization/types/McpServerWithUrl.ts index acca0539..4867ed73 100644 --- a/src/serialization/types/McpServerWithUrl.ts +++ b/src/serialization/types/McpServerWithUrl.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { McpTool } from "./McpTool.js"; -export const McpServerWithUrl: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("mcp-server-url"), - "url": core.serialization.string(), - "headers": core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), - "enableAllTools": core.serialization.property("enable_all_tools", core.serialization.boolean()), - "tools": core.serialization.list(McpTool).optional() - }); +export const McpServerWithUrl: core.serialization.ObjectSchema< + serializers.McpServerWithUrl.Raw, + TrueFoundry.McpServerWithUrl +> = core.serialization.object({ + type: core.serialization.stringLiteral("mcp-server-url"), + url: core.serialization.string(), + headers: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), + enableAllTools: core.serialization.property("enable_all_tools", core.serialization.boolean()), + tools: core.serialization.list(McpTool).optional(), +}); export declare namespace McpServerWithUrl { export interface Raw { diff --git a/src/serialization/types/McpTool.ts b/src/serialization/types/McpTool.ts index af130d10..cf87eb63 100644 --- a/src/serialization/types/McpTool.ts +++ b/src/serialization/types/McpTool.ts @@ -1,11 +1,12 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const McpTool: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string() +export const McpTool: core.serialization.ObjectSchema = + core.serialization.object({ + name: core.serialization.string(), }); export declare namespace McpTool { diff --git a/src/serialization/types/McpToolAnnotations.ts b/src/serialization/types/McpToolAnnotations.ts index 566c1ee3..ca2b091e 100644 --- a/src/serialization/types/McpToolAnnotations.ts +++ b/src/serialization/types/McpToolAnnotations.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const McpToolAnnotations: core.serialization.ObjectSchema = core.serialization.object({ - "readOnlyHint": core.serialization.boolean().optional(), - "destructiveHint": core.serialization.boolean().optional() - }); +export const McpToolAnnotations: core.serialization.ObjectSchema< + serializers.McpToolAnnotations.Raw, + TrueFoundry.McpToolAnnotations +> = core.serialization.object({ + readOnlyHint: core.serialization.boolean().optional(), + destructiveHint: core.serialization.boolean().optional(), +}); export declare namespace McpToolAnnotations { export interface Raw { diff --git a/src/serialization/types/McpToolSetting.ts b/src/serialization/types/McpToolSetting.ts index ff7c94f4..b3517b92 100644 --- a/src/serialization/types/McpToolSetting.ts +++ b/src/serialization/types/McpToolSetting.ts @@ -1,16 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { McpToolAnnotations } from "./McpToolAnnotations.js"; -export const McpToolSetting: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string().optional(), - "disabled": core.serialization.boolean().optional(), - "annotations": McpToolAnnotations.optional() - }); +export const McpToolSetting: core.serialization.ObjectSchema< + serializers.McpToolSetting.Raw, + TrueFoundry.McpToolSetting +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + disabled: core.serialization.boolean().optional(), + annotations: McpToolAnnotations.optional(), +}); export declare namespace McpToolSetting { export interface Raw { diff --git a/src/serialization/types/McpToolTarget.ts b/src/serialization/types/McpToolTarget.ts index e3bfda44..f09a1ae7 100644 --- a/src/serialization/types/McpToolTarget.ts +++ b/src/serialization/types/McpToolTarget.ts @@ -1,13 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const McpToolTarget: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "enableAllTools": core.serialization.property("enable_all_tools", core.serialization.boolean()), - "enabledTools": core.serialization.property("enabled_tools", core.serialization.list(core.serialization.string()).optional()) +export const McpToolTarget: core.serialization.ObjectSchema = + core.serialization.object({ + name: core.serialization.string(), + enableAllTools: core.serialization.property("enable_all_tools", core.serialization.boolean()), + enabledTools: core.serialization.property( + "enabled_tools", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace McpToolTarget { diff --git a/src/serialization/types/McpToolsOperator.ts b/src/serialization/types/McpToolsOperator.ts index 2e3351bb..8f6af749 100644 --- a/src/serialization/types/McpToolsOperator.ts +++ b/src/serialization/types/McpToolsOperator.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { McpToolsOperatorCondition } from "./McpToolsOperatorCondition.js"; import { McpToolTarget } from "./McpToolTarget.js"; -export const McpToolsOperator: core.serialization.ObjectSchema = core.serialization.object({ - "condition": McpToolsOperatorCondition, - "values": core.serialization.list(McpToolTarget) - }); +export const McpToolsOperator: core.serialization.ObjectSchema< + serializers.McpToolsOperator.Raw, + TrueFoundry.McpToolsOperator +> = core.serialization.object({ + condition: McpToolsOperatorCondition, + values: core.serialization.list(McpToolTarget), +}); export declare namespace McpToolsOperator { export interface Raw { diff --git a/src/serialization/types/McpToolsOperatorCondition.ts b/src/serialization/types/McpToolsOperatorCondition.ts index 1505daa1..e8cf5d53 100644 --- a/src/serialization/types/McpToolsOperatorCondition.ts +++ b/src/serialization/types/McpToolsOperatorCondition.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const McpToolsOperatorCondition: core.serialization.Schema = core.serialization.enum_(["in", "not_in"]); +export const McpToolsOperatorCondition: core.serialization.Schema< + serializers.McpToolsOperatorCondition.Raw, + TrueFoundry.McpToolsOperatorCondition +> = core.serialization.enum_(["in", "not_in"]); export declare namespace McpToolsOperatorCondition { export type Raw = "in" | "not_in"; diff --git a/src/serialization/types/Metadata.ts b/src/serialization/types/Metadata.ts index f4cebde2..1af75abc 100644 --- a/src/serialization/types/Metadata.ts +++ b/src/serialization/types/Metadata.ts @@ -1,15 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const Metadata: core.serialization.ObjectSchema = core.serialization.object({ - "jobRunNameAlias": core.serialization.property("job_run_name_alias", core.serialization.string().optional()) +export const Metadata: core.serialization.ObjectSchema = + core.serialization.object({ + jobRunNameAlias: core.serialization.property( + "job_run_name_alias", + core.serialization.string().optionalNullable(), + ), }); export declare namespace Metadata { export interface Raw { - job_run_name_alias?: string | null; + job_run_name_alias?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/Metric.ts b/src/serialization/types/Metric.ts index e8bac7be..cec15e75 100644 --- a/src/serialization/types/Metric.ts +++ b/src/serialization/types/Metric.ts @@ -1,21 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const Metric: core.serialization.ObjectSchema = core.serialization.object({ - "key": core.serialization.string(), - "value": core.serialization.number().optional(), - "timestamp": core.serialization.number().optional(), - "step": core.serialization.number().optional() +export const Metric: core.serialization.ObjectSchema = + core.serialization.object({ + key: core.serialization.string(), + value: core.serialization.number().optionalNullable(), + timestamp: core.serialization.number().optionalNullable(), + step: core.serialization.number().optionalNullable(), }); export declare namespace Metric { export interface Raw { key: string; - value?: number | null; - timestamp?: number | null; - step?: number | null; + value?: (number | null | undefined) | null; + timestamp?: (number | null | undefined) | null; + step?: (number | null | undefined) | null; } } diff --git a/src/serialization/types/MetricCollection.ts b/src/serialization/types/MetricCollection.ts index 60cd422e..c4a807b3 100644 --- a/src/serialization/types/MetricCollection.ts +++ b/src/serialization/types/MetricCollection.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Metric } from "./Metric.js"; -export const MetricCollection: core.serialization.ObjectSchema = core.serialization.object({ - "key": core.serialization.string(), - "metrics": core.serialization.list(Metric) - }); +export const MetricCollection: core.serialization.ObjectSchema< + serializers.MetricCollection.Raw, + TrueFoundry.MetricCollection +> = core.serialization.object({ + key: core.serialization.string(), + metrics: core.serialization.list(Metric), +}); export declare namespace MetricCollection { export interface Raw { diff --git a/src/serialization/types/MimeType.ts b/src/serialization/types/MimeType.ts index fe49ad92..c3968c54 100644 --- a/src/serialization/types/MimeType.ts +++ b/src/serialization/types/MimeType.ts @@ -1,10 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const MimeType: core.serialization.Schema = core.serialization.enum_(["text/plain", "application/json", "image/png", "image/jpeg", "application/x-directory"]); +export const MimeType: core.serialization.Schema = + core.serialization.enum_(["text/plain", "application/json", "image/png", "image/jpeg", "application/x-directory"]); export declare namespace MimeType { export type Raw = "text/plain" | "application/json" | "image/png" | "image/jpeg" | "application/x-directory"; diff --git a/src/serialization/types/MirrorAction.ts b/src/serialization/types/MirrorAction.ts index ab3cf946..08666e98 100644 --- a/src/serialization/types/MirrorAction.ts +++ b/src/serialization/types/MirrorAction.ts @@ -1,14 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const MirrorAction: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("mirror"), - "serviceUri": core.serialization.property("service_uri", core.serialization.string()), - "port": core.serialization.number(), - "percentage": core.serialization.number() +export const MirrorAction: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("mirror"), + serviceUri: core.serialization.property("service_uri", core.serialization.string()), + port: core.serialization.number(), + percentage: core.serialization.number(), }); export declare namespace MirrorAction { diff --git a/src/serialization/types/MistralAiIntegrations.ts b/src/serialization/types/MistralAiIntegrations.ts index 68ecc7f0..5ffec46e 100644 --- a/src/serialization/types/MistralAiIntegrations.ts +++ b/src/serialization/types/MistralAiIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { MistralAiModel } from "./MistralAiModel.js"; -export const MistralAiIntegrations: core.serialization.ObjectSchema = MistralAiModel; +export const MistralAiIntegrations: core.serialization.ObjectSchema< + serializers.MistralAiIntegrations.Raw, + TrueFoundry.MistralAiIntegrations +> = MistralAiModel; export declare namespace MistralAiIntegrations { export type Raw = MistralAiModel.Raw; diff --git a/src/serialization/types/MistralAiKeyAuth.ts b/src/serialization/types/MistralAiKeyAuth.ts index a2c85913..99194e79 100644 --- a/src/serialization/types/MistralAiKeyAuth.ts +++ b/src/serialization/types/MistralAiKeyAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const MistralAiKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) - }); +export const MistralAiKeyAuth: core.serialization.ObjectSchema< + serializers.MistralAiKeyAuth.Raw, + TrueFoundry.MistralAiKeyAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), +}); export declare namespace MistralAiKeyAuth { export interface Raw { diff --git a/src/serialization/types/MistralAiModel.ts b/src/serialization/types/MistralAiModel.ts index c317a8de..8a41bb7c 100644 --- a/src/serialization/types/MistralAiModel.ts +++ b/src/serialization/types/MistralAiModel.ts @@ -1,19 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const MistralAiModel: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/model/mistral-ai"), - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const MistralAiModel: core.serialization.ObjectSchema< + serializers.MistralAiModel.Raw, + TrueFoundry.MistralAiModel +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/model/mistral-ai"), + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace MistralAiModel { export interface Raw { diff --git a/src/serialization/types/MistralAiProviderAccount.ts b/src/serialization/types/MistralAiProviderAccount.ts index 80e8ddcd..65ce5f60 100644 --- a/src/serialization/types/MistralAiProviderAccount.ts +++ b/src/serialization/types/MistralAiProviderAccount.ts @@ -1,22 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { MistralAiIntegrations } from "./MistralAiIntegrations.js"; import { MistralAiKeyAuth } from "./MistralAiKeyAuth.js"; import { OwnedBy } from "./OwnedBy.js"; -export const MistralAiProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/mistral-ai"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", MistralAiKeyAuth), - "integrations": core.serialization.list(MistralAiIntegrations), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const MistralAiProviderAccount: core.serialization.ObjectSchema< + serializers.MistralAiProviderAccount.Raw, + TrueFoundry.MistralAiProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/mistral-ai"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", MistralAiKeyAuth), + integrations: core.serialization.list(MistralAiIntegrations), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace MistralAiProviderAccount { export interface Raw { diff --git a/src/serialization/types/MlRepo.ts b/src/serialization/types/MlRepo.ts index d260542a..420bcec2 100644 --- a/src/serialization/types/MlRepo.ts +++ b/src/serialization/types/MlRepo.ts @@ -1,22 +1,31 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { MlRepoManifest } from "./MlRepoManifest.js"; import { Subject } from "./Subject.js"; -export const MlRepo: core.serialization.ObjectSchema = core.serialization.object({ - "tenantName": core.serialization.property("tenant_name", core.serialization.string()), - "manifest": MlRepoManifest, - "createdBySubject": core.serialization.property("created_by_subject", Subject), - "createdAt": core.serialization.property("created_at", core.serialization.date()), - "accountId": core.serialization.property("account_id", core.serialization.string()), - "id": core.serialization.string(), - "numRuns": core.serialization.property("num_runs", core.serialization.number().optional()), - "artifactTypeCounts": core.serialization.property("artifact_type_counts", core.serialization.record(core.serialization.string(), core.serialization.number()).optional()), - "datasetsCount": core.serialization.property("datasets_count", core.serialization.number().optional()), - "tracingProjectsCount": core.serialization.property("tracing_projects_count", core.serialization.number().optional()) +export const MlRepo: core.serialization.ObjectSchema = + core.serialization.object({ + tenantName: core.serialization.property("tenant_name", core.serialization.string()), + manifest: MlRepoManifest, + createdBySubject: core.serialization.property("created_by_subject", Subject), + createdAt: core.serialization.property("created_at", core.serialization.date()), + accountId: core.serialization.property("account_id", core.serialization.string()), + id: core.serialization.string(), + numRuns: core.serialization.property("num_runs", core.serialization.number().optionalNullable()), + artifactTypeCounts: core.serialization.property( + "artifact_type_counts", + core.serialization + .record(core.serialization.string(), core.serialization.number().nullable()) + .optionalNullable(), + ), + datasetsCount: core.serialization.property("datasets_count", core.serialization.number().optionalNullable()), + tracingProjectsCount: core.serialization.property( + "tracing_projects_count", + core.serialization.number().optionalNullable(), + ), }); export declare namespace MlRepo { @@ -27,9 +36,9 @@ export declare namespace MlRepo { created_at: string; account_id: string; id: string; - num_runs?: number | null; - artifact_type_counts?: Record | null; - datasets_count?: number | null; - tracing_projects_count?: number | null; + num_runs?: (number | null | undefined) | null; + artifact_type_counts?: (Record | null | undefined) | null; + datasets_count?: (number | null | undefined) | null; + tracing_projects_count?: (number | null | undefined) | null; } } diff --git a/src/serialization/types/MlRepoManifest.ts b/src/serialization/types/MlRepoManifest.ts index 6f26753b..3e7d60c9 100644 --- a/src/serialization/types/MlRepoManifest.ts +++ b/src/serialization/types/MlRepoManifest.ts @@ -1,19 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { OwnedBy } from "./OwnedBy.js"; -export const MlRepoManifest: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("ml-repo"), - "name": core.serialization.string(), - "description": core.serialization.string().optional(), - "storageIntegrationFqn": core.serialization.property("storage_integration_fqn", core.serialization.string()), - "collaborators": core.serialization.list(Collaborator), - "ownedBy": OwnedBy.optional() - }); +export const MlRepoManifest: core.serialization.ObjectSchema< + serializers.MlRepoManifest.Raw, + TrueFoundry.MlRepoManifest +> = core.serialization.object({ + type: core.serialization.stringLiteral("ml-repo"), + name: core.serialization.string(), + description: core.serialization.string().optional(), + storageIntegrationFqn: core.serialization.property("storage_integration_fqn", core.serialization.string()), + collaborators: core.serialization.list(Collaborator), + ownedBy: OwnedBy.optional(), +}); export declare namespace MlRepoManifest { export interface Raw { diff --git a/src/serialization/types/Model.ts b/src/serialization/types/Model.ts index 6dc3820d..bb46539b 100644 --- a/src/serialization/types/Model.ts +++ b/src/serialization/types/Model.ts @@ -1,22 +1,26 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelVersion } from "./ModelVersion.js"; import { Subject } from "./Subject.js"; -export const Model: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string(), - "mlRepoId": core.serialization.property("ml_repo_id", core.serialization.string()), - "type": core.serialization.stringLiteral("model").optional(), - "name": core.serialization.string(), - "fqn": core.serialization.string(), - "createdBySubject": core.serialization.property("created_by_subject", Subject), - "createdAt": core.serialization.property("created_at", core.serialization.date().optional()), - "updatedAt": core.serialization.property("updated_at", core.serialization.date().optional()), - "latestVersion": core.serialization.property("latest_version", ModelVersion.optional()), - "runSteps": core.serialization.property("run_steps", core.serialization.list(core.serialization.number()).optional()) +export const Model: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string(), + mlRepoId: core.serialization.property("ml_repo_id", core.serialization.string()), + type: core.serialization.stringLiteral("model").optional(), + name: core.serialization.string(), + fqn: core.serialization.string(), + createdBySubject: core.serialization.property("created_by_subject", Subject), + createdAt: core.serialization.property("created_at", core.serialization.date().optionalNullable()), + updatedAt: core.serialization.property("updated_at", core.serialization.date().optionalNullable()), + latestVersion: core.serialization.property("latest_version", ModelVersion.optionalNullable()), + runSteps: core.serialization.property( + "run_steps", + core.serialization.list(core.serialization.number()).optionalNullable(), + ), }); export declare namespace Model { @@ -27,9 +31,9 @@ export declare namespace Model { name: string; fqn: string; created_by_subject: Subject.Raw; - created_at?: string | null; - updated_at?: string | null; - latest_version?: ModelVersion.Raw | null; - run_steps?: number[] | null; + created_at?: (string | null | undefined) | null; + updated_at?: (string | null | undefined) | null; + latest_version?: (ModelVersion.Raw | null | undefined) | null; + run_steps?: (number[] | null | undefined) | null; } } diff --git a/src/serialization/types/ModelConfiguration.ts b/src/serialization/types/ModelConfiguration.ts index 0971ea94..a3aae032 100644 --- a/src/serialization/types/ModelConfiguration.ts +++ b/src/serialization/types/ModelConfiguration.ts @@ -1,16 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Parameters } from "./Parameters.js"; -export const ModelConfiguration: core.serialization.ObjectSchema = core.serialization.object({ - "provider": core.serialization.string(), - "model": core.serialization.string(), - "parameters": Parameters.optional(), - "extraParameters": core.serialization.property("extra_parameters", core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional()) - }); +export const ModelConfiguration: core.serialization.ObjectSchema< + serializers.ModelConfiguration.Raw, + TrueFoundry.ModelConfiguration +> = core.serialization.object({ + provider: core.serialization.string(), + model: core.serialization.string(), + parameters: Parameters.optional(), + extraParameters: core.serialization.property( + "extra_parameters", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + ), +}); export declare namespace ModelConfiguration { export interface Raw { diff --git a/src/serialization/types/ModelCostMetric.ts b/src/serialization/types/ModelCostMetric.ts index 5a468456..4168b2a2 100644 --- a/src/serialization/types/ModelCostMetric.ts +++ b/src/serialization/types/ModelCostMetric.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { OcrCostMetric } from "./OcrCostMetric.js"; import { PerMillionCharactersCostMetric } from "./PerMillionCharactersCostMetric.js"; import { PerMinuteOfAudioCostMetric } from "./PerMinuteOfAudioCostMetric.js"; @@ -10,8 +10,22 @@ import { PerThousandEmbeddingTokensCostMetric } from "./PerThousandEmbeddingToke import { PerThousandTokensCostMetric } from "./PerThousandTokensCostMetric.js"; import { PublicCostMetric } from "./PublicCostMetric.js"; -export const ModelCostMetric: core.serialization.Schema = core.serialization.undiscriminatedUnion([PerThousandTokensCostMetric, PerThousandEmbeddingTokensCostMetric, PerMillionCharactersCostMetric, PerMinuteOfAudioCostMetric, OcrCostMetric, PublicCostMetric]); +export const ModelCostMetric: core.serialization.Schema = + core.serialization.undiscriminatedUnion([ + PerThousandTokensCostMetric, + PerThousandEmbeddingTokensCostMetric, + PerMillionCharactersCostMetric, + PerMinuteOfAudioCostMetric, + OcrCostMetric, + PublicCostMetric, + ]); export declare namespace ModelCostMetric { - export type Raw = PerThousandTokensCostMetric.Raw | PerThousandEmbeddingTokensCostMetric.Raw | PerMillionCharactersCostMetric.Raw | PerMinuteOfAudioCostMetric.Raw | OcrCostMetric.Raw | PublicCostMetric.Raw; + export type Raw = + | PerThousandTokensCostMetric.Raw + | PerThousandEmbeddingTokensCostMetric.Raw + | PerMillionCharactersCostMetric.Raw + | PerMinuteOfAudioCostMetric.Raw + | OcrCostMetric.Raw + | PublicCostMetric.Raw; } diff --git a/src/serialization/types/ModelManifest.ts b/src/serialization/types/ModelManifest.ts index be510ffe..6f20ebac 100644 --- a/src/serialization/types/ModelManifest.ts +++ b/src/serialization/types/ModelManifest.ts @@ -1,28 +1,31 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BaseArtifactVersion } from "./BaseArtifactVersion.js"; import { ModelManifestFramework } from "./ModelManifestFramework.js"; import { ModelManifestSource } from "./ModelManifestSource.js"; import { ModelVersionEnvironment } from "./ModelVersionEnvironment.js"; -export const ModelManifest: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("model-version"), - "description": core.serialization.string().optional(), - "versionAlias": core.serialization.property("version_alias", core.serialization.string().optional()), - "source": ModelManifestSource, - "framework": ModelManifestFramework.optional(), - "environment": ModelVersionEnvironment.optional(), - "step": core.serialization.number(), - "runId": core.serialization.property("run_id", core.serialization.string().optional()) - }).extend(BaseArtifactVersion); +export const ModelManifest: core.serialization.ObjectSchema = + core.serialization + .object({ + type: core.serialization.stringLiteral("model-version"), + description: core.serialization.string().optionalNullable(), + versionAlias: core.serialization.property("version_alias", core.serialization.string().optional()), + source: ModelManifestSource, + framework: ModelManifestFramework.optional(), + environment: ModelVersionEnvironment.optional(), + step: core.serialization.number(), + runId: core.serialization.property("run_id", core.serialization.string().optional()), + }) + .extend(BaseArtifactVersion); export declare namespace ModelManifest { export interface Raw extends BaseArtifactVersion.Raw { type: "model-version"; - description?: string | null; + description?: (string | null | undefined) | null; version_alias?: string | null; source: ModelManifestSource.Raw; framework?: ModelManifestFramework.Raw | null; diff --git a/src/serialization/types/ModelManifestFramework.ts b/src/serialization/types/ModelManifestFramework.ts index f83554a3..940709ba 100644 --- a/src/serialization/types/ModelManifestFramework.ts +++ b/src/serialization/types/ModelManifestFramework.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { FastAiFramework } from "./FastAiFramework.js"; import { GluonFramework } from "./GluonFramework.js"; import { H2OFramework } from "./H2OFramework.js"; @@ -18,8 +18,40 @@ import { TensorFlowFramework } from "./TensorFlowFramework.js"; import { TransformersFramework } from "./TransformersFramework.js"; import { XgBoostFramework } from "./XgBoostFramework.js"; -export const ModelManifestFramework: core.serialization.Schema = core.serialization.undiscriminatedUnion([TransformersFramework, TensorFlowFramework, SklearnFramework, PyTorchFramework, KerasFramework, XgBoostFramework, LightGbmFramework, FastAiFramework, H2OFramework, OnnxFramework, SpaCyFramework, StatsModelsFramework, GluonFramework, PaddleFramework]); +export const ModelManifestFramework: core.serialization.Schema< + serializers.ModelManifestFramework.Raw, + TrueFoundry.ModelManifestFramework +> = core.serialization.undiscriminatedUnion([ + TransformersFramework, + TensorFlowFramework, + SklearnFramework, + PyTorchFramework, + KerasFramework, + XgBoostFramework, + LightGbmFramework, + FastAiFramework, + H2OFramework, + OnnxFramework, + SpaCyFramework, + StatsModelsFramework, + GluonFramework, + PaddleFramework, +]); export declare namespace ModelManifestFramework { - export type Raw = TransformersFramework.Raw | TensorFlowFramework.Raw | SklearnFramework.Raw | PyTorchFramework.Raw | KerasFramework.Raw | XgBoostFramework.Raw | LightGbmFramework.Raw | FastAiFramework.Raw | H2OFramework.Raw | OnnxFramework.Raw | SpaCyFramework.Raw | StatsModelsFramework.Raw | GluonFramework.Raw | PaddleFramework.Raw; + export type Raw = + | TransformersFramework.Raw + | TensorFlowFramework.Raw + | SklearnFramework.Raw + | PyTorchFramework.Raw + | KerasFramework.Raw + | XgBoostFramework.Raw + | LightGbmFramework.Raw + | FastAiFramework.Raw + | H2OFramework.Raw + | OnnxFramework.Raw + | SpaCyFramework.Raw + | StatsModelsFramework.Raw + | GluonFramework.Raw + | PaddleFramework.Raw; } diff --git a/src/serialization/types/ModelManifestSource.ts b/src/serialization/types/ModelManifestSource.ts index a024adbb..f8464024 100644 --- a/src/serialization/types/ModelManifestSource.ts +++ b/src/serialization/types/ModelManifestSource.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ExternalBlobStorageSource } from "./ExternalBlobStorageSource.js"; import { LocalModelSource } from "./LocalModelSource.js"; import { TrueFoundryManagedSource } from "./TrueFoundryManagedSource.js"; -export const ModelManifestSource: core.serialization.Schema = core.serialization.undiscriminatedUnion([TrueFoundryManagedSource, ExternalBlobStorageSource, LocalModelSource]); +export const ModelManifestSource: core.serialization.Schema< + serializers.ModelManifestSource.Raw, + TrueFoundry.ModelManifestSource +> = core.serialization.undiscriminatedUnion([TrueFoundryManagedSource, ExternalBlobStorageSource, LocalModelSource]); export declare namespace ModelManifestSource { export type Raw = TrueFoundryManagedSource.Raw | ExternalBlobStorageSource.Raw | LocalModelSource.Raw; diff --git a/src/serialization/types/ModelProviderAccount.ts b/src/serialization/types/ModelProviderAccount.ts index 46b2bf21..47504021 100644 --- a/src/serialization/types/ModelProviderAccount.ts +++ b/src/serialization/types/ModelProviderAccount.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Ai21ProviderAccount } from "./Ai21ProviderAccount.js"; import { AnthropicProviderAccount } from "./AnthropicProviderAccount.js"; import { AwsBedrockMantleProviderAccount } from "./AwsBedrockMantleProviderAccount.js"; @@ -40,8 +40,84 @@ import { VirtualModelProviderAccount } from "./VirtualModelProviderAccount.js"; import { WaferProviderAccount } from "./WaferProviderAccount.js"; import { XaiProviderAccount } from "./XaiProviderAccount.js"; -export const ModelProviderAccount: core.serialization.Schema = core.serialization.undiscriminatedUnion([AwsBedrockProviderAccount, GoogleVertexProviderAccount, GoogleGeminiProviderAccount, AzureOpenAiProviderAccount, AzureFoundryProviderAccount, CohereProviderAccount, Ai21ProviderAccount, AnthropicProviderAccount, DeepinfraProviderAccount, GroqProviderAccount, MistralAiProviderAccount, PerplexityAiProviderAccount, TogetherAiProviderAccount, NomicProviderAccount, PalmProviderAccount, OllamaProviderAccount, OpenaiProviderAccount, DatabricksProviderAccount, ClouderaProviderAccount, SelfHostedModelProviderAccount, OpenRouterProviderAccount, SambaNovaProviderAccount, XaiProviderAccount, BasetenProviderAccount, AwsSagemakerProviderAccount, CerebrasProviderAccount, WaferProviderAccount, SnowflakeCortexProviderAccount, ElevenLabsProviderAccount, DeepgramProviderAccount, CartesiaProviderAccount, SmallestAiProviderAccount, AwsClaudePlatformProviderAccount, AwsBedrockMantleProviderAccount, VirtualModelProviderAccount, CustomEndpointProviderAccount]); +export const ModelProviderAccount: core.serialization.Schema< + serializers.ModelProviderAccount.Raw, + TrueFoundry.ModelProviderAccount +> = core.serialization.undiscriminatedUnion([ + AwsBedrockProviderAccount, + GoogleVertexProviderAccount, + GoogleGeminiProviderAccount, + AzureOpenAiProviderAccount, + AzureFoundryProviderAccount, + CohereProviderAccount, + Ai21ProviderAccount, + AnthropicProviderAccount, + DeepinfraProviderAccount, + GroqProviderAccount, + MistralAiProviderAccount, + PerplexityAiProviderAccount, + TogetherAiProviderAccount, + NomicProviderAccount, + PalmProviderAccount, + OllamaProviderAccount, + OpenaiProviderAccount, + DatabricksProviderAccount, + ClouderaProviderAccount, + SelfHostedModelProviderAccount, + OpenRouterProviderAccount, + SambaNovaProviderAccount, + XaiProviderAccount, + BasetenProviderAccount, + AwsSagemakerProviderAccount, + CerebrasProviderAccount, + WaferProviderAccount, + SnowflakeCortexProviderAccount, + ElevenLabsProviderAccount, + DeepgramProviderAccount, + CartesiaProviderAccount, + SmallestAiProviderAccount, + AwsClaudePlatformProviderAccount, + AwsBedrockMantleProviderAccount, + VirtualModelProviderAccount, + CustomEndpointProviderAccount, +]); export declare namespace ModelProviderAccount { - export type Raw = AwsBedrockProviderAccount.Raw | GoogleVertexProviderAccount.Raw | GoogleGeminiProviderAccount.Raw | AzureOpenAiProviderAccount.Raw | AzureFoundryProviderAccount.Raw | CohereProviderAccount.Raw | Ai21ProviderAccount.Raw | AnthropicProviderAccount.Raw | DeepinfraProviderAccount.Raw | GroqProviderAccount.Raw | MistralAiProviderAccount.Raw | PerplexityAiProviderAccount.Raw | TogetherAiProviderAccount.Raw | NomicProviderAccount.Raw | PalmProviderAccount.Raw | OllamaProviderAccount.Raw | OpenaiProviderAccount.Raw | DatabricksProviderAccount.Raw | ClouderaProviderAccount.Raw | SelfHostedModelProviderAccount.Raw | OpenRouterProviderAccount.Raw | SambaNovaProviderAccount.Raw | XaiProviderAccount.Raw | BasetenProviderAccount.Raw | AwsSagemakerProviderAccount.Raw | CerebrasProviderAccount.Raw | WaferProviderAccount.Raw | SnowflakeCortexProviderAccount.Raw | ElevenLabsProviderAccount.Raw | DeepgramProviderAccount.Raw | CartesiaProviderAccount.Raw | SmallestAiProviderAccount.Raw | AwsClaudePlatformProviderAccount.Raw | AwsBedrockMantleProviderAccount.Raw | VirtualModelProviderAccount.Raw | CustomEndpointProviderAccount.Raw; + export type Raw = + | AwsBedrockProviderAccount.Raw + | GoogleVertexProviderAccount.Raw + | GoogleGeminiProviderAccount.Raw + | AzureOpenAiProviderAccount.Raw + | AzureFoundryProviderAccount.Raw + | CohereProviderAccount.Raw + | Ai21ProviderAccount.Raw + | AnthropicProviderAccount.Raw + | DeepinfraProviderAccount.Raw + | GroqProviderAccount.Raw + | MistralAiProviderAccount.Raw + | PerplexityAiProviderAccount.Raw + | TogetherAiProviderAccount.Raw + | NomicProviderAccount.Raw + | PalmProviderAccount.Raw + | OllamaProviderAccount.Raw + | OpenaiProviderAccount.Raw + | DatabricksProviderAccount.Raw + | ClouderaProviderAccount.Raw + | SelfHostedModelProviderAccount.Raw + | OpenRouterProviderAccount.Raw + | SambaNovaProviderAccount.Raw + | XaiProviderAccount.Raw + | BasetenProviderAccount.Raw + | AwsSagemakerProviderAccount.Raw + | CerebrasProviderAccount.Raw + | WaferProviderAccount.Raw + | SnowflakeCortexProviderAccount.Raw + | ElevenLabsProviderAccount.Raw + | DeepgramProviderAccount.Raw + | CartesiaProviderAccount.Raw + | SmallestAiProviderAccount.Raw + | AwsClaudePlatformProviderAccount.Raw + | AwsBedrockMantleProviderAccount.Raw + | VirtualModelProviderAccount.Raw + | CustomEndpointProviderAccount.Raw; } diff --git a/src/serialization/types/ModelType.ts b/src/serialization/types/ModelType.ts index 334128bc..5fd9362c 100644 --- a/src/serialization/types/ModelType.ts +++ b/src/serialization/types/ModelType.ts @@ -1,11 +1,37 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const ModelType: core.serialization.Schema = core.serialization.enum_(["chat", "completion", "embedding", "realtime", "rerank", "audio_transcription", "audio_translation", "text_to_speech", "moderation", "image", "responses", "ocr"]); +export const ModelType: core.serialization.Schema = + core.serialization.enum_([ + "chat", + "completion", + "embedding", + "realtime", + "rerank", + "audio_transcription", + "audio_translation", + "text_to_speech", + "moderation", + "image", + "responses", + "ocr", + ]); export declare namespace ModelType { - export type Raw = "chat" | "completion" | "embedding" | "realtime" | "rerank" | "audio_transcription" | "audio_translation" | "text_to_speech" | "moderation" | "image" | "responses" | "ocr"; + export type Raw = + | "chat" + | "completion" + | "embedding" + | "realtime" + | "rerank" + | "audio_transcription" + | "audio_translation" + | "text_to_speech" + | "moderation" + | "image" + | "responses" + | "ocr"; } diff --git a/src/serialization/types/ModelVersion.ts b/src/serialization/types/ModelVersion.ts index 1f1b5450..b3e26215 100644 --- a/src/serialization/types/ModelVersion.ts +++ b/src/serialization/types/ModelVersion.ts @@ -1,40 +1,44 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Metric } from "./Metric.js"; import { ModelManifest } from "./ModelManifest.js"; import { Subject } from "./Subject.js"; -export const ModelVersion: core.serialization.ObjectSchema = core.serialization.object({ - "createdAt": core.serialization.property("created_at", core.serialization.date().optional()), - "updatedAt": core.serialization.property("updated_at", core.serialization.date().optional()), - "manifest": ModelManifest, - "id": core.serialization.string(), - "fqn": core.serialization.string(), - "createdBySubject": core.serialization.property("created_by_subject", Subject), - "mlRepoId": core.serialization.property("ml_repo_id", core.serialization.string()), - "usageCodeSnippet": core.serialization.property("usage_code_snippet", core.serialization.string().optional()), - "tags": core.serialization.list(core.serialization.string()).optional(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "metrics": core.serialization.list(Metric).optional(), - "deployable": core.serialization.boolean().optional() +export const ModelVersion: core.serialization.ObjectSchema = + core.serialization.object({ + createdAt: core.serialization.property("created_at", core.serialization.date().optionalNullable()), + updatedAt: core.serialization.property("updated_at", core.serialization.date().optionalNullable()), + manifest: ModelManifest, + id: core.serialization.string(), + fqn: core.serialization.string(), + createdBySubject: core.serialization.property("created_by_subject", Subject), + mlRepoId: core.serialization.property("ml_repo_id", core.serialization.string()), + usageCodeSnippet: core.serialization.property( + "usage_code_snippet", + core.serialization.string().optionalNullable(), + ), + tags: core.serialization.list(core.serialization.string()).optional(), + modelId: core.serialization.property("model_id", core.serialization.string()), + metrics: core.serialization.list(Metric).optionalNullable(), + deployable: core.serialization.boolean().optionalNullable(), }); export declare namespace ModelVersion { export interface Raw { - created_at?: string | null; - updated_at?: string | null; + created_at?: (string | null | undefined) | null; + updated_at?: (string | null | undefined) | null; manifest: ModelManifest.Raw; id: string; fqn: string; created_by_subject: Subject.Raw; ml_repo_id: string; - usage_code_snippet?: string | null; + usage_code_snippet?: (string | null | undefined) | null; tags?: string[] | null; model_id: string; - metrics?: Metric.Raw[] | null; - deployable?: boolean | null; + metrics?: (Metric.Raw[] | null | undefined) | null; + deployable?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/types/ModelVersionEnvironment.ts b/src/serialization/types/ModelVersionEnvironment.ts index 20bd5f57..9bb40e82 100644 --- a/src/serialization/types/ModelVersionEnvironment.ts +++ b/src/serialization/types/ModelVersionEnvironment.ts @@ -1,13 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const ModelVersionEnvironment: core.serialization.ObjectSchema = core.serialization.object({ - "pythonVersion": core.serialization.property("python_version", core.serialization.string().optional()), - "pipPackages": core.serialization.property("pip_packages", core.serialization.list(core.serialization.string()).optional()) - }); +export const ModelVersionEnvironment: core.serialization.ObjectSchema< + serializers.ModelVersionEnvironment.Raw, + TrueFoundry.ModelVersionEnvironment +> = core.serialization.object({ + pythonVersion: core.serialization.property("python_version", core.serialization.string().optional()), + pipPackages: core.serialization.property( + "pip_packages", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace ModelVersionEnvironment { export interface Raw { diff --git a/src/serialization/types/MsTeamsIntegrations.ts b/src/serialization/types/MsTeamsIntegrations.ts index c4efc569..708e5a00 100644 --- a/src/serialization/types/MsTeamsIntegrations.ts +++ b/src/serialization/types/MsTeamsIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { MsTeamsWebhookIntegration } from "./MsTeamsWebhookIntegration.js"; -export const MsTeamsIntegrations: core.serialization.ObjectSchema = MsTeamsWebhookIntegration; +export const MsTeamsIntegrations: core.serialization.ObjectSchema< + serializers.MsTeamsIntegrations.Raw, + TrueFoundry.MsTeamsIntegrations +> = MsTeamsWebhookIntegration; export declare namespace MsTeamsIntegrations { export type Raw = MsTeamsWebhookIntegration.Raw; diff --git a/src/serialization/types/MsTeamsProviderAccount.ts b/src/serialization/types/MsTeamsProviderAccount.ts index 608ecdc9..b85f0652 100644 --- a/src/serialization/types/MsTeamsProviderAccount.ts +++ b/src/serialization/types/MsTeamsProviderAccount.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { MsTeamsIntegrations } from "./MsTeamsIntegrations.js"; import { OwnedBy } from "./OwnedBy.js"; -export const MsTeamsProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/ms-teams"), - "name": core.serialization.string(), - "integrations": core.serialization.list(MsTeamsIntegrations), - "ownedBy": OwnedBy.optional() - }); +export const MsTeamsProviderAccount: core.serialization.ObjectSchema< + serializers.MsTeamsProviderAccount.Raw, + TrueFoundry.MsTeamsProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/ms-teams"), + name: core.serialization.string(), + integrations: core.serialization.list(MsTeamsIntegrations), + ownedBy: OwnedBy.optional(), +}); export declare namespace MsTeamsProviderAccount { export interface Raw { diff --git a/src/serialization/types/MsTeamsWebhook.ts b/src/serialization/types/MsTeamsWebhook.ts index ff744081..edde9139 100644 --- a/src/serialization/types/MsTeamsWebhook.ts +++ b/src/serialization/types/MsTeamsWebhook.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const MsTeamsWebhook: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("ms-teams-webhook"), - "notificationChannel": core.serialization.property("notification_channel", core.serialization.string()) - }); +export const MsTeamsWebhook: core.serialization.ObjectSchema< + serializers.MsTeamsWebhook.Raw, + TrueFoundry.MsTeamsWebhook +> = core.serialization.object({ + type: core.serialization.stringLiteral("ms-teams-webhook"), + notificationChannel: core.serialization.property("notification_channel", core.serialization.string()), +}); export declare namespace MsTeamsWebhook { export interface Raw { diff --git a/src/serialization/types/MsTeamsWebhookAuth.ts b/src/serialization/types/MsTeamsWebhookAuth.ts index ccd1ad46..30b87c64 100644 --- a/src/serialization/types/MsTeamsWebhookAuth.ts +++ b/src/serialization/types/MsTeamsWebhookAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const MsTeamsWebhookAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("ms-teams-webhook"), - "webhookUrl": core.serialization.property("webhook_url", core.serialization.string()) - }); +export const MsTeamsWebhookAuth: core.serialization.ObjectSchema< + serializers.MsTeamsWebhookAuth.Raw, + TrueFoundry.MsTeamsWebhookAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("ms-teams-webhook"), + webhookUrl: core.serialization.property("webhook_url", core.serialization.string()), +}); export declare namespace MsTeamsWebhookAuth { export interface Raw { diff --git a/src/serialization/types/MsTeamsWebhookIntegration.ts b/src/serialization/types/MsTeamsWebhookIntegration.ts index 1810bda6..ceec270b 100644 --- a/src/serialization/types/MsTeamsWebhookIntegration.ts +++ b/src/serialization/types/MsTeamsWebhookIntegration.ts @@ -1,16 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { MsTeamsWebhookAuth } from "./MsTeamsWebhookAuth.js"; -export const MsTeamsWebhookIntegration: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/notification-channel/ms-teams-webhook"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", MsTeamsWebhookAuth), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const MsTeamsWebhookIntegration: core.serialization.ObjectSchema< + serializers.MsTeamsWebhookIntegration.Raw, + TrueFoundry.MsTeamsWebhookIntegration +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/notification-channel/ms-teams-webhook"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", MsTeamsWebhookAuth), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace MsTeamsWebhookIntegration { export interface Raw { diff --git a/src/serialization/types/MultiPartUpload.ts b/src/serialization/types/MultiPartUpload.ts index 9f9ef8d6..4e79e9c2 100644 --- a/src/serialization/types/MultiPartUpload.ts +++ b/src/serialization/types/MultiPartUpload.ts @@ -1,25 +1,34 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { MultiPartUploadStorageProvider } from "./MultiPartUploadStorageProvider.js"; import { SignedUrl } from "./SignedUrl.js"; -export const MultiPartUpload: core.serialization.ObjectSchema = core.serialization.object({ - "storageProvider": core.serialization.property("storage_provider", MultiPartUploadStorageProvider), - "partSignedUrls": core.serialization.property("part_signed_urls", core.serialization.list(SignedUrl)), - "finalizeSignedUrl": core.serialization.property("finalize_signed_url", SignedUrl), - "s3CompatibleUploadId": core.serialization.property("s3_compatible_upload_id", core.serialization.string().optional()), - "azureBlobBlockIds": core.serialization.property("azure_blob_block_ids", core.serialization.list(core.serialization.string()).optional()) - }); +export const MultiPartUpload: core.serialization.ObjectSchema< + serializers.MultiPartUpload.Raw, + TrueFoundry.MultiPartUpload +> = core.serialization.object({ + storageProvider: core.serialization.property("storage_provider", MultiPartUploadStorageProvider), + partSignedUrls: core.serialization.property("part_signed_urls", core.serialization.list(SignedUrl)), + finalizeSignedUrl: core.serialization.property("finalize_signed_url", SignedUrl), + s3CompatibleUploadId: core.serialization.property( + "s3_compatible_upload_id", + core.serialization.string().optionalNullable(), + ), + azureBlobBlockIds: core.serialization.property( + "azure_blob_block_ids", + core.serialization.list(core.serialization.string()).optionalNullable(), + ), +}); export declare namespace MultiPartUpload { export interface Raw { storage_provider: MultiPartUploadStorageProvider.Raw; part_signed_urls: SignedUrl.Raw[]; finalize_signed_url: SignedUrl.Raw; - s3_compatible_upload_id?: string | null; - azure_blob_block_ids?: string[] | null; + s3_compatible_upload_id?: (string | null | undefined) | null; + azure_blob_block_ids?: (string[] | null | undefined) | null; } } diff --git a/src/serialization/types/MultiPartUploadResponse.ts b/src/serialization/types/MultiPartUploadResponse.ts index cb5dde09..da97c642 100644 --- a/src/serialization/types/MultiPartUploadResponse.ts +++ b/src/serialization/types/MultiPartUploadResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { MultiPartUpload } from "./MultiPartUpload.js"; -export const MultiPartUploadResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": MultiPartUpload - }); +export const MultiPartUploadResponse: core.serialization.ObjectSchema< + serializers.MultiPartUploadResponse.Raw, + TrueFoundry.MultiPartUploadResponse +> = core.serialization.object({ + data: MultiPartUpload, +}); export declare namespace MultiPartUploadResponse { export interface Raw { diff --git a/src/serialization/types/MultiPartUploadStorageProvider.ts b/src/serialization/types/MultiPartUploadStorageProvider.ts index 680cf33b..4145195e 100644 --- a/src/serialization/types/MultiPartUploadStorageProvider.ts +++ b/src/serialization/types/MultiPartUploadStorageProvider.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const MultiPartUploadStorageProvider: core.serialization.Schema = core.serialization.enum_(["S3_COMPATIBLE", "AZURE_BLOB"]); +export const MultiPartUploadStorageProvider: core.serialization.Schema< + serializers.MultiPartUploadStorageProvider.Raw, + TrueFoundry.MultiPartUploadStorageProvider +> = core.serialization.enum_(["S3_COMPATIBLE", "AZURE_BLOB"]); export declare namespace MultiPartUploadStorageProvider { export type Raw = "S3_COMPATIBLE" | "AZURE_BLOB"; diff --git a/src/serialization/types/NativeSnowflakeFlyteTaskTemplate.ts b/src/serialization/types/NativeSnowflakeFlyteTaskTemplate.ts index c7dd4b6d..d4bab418 100644 --- a/src/serialization/types/NativeSnowflakeFlyteTaskTemplate.ts +++ b/src/serialization/types/NativeSnowflakeFlyteTaskTemplate.ts @@ -1,18 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { FlyteTaskId } from "./FlyteTaskId.js"; import { SnowflakeConfig } from "./SnowflakeConfig.js"; import { SnowflakeSql } from "./SnowflakeSql.js"; -export const NativeSnowflakeFlyteTaskTemplate: core.serialization.ObjectSchema = core.serialization.object({ - "id": FlyteTaskId, - "type": core.serialization.stringLiteral("snowflake"), - "config": SnowflakeConfig, - "sql": SnowflakeSql - }); +export const NativeSnowflakeFlyteTaskTemplate: core.serialization.ObjectSchema< + serializers.NativeSnowflakeFlyteTaskTemplate.Raw, + TrueFoundry.NativeSnowflakeFlyteTaskTemplate +> = core.serialization.object({ + id: FlyteTaskId, + type: core.serialization.stringLiteral("snowflake"), + config: SnowflakeConfig, + sql: SnowflakeSql, +}); export declare namespace NativeSnowflakeFlyteTaskTemplate { export interface Raw { diff --git a/src/serialization/types/NatsInputConfig.ts b/src/serialization/types/NatsInputConfig.ts index 3f662a6f..93503c92 100644 --- a/src/serialization/types/NatsInputConfig.ts +++ b/src/serialization/types/NatsInputConfig.ts @@ -1,20 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { NatsUserPasswordAuth } from "./NatsUserPasswordAuth.js"; -export const NatsInputConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("nats"), - "natsUrl": core.serialization.property("nats_url", core.serialization.string()), - "streamName": core.serialization.property("stream_name", core.serialization.string()), - "rootSubject": core.serialization.property("root_subject", core.serialization.string()), - "consumerName": core.serialization.property("consumer_name", core.serialization.string()), - "waitTimeSeconds": core.serialization.property("wait_time_seconds", core.serialization.number()), - "natsMetricsUrl": core.serialization.property("nats_metrics_url", core.serialization.string().optional()), - "auth": NatsUserPasswordAuth.optional() - }); +export const NatsInputConfig: core.serialization.ObjectSchema< + serializers.NatsInputConfig.Raw, + TrueFoundry.NatsInputConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("nats"), + natsUrl: core.serialization.property("nats_url", core.serialization.string()), + streamName: core.serialization.property("stream_name", core.serialization.string()), + rootSubject: core.serialization.property("root_subject", core.serialization.string()), + consumerName: core.serialization.property("consumer_name", core.serialization.string()), + waitTimeSeconds: core.serialization.property("wait_time_seconds", core.serialization.number()), + natsMetricsUrl: core.serialization.property("nats_metrics_url", core.serialization.string().optional()), + auth: NatsUserPasswordAuth.optional(), +}); export declare namespace NatsInputConfig { export interface Raw { diff --git a/src/serialization/types/NatsMetricConfig.ts b/src/serialization/types/NatsMetricConfig.ts index 749c0d36..200dc978 100644 --- a/src/serialization/types/NatsMetricConfig.ts +++ b/src/serialization/types/NatsMetricConfig.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const NatsMetricConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("nats"), - "lagThreshold": core.serialization.property("lag_threshold", core.serialization.number()) - }); +export const NatsMetricConfig: core.serialization.ObjectSchema< + serializers.NatsMetricConfig.Raw, + TrueFoundry.NatsMetricConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("nats"), + lagThreshold: core.serialization.property("lag_threshold", core.serialization.number()), +}); export declare namespace NatsMetricConfig { export interface Raw { diff --git a/src/serialization/types/NatsOutputConfig.ts b/src/serialization/types/NatsOutputConfig.ts index 13fe1554..419caff1 100644 --- a/src/serialization/types/NatsOutputConfig.ts +++ b/src/serialization/types/NatsOutputConfig.ts @@ -1,16 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { NatsUserPasswordAuth } from "./NatsUserPasswordAuth.js"; -export const NatsOutputConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("nats"), - "natsUrl": core.serialization.property("nats_url", core.serialization.string()), - "rootSubject": core.serialization.property("root_subject", core.serialization.string()), - "auth": NatsUserPasswordAuth.optional() - }); +export const NatsOutputConfig: core.serialization.ObjectSchema< + serializers.NatsOutputConfig.Raw, + TrueFoundry.NatsOutputConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("nats"), + natsUrl: core.serialization.property("nats_url", core.serialization.string()), + rootSubject: core.serialization.property("root_subject", core.serialization.string()), + auth: NatsUserPasswordAuth.optional(), +}); export declare namespace NatsOutputConfig { export interface Raw { diff --git a/src/serialization/types/NatsUserPasswordAuth.ts b/src/serialization/types/NatsUserPasswordAuth.ts index 497499ef..44e63f9f 100644 --- a/src/serialization/types/NatsUserPasswordAuth.ts +++ b/src/serialization/types/NatsUserPasswordAuth.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const NatsUserPasswordAuth: core.serialization.ObjectSchema = core.serialization.object({ - "accountName": core.serialization.property("account_name", core.serialization.string()), - "user": core.serialization.string(), - "password": core.serialization.string() - }); +export const NatsUserPasswordAuth: core.serialization.ObjectSchema< + serializers.NatsUserPasswordAuth.Raw, + TrueFoundry.NatsUserPasswordAuth +> = core.serialization.object({ + accountName: core.serialization.property("account_name", core.serialization.string()), + user: core.serialization.string(), + password: core.serialization.string(), +}); export declare namespace NatsUserPasswordAuth { export interface Raw { diff --git a/src/serialization/types/NodeSelector.ts b/src/serialization/types/NodeSelector.ts index b948b495..e508a38a 100644 --- a/src/serialization/types/NodeSelector.ts +++ b/src/serialization/types/NodeSelector.ts @@ -1,14 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { NodeSelectorCapacityType } from "./NodeSelectorCapacityType.js"; -export const NodeSelector: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("node_selector"), - "instanceFamilies": core.serialization.property("instance_families", core.serialization.list(core.serialization.string()).optional()), - "capacityType": core.serialization.property("capacity_type", NodeSelectorCapacityType.optional()) +export const NodeSelector: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("node_selector"), + instanceFamilies: core.serialization.property( + "instance_families", + core.serialization.list(core.serialization.string()).optional(), + ), + capacityType: core.serialization.property("capacity_type", NodeSelectorCapacityType.optional()), }); export declare namespace NodeSelector { diff --git a/src/serialization/types/NodeSelectorCapacityType.ts b/src/serialization/types/NodeSelectorCapacityType.ts index 7b8a6284..1c2975dd 100644 --- a/src/serialization/types/NodeSelectorCapacityType.ts +++ b/src/serialization/types/NodeSelectorCapacityType.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const NodeSelectorCapacityType: core.serialization.Schema = core.serialization.enum_(["spot_fallback_on_demand", "spot", "on_demand"]); +export const NodeSelectorCapacityType: core.serialization.Schema< + serializers.NodeSelectorCapacityType.Raw, + TrueFoundry.NodeSelectorCapacityType +> = core.serialization.enum_(["spot_fallback_on_demand", "spot", "on_demand"]); export declare namespace NodeSelectorCapacityType { export type Raw = "spot_fallback_on_demand" | "spot" | "on_demand"; diff --git a/src/serialization/types/Nodepool.ts b/src/serialization/types/Nodepool.ts index 3abf577d..3b4169e0 100644 --- a/src/serialization/types/Nodepool.ts +++ b/src/serialization/types/Nodepool.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const Nodepool: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string().optional() +export const Nodepool: core.serialization.ObjectSchema = + core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), }); export declare namespace Nodepool { diff --git a/src/serialization/types/NodepoolSelector.ts b/src/serialization/types/NodepoolSelector.ts index 796b8b46..52e3504f 100644 --- a/src/serialization/types/NodepoolSelector.ts +++ b/src/serialization/types/NodepoolSelector.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const NodepoolSelector: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("nodepool_selector"), - "nodepools": core.serialization.list(core.serialization.string()).optional() - }); +export const NodepoolSelector: core.serialization.ObjectSchema< + serializers.NodepoolSelector.Raw, + TrueFoundry.NodepoolSelector +> = core.serialization.object({ + type: core.serialization.stringLiteral("nodepool_selector"), + nodepools: core.serialization.list(core.serialization.string()).optional(), +}); export declare namespace NodepoolSelector { export interface Raw { diff --git a/src/serialization/types/NomaSecurityApiKeyAuth.ts b/src/serialization/types/NomaSecurityApiKeyAuth.ts new file mode 100644 index 00000000..b51fc33a --- /dev/null +++ b/src/serialization/types/NomaSecurityApiKeyAuth.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const NomaSecurityApiKeyAuth: core.serialization.ObjectSchema< + serializers.NomaSecurityApiKeyAuth.Raw, + TrueFoundry.NomaSecurityApiKeyAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), +}); + +export declare namespace NomaSecurityApiKeyAuth { + export interface Raw { + type: "api-key"; + api_key: string; + } +} diff --git a/src/serialization/types/NomaSecurityGuardrailConfig.ts b/src/serialization/types/NomaSecurityGuardrailConfig.ts new file mode 100644 index 00000000..8d05e8f1 --- /dev/null +++ b/src/serialization/types/NomaSecurityGuardrailConfig.ts @@ -0,0 +1,36 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { EnforcingStrategy } from "./EnforcingStrategy.js"; +import { NomaSecurityApiKeyAuth } from "./NomaSecurityApiKeyAuth.js"; +import { NomaSecurityGuardrailConfigConfig } from "./NomaSecurityGuardrailConfigConfig.js"; +import { NomaSecurityGuardrailConfigOperation } from "./NomaSecurityGuardrailConfigOperation.js"; + +export const NomaSecurityGuardrailConfig: core.serialization.ObjectSchema< + serializers.NomaSecurityGuardrailConfig.Raw, + TrueFoundry.NomaSecurityGuardrailConfig +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + type: core.serialization.stringLiteral("integration/guardrail-config/noma-security"), + authData: core.serialization.property("auth_data", NomaSecurityApiKeyAuth), + operation: NomaSecurityGuardrailConfigOperation, + priority: core.serialization.number().optional(), + enforcingStrategy: core.serialization.property("enforcing_strategy", EnforcingStrategy), + config: NomaSecurityGuardrailConfigConfig, +}); + +export declare namespace NomaSecurityGuardrailConfig { + export interface Raw { + name: string; + description?: string | null; + type: "integration/guardrail-config/noma-security"; + auth_data: NomaSecurityApiKeyAuth.Raw; + operation: NomaSecurityGuardrailConfigOperation.Raw; + priority?: number | null; + enforcing_strategy: EnforcingStrategy.Raw; + config: NomaSecurityGuardrailConfigConfig.Raw; + } +} diff --git a/src/serialization/types/NomaSecurityGuardrailConfigConfig.ts b/src/serialization/types/NomaSecurityGuardrailConfigConfig.ts new file mode 100644 index 00000000..e30f1cd1 --- /dev/null +++ b/src/serialization/types/NomaSecurityGuardrailConfigConfig.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const NomaSecurityGuardrailConfigConfig: core.serialization.ObjectSchema< + serializers.NomaSecurityGuardrailConfigConfig.Raw, + TrueFoundry.NomaSecurityGuardrailConfigConfig +> = core.serialization.object({ + baseUrl: core.serialization.property("base_url", core.serialization.string().optional()), + applicationId: core.serialization.property("application_id", core.serialization.string().optional()), + userIdMetadataKey: core.serialization.property("user_id_metadata_key", core.serialization.string().optional()), +}); + +export declare namespace NomaSecurityGuardrailConfigConfig { + export interface Raw { + base_url?: string | null; + application_id?: string | null; + user_id_metadata_key?: string | null; + } +} diff --git a/src/serialization/types/NomaSecurityGuardrailConfigOperation.ts b/src/serialization/types/NomaSecurityGuardrailConfigOperation.ts new file mode 100644 index 00000000..fb6c9ac2 --- /dev/null +++ b/src/serialization/types/NomaSecurityGuardrailConfigOperation.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const NomaSecurityGuardrailConfigOperation: core.serialization.Schema< + serializers.NomaSecurityGuardrailConfigOperation.Raw, + TrueFoundry.NomaSecurityGuardrailConfigOperation +> = core.serialization.enum_(["validate", "mutate"]); + +export declare namespace NomaSecurityGuardrailConfigOperation { + export type Raw = "validate" | "mutate"; +} diff --git a/src/serialization/types/NomicIntegrations.ts b/src/serialization/types/NomicIntegrations.ts index d1a86412..32fb6a31 100644 --- a/src/serialization/types/NomicIntegrations.ts +++ b/src/serialization/types/NomicIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { NomicModel } from "./NomicModel.js"; -export const NomicIntegrations: core.serialization.ObjectSchema = NomicModel; +export const NomicIntegrations: core.serialization.ObjectSchema< + serializers.NomicIntegrations.Raw, + TrueFoundry.NomicIntegrations +> = NomicModel; export declare namespace NomicIntegrations { export type Raw = NomicModel.Raw; diff --git a/src/serialization/types/NomicKeyAuth.ts b/src/serialization/types/NomicKeyAuth.ts index da545be0..7ec61f65 100644 --- a/src/serialization/types/NomicKeyAuth.ts +++ b/src/serialization/types/NomicKeyAuth.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const NomicKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) +export const NomicKeyAuth: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), }); export declare namespace NomicKeyAuth { diff --git a/src/serialization/types/NomicModel.ts b/src/serialization/types/NomicModel.ts index 852ec706..93b9fa14 100644 --- a/src/serialization/types/NomicModel.ts +++ b/src/serialization/types/NomicModel.ts @@ -1,18 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const NomicModel: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/model/nomic"), - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) +export const NomicModel: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("integration/model/nomic"), + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace NomicModel { diff --git a/src/serialization/types/NomicProviderAccount.ts b/src/serialization/types/NomicProviderAccount.ts index 107a5be3..af5a2542 100644 --- a/src/serialization/types/NomicProviderAccount.ts +++ b/src/serialization/types/NomicProviderAccount.ts @@ -1,22 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { NomicIntegrations } from "./NomicIntegrations.js"; import { NomicKeyAuth } from "./NomicKeyAuth.js"; import { OwnedBy } from "./OwnedBy.js"; -export const NomicProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/nomic"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", NomicKeyAuth), - "integrations": core.serialization.list(NomicIntegrations), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const NomicProviderAccount: core.serialization.ObjectSchema< + serializers.NomicProviderAccount.Raw, + TrueFoundry.NomicProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/nomic"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", NomicKeyAuth), + integrations: core.serialization.list(NomicIntegrations), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace NomicProviderAccount { export interface Raw { diff --git a/src/serialization/types/NonNegativeFloat.ts b/src/serialization/types/NonNegativeFloat.ts index 666729f7..0e346906 100644 --- a/src/serialization/types/NonNegativeFloat.ts +++ b/src/serialization/types/NonNegativeFloat.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const NonNegativeFloat: core.serialization.Schema = core.serialization.number(); +export const NonNegativeFloat: core.serialization.Schema< + serializers.NonNegativeFloat.Raw, + TrueFoundry.NonNegativeFloat +> = core.serialization.number(); export declare namespace NonNegativeFloat { export type Raw = number; diff --git a/src/serialization/types/Notebook.ts b/src/serialization/types/Notebook.ts index 404d7daf..88b26bc4 100644 --- a/src/serialization/types/Notebook.ts +++ b/src/serialization/types/Notebook.ts @@ -1,16 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BaseWorkbenchInput } from "./BaseWorkbenchInput.js"; import { WorkbenchImage } from "./WorkbenchImage.js"; -export const Notebook: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("notebook"), - "image": WorkbenchImage, - "cullTimeout": core.serialization.property("cull_timeout", core.serialization.number().optional()) - }).extend(BaseWorkbenchInput); +export const Notebook: core.serialization.ObjectSchema = + core.serialization + .object({ + type: core.serialization.stringLiteral("notebook"), + image: WorkbenchImage, + cullTimeout: core.serialization.property("cull_timeout", core.serialization.number().optional()), + }) + .extend(BaseWorkbenchInput); export declare namespace Notebook { export interface Raw extends BaseWorkbenchInput.Raw { diff --git a/src/serialization/types/NotebookConfig.ts b/src/serialization/types/NotebookConfig.ts index cbc5f093..f21f2218 100644 --- a/src/serialization/types/NotebookConfig.ts +++ b/src/serialization/types/NotebookConfig.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const NotebookConfig: core.serialization.ObjectSchema = core.serialization.object({ - "baseDomain": core.serialization.property("base_domain", core.serialization.string()) - }); +export const NotebookConfig: core.serialization.ObjectSchema< + serializers.NotebookConfig.Raw, + TrueFoundry.NotebookConfig +> = core.serialization.object({ + baseDomain: core.serialization.property("base_domain", core.serialization.string()), +}); export declare namespace NotebookConfig { export interface Raw { diff --git a/src/serialization/types/NotificationTarget.ts b/src/serialization/types/NotificationTarget.ts index 719f65e9..9a8208d6 100644 --- a/src/serialization/types/NotificationTarget.ts +++ b/src/serialization/types/NotificationTarget.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Email } from "./Email.js"; import { MsTeamsWebhook } from "./MsTeamsWebhook.js"; import { PagerDuty } from "./PagerDuty.js"; import { SlackBot } from "./SlackBot.js"; import { SlackWebhook } from "./SlackWebhook.js"; -export const NotificationTarget: core.serialization.Schema = core.serialization.undiscriminatedUnion([Email, SlackWebhook, SlackBot, PagerDuty, MsTeamsWebhook]); +export const NotificationTarget: core.serialization.Schema< + serializers.NotificationTarget.Raw, + TrueFoundry.NotificationTarget +> = core.serialization.undiscriminatedUnion([Email, SlackWebhook, SlackBot, PagerDuty, MsTeamsWebhook]); export declare namespace NotificationTarget { export type Raw = Email.Raw | SlackWebhook.Raw | SlackBot.Raw | PagerDuty.Raw | MsTeamsWebhook.Raw; diff --git a/src/serialization/types/NotificationTargetForAlertRule.ts b/src/serialization/types/NotificationTargetForAlertRule.ts index bf5d936d..ab3eed23 100644 --- a/src/serialization/types/NotificationTargetForAlertRule.ts +++ b/src/serialization/types/NotificationTargetForAlertRule.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Email } from "./Email.js"; import { MsTeamsWebhook } from "./MsTeamsWebhook.js"; import { PagerDuty } from "./PagerDuty.js"; import { SlackBot } from "./SlackBot.js"; import { SlackWebhook } from "./SlackWebhook.js"; -export const NotificationTargetForAlertRule: core.serialization.Schema = core.serialization.undiscriminatedUnion([Email, SlackWebhook, SlackBot, PagerDuty, MsTeamsWebhook]); +export const NotificationTargetForAlertRule: core.serialization.Schema< + serializers.NotificationTargetForAlertRule.Raw, + TrueFoundry.NotificationTargetForAlertRule +> = core.serialization.undiscriminatedUnion([Email, SlackWebhook, SlackBot, PagerDuty, MsTeamsWebhook]); export declare namespace NotificationTargetForAlertRule { export type Raw = Email.Raw | SlackWebhook.Raw | SlackBot.Raw | PagerDuty.Raw | MsTeamsWebhook.Raw; diff --git a/src/serialization/types/NvidiaGpu.ts b/src/serialization/types/NvidiaGpu.ts index cc9b00b2..4412feb5 100644 --- a/src/serialization/types/NvidiaGpu.ts +++ b/src/serialization/types/NvidiaGpu.ts @@ -1,13 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const NvidiaGpu: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("nvidia_gpu"), - "name": core.serialization.string().optional(), - "count": core.serialization.number() +export const NvidiaGpu: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("nvidia_gpu"), + name: core.serialization.string().optional(), + count: core.serialization.number(), }); export declare namespace NvidiaGpu { diff --git a/src/serialization/types/NvidiaMiggpu.ts b/src/serialization/types/NvidiaMiggpu.ts index d4eb811f..e34d65fe 100644 --- a/src/serialization/types/NvidiaMiggpu.ts +++ b/src/serialization/types/NvidiaMiggpu.ts @@ -1,14 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { NvidiaMiggpuProfile } from "./NvidiaMiggpuProfile.js"; -export const NvidiaMiggpu: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("nvidia_mig_gpu"), - "name": core.serialization.string().optional(), - "profile": NvidiaMiggpuProfile +export const NvidiaMiggpu: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("nvidia_mig_gpu"), + name: core.serialization.string().optional(), + profile: NvidiaMiggpuProfile, }); export declare namespace NvidiaMiggpu { diff --git a/src/serialization/types/NvidiaMiggpuProfile.ts b/src/serialization/types/NvidiaMiggpuProfile.ts index 4be541b4..18d61761 100644 --- a/src/serialization/types/NvidiaMiggpuProfile.ts +++ b/src/serialization/types/NvidiaMiggpuProfile.ts @@ -1,11 +1,83 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const NvidiaMiggpuProfile: core.serialization.Schema = core.serialization.enum_(["1g.6gb", "2g.12gb", "1g.5gb", "1g.10gb", "2g.10gb", "3g.20gb", "4g.20gb", "1g.20gb", "2g.20gb", "3g.40gb", "4g.40gb", "1g.12gb", "1g.24gb", "2g.24gb", "3g.47gb", "4g.47gb", "3g.48gb", "4g.48gb", "1g.18gb", "1g.35gb", "2g.35gb", "3g.71gb", "4g.71gb", "1g.23gb", "1g.45gb", "2g.45gb", "3g.90gb", "4g.90gb", "4g.24gb", "7g.40gb", "7g.80gb", "7g.94gb", "7g.96gb", "7g.180gb"]); +export const NvidiaMiggpuProfile: core.serialization.Schema< + serializers.NvidiaMiggpuProfile.Raw, + TrueFoundry.NvidiaMiggpuProfile +> = core.serialization.enum_([ + "1g.6gb", + "2g.12gb", + "1g.5gb", + "1g.10gb", + "2g.10gb", + "3g.20gb", + "4g.20gb", + "1g.20gb", + "2g.20gb", + "3g.40gb", + "4g.40gb", + "1g.12gb", + "1g.24gb", + "2g.24gb", + "3g.47gb", + "4g.47gb", + "3g.48gb", + "4g.48gb", + "1g.18gb", + "1g.35gb", + "2g.35gb", + "3g.71gb", + "4g.71gb", + "1g.23gb", + "1g.45gb", + "2g.45gb", + "3g.90gb", + "4g.90gb", + "4g.24gb", + "7g.40gb", + "7g.80gb", + "7g.94gb", + "7g.96gb", + "7g.180gb", +]); export declare namespace NvidiaMiggpuProfile { - export type Raw = "1g.6gb" | "2g.12gb" | "1g.5gb" | "1g.10gb" | "2g.10gb" | "3g.20gb" | "4g.20gb" | "1g.20gb" | "2g.20gb" | "3g.40gb" | "4g.40gb" | "1g.12gb" | "1g.24gb" | "2g.24gb" | "3g.47gb" | "4g.47gb" | "3g.48gb" | "4g.48gb" | "1g.18gb" | "1g.35gb" | "2g.35gb" | "3g.71gb" | "4g.71gb" | "1g.23gb" | "1g.45gb" | "2g.45gb" | "3g.90gb" | "4g.90gb" | "4g.24gb" | "7g.40gb" | "7g.80gb" | "7g.94gb" | "7g.96gb" | "7g.180gb"; + export type Raw = + | "1g.6gb" + | "2g.12gb" + | "1g.5gb" + | "1g.10gb" + | "2g.10gb" + | "3g.20gb" + | "4g.20gb" + | "1g.20gb" + | "2g.20gb" + | "3g.40gb" + | "4g.40gb" + | "1g.12gb" + | "1g.24gb" + | "2g.24gb" + | "3g.47gb" + | "4g.47gb" + | "3g.48gb" + | "4g.48gb" + | "1g.18gb" + | "1g.35gb" + | "2g.35gb" + | "3g.71gb" + | "4g.71gb" + | "1g.23gb" + | "1g.45gb" + | "2g.45gb" + | "3g.90gb" + | "4g.90gb" + | "4g.24gb" + | "7g.40gb" + | "7g.80gb" + | "7g.94gb" + | "7g.96gb" + | "7g.180gb"; } diff --git a/src/serialization/types/NvidiaTimeslicingGpu.ts b/src/serialization/types/NvidiaTimeslicingGpu.ts index 279d3918..1ebd7df8 100644 --- a/src/serialization/types/NvidiaTimeslicingGpu.ts +++ b/src/serialization/types/NvidiaTimeslicingGpu.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const NvidiaTimeslicingGpu: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("nvidia_timeslicing_gpu"), - "name": core.serialization.string().optional(), - "gpuMemory": core.serialization.property("gpu_memory", core.serialization.number()) - }); +export const NvidiaTimeslicingGpu: core.serialization.ObjectSchema< + serializers.NvidiaTimeslicingGpu.Raw, + TrueFoundry.NvidiaTimeslicingGpu +> = core.serialization.object({ + type: core.serialization.stringLiteral("nvidia_timeslicing_gpu"), + name: core.serialization.string().optional(), + gpuMemory: core.serialization.property("gpu_memory", core.serialization.number()), +}); export declare namespace NvidiaTimeslicingGpu { export interface Raw { diff --git a/src/serialization/types/OAuth2LoginProvider.ts b/src/serialization/types/OAuth2LoginProvider.ts index e148a034..b26f3b00 100644 --- a/src/serialization/types/OAuth2LoginProvider.ts +++ b/src/serialization/types/OAuth2LoginProvider.ts @@ -1,13 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BaseOAuth2Login } from "./BaseOAuth2Login.js"; -export const OAuth2LoginProvider: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("oauth2") - }).extend(BaseOAuth2Login); +export const OAuth2LoginProvider: core.serialization.ObjectSchema< + serializers.OAuth2LoginProvider.Raw, + TrueFoundry.OAuth2LoginProvider +> = core.serialization + .object({ + type: core.serialization.stringLiteral("oauth2"), + }) + .extend(BaseOAuth2Login); export declare namespace OAuth2LoginProvider { export interface Raw extends BaseOAuth2Login.Raw { diff --git a/src/serialization/types/OciRepo.ts b/src/serialization/types/OciRepo.ts index 953c0054..4c8070d1 100644 --- a/src/serialization/types/OciRepo.ts +++ b/src/serialization/types/OciRepo.ts @@ -1,14 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const OciRepo: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("oci-repo"), - "ociChartUrl": core.serialization.property("oci_chart_url", core.serialization.string()), - "integrationFqn": core.serialization.property("integration_fqn", core.serialization.string().optional()), - "version": core.serialization.string() +export const OciRepo: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("oci-repo"), + ociChartUrl: core.serialization.property("oci_chart_url", core.serialization.string()), + integrationFqn: core.serialization.property("integration_fqn", core.serialization.string().optional()), + version: core.serialization.string(), }); export declare namespace OciRepo { diff --git a/src/serialization/types/OcrCostMetric.ts b/src/serialization/types/OcrCostMetric.ts index 2499bbae..7a6630e7 100644 --- a/src/serialization/types/OcrCostMetric.ts +++ b/src/serialization/types/OcrCostMetric.ts @@ -1,13 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { OcrCostMetricValue } from "./OcrCostMetricValue.js"; -export const OcrCostMetric: core.serialization.ObjectSchema = core.serialization.object({ - "metric": core.serialization.string(), - "value": OcrCostMetricValue +export const OcrCostMetric: core.serialization.ObjectSchema = + core.serialization.object({ + metric: core.serialization.string(), + value: OcrCostMetricValue, }); export declare namespace OcrCostMetric { diff --git a/src/serialization/types/OcrCostMetricValue.ts b/src/serialization/types/OcrCostMetricValue.ts index 950cfd99..1df68180 100644 --- a/src/serialization/types/OcrCostMetricValue.ts +++ b/src/serialization/types/OcrCostMetricValue.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { NonNegativeFloat } from "./NonNegativeFloat.js"; -export const OcrCostMetricValue: core.serialization.ObjectSchema = core.serialization.object({ - "pages": NonNegativeFloat, - "annotatedPages": core.serialization.property("annotated_pages", NonNegativeFloat.optional()) - }); +export const OcrCostMetricValue: core.serialization.ObjectSchema< + serializers.OcrCostMetricValue.Raw, + TrueFoundry.OcrCostMetricValue +> = core.serialization.object({ + pages: NonNegativeFloat, + annotatedPages: core.serialization.property("annotated_pages", NonNegativeFloat.optional()), +}); export declare namespace OcrCostMetricValue { export interface Raw { diff --git a/src/serialization/types/OllamaIntegrations.ts b/src/serialization/types/OllamaIntegrations.ts index d214e3cd..b320cec0 100644 --- a/src/serialization/types/OllamaIntegrations.ts +++ b/src/serialization/types/OllamaIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { OllamaModel } from "./OllamaModel.js"; -export const OllamaIntegrations: core.serialization.ObjectSchema = OllamaModel; +export const OllamaIntegrations: core.serialization.ObjectSchema< + serializers.OllamaIntegrations.Raw, + TrueFoundry.OllamaIntegrations +> = OllamaModel; export declare namespace OllamaIntegrations { export type Raw = OllamaModel.Raw; diff --git a/src/serialization/types/OllamaKeyAuth.ts b/src/serialization/types/OllamaKeyAuth.ts index 14a6e8b5..51b696c6 100644 --- a/src/serialization/types/OllamaKeyAuth.ts +++ b/src/serialization/types/OllamaKeyAuth.ts @@ -1,11 +1,12 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const OllamaKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "customHost": core.serialization.property("custom_host", core.serialization.string()) +export const OllamaKeyAuth: core.serialization.ObjectSchema = + core.serialization.object({ + customHost: core.serialization.property("custom_host", core.serialization.string()), }); export declare namespace OllamaKeyAuth { diff --git a/src/serialization/types/OllamaModel.ts b/src/serialization/types/OllamaModel.ts index c9b24ffc..62ded8a6 100644 --- a/src/serialization/types/OllamaModel.ts +++ b/src/serialization/types/OllamaModel.ts @@ -1,18 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const OllamaModel: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/model/ollama"), - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) +export const OllamaModel: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("integration/model/ollama"), + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace OllamaModel { diff --git a/src/serialization/types/OllamaProviderAccount.ts b/src/serialization/types/OllamaProviderAccount.ts index 66450616..c946d3d8 100644 --- a/src/serialization/types/OllamaProviderAccount.ts +++ b/src/serialization/types/OllamaProviderAccount.ts @@ -1,22 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { OllamaIntegrations } from "./OllamaIntegrations.js"; import { OllamaKeyAuth } from "./OllamaKeyAuth.js"; import { OwnedBy } from "./OwnedBy.js"; -export const OllamaProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/ollama"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", OllamaKeyAuth), - "integrations": core.serialization.list(OllamaIntegrations), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const OllamaProviderAccount: core.serialization.ObjectSchema< + serializers.OllamaProviderAccount.Raw, + TrueFoundry.OllamaProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/ollama"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", OllamaKeyAuth), + integrations: core.serialization.list(OllamaIntegrations), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace OllamaProviderAccount { export interface Raw { diff --git a/src/serialization/types/OnnxFramework.ts b/src/serialization/types/OnnxFramework.ts index ef6c9bfd..a211fd22 100644 --- a/src/serialization/types/OnnxFramework.ts +++ b/src/serialization/types/OnnxFramework.ts @@ -1,11 +1,12 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const OnnxFramework: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("onnx") +export const OnnxFramework: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("onnx"), }); export declare namespace OnnxFramework { diff --git a/src/serialization/types/OpaAuth.ts b/src/serialization/types/OpaAuth.ts index 03fd9029..6cb3e8b4 100644 --- a/src/serialization/types/OpaAuth.ts +++ b/src/serialization/types/OpaAuth.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { OpaBearerAuth } from "./OpaBearerAuth.js"; import { OpaHeaderAuth } from "./OpaHeaderAuth.js"; -export const OpaAuth: core.serialization.Schema = core.serialization.undiscriminatedUnion([OpaHeaderAuth, OpaBearerAuth]); +export const OpaAuth: core.serialization.Schema = + core.serialization.undiscriminatedUnion([OpaHeaderAuth, OpaBearerAuth]); export declare namespace OpaAuth { export type Raw = OpaHeaderAuth.Raw | OpaBearerAuth.Raw; diff --git a/src/serialization/types/OpaBearerAuth.ts b/src/serialization/types/OpaBearerAuth.ts index 12b6d2a6..04cf6a05 100644 --- a/src/serialization/types/OpaBearerAuth.ts +++ b/src/serialization/types/OpaBearerAuth.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const OpaBearerAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("bearer-auth"), - "bearerToken": core.serialization.property("bearer_token", core.serialization.string()) +export const OpaBearerAuth: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("bearer-auth"), + bearerToken: core.serialization.property("bearer_token", core.serialization.string()), }); export declare namespace OpaBearerAuth { diff --git a/src/serialization/types/OpaGuardrailConfig.ts b/src/serialization/types/OpaGuardrailConfig.ts index bf655ae8..d017b2f1 100644 --- a/src/serialization/types/OpaGuardrailConfig.ts +++ b/src/serialization/types/OpaGuardrailConfig.ts @@ -1,21 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { EnforcingStrategy } from "./EnforcingStrategy.js"; import { OpaAuth } from "./OpaAuth.js"; import { OpaGuardrailConfigConfig } from "./OpaGuardrailConfigConfig.js"; -export const OpaGuardrailConfig: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string().optional(), - "type": core.serialization.stringLiteral("integration/guardrail-config/opa"), - "authData": core.serialization.property("auth_data", OpaAuth.optional()), - "operation": core.serialization.stringLiteral("validate"), - "enforcingStrategy": core.serialization.property("enforcing_strategy", EnforcingStrategy), - "config": OpaGuardrailConfigConfig - }); +export const OpaGuardrailConfig: core.serialization.ObjectSchema< + serializers.OpaGuardrailConfig.Raw, + TrueFoundry.OpaGuardrailConfig +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + type: core.serialization.stringLiteral("integration/guardrail-config/opa"), + authData: core.serialization.property("auth_data", OpaAuth.optional()), + operation: core.serialization.stringLiteral("validate"), + enforcingStrategy: core.serialization.property("enforcing_strategy", EnforcingStrategy), + config: OpaGuardrailConfigConfig, +}); export declare namespace OpaGuardrailConfig { export interface Raw { diff --git a/src/serialization/types/OpaGuardrailConfigConfig.ts b/src/serialization/types/OpaGuardrailConfigConfig.ts index 11fac08d..d7abc9b2 100644 --- a/src/serialization/types/OpaGuardrailConfigConfig.ts +++ b/src/serialization/types/OpaGuardrailConfigConfig.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const OpaGuardrailConfigConfig: core.serialization.ObjectSchema = core.serialization.object({ - "opaUrl": core.serialization.property("opa_url", core.serialization.string()), - "policyPath": core.serialization.property("policy_path", core.serialization.string()) - }); +export const OpaGuardrailConfigConfig: core.serialization.ObjectSchema< + serializers.OpaGuardrailConfigConfig.Raw, + TrueFoundry.OpaGuardrailConfigConfig +> = core.serialization.object({ + opaUrl: core.serialization.property("opa_url", core.serialization.string()), + policyPath: core.serialization.property("policy_path", core.serialization.string()), +}); export declare namespace OpaGuardrailConfigConfig { export interface Raw { diff --git a/src/serialization/types/OpaHeaderAuth.ts b/src/serialization/types/OpaHeaderAuth.ts index 74a70223..a6cb97dd 100644 --- a/src/serialization/types/OpaHeaderAuth.ts +++ b/src/serialization/types/OpaHeaderAuth.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const OpaHeaderAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("header"), - "headers": core.serialization.record(core.serialization.string(), core.serialization.string()) +export const OpaHeaderAuth: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("header"), + headers: core.serialization.record(core.serialization.string(), core.serialization.string()), }); export declare namespace OpaHeaderAuth { diff --git a/src/serialization/types/OpenAiIntegrations.ts b/src/serialization/types/OpenAiIntegrations.ts index 2f634e67..4410b791 100644 --- a/src/serialization/types/OpenAiIntegrations.ts +++ b/src/serialization/types/OpenAiIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { OpenAiModel } from "./OpenAiModel.js"; -export const OpenAiIntegrations: core.serialization.ObjectSchema = OpenAiModel; +export const OpenAiIntegrations: core.serialization.ObjectSchema< + serializers.OpenAiIntegrations.Raw, + TrueFoundry.OpenAiIntegrations +> = OpenAiModel; export declare namespace OpenAiIntegrations { export type Raw = OpenAiModel.Raw; diff --git a/src/serialization/types/OpenAiModel.ts b/src/serialization/types/OpenAiModel.ts index 5415f3e6..04193eff 100644 --- a/src/serialization/types/OpenAiModel.ts +++ b/src/serialization/types/OpenAiModel.ts @@ -1,18 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const OpenAiModel: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/model/openai"), - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) +export const OpenAiModel: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("integration/model/openai"), + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace OpenAiModel { diff --git a/src/serialization/types/OpenAiModerationsGuardrailConfig.ts b/src/serialization/types/OpenAiModerationsGuardrailConfig.ts index beed1e30..8e1637ba 100644 --- a/src/serialization/types/OpenAiModerationsGuardrailConfig.ts +++ b/src/serialization/types/OpenAiModerationsGuardrailConfig.ts @@ -1,21 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { EnforcingStrategy } from "./EnforcingStrategy.js"; -import { OpenaiApiKeyAuth } from "./OpenaiApiKeyAuth.js"; import { OpenAiModerationsGuardrailConfigConfig } from "./OpenAiModerationsGuardrailConfigConfig.js"; +import { OpenaiApiKeyAuth } from "./OpenaiApiKeyAuth.js"; -export const OpenAiModerationsGuardrailConfig: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string().optional(), - "type": core.serialization.stringLiteral("integration/guardrail-config/openai-moderations"), - "authData": core.serialization.property("auth_data", OpenaiApiKeyAuth), - "operation": core.serialization.stringLiteral("validate"), - "enforcingStrategy": core.serialization.property("enforcing_strategy", EnforcingStrategy), - "config": OpenAiModerationsGuardrailConfigConfig - }); +export const OpenAiModerationsGuardrailConfig: core.serialization.ObjectSchema< + serializers.OpenAiModerationsGuardrailConfig.Raw, + TrueFoundry.OpenAiModerationsGuardrailConfig +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + type: core.serialization.stringLiteral("integration/guardrail-config/openai-moderations"), + authData: core.serialization.property("auth_data", OpenaiApiKeyAuth), + operation: core.serialization.stringLiteral("validate"), + enforcingStrategy: core.serialization.property("enforcing_strategy", EnforcingStrategy), + config: OpenAiModerationsGuardrailConfigConfig, +}); export declare namespace OpenAiModerationsGuardrailConfig { export interface Raw { diff --git a/src/serialization/types/OpenAiModerationsGuardrailConfigConfig.ts b/src/serialization/types/OpenAiModerationsGuardrailConfigConfig.ts index 39c1bb6c..9f38d695 100644 --- a/src/serialization/types/OpenAiModerationsGuardrailConfigConfig.ts +++ b/src/serialization/types/OpenAiModerationsGuardrailConfigConfig.ts @@ -1,14 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const OpenAiModerationsGuardrailConfigConfig: core.serialization.ObjectSchema = core.serialization.object({ - "model": core.serialization.string(), - "baseUrl": core.serialization.property("base_url", core.serialization.string().optional()), - "categoryThresholds": core.serialization.property("category_thresholds", core.serialization.record(core.serialization.string(), core.serialization.number()).optional()) - }); +export const OpenAiModerationsGuardrailConfigConfig: core.serialization.ObjectSchema< + serializers.OpenAiModerationsGuardrailConfigConfig.Raw, + TrueFoundry.OpenAiModerationsGuardrailConfigConfig +> = core.serialization.object({ + model: core.serialization.string(), + baseUrl: core.serialization.property("base_url", core.serialization.string().optional()), + categoryThresholds: core.serialization.property( + "category_thresholds", + core.serialization.record(core.serialization.string(), core.serialization.number()).optional(), + ), +}); export declare namespace OpenAiModerationsGuardrailConfigConfig { export interface Raw { diff --git a/src/serialization/types/OpenApiSpecSource.ts b/src/serialization/types/OpenApiSpecSource.ts index 180d25e9..86dcec8c 100644 --- a/src/serialization/types/OpenApiSpecSource.ts +++ b/src/serialization/types/OpenApiSpecSource.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { InlineSpecSource } from "./InlineSpecSource.js"; import { RemoteSpecSource } from "./RemoteSpecSource.js"; import { UploadSpecSource } from "./UploadSpecSource.js"; -export const OpenApiSpecSource: core.serialization.Schema = core.serialization.undiscriminatedUnion([RemoteSpecSource, UploadSpecSource, InlineSpecSource]); +export const OpenApiSpecSource: core.serialization.Schema< + serializers.OpenApiSpecSource.Raw, + TrueFoundry.OpenApiSpecSource +> = core.serialization.undiscriminatedUnion([RemoteSpecSource, UploadSpecSource, InlineSpecSource]); export declare namespace OpenApiSpecSource { export type Raw = RemoteSpecSource.Raw | UploadSpecSource.Raw | InlineSpecSource.Raw; diff --git a/src/serialization/types/OpenApimcpServerManifest.ts b/src/serialization/types/OpenApimcpServerManifest.ts index f9caab1f..12c8401a 100644 --- a/src/serialization/types/OpenApimcpServerManifest.ts +++ b/src/serialization/types/OpenApimcpServerManifest.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { CustomTlsSettings } from "./CustomTlsSettings.js"; import { McpServerAuth } from "./McpServerAuth.js"; @@ -10,26 +10,37 @@ import { OpenApimcpToolSetting } from "./OpenApimcpToolSetting.js"; import { OpenApiSpecSource } from "./OpenApiSpecSource.js"; import { OwnedBy } from "./OwnedBy.js"; -export const OpenApimcpServerManifest: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("mcp-server/openapi"), - "name": core.serialization.string(), - "description": core.serialization.string(), - "url": core.serialization.string(), - "openapiSpecSource": core.serialization.property("openapi_spec_source", OpenApiSpecSource), - "tlsSettings": core.serialization.property("tls_settings", CustomTlsSettings.optional()), - "enableAllTools": core.serialization.property("enable_all_tools", core.serialization.boolean().optional()), - "toolSettings": core.serialization.property("tool_settings", core.serialization.list(OpenApimcpToolSetting).optional()), - "authData": core.serialization.property("auth_data", McpServerAuth.optional()), - "collaborators": core.serialization.list(Collaborator), - "ownedBy": OwnedBy.optional(), - "additionalHeaders": core.serialization.property("additional_headers", core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional()), - "tags": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() - }); +export const OpenApimcpServerManifest: core.serialization.ObjectSchema< + serializers.OpenApimcpServerManifest.Raw, + TrueFoundry.OpenApimcpServerManifest +> = core.serialization.object({ + type: core.serialization.stringLiteral("mcp-server/openapi"), + name: core.serialization.string(), + displayName: core.serialization.property("display_name", core.serialization.string().optional()), + description: core.serialization.string(), + url: core.serialization.string(), + openapiSpecSource: core.serialization.property("openapi_spec_source", OpenApiSpecSource), + tlsSettings: core.serialization.property("tls_settings", CustomTlsSettings.optional()), + enableAllTools: core.serialization.property("enable_all_tools", core.serialization.boolean().optional()), + toolSettings: core.serialization.property( + "tool_settings", + core.serialization.list(OpenApimcpToolSetting).optional(), + ), + authData: core.serialization.property("auth_data", McpServerAuth.optional()), + collaborators: core.serialization.list(Collaborator), + ownedBy: OwnedBy.optional(), + additionalHeaders: core.serialization.property( + "additional_headers", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + ), + tags: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), +}); export declare namespace OpenApimcpServerManifest { export interface Raw { type: "mcp-server/openapi"; name: string; + display_name?: string | null; description: string; url: string; openapi_spec_source: OpenApiSpecSource.Raw; diff --git a/src/serialization/types/OpenApimcpToolSetting.ts b/src/serialization/types/OpenApimcpToolSetting.ts index 7069350e..dc524163 100644 --- a/src/serialization/types/OpenApimcpToolSetting.ts +++ b/src/serialization/types/OpenApimcpToolSetting.ts @@ -1,18 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { McpToolAnnotations } from "./McpToolAnnotations.js"; import { OpenApimcpToolSettingMethod } from "./OpenApimcpToolSettingMethod.js"; -export const OpenApimcpToolSetting: core.serialization.ObjectSchema = core.serialization.object({ - "method": OpenApimcpToolSettingMethod, - "path": core.serialization.string(), - "name": core.serialization.string(), - "description": core.serialization.string(), - "annotations": McpToolAnnotations.optional() - }); +export const OpenApimcpToolSetting: core.serialization.ObjectSchema< + serializers.OpenApimcpToolSetting.Raw, + TrueFoundry.OpenApimcpToolSetting +> = core.serialization.object({ + method: OpenApimcpToolSettingMethod, + path: core.serialization.string(), + name: core.serialization.string(), + description: core.serialization.string(), + annotations: McpToolAnnotations.optional(), +}); export declare namespace OpenApimcpToolSetting { export interface Raw { diff --git a/src/serialization/types/OpenApimcpToolSettingMethod.ts b/src/serialization/types/OpenApimcpToolSettingMethod.ts index 14b3034c..61b36693 100644 --- a/src/serialization/types/OpenApimcpToolSettingMethod.ts +++ b/src/serialization/types/OpenApimcpToolSettingMethod.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const OpenApimcpToolSettingMethod: core.serialization.Schema = core.serialization.enum_(["get", "post", "put", "patch", "delete", "head"]); +export const OpenApimcpToolSettingMethod: core.serialization.Schema< + serializers.OpenApimcpToolSettingMethod.Raw, + TrueFoundry.OpenApimcpToolSettingMethod +> = core.serialization.enum_(["get", "post", "put", "patch", "delete", "head"]); export declare namespace OpenApimcpToolSettingMethod { export type Raw = "get" | "post" | "put" | "patch" | "delete" | "head"; diff --git a/src/serialization/types/OpenRouterApiKeyAuth.ts b/src/serialization/types/OpenRouterApiKeyAuth.ts index 3399a215..93c85c8f 100644 --- a/src/serialization/types/OpenRouterApiKeyAuth.ts +++ b/src/serialization/types/OpenRouterApiKeyAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const OpenRouterApiKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) - }); +export const OpenRouterApiKeyAuth: core.serialization.ObjectSchema< + serializers.OpenRouterApiKeyAuth.Raw, + TrueFoundry.OpenRouterApiKeyAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), +}); export declare namespace OpenRouterApiKeyAuth { export interface Raw { diff --git a/src/serialization/types/OpenRouterIntegrations.ts b/src/serialization/types/OpenRouterIntegrations.ts index f525f556..50aa188c 100644 --- a/src/serialization/types/OpenRouterIntegrations.ts +++ b/src/serialization/types/OpenRouterIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { OpenRouterModel } from "./OpenRouterModel.js"; -export const OpenRouterIntegrations: core.serialization.ObjectSchema = OpenRouterModel; +export const OpenRouterIntegrations: core.serialization.ObjectSchema< + serializers.OpenRouterIntegrations.Raw, + TrueFoundry.OpenRouterIntegrations +> = OpenRouterModel; export declare namespace OpenRouterIntegrations { export type Raw = OpenRouterModel.Raw; diff --git a/src/serialization/types/OpenRouterModel.ts b/src/serialization/types/OpenRouterModel.ts index 297fad0f..7c8a4c45 100644 --- a/src/serialization/types/OpenRouterModel.ts +++ b/src/serialization/types/OpenRouterModel.ts @@ -1,19 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const OpenRouterModel: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/model/openrouter"), - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const OpenRouterModel: core.serialization.ObjectSchema< + serializers.OpenRouterModel.Raw, + TrueFoundry.OpenRouterModel +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/model/openrouter"), + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace OpenRouterModel { export interface Raw { diff --git a/src/serialization/types/OpenRouterProviderAccount.ts b/src/serialization/types/OpenRouterProviderAccount.ts index 3e4dc17e..90a21f64 100644 --- a/src/serialization/types/OpenRouterProviderAccount.ts +++ b/src/serialization/types/OpenRouterProviderAccount.ts @@ -1,22 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { OpenRouterApiKeyAuth } from "./OpenRouterApiKeyAuth.js"; import { OpenRouterIntegrations } from "./OpenRouterIntegrations.js"; import { OwnedBy } from "./OwnedBy.js"; -export const OpenRouterProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/openrouter"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", OpenRouterApiKeyAuth), - "integrations": core.serialization.list(OpenRouterIntegrations), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const OpenRouterProviderAccount: core.serialization.ObjectSchema< + serializers.OpenRouterProviderAccount.Raw, + TrueFoundry.OpenRouterProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/openrouter"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", OpenRouterApiKeyAuth), + integrations: core.serialization.list(OpenRouterIntegrations), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace OpenRouterProviderAccount { export interface Raw { diff --git a/src/serialization/types/OpenaiApiKeyAuth.ts b/src/serialization/types/OpenaiApiKeyAuth.ts index 5e4edbcf..85807d65 100644 --- a/src/serialization/types/OpenaiApiKeyAuth.ts +++ b/src/serialization/types/OpenaiApiKeyAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const OpenaiApiKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) - }); +export const OpenaiApiKeyAuth: core.serialization.ObjectSchema< + serializers.OpenaiApiKeyAuth.Raw, + TrueFoundry.OpenaiApiKeyAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), +}); export declare namespace OpenaiApiKeyAuth { export interface Raw { diff --git a/src/serialization/types/OpenaiProviderAccount.ts b/src/serialization/types/OpenaiProviderAccount.ts index 0bcaaf0e..13b9bc66 100644 --- a/src/serialization/types/OpenaiProviderAccount.ts +++ b/src/serialization/types/OpenaiProviderAccount.ts @@ -1,23 +1,26 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; -import { OpenaiApiKeyAuth } from "./OpenaiApiKeyAuth.js"; import { OpenAiIntegrations } from "./OpenAiIntegrations.js"; +import { OpenaiApiKeyAuth } from "./OpenaiApiKeyAuth.js"; import { OwnedBy } from "./OwnedBy.js"; -export const OpenaiProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/openai"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", OpenaiApiKeyAuth.optional()), - "baseUrl": core.serialization.property("base_url", core.serialization.string().optional()), - "integrations": core.serialization.list(OpenAiIntegrations), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const OpenaiProviderAccount: core.serialization.ObjectSchema< + serializers.OpenaiProviderAccount.Raw, + TrueFoundry.OpenaiProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/openai"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", OpenaiApiKeyAuth.optional()), + baseUrl: core.serialization.property("base_url", core.serialization.string().optional()), + integrations: core.serialization.list(OpenAiIntegrations), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace OpenaiProviderAccount { export interface Raw { diff --git a/src/serialization/types/Operation.ts b/src/serialization/types/Operation.ts index a8cc99d7..20712d03 100644 --- a/src/serialization/types/Operation.ts +++ b/src/serialization/types/Operation.ts @@ -1,10 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const Operation: core.serialization.Schema = core.serialization.enum_(["READ", "WRITE"]); +export const Operation: core.serialization.Schema = + core.serialization.enum_(["READ", "WRITE"]); export declare namespace Operation { export type Raw = "READ" | "WRITE"; diff --git a/src/serialization/types/OtelExporterGrpcConfigBase.ts b/src/serialization/types/OtelExporterGrpcConfigBase.ts index 1f055b80..5d0da8e3 100644 --- a/src/serialization/types/OtelExporterGrpcConfigBase.ts +++ b/src/serialization/types/OtelExporterGrpcConfigBase.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const OtelExporterGrpcConfigBase: core.serialization.ObjectSchema = core.serialization.object({ - "endpoint": core.serialization.string(), - "headers": core.serialization.record(core.serialization.string(), core.serialization.string()).optional() - }); +export const OtelExporterGrpcConfigBase: core.serialization.ObjectSchema< + serializers.OtelExporterGrpcConfigBase.Raw, + TrueFoundry.OtelExporterGrpcConfigBase +> = core.serialization.object({ + endpoint: core.serialization.string(), + headers: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), +}); export declare namespace OtelExporterGrpcConfigBase { export interface Raw { diff --git a/src/serialization/types/OtelExporterHttpConfigBase.ts b/src/serialization/types/OtelExporterHttpConfigBase.ts index 7a5f3999..1f805e8d 100644 --- a/src/serialization/types/OtelExporterHttpConfigBase.ts +++ b/src/serialization/types/OtelExporterHttpConfigBase.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { OtelExporterHttpConfigBaseEncoding } from "./OtelExporterHttpConfigBaseEncoding.js"; -export const OtelExporterHttpConfigBase: core.serialization.ObjectSchema = core.serialization.object({ - "endpoint": core.serialization.string(), - "encoding": OtelExporterHttpConfigBaseEncoding, - "headers": core.serialization.record(core.serialization.string(), core.serialization.string()).optional() - }); +export const OtelExporterHttpConfigBase: core.serialization.ObjectSchema< + serializers.OtelExporterHttpConfigBase.Raw, + TrueFoundry.OtelExporterHttpConfigBase +> = core.serialization.object({ + endpoint: core.serialization.string(), + encoding: OtelExporterHttpConfigBaseEncoding, + headers: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), +}); export declare namespace OtelExporterHttpConfigBase { export interface Raw { diff --git a/src/serialization/types/OtelExporterHttpConfigBaseEncoding.ts b/src/serialization/types/OtelExporterHttpConfigBaseEncoding.ts index d7910592..d897db9d 100644 --- a/src/serialization/types/OtelExporterHttpConfigBaseEncoding.ts +++ b/src/serialization/types/OtelExporterHttpConfigBaseEncoding.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const OtelExporterHttpConfigBaseEncoding: core.serialization.Schema = core.serialization.enum_(["proto", "json"]); +export const OtelExporterHttpConfigBaseEncoding: core.serialization.Schema< + serializers.OtelExporterHttpConfigBaseEncoding.Raw, + TrueFoundry.OtelExporterHttpConfigBaseEncoding +> = core.serialization.enum_(["proto", "json"]); export declare namespace OtelExporterHttpConfigBaseEncoding { export type Raw = "proto" | "json"; diff --git a/src/serialization/types/OtelMetricsExporterGrpcConfig.ts b/src/serialization/types/OtelMetricsExporterGrpcConfig.ts index bf7c82ff..6270e177 100644 --- a/src/serialization/types/OtelMetricsExporterGrpcConfig.ts +++ b/src/serialization/types/OtelMetricsExporterGrpcConfig.ts @@ -1,13 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { OtelExporterGrpcConfigBase } from "./OtelExporterGrpcConfigBase.js"; -export const OtelMetricsExporterGrpcConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("grpc") - }).extend(OtelExporterGrpcConfigBase); +export const OtelMetricsExporterGrpcConfig: core.serialization.ObjectSchema< + serializers.OtelMetricsExporterGrpcConfig.Raw, + TrueFoundry.OtelMetricsExporterGrpcConfig +> = core.serialization + .object({ + type: core.serialization.stringLiteral("grpc"), + }) + .extend(OtelExporterGrpcConfigBase); export declare namespace OtelMetricsExporterGrpcConfig { export interface Raw extends OtelExporterGrpcConfigBase.Raw { diff --git a/src/serialization/types/OtelMetricsExporterHttpConfig.ts b/src/serialization/types/OtelMetricsExporterHttpConfig.ts index 8fcb622c..15014cc7 100644 --- a/src/serialization/types/OtelMetricsExporterHttpConfig.ts +++ b/src/serialization/types/OtelMetricsExporterHttpConfig.ts @@ -1,13 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { OtelExporterHttpConfigBase } from "./OtelExporterHttpConfigBase.js"; -export const OtelMetricsExporterHttpConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("http") - }).extend(OtelExporterHttpConfigBase); +export const OtelMetricsExporterHttpConfig: core.serialization.ObjectSchema< + serializers.OtelMetricsExporterHttpConfig.Raw, + TrueFoundry.OtelMetricsExporterHttpConfig +> = core.serialization + .object({ + type: core.serialization.stringLiteral("http"), + }) + .extend(OtelExporterHttpConfigBase); export declare namespace OtelMetricsExporterHttpConfig { export interface Raw extends OtelExporterHttpConfigBase.Raw { diff --git a/src/serialization/types/OtelTracesExporterCommonConfig.ts b/src/serialization/types/OtelTracesExporterCommonConfig.ts index 69bee45b..cf4158e1 100644 --- a/src/serialization/types/OtelTracesExporterCommonConfig.ts +++ b/src/serialization/types/OtelTracesExporterCommonConfig.ts @@ -1,15 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { OtelTracesExporterSpanAttributeFilter } from "./OtelTracesExporterSpanAttributeFilter.js"; -export const OtelTracesExporterCommonConfig: core.serialization.ObjectSchema = core.serialization.object({ - "additionalResourceAttributes": core.serialization.property("additional_resource_attributes", core.serialization.record(core.serialization.string(), core.serialization.string()).optional()), - "excludeRequestData": core.serialization.property("exclude_request_data", core.serialization.boolean().optional()), - "when": core.serialization.list(OtelTracesExporterSpanAttributeFilter).optional() - }); +export const OtelTracesExporterCommonConfig: core.serialization.ObjectSchema< + serializers.OtelTracesExporterCommonConfig.Raw, + TrueFoundry.OtelTracesExporterCommonConfig +> = core.serialization.object({ + additionalResourceAttributes: core.serialization.property( + "additional_resource_attributes", + core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), + ), + excludeRequestData: core.serialization.property("exclude_request_data", core.serialization.boolean().optional()), + when: core.serialization.list(OtelTracesExporterSpanAttributeFilter).optional(), +}); export declare namespace OtelTracesExporterCommonConfig { export interface Raw { diff --git a/src/serialization/types/OtelTracesExporterGrpcConfig.ts b/src/serialization/types/OtelTracesExporterGrpcConfig.ts index 219d458b..0bbe361c 100644 --- a/src/serialization/types/OtelTracesExporterGrpcConfig.ts +++ b/src/serialization/types/OtelTracesExporterGrpcConfig.ts @@ -1,14 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { OtelExporterGrpcConfigBase } from "./OtelExporterGrpcConfigBase.js"; import { OtelTracesExporterCommonConfig } from "./OtelTracesExporterCommonConfig.js"; -export const OtelTracesExporterGrpcConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("grpc") - }).extend(OtelExporterGrpcConfigBase).extend(OtelTracesExporterCommonConfig); +export const OtelTracesExporterGrpcConfig: core.serialization.ObjectSchema< + serializers.OtelTracesExporterGrpcConfig.Raw, + TrueFoundry.OtelTracesExporterGrpcConfig +> = core.serialization + .object({ + type: core.serialization.stringLiteral("grpc"), + }) + .extend(OtelExporterGrpcConfigBase) + .extend(OtelTracesExporterCommonConfig); export declare namespace OtelTracesExporterGrpcConfig { export interface Raw extends OtelExporterGrpcConfigBase.Raw, OtelTracesExporterCommonConfig.Raw { diff --git a/src/serialization/types/OtelTracesExporterHttpConfig.ts b/src/serialization/types/OtelTracesExporterHttpConfig.ts index b89c9a0a..fc70ff5e 100644 --- a/src/serialization/types/OtelTracesExporterHttpConfig.ts +++ b/src/serialization/types/OtelTracesExporterHttpConfig.ts @@ -1,14 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { OtelExporterHttpConfigBase } from "./OtelExporterHttpConfigBase.js"; import { OtelTracesExporterCommonConfig } from "./OtelTracesExporterCommonConfig.js"; -export const OtelTracesExporterHttpConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("http") - }).extend(OtelExporterHttpConfigBase).extend(OtelTracesExporterCommonConfig); +export const OtelTracesExporterHttpConfig: core.serialization.ObjectSchema< + serializers.OtelTracesExporterHttpConfig.Raw, + TrueFoundry.OtelTracesExporterHttpConfig +> = core.serialization + .object({ + type: core.serialization.stringLiteral("http"), + }) + .extend(OtelExporterHttpConfigBase) + .extend(OtelTracesExporterCommonConfig); export declare namespace OtelTracesExporterHttpConfig { export interface Raw extends OtelExporterHttpConfigBase.Raw, OtelTracesExporterCommonConfig.Raw { diff --git a/src/serialization/types/OtelTracesExporterSpanAttributeFilter.ts b/src/serialization/types/OtelTracesExporterSpanAttributeFilter.ts index 863ef83c..46c27a47 100644 --- a/src/serialization/types/OtelTracesExporterSpanAttributeFilter.ts +++ b/src/serialization/types/OtelTracesExporterSpanAttributeFilter.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const OtelTracesExporterSpanAttributeFilter: core.serialization.ObjectSchema = core.serialization.object({ - "field": core.serialization.stringLiteral("spanAttributes"), - "key": core.serialization.string(), - "operator": core.serialization.stringLiteral("IN"), - "value": core.serialization.list(core.serialization.string()) - }); +export const OtelTracesExporterSpanAttributeFilter: core.serialization.ObjectSchema< + serializers.OtelTracesExporterSpanAttributeFilter.Raw, + TrueFoundry.OtelTracesExporterSpanAttributeFilter +> = core.serialization.object({ + field: core.serialization.stringLiteral("spanAttributes"), + key: core.serialization.string(), + operator: core.serialization.stringLiteral("IN"), + value: core.serialization.list(core.serialization.string()), +}); export declare namespace OtelTracesExporterSpanAttributeFilter { export interface Raw { diff --git a/src/serialization/types/OwnDataAccessRule.ts b/src/serialization/types/OwnDataAccessRule.ts index 19adf4b4..aebf7455 100644 --- a/src/serialization/types/OwnDataAccessRule.ts +++ b/src/serialization/types/OwnDataAccessRule.ts @@ -1,13 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { DataAccessRuleBase } from "./DataAccessRuleBase.js"; -export const OwnDataAccessRule: core.serialization.ObjectSchema = core.serialization.object({ - "scope": core.serialization.stringLiteral("own_data") - }).extend(DataAccessRuleBase); +export const OwnDataAccessRule: core.serialization.ObjectSchema< + serializers.OwnDataAccessRule.Raw, + TrueFoundry.OwnDataAccessRule +> = core.serialization + .object({ + scope: core.serialization.stringLiteral("own_data"), + }) + .extend(DataAccessRuleBase); export declare namespace OwnDataAccessRule { export interface Raw extends DataAccessRuleBase.Raw { diff --git a/src/serialization/types/OwnedBy.ts b/src/serialization/types/OwnedBy.ts index 5809aa31..44aae66d 100644 --- a/src/serialization/types/OwnedBy.ts +++ b/src/serialization/types/OwnedBy.ts @@ -1,11 +1,12 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const OwnedBy: core.serialization.ObjectSchema = core.serialization.object({ - "account": core.serialization.string() +export const OwnedBy: core.serialization.ObjectSchema = + core.serialization.object({ + account: core.serialization.string(), }); export declare namespace OwnedBy { diff --git a/src/serialization/types/PaddleFramework.ts b/src/serialization/types/PaddleFramework.ts index 49838cf6..d8639cde 100644 --- a/src/serialization/types/PaddleFramework.ts +++ b/src/serialization/types/PaddleFramework.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const PaddleFramework: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("paddle") - }); +export const PaddleFramework: core.serialization.ObjectSchema< + serializers.PaddleFramework.Raw, + TrueFoundry.PaddleFramework +> = core.serialization.object({ + type: core.serialization.stringLiteral("paddle"), +}); export declare namespace PaddleFramework { export interface Raw { diff --git a/src/serialization/types/PagerDuty.ts b/src/serialization/types/PagerDuty.ts index ff433cd0..c0999b0a 100644 --- a/src/serialization/types/PagerDuty.ts +++ b/src/serialization/types/PagerDuty.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const PagerDuty: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("pagerduty"), - "notificationChannel": core.serialization.property("notification_channel", core.serialization.string()) +export const PagerDuty: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("pagerduty"), + notificationChannel: core.serialization.property("notification_channel", core.serialization.string()), }); export declare namespace PagerDuty { diff --git a/src/serialization/types/PagerDutyIntegration.ts b/src/serialization/types/PagerDutyIntegration.ts index 756962a6..a2621e5a 100644 --- a/src/serialization/types/PagerDutyIntegration.ts +++ b/src/serialization/types/PagerDutyIntegration.ts @@ -1,16 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { PagerDutyIntegrationKeyAuth } from "./PagerDutyIntegrationKeyAuth.js"; -export const PagerDutyIntegration: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/notification-channel/pagerduty"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", PagerDutyIntegrationKeyAuth), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const PagerDutyIntegration: core.serialization.ObjectSchema< + serializers.PagerDutyIntegration.Raw, + TrueFoundry.PagerDutyIntegration +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/notification-channel/pagerduty"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", PagerDutyIntegrationKeyAuth), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace PagerDutyIntegration { export interface Raw { diff --git a/src/serialization/types/PagerDutyIntegrationKeyAuth.ts b/src/serialization/types/PagerDutyIntegrationKeyAuth.ts index a67bc463..ebf89d63 100644 --- a/src/serialization/types/PagerDutyIntegrationKeyAuth.ts +++ b/src/serialization/types/PagerDutyIntegrationKeyAuth.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const PagerDutyIntegrationKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("pagerduty-integration-auth"), - "integrationKey": core.serialization.property("integration_key", core.serialization.string()), - "integrationUrl": core.serialization.property("integration_url", core.serialization.string()) - }); +export const PagerDutyIntegrationKeyAuth: core.serialization.ObjectSchema< + serializers.PagerDutyIntegrationKeyAuth.Raw, + TrueFoundry.PagerDutyIntegrationKeyAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("pagerduty-integration-auth"), + integrationKey: core.serialization.property("integration_key", core.serialization.string()), + integrationUrl: core.serialization.property("integration_url", core.serialization.string()), +}); export declare namespace PagerDutyIntegrationKeyAuth { export interface Raw { diff --git a/src/serialization/types/PagerDutyIntegrations.ts b/src/serialization/types/PagerDutyIntegrations.ts index 6735415a..f75c30cc 100644 --- a/src/serialization/types/PagerDutyIntegrations.ts +++ b/src/serialization/types/PagerDutyIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { PagerDutyIntegration } from "./PagerDutyIntegration.js"; -export const PagerDutyIntegrations: core.serialization.ObjectSchema = PagerDutyIntegration; +export const PagerDutyIntegrations: core.serialization.ObjectSchema< + serializers.PagerDutyIntegrations.Raw, + TrueFoundry.PagerDutyIntegrations +> = PagerDutyIntegration; export declare namespace PagerDutyIntegrations { export type Raw = PagerDutyIntegration.Raw; diff --git a/src/serialization/types/PagerDutyProviderAccount.ts b/src/serialization/types/PagerDutyProviderAccount.ts index 1803d70a..e7bd42a0 100644 --- a/src/serialization/types/PagerDutyProviderAccount.ts +++ b/src/serialization/types/PagerDutyProviderAccount.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { OwnedBy } from "./OwnedBy.js"; import { PagerDutyIntegrations } from "./PagerDutyIntegrations.js"; -export const PagerDutyProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/pagerduty"), - "name": core.serialization.string(), - "integrations": core.serialization.list(PagerDutyIntegrations), - "ownedBy": OwnedBy.optional() - }); +export const PagerDutyProviderAccount: core.serialization.ObjectSchema< + serializers.PagerDutyProviderAccount.Raw, + TrueFoundry.PagerDutyProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/pagerduty"), + name: core.serialization.string(), + integrations: core.serialization.list(PagerDutyIntegrations), + ownedBy: OwnedBy.optional(), +}); export declare namespace PagerDutyProviderAccount { export interface Raw { diff --git a/src/serialization/types/Pagination.ts b/src/serialization/types/Pagination.ts index 8a7a249d..13e8cc0e 100644 --- a/src/serialization/types/Pagination.ts +++ b/src/serialization/types/Pagination.ts @@ -1,19 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const Pagination: core.serialization.ObjectSchema = core.serialization.object({ - "total": core.serialization.number(), - "offset": core.serialization.number().optional(), - "limit": core.serialization.number().optional() +export const Pagination: core.serialization.ObjectSchema = + core.serialization.object({ + total: core.serialization.number(), + offset: core.serialization.number().optionalNullable(), + limit: core.serialization.number().optionalNullable(), }); export declare namespace Pagination { export interface Raw { total: number; - offset?: number | null; - limit?: number | null; + offset?: (number | null | undefined) | null; + limit?: (number | null | undefined) | null; } } diff --git a/src/serialization/types/PalmIntegrations.ts b/src/serialization/types/PalmIntegrations.ts index 6e89334f..2d9d07d4 100644 --- a/src/serialization/types/PalmIntegrations.ts +++ b/src/serialization/types/PalmIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { PalmModel } from "./PalmModel.js"; -export const PalmIntegrations: core.serialization.ObjectSchema = PalmModel; +export const PalmIntegrations: core.serialization.ObjectSchema< + serializers.PalmIntegrations.Raw, + TrueFoundry.PalmIntegrations +> = PalmModel; export declare namespace PalmIntegrations { export type Raw = PalmModel.Raw; diff --git a/src/serialization/types/PalmKeyAuth.ts b/src/serialization/types/PalmKeyAuth.ts index e8fae2d4..c98d25de 100644 --- a/src/serialization/types/PalmKeyAuth.ts +++ b/src/serialization/types/PalmKeyAuth.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const PalmKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) +export const PalmKeyAuth: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), }); export declare namespace PalmKeyAuth { diff --git a/src/serialization/types/PalmModel.ts b/src/serialization/types/PalmModel.ts index 7ec40415..52ff5f22 100644 --- a/src/serialization/types/PalmModel.ts +++ b/src/serialization/types/PalmModel.ts @@ -1,18 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const PalmModel: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/model/palm"), - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) +export const PalmModel: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("integration/model/palm"), + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace PalmModel { diff --git a/src/serialization/types/PalmProviderAccount.ts b/src/serialization/types/PalmProviderAccount.ts index b948d3f0..ee62f05c 100644 --- a/src/serialization/types/PalmProviderAccount.ts +++ b/src/serialization/types/PalmProviderAccount.ts @@ -1,22 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { OwnedBy } from "./OwnedBy.js"; import { PalmIntegrations } from "./PalmIntegrations.js"; import { PalmKeyAuth } from "./PalmKeyAuth.js"; -export const PalmProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/palm"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", PalmKeyAuth), - "integrations": core.serialization.list(PalmIntegrations), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const PalmProviderAccount: core.serialization.ObjectSchema< + serializers.PalmProviderAccount.Raw, + TrueFoundry.PalmProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/palm"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", PalmKeyAuth), + integrations: core.serialization.list(PalmIntegrations), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace PalmProviderAccount { export interface Raw { diff --git a/src/serialization/types/PaloAltoPrismaAirsGuardrailConfig.ts b/src/serialization/types/PaloAltoPrismaAirsGuardrailConfig.ts index 304c14c5..3f2ac398 100644 --- a/src/serialization/types/PaloAltoPrismaAirsGuardrailConfig.ts +++ b/src/serialization/types/PaloAltoPrismaAirsGuardrailConfig.ts @@ -1,21 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { EnforcingStrategy } from "./EnforcingStrategy.js"; import { PaloAltoPrismaAirsGuardrailConfigConfig } from "./PaloAltoPrismaAirsGuardrailConfigConfig.js"; import { PaloAltoPrismaAirsKeyAuth } from "./PaloAltoPrismaAirsKeyAuth.js"; -export const PaloAltoPrismaAirsGuardrailConfig: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string().optional(), - "type": core.serialization.stringLiteral("integration/guardrail-config/palo-alto-prisma-airs"), - "authData": core.serialization.property("auth_data", PaloAltoPrismaAirsKeyAuth), - "operation": core.serialization.stringLiteral("validate"), - "enforcingStrategy": core.serialization.property("enforcing_strategy", EnforcingStrategy), - "config": PaloAltoPrismaAirsGuardrailConfigConfig - }); +export const PaloAltoPrismaAirsGuardrailConfig: core.serialization.ObjectSchema< + serializers.PaloAltoPrismaAirsGuardrailConfig.Raw, + TrueFoundry.PaloAltoPrismaAirsGuardrailConfig +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + type: core.serialization.stringLiteral("integration/guardrail-config/palo-alto-prisma-airs"), + authData: core.serialization.property("auth_data", PaloAltoPrismaAirsKeyAuth), + operation: core.serialization.stringLiteral("validate"), + enforcingStrategy: core.serialization.property("enforcing_strategy", EnforcingStrategy), + config: PaloAltoPrismaAirsGuardrailConfigConfig, +}); export declare namespace PaloAltoPrismaAirsGuardrailConfig { export interface Raw { diff --git a/src/serialization/types/PaloAltoPrismaAirsGuardrailConfigConfig.ts b/src/serialization/types/PaloAltoPrismaAirsGuardrailConfigConfig.ts index 81ff5a48..10d503a8 100644 --- a/src/serialization/types/PaloAltoPrismaAirsGuardrailConfigConfig.ts +++ b/src/serialization/types/PaloAltoPrismaAirsGuardrailConfigConfig.ts @@ -1,16 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { PaloAltoPrismaAirsGuardrailConfigConfigMode } from "./PaloAltoPrismaAirsGuardrailConfigConfigMode.js"; -export const PaloAltoPrismaAirsGuardrailConfigConfig: core.serialization.ObjectSchema = core.serialization.object({ - "baseUrl": core.serialization.property("base_url", core.serialization.string().optional()), - "profileName": core.serialization.property("profile_name", core.serialization.string()), - "mode": PaloAltoPrismaAirsGuardrailConfigConfigMode.optional(), - "metadataKeyMapping": core.serialization.property("metadata_key_mapping", core.serialization.record(core.serialization.string(), core.serialization.string()).optional()) - }); +export const PaloAltoPrismaAirsGuardrailConfigConfig: core.serialization.ObjectSchema< + serializers.PaloAltoPrismaAirsGuardrailConfigConfig.Raw, + TrueFoundry.PaloAltoPrismaAirsGuardrailConfigConfig +> = core.serialization.object({ + baseUrl: core.serialization.property("base_url", core.serialization.string().optional()), + profileName: core.serialization.property("profile_name", core.serialization.string()), + mode: PaloAltoPrismaAirsGuardrailConfigConfigMode.optional(), + metadataKeyMapping: core.serialization.property( + "metadata_key_mapping", + core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), + ), +}); export declare namespace PaloAltoPrismaAirsGuardrailConfigConfig { export interface Raw { diff --git a/src/serialization/types/PaloAltoPrismaAirsGuardrailConfigConfigMode.ts b/src/serialization/types/PaloAltoPrismaAirsGuardrailConfigConfigMode.ts index 7e731464..47eaeea2 100644 --- a/src/serialization/types/PaloAltoPrismaAirsGuardrailConfigConfigMode.ts +++ b/src/serialization/types/PaloAltoPrismaAirsGuardrailConfigConfigMode.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const PaloAltoPrismaAirsGuardrailConfigConfigMode: core.serialization.Schema = core.serialization.enum_(["sync", "async"]); +export const PaloAltoPrismaAirsGuardrailConfigConfigMode: core.serialization.Schema< + serializers.PaloAltoPrismaAirsGuardrailConfigConfigMode.Raw, + TrueFoundry.PaloAltoPrismaAirsGuardrailConfigConfigMode +> = core.serialization.enum_(["sync", "async"]); export declare namespace PaloAltoPrismaAirsGuardrailConfigConfigMode { export type Raw = "sync" | "async"; diff --git a/src/serialization/types/PaloAltoPrismaAirsKeyAuth.ts b/src/serialization/types/PaloAltoPrismaAirsKeyAuth.ts index ab9b1204..6e26542e 100644 --- a/src/serialization/types/PaloAltoPrismaAirsKeyAuth.ts +++ b/src/serialization/types/PaloAltoPrismaAirsKeyAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const PaloAltoPrismaAirsKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) - }); +export const PaloAltoPrismaAirsKeyAuth: core.serialization.ObjectSchema< + serializers.PaloAltoPrismaAirsKeyAuth.Raw, + TrueFoundry.PaloAltoPrismaAirsKeyAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), +}); export declare namespace PaloAltoPrismaAirsKeyAuth { export interface Raw { diff --git a/src/serialization/types/Param.ts b/src/serialization/types/Param.ts index 371e986b..54f104aa 100644 --- a/src/serialization/types/Param.ts +++ b/src/serialization/types/Param.ts @@ -1,22 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ParamParamType } from "./ParamParamType.js"; -export const Param: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string().optional(), - "default": core.serialization.string().optional(), - "paramType": core.serialization.property("param_type", ParamParamType.optional()) +export const Param: core.serialization.ObjectSchema = + core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + default: core.serialization.string().optional(), + paramType: core.serialization.property("param_type", ParamParamType.optional()), }); export declare namespace Param { export interface Raw { name: string; description?: string | null; - "default"?: string | null; + default?: string | null; param_type?: ParamParamType.Raw | null; } } diff --git a/src/serialization/types/ParamParamType.ts b/src/serialization/types/ParamParamType.ts index 6f41687e..4450df1f 100644 --- a/src/serialization/types/ParamParamType.ts +++ b/src/serialization/types/ParamParamType.ts @@ -1,10 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const ParamParamType: core.serialization.Schema = core.serialization.enum_(["string", "ml_repo"]); +export const ParamParamType: core.serialization.Schema = + core.serialization.enum_(["string", "ml_repo"]); export declare namespace ParamParamType { export type Raw = "string" | "ml_repo"; diff --git a/src/serialization/types/Parameters.ts b/src/serialization/types/Parameters.ts index fb673935..2d34b721 100644 --- a/src/serialization/types/Parameters.ts +++ b/src/serialization/types/Parameters.ts @@ -1,16 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ParametersStop } from "./ParametersStop.js"; -export const Parameters: core.serialization.ObjectSchema = core.serialization.object({ - "maxTokens": core.serialization.property("max_tokens", core.serialization.number().optional()), - "temperature": core.serialization.number().optional(), - "topK": core.serialization.property("top_k", core.serialization.number().optional()), - "topP": core.serialization.property("top_p", core.serialization.number().optional()), - "stop": ParametersStop.optional() +export const Parameters: core.serialization.ObjectSchema = + core.serialization.object({ + maxTokens: core.serialization.property("max_tokens", core.serialization.number().optional()), + temperature: core.serialization.number().optional(), + topK: core.serialization.property("top_k", core.serialization.number().optional()), + topP: core.serialization.property("top_p", core.serialization.number().optional()), + stop: ParametersStop.optional(), }); export declare namespace Parameters { diff --git a/src/serialization/types/ParametersStop.ts b/src/serialization/types/ParametersStop.ts index 84dbda79..400ecc50 100644 --- a/src/serialization/types/ParametersStop.ts +++ b/src/serialization/types/ParametersStop.ts @@ -1,10 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const ParametersStop: core.serialization.Schema = core.serialization.undiscriminatedUnion([core.serialization.list(core.serialization.string()), core.serialization.string()]); +export const ParametersStop: core.serialization.Schema = + core.serialization.undiscriminatedUnion([ + core.serialization.list(core.serialization.string()), + core.serialization.string(), + ]); export declare namespace ParametersStop { export type Raw = string[] | string; diff --git a/src/serialization/types/PatronusAnswerRelevanceCriteria.ts b/src/serialization/types/PatronusAnswerRelevanceCriteria.ts index b0a1fbbb..38a1ede8 100644 --- a/src/serialization/types/PatronusAnswerRelevanceCriteria.ts +++ b/src/serialization/types/PatronusAnswerRelevanceCriteria.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const PatronusAnswerRelevanceCriteria: core.serialization.Schema = core.serialization.stringLiteral("patronus:answer-relevance"); +export const PatronusAnswerRelevanceCriteria: core.serialization.Schema< + serializers.PatronusAnswerRelevanceCriteria.Raw, + TrueFoundry.PatronusAnswerRelevanceCriteria +> = core.serialization.stringLiteral("patronus:answer-relevance"); export declare namespace PatronusAnswerRelevanceCriteria { export type Raw = "patronus:answer-relevance"; diff --git a/src/serialization/types/PatronusAnswerRelevanceEvaluator.ts b/src/serialization/types/PatronusAnswerRelevanceEvaluator.ts index f4d0d6d7..b5cba923 100644 --- a/src/serialization/types/PatronusAnswerRelevanceEvaluator.ts +++ b/src/serialization/types/PatronusAnswerRelevanceEvaluator.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { PatronusAnswerRelevanceCriteria } from "./PatronusAnswerRelevanceCriteria.js"; -export const PatronusAnswerRelevanceEvaluator: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("answer-relevance"), - "criteria": PatronusAnswerRelevanceCriteria - }); +export const PatronusAnswerRelevanceEvaluator: core.serialization.ObjectSchema< + serializers.PatronusAnswerRelevanceEvaluator.Raw, + TrueFoundry.PatronusAnswerRelevanceEvaluator +> = core.serialization.object({ + type: core.serialization.stringLiteral("answer-relevance"), + criteria: PatronusAnswerRelevanceCriteria, +}); export declare namespace PatronusAnswerRelevanceEvaluator { export interface Raw { diff --git a/src/serialization/types/PatronusEvaluator.ts b/src/serialization/types/PatronusEvaluator.ts index 62e8d931..1de9254e 100644 --- a/src/serialization/types/PatronusEvaluator.ts +++ b/src/serialization/types/PatronusEvaluator.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { PatronusAnswerRelevanceEvaluator } from "./PatronusAnswerRelevanceEvaluator.js"; import { PatronusGliderEvaluator } from "./PatronusGliderEvaluator.js"; import { PatronusJudgeEvaluator } from "./PatronusJudgeEvaluator.js"; @@ -10,8 +10,24 @@ import { PatronusPhiEvaluator } from "./PatronusPhiEvaluator.js"; import { PatronusPiiEvaluator } from "./PatronusPiiEvaluator.js"; import { PatronusToxicityEvaluator } from "./PatronusToxicityEvaluator.js"; -export const PatronusEvaluator: core.serialization.Schema = core.serialization.undiscriminatedUnion([PatronusAnswerRelevanceEvaluator, PatronusGliderEvaluator, PatronusJudgeEvaluator, PatronusPiiEvaluator, PatronusPhiEvaluator, PatronusToxicityEvaluator]); +export const PatronusEvaluator: core.serialization.Schema< + serializers.PatronusEvaluator.Raw, + TrueFoundry.PatronusEvaluator +> = core.serialization.undiscriminatedUnion([ + PatronusAnswerRelevanceEvaluator, + PatronusGliderEvaluator, + PatronusJudgeEvaluator, + PatronusPiiEvaluator, + PatronusPhiEvaluator, + PatronusToxicityEvaluator, +]); export declare namespace PatronusEvaluator { - export type Raw = PatronusAnswerRelevanceEvaluator.Raw | PatronusGliderEvaluator.Raw | PatronusJudgeEvaluator.Raw | PatronusPiiEvaluator.Raw | PatronusPhiEvaluator.Raw | PatronusToxicityEvaluator.Raw; + export type Raw = + | PatronusAnswerRelevanceEvaluator.Raw + | PatronusGliderEvaluator.Raw + | PatronusJudgeEvaluator.Raw + | PatronusPiiEvaluator.Raw + | PatronusPhiEvaluator.Raw + | PatronusToxicityEvaluator.Raw; } diff --git a/src/serialization/types/PatronusGliderCriteria.ts b/src/serialization/types/PatronusGliderCriteria.ts index ad497bb7..9d7ff122 100644 --- a/src/serialization/types/PatronusGliderCriteria.ts +++ b/src/serialization/types/PatronusGliderCriteria.ts @@ -1,11 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const PatronusGliderCriteria: core.serialization.Schema = core.serialization.enum_(["patronus:is-compliant", "patronus:is-factually-consistent", "patronus:is-good-summary", "patronus:is-harmful-advice", "patronus:is-informal-tone"]); +export const PatronusGliderCriteria: core.serialization.Schema< + serializers.PatronusGliderCriteria.Raw, + TrueFoundry.PatronusGliderCriteria +> = core.serialization.enum_([ + "patronus:is-compliant", + "patronus:is-factually-consistent", + "patronus:is-good-summary", + "patronus:is-harmful-advice", + "patronus:is-informal-tone", +]); export declare namespace PatronusGliderCriteria { - export type Raw = "patronus:is-compliant" | "patronus:is-factually-consistent" | "patronus:is-good-summary" | "patronus:is-harmful-advice" | "patronus:is-informal-tone"; + export type Raw = + | "patronus:is-compliant" + | "patronus:is-factually-consistent" + | "patronus:is-good-summary" + | "patronus:is-harmful-advice" + | "patronus:is-informal-tone"; } diff --git a/src/serialization/types/PatronusGliderEvaluator.ts b/src/serialization/types/PatronusGliderEvaluator.ts index f3354897..22e14d84 100644 --- a/src/serialization/types/PatronusGliderEvaluator.ts +++ b/src/serialization/types/PatronusGliderEvaluator.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { PatronusGliderCriteria } from "./PatronusGliderCriteria.js"; -export const PatronusGliderEvaluator: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("glider"), - "criteria": PatronusGliderCriteria - }); +export const PatronusGliderEvaluator: core.serialization.ObjectSchema< + serializers.PatronusGliderEvaluator.Raw, + TrueFoundry.PatronusGliderEvaluator +> = core.serialization.object({ + type: core.serialization.stringLiteral("glider"), + criteria: PatronusGliderCriteria, +}); export declare namespace PatronusGliderEvaluator { export interface Raw { diff --git a/src/serialization/types/PatronusGuardrailConfig.ts b/src/serialization/types/PatronusGuardrailConfig.ts index 23a8a0f8..f22ecf6e 100644 --- a/src/serialization/types/PatronusGuardrailConfig.ts +++ b/src/serialization/types/PatronusGuardrailConfig.ts @@ -1,21 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { EnforcingStrategy } from "./EnforcingStrategy.js"; import { PatronusGuardrailConfigConfig } from "./PatronusGuardrailConfigConfig.js"; import { PatronusKeyAuth } from "./PatronusKeyAuth.js"; -export const PatronusGuardrailConfig: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string().optional(), - "type": core.serialization.stringLiteral("integration/guardrail-config/patronus"), - "authData": core.serialization.property("auth_data", PatronusKeyAuth), - "operation": core.serialization.stringLiteral("validate"), - "enforcingStrategy": core.serialization.property("enforcing_strategy", EnforcingStrategy), - "config": PatronusGuardrailConfigConfig - }); +export const PatronusGuardrailConfig: core.serialization.ObjectSchema< + serializers.PatronusGuardrailConfig.Raw, + TrueFoundry.PatronusGuardrailConfig +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + type: core.serialization.stringLiteral("integration/guardrail-config/patronus"), + authData: core.serialization.property("auth_data", PatronusKeyAuth), + operation: core.serialization.stringLiteral("validate"), + enforcingStrategy: core.serialization.property("enforcing_strategy", EnforcingStrategy), + config: PatronusGuardrailConfigConfig, +}); export declare namespace PatronusGuardrailConfig { export interface Raw { diff --git a/src/serialization/types/PatronusGuardrailConfigConfig.ts b/src/serialization/types/PatronusGuardrailConfigConfig.ts index 361005ac..7cabcfcc 100644 --- a/src/serialization/types/PatronusGuardrailConfigConfig.ts +++ b/src/serialization/types/PatronusGuardrailConfigConfig.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { PatronusEvaluator } from "./PatronusEvaluator.js"; import { PatronusGuardrailConfigConfigTarget } from "./PatronusGuardrailConfigConfigTarget.js"; -export const PatronusGuardrailConfigConfig: core.serialization.ObjectSchema = core.serialization.object({ - "target": PatronusGuardrailConfigConfigTarget, - "evaluators": core.serialization.list(PatronusEvaluator) - }); +export const PatronusGuardrailConfigConfig: core.serialization.ObjectSchema< + serializers.PatronusGuardrailConfigConfig.Raw, + TrueFoundry.PatronusGuardrailConfigConfig +> = core.serialization.object({ + target: PatronusGuardrailConfigConfigTarget, + evaluators: core.serialization.list(PatronusEvaluator), +}); export declare namespace PatronusGuardrailConfigConfig { export interface Raw { diff --git a/src/serialization/types/PatronusGuardrailConfigConfigTarget.ts b/src/serialization/types/PatronusGuardrailConfigConfigTarget.ts index 768b0b75..63aa1502 100644 --- a/src/serialization/types/PatronusGuardrailConfigConfigTarget.ts +++ b/src/serialization/types/PatronusGuardrailConfigConfigTarget.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const PatronusGuardrailConfigConfigTarget: core.serialization.Schema = core.serialization.enum_(["response", "request"]); +export const PatronusGuardrailConfigConfigTarget: core.serialization.Schema< + serializers.PatronusGuardrailConfigConfigTarget.Raw, + TrueFoundry.PatronusGuardrailConfigConfigTarget +> = core.serialization.enum_(["response", "request"]); export declare namespace PatronusGuardrailConfigConfigTarget { export type Raw = "response" | "request"; diff --git a/src/serialization/types/PatronusJudgeCriteria.ts b/src/serialization/types/PatronusJudgeCriteria.ts index bce6a129..1d79d97e 100644 --- a/src/serialization/types/PatronusJudgeCriteria.ts +++ b/src/serialization/types/PatronusJudgeCriteria.ts @@ -1,11 +1,45 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const PatronusJudgeCriteria: core.serialization.Schema = core.serialization.enum_(["patronus:answer-refusal", "patronus:no-openai-reference", "patronus:is-concise", "patronus:no-apologies", "patronus:is-polite", "patronus:is-helpful", "patronus:clinically-inappropriate-tone", "patronus:no-harmful-therapeutic-guidance", "patronus:is-code", "patronus:is-csv", "patronus:is-json", "patronus:no-age-bias", "patronus:no-gender-bias", "patronus:no-racial-bias", "patronus:prompt-injection"]); +export const PatronusJudgeCriteria: core.serialization.Schema< + serializers.PatronusJudgeCriteria.Raw, + TrueFoundry.PatronusJudgeCriteria +> = core.serialization.enum_([ + "patronus:answer-refusal", + "patronus:no-openai-reference", + "patronus:is-concise", + "patronus:no-apologies", + "patronus:is-polite", + "patronus:is-helpful", + "patronus:clinically-inappropriate-tone", + "patronus:no-harmful-therapeutic-guidance", + "patronus:is-code", + "patronus:is-csv", + "patronus:is-json", + "patronus:no-age-bias", + "patronus:no-gender-bias", + "patronus:no-racial-bias", + "patronus:prompt-injection", +]); export declare namespace PatronusJudgeCriteria { - export type Raw = "patronus:answer-refusal" | "patronus:no-openai-reference" | "patronus:is-concise" | "patronus:no-apologies" | "patronus:is-polite" | "patronus:is-helpful" | "patronus:clinically-inappropriate-tone" | "patronus:no-harmful-therapeutic-guidance" | "patronus:is-code" | "patronus:is-csv" | "patronus:is-json" | "patronus:no-age-bias" | "patronus:no-gender-bias" | "patronus:no-racial-bias" | "patronus:prompt-injection"; + export type Raw = + | "patronus:answer-refusal" + | "patronus:no-openai-reference" + | "patronus:is-concise" + | "patronus:no-apologies" + | "patronus:is-polite" + | "patronus:is-helpful" + | "patronus:clinically-inappropriate-tone" + | "patronus:no-harmful-therapeutic-guidance" + | "patronus:is-code" + | "patronus:is-csv" + | "patronus:is-json" + | "patronus:no-age-bias" + | "patronus:no-gender-bias" + | "patronus:no-racial-bias" + | "patronus:prompt-injection"; } diff --git a/src/serialization/types/PatronusJudgeEvaluator.ts b/src/serialization/types/PatronusJudgeEvaluator.ts index 131315fc..259f7d29 100644 --- a/src/serialization/types/PatronusJudgeEvaluator.ts +++ b/src/serialization/types/PatronusJudgeEvaluator.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { PatronusJudgeCriteria } from "./PatronusJudgeCriteria.js"; -export const PatronusJudgeEvaluator: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("judge"), - "criteria": PatronusJudgeCriteria - }); +export const PatronusJudgeEvaluator: core.serialization.ObjectSchema< + serializers.PatronusJudgeEvaluator.Raw, + TrueFoundry.PatronusJudgeEvaluator +> = core.serialization.object({ + type: core.serialization.stringLiteral("judge"), + criteria: PatronusJudgeCriteria, +}); export declare namespace PatronusJudgeEvaluator { export interface Raw { diff --git a/src/serialization/types/PatronusKeyAuth.ts b/src/serialization/types/PatronusKeyAuth.ts index ab945f0d..b40a9e4d 100644 --- a/src/serialization/types/PatronusKeyAuth.ts +++ b/src/serialization/types/PatronusKeyAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const PatronusKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) - }); +export const PatronusKeyAuth: core.serialization.ObjectSchema< + serializers.PatronusKeyAuth.Raw, + TrueFoundry.PatronusKeyAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), +}); export declare namespace PatronusKeyAuth { export interface Raw { diff --git a/src/serialization/types/PatronusPhiCriteria.ts b/src/serialization/types/PatronusPhiCriteria.ts index 92c4e939..5dc4a8ad 100644 --- a/src/serialization/types/PatronusPhiCriteria.ts +++ b/src/serialization/types/PatronusPhiCriteria.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const PatronusPhiCriteria: core.serialization.Schema = core.serialization.stringLiteral("patronus:phi"); +export const PatronusPhiCriteria: core.serialization.Schema< + serializers.PatronusPhiCriteria.Raw, + TrueFoundry.PatronusPhiCriteria +> = core.serialization.stringLiteral("patronus:phi"); export declare namespace PatronusPhiCriteria { export type Raw = "patronus:phi"; diff --git a/src/serialization/types/PatronusPhiEvaluator.ts b/src/serialization/types/PatronusPhiEvaluator.ts index c3f56300..e1d70ba4 100644 --- a/src/serialization/types/PatronusPhiEvaluator.ts +++ b/src/serialization/types/PatronusPhiEvaluator.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { PatronusPhiCriteria } from "./PatronusPhiCriteria.js"; -export const PatronusPhiEvaluator: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("phi"), - "criteria": PatronusPhiCriteria - }); +export const PatronusPhiEvaluator: core.serialization.ObjectSchema< + serializers.PatronusPhiEvaluator.Raw, + TrueFoundry.PatronusPhiEvaluator +> = core.serialization.object({ + type: core.serialization.stringLiteral("phi"), + criteria: PatronusPhiCriteria, +}); export declare namespace PatronusPhiEvaluator { export interface Raw { diff --git a/src/serialization/types/PatronusPiiCriteria.ts b/src/serialization/types/PatronusPiiCriteria.ts index 262df1a6..1e61a063 100644 --- a/src/serialization/types/PatronusPiiCriteria.ts +++ b/src/serialization/types/PatronusPiiCriteria.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const PatronusPiiCriteria: core.serialization.Schema = core.serialization.stringLiteral("patronus:pii"); +export const PatronusPiiCriteria: core.serialization.Schema< + serializers.PatronusPiiCriteria.Raw, + TrueFoundry.PatronusPiiCriteria +> = core.serialization.stringLiteral("patronus:pii"); export declare namespace PatronusPiiCriteria { export type Raw = "patronus:pii"; diff --git a/src/serialization/types/PatronusPiiEvaluator.ts b/src/serialization/types/PatronusPiiEvaluator.ts index ade6defe..021385fc 100644 --- a/src/serialization/types/PatronusPiiEvaluator.ts +++ b/src/serialization/types/PatronusPiiEvaluator.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { PatronusPiiCriteria } from "./PatronusPiiCriteria.js"; -export const PatronusPiiEvaluator: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("pii"), - "criteria": PatronusPiiCriteria - }); +export const PatronusPiiEvaluator: core.serialization.ObjectSchema< + serializers.PatronusPiiEvaluator.Raw, + TrueFoundry.PatronusPiiEvaluator +> = core.serialization.object({ + type: core.serialization.stringLiteral("pii"), + criteria: PatronusPiiCriteria, +}); export declare namespace PatronusPiiEvaluator { export interface Raw { diff --git a/src/serialization/types/PatronusToxicityCriteria.ts b/src/serialization/types/PatronusToxicityCriteria.ts index cab7c667..bc609cf1 100644 --- a/src/serialization/types/PatronusToxicityCriteria.ts +++ b/src/serialization/types/PatronusToxicityCriteria.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const PatronusToxicityCriteria: core.serialization.Schema = core.serialization.stringLiteral("patronus:toxicity"); +export const PatronusToxicityCriteria: core.serialization.Schema< + serializers.PatronusToxicityCriteria.Raw, + TrueFoundry.PatronusToxicityCriteria +> = core.serialization.stringLiteral("patronus:toxicity"); export declare namespace PatronusToxicityCriteria { export type Raw = "patronus:toxicity"; diff --git a/src/serialization/types/PatronusToxicityEvaluator.ts b/src/serialization/types/PatronusToxicityEvaluator.ts index 18f408be..acec1349 100644 --- a/src/serialization/types/PatronusToxicityEvaluator.ts +++ b/src/serialization/types/PatronusToxicityEvaluator.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { PatronusToxicityCriteria } from "./PatronusToxicityCriteria.js"; -export const PatronusToxicityEvaluator: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("toxicity"), - "criteria": PatronusToxicityCriteria - }); +export const PatronusToxicityEvaluator: core.serialization.ObjectSchema< + serializers.PatronusToxicityEvaluator.Raw, + TrueFoundry.PatronusToxicityEvaluator +> = core.serialization.object({ + type: core.serialization.stringLiteral("toxicity"), + criteria: PatronusToxicityCriteria, +}); export declare namespace PatronusToxicityEvaluator { export interface Raw { diff --git a/src/serialization/types/PerMillionCharactersCostMetric.ts b/src/serialization/types/PerMillionCharactersCostMetric.ts index 72193b27..146332b1 100644 --- a/src/serialization/types/PerMillionCharactersCostMetric.ts +++ b/src/serialization/types/PerMillionCharactersCostMetric.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { PerMillionCharactersCostMetricValue } from "./PerMillionCharactersCostMetricValue.js"; -export const PerMillionCharactersCostMetric: core.serialization.ObjectSchema = core.serialization.object({ - "metric": core.serialization.string(), - "value": PerMillionCharactersCostMetricValue - }); +export const PerMillionCharactersCostMetric: core.serialization.ObjectSchema< + serializers.PerMillionCharactersCostMetric.Raw, + TrueFoundry.PerMillionCharactersCostMetric +> = core.serialization.object({ + metric: core.serialization.string(), + value: PerMillionCharactersCostMetricValue, +}); export declare namespace PerMillionCharactersCostMetric { export interface Raw { diff --git a/src/serialization/types/PerMillionCharactersCostMetricValue.ts b/src/serialization/types/PerMillionCharactersCostMetricValue.ts index ca1117d8..4eeb9ed8 100644 --- a/src/serialization/types/PerMillionCharactersCostMetricValue.ts +++ b/src/serialization/types/PerMillionCharactersCostMetricValue.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { NonNegativeFloat } from "./NonNegativeFloat.js"; -export const PerMillionCharactersCostMetricValue: core.serialization.ObjectSchema = core.serialization.object({ - "input": NonNegativeFloat - }); +export const PerMillionCharactersCostMetricValue: core.serialization.ObjectSchema< + serializers.PerMillionCharactersCostMetricValue.Raw, + TrueFoundry.PerMillionCharactersCostMetricValue +> = core.serialization.object({ + input: NonNegativeFloat, +}); export declare namespace PerMillionCharactersCostMetricValue { export interface Raw { diff --git a/src/serialization/types/PerMinuteOfAudioCostMetric.ts b/src/serialization/types/PerMinuteOfAudioCostMetric.ts index 5e0fc586..2d61efb9 100644 --- a/src/serialization/types/PerMinuteOfAudioCostMetric.ts +++ b/src/serialization/types/PerMinuteOfAudioCostMetric.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { PerMinuteOfAudioCostMetricValue } from "./PerMinuteOfAudioCostMetricValue.js"; -export const PerMinuteOfAudioCostMetric: core.serialization.ObjectSchema = core.serialization.object({ - "metric": core.serialization.string(), - "value": PerMinuteOfAudioCostMetricValue - }); +export const PerMinuteOfAudioCostMetric: core.serialization.ObjectSchema< + serializers.PerMinuteOfAudioCostMetric.Raw, + TrueFoundry.PerMinuteOfAudioCostMetric +> = core.serialization.object({ + metric: core.serialization.string(), + value: PerMinuteOfAudioCostMetricValue, +}); export declare namespace PerMinuteOfAudioCostMetric { export interface Raw { diff --git a/src/serialization/types/PerMinuteOfAudioCostMetricValue.ts b/src/serialization/types/PerMinuteOfAudioCostMetricValue.ts index 1c80d74d..5961e82d 100644 --- a/src/serialization/types/PerMinuteOfAudioCostMetricValue.ts +++ b/src/serialization/types/PerMinuteOfAudioCostMetricValue.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { NonNegativeFloat } from "./NonNegativeFloat.js"; -export const PerMinuteOfAudioCostMetricValue: core.serialization.ObjectSchema = core.serialization.object({ - "input": NonNegativeFloat - }); +export const PerMinuteOfAudioCostMetricValue: core.serialization.ObjectSchema< + serializers.PerMinuteOfAudioCostMetricValue.Raw, + TrueFoundry.PerMinuteOfAudioCostMetricValue +> = core.serialization.object({ + input: NonNegativeFloat, +}); export declare namespace PerMinuteOfAudioCostMetricValue { export interface Raw { diff --git a/src/serialization/types/PerThousandEmbeddingTokensCostMetric.ts b/src/serialization/types/PerThousandEmbeddingTokensCostMetric.ts index 6918523b..66c7f1d0 100644 --- a/src/serialization/types/PerThousandEmbeddingTokensCostMetric.ts +++ b/src/serialization/types/PerThousandEmbeddingTokensCostMetric.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { NonNegativeFloat } from "./NonNegativeFloat.js"; -export const PerThousandEmbeddingTokensCostMetric: core.serialization.ObjectSchema = core.serialization.object({ - "metric": core.serialization.string(), - "value": NonNegativeFloat - }); +export const PerThousandEmbeddingTokensCostMetric: core.serialization.ObjectSchema< + serializers.PerThousandEmbeddingTokensCostMetric.Raw, + TrueFoundry.PerThousandEmbeddingTokensCostMetric +> = core.serialization.object({ + metric: core.serialization.string(), + value: NonNegativeFloat, +}); export declare namespace PerThousandEmbeddingTokensCostMetric { export interface Raw { diff --git a/src/serialization/types/PerThousandTokensCostMetric.ts b/src/serialization/types/PerThousandTokensCostMetric.ts index d5d21844..1f25db01 100644 --- a/src/serialization/types/PerThousandTokensCostMetric.ts +++ b/src/serialization/types/PerThousandTokensCostMetric.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { InputOutputBasedCostMetricValue } from "./InputOutputBasedCostMetricValue.js"; -export const PerThousandTokensCostMetric: core.serialization.ObjectSchema = core.serialization.object({ - "metric": core.serialization.string(), - "value": InputOutputBasedCostMetricValue - }); +export const PerThousandTokensCostMetric: core.serialization.ObjectSchema< + serializers.PerThousandTokensCostMetric.Raw, + TrueFoundry.PerThousandTokensCostMetric +> = core.serialization.object({ + metric: core.serialization.string(), + value: InputOutputBasedCostMetricValue, +}); export declare namespace PerThousandTokensCostMetric { export interface Raw { diff --git a/src/serialization/types/PeriodUsage.ts b/src/serialization/types/PeriodUsage.ts new file mode 100644 index 00000000..e1e0c5a9 --- /dev/null +++ b/src/serialization/types/PeriodUsage.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const PeriodUsage: core.serialization.ObjectSchema = + core.serialization.object({ + limit: core.serialization.number(), + used: core.serialization.number(), + percentage: core.serialization.number(), + start: core.serialization.number(), + end: core.serialization.number(), + }); + +export declare namespace PeriodUsage { + export interface Raw { + limit: number; + used: number; + percentage: number; + start: number; + end: number; + } +} diff --git a/src/serialization/types/PermissionSetV2.ts b/src/serialization/types/PermissionSetV2.ts new file mode 100644 index 00000000..7a93df5d --- /dev/null +++ b/src/serialization/types/PermissionSetV2.ts @@ -0,0 +1,23 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { PermissionSetV2ResourceType } from "./PermissionSetV2ResourceType.js"; + +export const PermissionSetV2: core.serialization.ObjectSchema< + serializers.PermissionSetV2.Raw, + TrueFoundry.PermissionSetV2 +> = core.serialization.object({ + id: core.serialization.string().optionalNullable(), + resourceType: PermissionSetV2ResourceType, + permissions: core.serialization.list(core.serialization.string()), +}); + +export declare namespace PermissionSetV2 { + export interface Raw { + id?: (string | null | undefined) | null; + resourceType: PermissionSetV2ResourceType.Raw; + permissions: string[]; + } +} diff --git a/src/serialization/types/PermissionSetV2ResourceType.ts b/src/serialization/types/PermissionSetV2ResourceType.ts new file mode 100644 index 00000000..69b63244 --- /dev/null +++ b/src/serialization/types/PermissionSetV2ResourceType.ts @@ -0,0 +1,99 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const PermissionSetV2ResourceType: core.serialization.Schema< + serializers.PermissionSetV2ResourceType.Raw, + TrueFoundry.PermissionSetV2ResourceType +> = core.serialization.enum_([ + "role", + "account", + "cluster", + "workspace", + "environment", + "secret-group", + "deployment", + "application", + "secret", + "docker-registry", + "tenant", + "vcs-integration", + "mlf-project", + "repository", + "provider-integration", + "team", + "service-account", + "llm-gateway", + "policy", + "role-binding", + "settings", + "provider-account", + "user", + "alert-config", + "alert-rule", + "gateway-config", + "gateway-controls", + "gateway-budget", + "gateway-policy", + "gateway-approval-request", + "tracing-project", + "tracing-application", + "agent", + "agent-app", + "agent-channel", + "gateway-installation", + "virtual-account", + "sso-based-identity", + "external-identity", + "mcp-server", + "external-identity-provider", + "agent-identity", +]); + +export declare namespace PermissionSetV2ResourceType { + export type Raw = + | "role" + | "account" + | "cluster" + | "workspace" + | "environment" + | "secret-group" + | "deployment" + | "application" + | "secret" + | "docker-registry" + | "tenant" + | "vcs-integration" + | "mlf-project" + | "repository" + | "provider-integration" + | "team" + | "service-account" + | "llm-gateway" + | "policy" + | "role-binding" + | "settings" + | "provider-account" + | "user" + | "alert-config" + | "alert-rule" + | "gateway-config" + | "gateway-controls" + | "gateway-budget" + | "gateway-policy" + | "gateway-approval-request" + | "tracing-project" + | "tracing-application" + | "agent" + | "agent-app" + | "agent-channel" + | "gateway-installation" + | "virtual-account" + | "sso-based-identity" + | "external-identity" + | "mcp-server" + | "external-identity-provider" + | "agent-identity"; +} diff --git a/src/serialization/types/Permissions.ts b/src/serialization/types/Permissions.ts index 3b1be49b..dedb9e96 100644 --- a/src/serialization/types/Permissions.ts +++ b/src/serialization/types/Permissions.ts @@ -1,13 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const Permissions: core.serialization.ObjectSchema = core.serialization.object({ - "resourceFqn": core.serialization.property("resource_fqn", core.serialization.string()), - "resourceType": core.serialization.property("resource_type", core.serialization.string()), - "roleId": core.serialization.property("role_id", core.serialization.string()) +export const Permissions: core.serialization.ObjectSchema = + core.serialization.object({ + resourceFqn: core.serialization.property("resource_fqn", core.serialization.string()), + resourceType: core.serialization.property("resource_type", core.serialization.string()), + roleId: core.serialization.property("role_id", core.serialization.string()), }); export declare namespace Permissions { diff --git a/src/serialization/types/PerplexityAiKeyAuth.ts b/src/serialization/types/PerplexityAiKeyAuth.ts index bd980d80..0ee763b5 100644 --- a/src/serialization/types/PerplexityAiKeyAuth.ts +++ b/src/serialization/types/PerplexityAiKeyAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const PerplexityAiKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) - }); +export const PerplexityAiKeyAuth: core.serialization.ObjectSchema< + serializers.PerplexityAiKeyAuth.Raw, + TrueFoundry.PerplexityAiKeyAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), +}); export declare namespace PerplexityAiKeyAuth { export interface Raw { diff --git a/src/serialization/types/PerplexityAiModel.ts b/src/serialization/types/PerplexityAiModel.ts index 6aad5ff7..dcf1a75c 100644 --- a/src/serialization/types/PerplexityAiModel.ts +++ b/src/serialization/types/PerplexityAiModel.ts @@ -1,19 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const PerplexityAiModel: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/model/perplexity-ai"), - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const PerplexityAiModel: core.serialization.ObjectSchema< + serializers.PerplexityAiModel.Raw, + TrueFoundry.PerplexityAiModel +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/model/perplexity-ai"), + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace PerplexityAiModel { export interface Raw { diff --git a/src/serialization/types/PerplexityAiProviderAccount.ts b/src/serialization/types/PerplexityAiProviderAccount.ts index 5dde9f71..0bab0773 100644 --- a/src/serialization/types/PerplexityAiProviderAccount.ts +++ b/src/serialization/types/PerplexityAiProviderAccount.ts @@ -1,22 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { OwnedBy } from "./OwnedBy.js"; import { PerplexityAiKeyAuth } from "./PerplexityAiKeyAuth.js"; import { PerplexityIntegrations } from "./PerplexityIntegrations.js"; -export const PerplexityAiProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/perplexity-ai"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", PerplexityAiKeyAuth), - "integrations": core.serialization.list(PerplexityIntegrations), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const PerplexityAiProviderAccount: core.serialization.ObjectSchema< + serializers.PerplexityAiProviderAccount.Raw, + TrueFoundry.PerplexityAiProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/perplexity-ai"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", PerplexityAiKeyAuth), + integrations: core.serialization.list(PerplexityIntegrations), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace PerplexityAiProviderAccount { export interface Raw { diff --git a/src/serialization/types/PerplexityIntegrations.ts b/src/serialization/types/PerplexityIntegrations.ts index 6e776f2f..9229d817 100644 --- a/src/serialization/types/PerplexityIntegrations.ts +++ b/src/serialization/types/PerplexityIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { PerplexityAiModel } from "./PerplexityAiModel.js"; -export const PerplexityIntegrations: core.serialization.ObjectSchema = PerplexityAiModel; +export const PerplexityIntegrations: core.serialization.ObjectSchema< + serializers.PerplexityIntegrations.Raw, + TrueFoundry.PerplexityIntegrations +> = PerplexityAiModel; export declare namespace PerplexityIntegrations { export type Raw = PerplexityAiModel.Raw; diff --git a/src/serialization/types/PersonalAccessTokenManifest.ts b/src/serialization/types/PersonalAccessTokenManifest.ts index b7e07041..bfced456 100644 --- a/src/serialization/types/PersonalAccessTokenManifest.ts +++ b/src/serialization/types/PersonalAccessTokenManifest.ts @@ -1,19 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { PersonalAccessTokenManifestTokenType } from "./PersonalAccessTokenManifestTokenType.js"; import { VirtualAccountOwnedBy } from "./VirtualAccountOwnedBy.js"; -export const PersonalAccessTokenManifest: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "type": core.serialization.stringLiteral("pat"), - "expirationDate": core.serialization.property("expiration_date", core.serialization.string().optional()), - "userFqn": core.serialization.property("user_fqn", core.serialization.string()), - "ownedBy": VirtualAccountOwnedBy.optional(), - "tokenType": core.serialization.property("token_type", PersonalAccessTokenManifestTokenType.optional()) - }); +export const PersonalAccessTokenManifest: core.serialization.ObjectSchema< + serializers.PersonalAccessTokenManifest.Raw, + TrueFoundry.PersonalAccessTokenManifest +> = core.serialization.object({ + name: core.serialization.string(), + type: core.serialization.stringLiteral("pat"), + expirationDate: core.serialization.property("expiration_date", core.serialization.string().optional()), + userFqn: core.serialization.property("user_fqn", core.serialization.string()), + ownedBy: VirtualAccountOwnedBy.optional(), + tokenType: core.serialization.property("token_type", PersonalAccessTokenManifestTokenType.optional()), +}); export declare namespace PersonalAccessTokenManifest { export interface Raw { diff --git a/src/serialization/types/PersonalAccessTokenManifestTokenType.ts b/src/serialization/types/PersonalAccessTokenManifestTokenType.ts index 5e0f7220..41bba06d 100644 --- a/src/serialization/types/PersonalAccessTokenManifestTokenType.ts +++ b/src/serialization/types/PersonalAccessTokenManifestTokenType.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const PersonalAccessTokenManifestTokenType: core.serialization.Schema = core.serialization.enum_(["jwt", "opaque"]); +export const PersonalAccessTokenManifestTokenType: core.serialization.Schema< + serializers.PersonalAccessTokenManifestTokenType.Raw, + TrueFoundry.PersonalAccessTokenManifestTokenType +> = core.serialization.enum_(["jwt", "opaque"]); export declare namespace PersonalAccessTokenManifestTokenType { export type Raw = "jwt" | "opaque"; diff --git a/src/serialization/types/Pip.ts b/src/serialization/types/Pip.ts index 51d487d8..e42eee3d 100644 --- a/src/serialization/types/Pip.ts +++ b/src/serialization/types/Pip.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; export const Pip: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("pip"), - "requirementsPath": core.serialization.property("requirements_path", core.serialization.string().optional()), - "pipPackages": core.serialization.property("pip_packages", core.serialization.list(core.serialization.string()).optional()) - }); + type: core.serialization.stringLiteral("pip"), + requirementsPath: core.serialization.property("requirements_path", core.serialization.string().optional()), + pipPackages: core.serialization.property( + "pip_packages", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace Pip { export interface Raw { diff --git a/src/serialization/types/Poetry.ts b/src/serialization/types/Poetry.ts index 7ed30b1e..8e4fdf07 100644 --- a/src/serialization/types/Poetry.ts +++ b/src/serialization/types/Poetry.ts @@ -1,13 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const Poetry: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("poetry"), - "poetryVersion": core.serialization.property("poetry_version", core.serialization.string().optional()), - "installOptions": core.serialization.property("install_options", core.serialization.string().optional()) +export const Poetry: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("poetry"), + poetryVersion: core.serialization.property("poetry_version", core.serialization.string().optional()), + installOptions: core.serialization.property("install_options", core.serialization.string().optional()), }); export declare namespace Poetry { diff --git a/src/serialization/types/Policy.ts b/src/serialization/types/Policy.ts new file mode 100644 index 00000000..ca1fdd8d --- /dev/null +++ b/src/serialization/types/Policy.ts @@ -0,0 +1,30 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { PolicyVersion } from "./PolicyVersion.js"; +import { Subject } from "./Subject.js"; + +export const Policy: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string().optionalNullable(), + name: core.serialization.string(), + tenantName: core.serialization.string(), + activeVersion: core.serialization.number(), + activePolicyVersion: PolicyVersion.optionalNullable(), + createdBySubject: Subject, + createdBy: core.serialization.string().optionalNullable(), + }); + +export declare namespace Policy { + export interface Raw { + id?: (string | null | undefined) | null; + name: string; + tenantName: string; + activeVersion: number; + activePolicyVersion?: (PolicyVersion.Raw | null | undefined) | null; + createdBySubject: Subject.Raw; + createdBy?: (string | null | undefined) | null; + } +} diff --git a/src/serialization/types/PolicyActions.ts b/src/serialization/types/PolicyActions.ts index fd47332e..15b40d47 100644 --- a/src/serialization/types/PolicyActions.ts +++ b/src/serialization/types/PolicyActions.ts @@ -1,10 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const PolicyActions: core.serialization.Schema = core.serialization.stringLiteral("apply"); +export const PolicyActions: core.serialization.Schema = + core.serialization.stringLiteral("apply"); export declare namespace PolicyActions { export type Raw = "apply"; diff --git a/src/serialization/types/PolicyEntityTypes.ts b/src/serialization/types/PolicyEntityTypes.ts index db5cb48d..13877f32 100644 --- a/src/serialization/types/PolicyEntityTypes.ts +++ b/src/serialization/types/PolicyEntityTypes.ts @@ -1,10 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const PolicyEntityTypes: core.serialization.Schema = core.serialization.enum_(["service", "async-service", "job", "notebook", "ssh-server", "workflow", "helm", "volume"]); +export const PolicyEntityTypes: core.serialization.Schema< + serializers.PolicyEntityTypes.Raw, + TrueFoundry.PolicyEntityTypes +> = core.serialization.enum_([ + "service", + "async-service", + "job", + "notebook", + "ssh-server", + "workflow", + "helm", + "volume", +]); export declare namespace PolicyEntityTypes { export type Raw = "service" | "async-service" | "job" | "notebook" | "ssh-server" | "workflow" | "helm" | "volume"; diff --git a/src/serialization/types/PolicyFilters.ts b/src/serialization/types/PolicyFilters.ts index d1870a9f..4a014494 100644 --- a/src/serialization/types/PolicyFilters.ts +++ b/src/serialization/types/PolicyFilters.ts @@ -1,13 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const PolicyFilters: core.serialization.ObjectSchema = core.serialization.object({ - "clusterNames": core.serialization.property("cluster_names", core.serialization.list(core.serialization.string()).optional()), - "workspaceNames": core.serialization.property("workspace_names", core.serialization.list(core.serialization.string()).optional()), - "envNames": core.serialization.property("env_names", core.serialization.list(core.serialization.string()).optional()) +export const PolicyFilters: core.serialization.ObjectSchema = + core.serialization.object({ + clusterNames: core.serialization.property( + "cluster_names", + core.serialization.list(core.serialization.string()).optional(), + ), + workspaceNames: core.serialization.property( + "workspace_names", + core.serialization.list(core.serialization.string()).optional(), + ), + envNames: core.serialization.property( + "env_names", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace PolicyFilters { diff --git a/src/serialization/types/PolicyManifest.ts b/src/serialization/types/PolicyManifest.ts index f59f8c86..4d7319d0 100644 --- a/src/serialization/types/PolicyManifest.ts +++ b/src/serialization/types/PolicyManifest.ts @@ -1,25 +1,28 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { PolicyActions } from "./PolicyActions.js"; import { PolicyEntityTypes } from "./PolicyEntityTypes.js"; import { PolicyFilters } from "./PolicyFilters.js"; import { PolicyManifestMode } from "./PolicyManifestMode.js"; import { PolicyManifestOperation } from "./PolicyManifestOperation.js"; -export const PolicyManifest: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("policy"), - "name": core.serialization.string(), - "description": core.serialization.string(), - "operation": PolicyManifestOperation, - "mode": PolicyManifestMode, - "entities": core.serialization.list(PolicyEntityTypes), - "actions": core.serialization.list(PolicyActions), - "filters": PolicyFilters.optional(), - "code": core.serialization.string() - }); +export const PolicyManifest: core.serialization.ObjectSchema< + serializers.PolicyManifest.Raw, + TrueFoundry.PolicyManifest +> = core.serialization.object({ + type: core.serialization.stringLiteral("policy"), + name: core.serialization.string(), + description: core.serialization.string(), + operation: PolicyManifestOperation, + mode: PolicyManifestMode, + entities: core.serialization.list(PolicyEntityTypes), + actions: core.serialization.list(PolicyActions), + filters: PolicyFilters.optional(), + code: core.serialization.string(), +}); export declare namespace PolicyManifest { export interface Raw { diff --git a/src/serialization/types/PolicyManifestMode.ts b/src/serialization/types/PolicyManifestMode.ts index cd07c805..29cec321 100644 --- a/src/serialization/types/PolicyManifestMode.ts +++ b/src/serialization/types/PolicyManifestMode.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const PolicyManifestMode: core.serialization.Schema = core.serialization.enum_(["audit", "enforce", "disabled"]); +export const PolicyManifestMode: core.serialization.Schema< + serializers.PolicyManifestMode.Raw, + TrueFoundry.PolicyManifestMode +> = core.serialization.enum_(["audit", "enforce", "disabled"]); export declare namespace PolicyManifestMode { export type Raw = "audit" | "enforce" | "disabled"; diff --git a/src/serialization/types/PolicyManifestOperation.ts b/src/serialization/types/PolicyManifestOperation.ts index 4e7e8770..352f5fe2 100644 --- a/src/serialization/types/PolicyManifestOperation.ts +++ b/src/serialization/types/PolicyManifestOperation.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { PolicyMutationOperation } from "./PolicyMutationOperation.js"; import { PolicyValidationOperation } from "./PolicyValidationOperation.js"; -export const PolicyManifestOperation: core.serialization.Schema = core.serialization.undiscriminatedUnion([PolicyMutationOperation, PolicyValidationOperation]); +export const PolicyManifestOperation: core.serialization.Schema< + serializers.PolicyManifestOperation.Raw, + TrueFoundry.PolicyManifestOperation +> = core.serialization.undiscriminatedUnion([PolicyMutationOperation, PolicyValidationOperation]); export declare namespace PolicyManifestOperation { export type Raw = PolicyMutationOperation.Raw | PolicyValidationOperation.Raw; diff --git a/src/serialization/types/PolicyMutationOperation.ts b/src/serialization/types/PolicyMutationOperation.ts index 89cf5cd3..4bf7e6e2 100644 --- a/src/serialization/types/PolicyMutationOperation.ts +++ b/src/serialization/types/PolicyMutationOperation.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const PolicyMutationOperation: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("mutate"), - "order": core.serialization.number() - }); +export const PolicyMutationOperation: core.serialization.ObjectSchema< + serializers.PolicyMutationOperation.Raw, + TrueFoundry.PolicyMutationOperation +> = core.serialization.object({ + type: core.serialization.stringLiteral("mutate"), + order: core.serialization.number(), +}); export declare namespace PolicyMutationOperation { export interface Raw { diff --git a/src/serialization/types/PolicyValidationOperation.ts b/src/serialization/types/PolicyValidationOperation.ts index f1aefe6a..a00ad1bb 100644 --- a/src/serialization/types/PolicyValidationOperation.ts +++ b/src/serialization/types/PolicyValidationOperation.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const PolicyValidationOperation: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("validate") - }); +export const PolicyValidationOperation: core.serialization.ObjectSchema< + serializers.PolicyValidationOperation.Raw, + TrueFoundry.PolicyValidationOperation +> = core.serialization.object({ + type: core.serialization.stringLiteral("validate"), +}); export declare namespace PolicyValidationOperation { export interface Raw { diff --git a/src/serialization/types/PolicyVersion.ts b/src/serialization/types/PolicyVersion.ts new file mode 100644 index 00000000..dfeda995 --- /dev/null +++ b/src/serialization/types/PolicyVersion.ts @@ -0,0 +1,25 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { Subject } from "./Subject.js"; + +export const PolicyVersion: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string().optionalNullable(), + policyId: core.serialization.string(), + manifest: core.serialization.record(core.serialization.string(), core.serialization.unknown()), + version: core.serialization.number(), + createdBySubject: Subject.optionalNullable(), + }); + +export declare namespace PolicyVersion { + export interface Raw { + id?: (string | null | undefined) | null; + policyId: string; + manifest: Record; + version: number; + createdBySubject?: (Subject.Raw | null | undefined) | null; + } +} diff --git a/src/serialization/types/Port.ts b/src/serialization/types/Port.ts index 0a9bac75..66cb5078 100644 --- a/src/serialization/types/Port.ts +++ b/src/serialization/types/Port.ts @@ -1,22 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { PortAppProtocol } from "./PortAppProtocol.js"; import { PortAuth } from "./PortAuth.js"; import { PortProtocol } from "./PortProtocol.js"; export const Port: core.serialization.ObjectSchema = core.serialization.object({ - "port": core.serialization.number(), - "protocol": PortProtocol, - "expose": core.serialization.boolean(), - "appProtocol": core.serialization.property("app_protocol", PortAppProtocol.optional()), - "host": core.serialization.string().optional(), - "path": core.serialization.string().optional(), - "rewritePathTo": core.serialization.property("rewrite_path_to", core.serialization.string().optional()), - "auth": PortAuth.optional() - }); + port: core.serialization.number(), + protocol: PortProtocol, + expose: core.serialization.boolean(), + appProtocol: core.serialization.property("app_protocol", PortAppProtocol.optional()), + host: core.serialization.string().optional(), + path: core.serialization.string().optional(), + rewritePathTo: core.serialization.property("rewrite_path_to", core.serialization.string().optional()), + auth: PortAuth.optional(), +}); export declare namespace Port { export interface Raw { diff --git a/src/serialization/types/PortAppProtocol.ts b/src/serialization/types/PortAppProtocol.ts index 6c9f2f35..c0cb0b45 100644 --- a/src/serialization/types/PortAppProtocol.ts +++ b/src/serialization/types/PortAppProtocol.ts @@ -1,10 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const PortAppProtocol: core.serialization.Schema = core.serialization.enum_(["http", "grpc", "tcp"]); +export const PortAppProtocol: core.serialization.Schema = + core.serialization.enum_(["http", "grpc", "tcp"]); export declare namespace PortAppProtocol { export type Raw = "http" | "grpc" | "tcp"; diff --git a/src/serialization/types/PortAuth.ts b/src/serialization/types/PortAuth.ts index 2923c7e5..543d7e91 100644 --- a/src/serialization/types/PortAuth.ts +++ b/src/serialization/types/PortAuth.ts @@ -1,13 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BasicAuthCreds } from "./BasicAuthCreds.js"; import { JwtAuthConfig } from "./JwtAuthConfig.js"; import { TrueFoundryInteractiveLogin } from "./TrueFoundryInteractiveLogin.js"; -export const PortAuth: core.serialization.Schema = core.serialization.undiscriminatedUnion([BasicAuthCreds, JwtAuthConfig, TrueFoundryInteractiveLogin]); +export const PortAuth: core.serialization.Schema = + core.serialization.undiscriminatedUnion([BasicAuthCreds, JwtAuthConfig, TrueFoundryInteractiveLogin]); export declare namespace PortAuth { export type Raw = BasicAuthCreds.Raw | JwtAuthConfig.Raw | TrueFoundryInteractiveLogin.Raw; diff --git a/src/serialization/types/PortProtocol.ts b/src/serialization/types/PortProtocol.ts index c25197e4..f8b43859 100644 --- a/src/serialization/types/PortProtocol.ts +++ b/src/serialization/types/PortProtocol.ts @@ -1,10 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const PortProtocol: core.serialization.Schema = core.serialization.enum_(["TCP", "UDP"]); +export const PortProtocol: core.serialization.Schema = + core.serialization.enum_(["TCP", "UDP"]); export declare namespace PortProtocol { export type Raw = "TCP" | "UDP"; diff --git a/src/serialization/types/PresetRegexPattern.ts b/src/serialization/types/PresetRegexPattern.ts index e7a45b40..a9fcd86e 100644 --- a/src/serialization/types/PresetRegexPattern.ts +++ b/src/serialization/types/PresetRegexPattern.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { PresetRegexPatternEnum } from "./PresetRegexPatternEnum.js"; -export const PresetRegexPattern: core.serialization.ObjectSchema = core.serialization.object({ - "presets": core.serialization.list(PresetRegexPatternEnum) - }); +export const PresetRegexPattern: core.serialization.ObjectSchema< + serializers.PresetRegexPattern.Raw, + TrueFoundry.PresetRegexPattern +> = core.serialization.object({ + presets: core.serialization.list(PresetRegexPatternEnum), +}); export declare namespace PresetRegexPattern { export interface Raw { diff --git a/src/serialization/types/PresetRegexPatternEnum.ts b/src/serialization/types/PresetRegexPatternEnum.ts index 6c90c561..7079a233 100644 --- a/src/serialization/types/PresetRegexPatternEnum.ts +++ b/src/serialization/types/PresetRegexPatternEnum.ts @@ -1,11 +1,101 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const PresetRegexPatternEnum: core.serialization.Schema = core.serialization.enum_(["us_ssn", "us_ssn_no_dash", "email", "us_phone", "visa", "mastercard", "amex", "discover", "credit_card", "aws_access_key", "aws_secret_key", "github_token", "slack_token", "generic_api_key", "ipv4", "ipv6", "url", "passport_us", "passport_uk", "passport_germany", "passport_france", "passport_netherlands", "passport_canada", "passport_india", "passport_australia", "passport_china", "passport_japan", "gender_sexual_orientation", "race_ethnicity_national_origin", "religion", "age_discrimination", "disability", "marital_family_status", "military_status", "public_assistance", "weapons_firearms", "weapons_other", "explosives", "violence_threats", "terrorism", "self_harm_suicide", "illegal_activities", "harassment_hate"]); +export const PresetRegexPatternEnum: core.serialization.Schema< + serializers.PresetRegexPatternEnum.Raw, + TrueFoundry.PresetRegexPatternEnum +> = core.serialization.enum_([ + "us_ssn", + "us_ssn_no_dash", + "email", + "us_phone", + "visa", + "mastercard", + "amex", + "discover", + "credit_card", + "aws_access_key", + "aws_secret_key", + "github_token", + "slack_token", + "generic_api_key", + "ipv4", + "ipv6", + "url", + "passport_us", + "passport_uk", + "passport_germany", + "passport_france", + "passport_netherlands", + "passport_canada", + "passport_india", + "passport_australia", + "passport_china", + "passport_japan", + "gender_sexual_orientation", + "race_ethnicity_national_origin", + "religion", + "age_discrimination", + "disability", + "marital_family_status", + "military_status", + "public_assistance", + "weapons_firearms", + "weapons_other", + "explosives", + "violence_threats", + "terrorism", + "self_harm_suicide", + "illegal_activities", + "harassment_hate", +]); export declare namespace PresetRegexPatternEnum { - export type Raw = "us_ssn" | "us_ssn_no_dash" | "email" | "us_phone" | "visa" | "mastercard" | "amex" | "discover" | "credit_card" | "aws_access_key" | "aws_secret_key" | "github_token" | "slack_token" | "generic_api_key" | "ipv4" | "ipv6" | "url" | "passport_us" | "passport_uk" | "passport_germany" | "passport_france" | "passport_netherlands" | "passport_canada" | "passport_india" | "passport_australia" | "passport_china" | "passport_japan" | "gender_sexual_orientation" | "race_ethnicity_national_origin" | "religion" | "age_discrimination" | "disability" | "marital_family_status" | "military_status" | "public_assistance" | "weapons_firearms" | "weapons_other" | "explosives" | "violence_threats" | "terrorism" | "self_harm_suicide" | "illegal_activities" | "harassment_hate"; + export type Raw = + | "us_ssn" + | "us_ssn_no_dash" + | "email" + | "us_phone" + | "visa" + | "mastercard" + | "amex" + | "discover" + | "credit_card" + | "aws_access_key" + | "aws_secret_key" + | "github_token" + | "slack_token" + | "generic_api_key" + | "ipv4" + | "ipv6" + | "url" + | "passport_us" + | "passport_uk" + | "passport_germany" + | "passport_france" + | "passport_netherlands" + | "passport_canada" + | "passport_india" + | "passport_australia" + | "passport_china" + | "passport_japan" + | "gender_sexual_orientation" + | "race_ethnicity_national_origin" + | "religion" + | "age_discrimination" + | "disability" + | "marital_family_status" + | "military_status" + | "public_assistance" + | "weapons_firearms" + | "weapons_other" + | "explosives" + | "violence_threats" + | "terrorism" + | "self_harm_suicide" + | "illegal_activities" + | "harassment_hate"; } diff --git a/src/serialization/types/PresignedUrlObject.ts b/src/serialization/types/PresignedUrlObject.ts index 48a173e0..89dfc811 100644 --- a/src/serialization/types/PresignedUrlObject.ts +++ b/src/serialization/types/PresignedUrlObject.ts @@ -1,19 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const PresignedUrlObject: core.serialization.ObjectSchema = core.serialization.object({ - "uri": core.serialization.string(), - "url": core.serialization.string(), - "headers": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() - }); +export const PresignedUrlObject: core.serialization.ObjectSchema< + serializers.PresignedUrlObject.Raw, + TrueFoundry.PresignedUrlObject +> = core.serialization.object({ + uri: core.serialization.string(), + url: core.serialization.string(), + headers: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optionalNullable(), +}); export declare namespace PresignedUrlObject { export interface Raw { uri: string; url: string; - headers?: Record | null; + headers?: (Record | null | undefined) | null; } } diff --git a/src/serialization/types/PriorityBasedLoadBalanceTarget.ts b/src/serialization/types/PriorityBasedLoadBalanceTarget.ts index ca52ac1a..68713e4e 100644 --- a/src/serialization/types/PriorityBasedLoadBalanceTarget.ts +++ b/src/serialization/types/PriorityBasedLoadBalanceTarget.ts @@ -1,23 +1,35 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { HeadersOverride } from "./HeadersOverride.js"; import { RetryConfig } from "./RetryConfig.js"; import { SlaCutoff } from "./SlaCutoff.js"; -export const PriorityBasedLoadBalanceTarget: core.serialization.ObjectSchema = core.serialization.object({ - "target": core.serialization.string(), - "priority": core.serialization.number(), - "slaCutoff": core.serialization.property("sla_cutoff", SlaCutoff.optional()), - "retryConfig": core.serialization.property("retry_config", RetryConfig.optional()), - "fallbackStatusCodes": core.serialization.property("fallback_status_codes", core.serialization.list(core.serialization.string()).optional()), - "fallbackCandidate": core.serialization.property("fallback_candidate", core.serialization.boolean().optional()), - "overrideParams": core.serialization.property("override_params", core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional()), - "headersOverride": core.serialization.property("headers_override", HeadersOverride.optional()), - "metadataMatch": core.serialization.property("metadata_match", core.serialization.record(core.serialization.string(), core.serialization.string()).optional()) - }); +export const PriorityBasedLoadBalanceTarget: core.serialization.ObjectSchema< + serializers.PriorityBasedLoadBalanceTarget.Raw, + TrueFoundry.PriorityBasedLoadBalanceTarget +> = core.serialization.object({ + target: core.serialization.string(), + priority: core.serialization.number(), + slaCutoff: core.serialization.property("sla_cutoff", SlaCutoff.optional()), + retryConfig: core.serialization.property("retry_config", RetryConfig.optional()), + fallbackStatusCodes: core.serialization.property( + "fallback_status_codes", + core.serialization.list(core.serialization.string()).optional(), + ), + fallbackCandidate: core.serialization.property("fallback_candidate", core.serialization.boolean().optional()), + overrideParams: core.serialization.property( + "override_params", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + ), + headersOverride: core.serialization.property("headers_override", HeadersOverride.optional()), + metadataMatch: core.serialization.property( + "metadata_match", + core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), + ), +}); export declare namespace PriorityBasedLoadBalanceTarget { export interface Raw { diff --git a/src/serialization/types/PriorityBasedLoadBalancing.ts b/src/serialization/types/PriorityBasedLoadBalancing.ts index 714680a9..94f0ed1f 100644 --- a/src/serialization/types/PriorityBasedLoadBalancing.ts +++ b/src/serialization/types/PriorityBasedLoadBalancing.ts @@ -1,14 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { PriorityBasedLoadBalanceTarget } from "./PriorityBasedLoadBalanceTarget.js"; -export const PriorityBasedLoadBalancing: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("priority-based-routing"), - "loadBalanceTargets": core.serialization.property("load_balance_targets", core.serialization.list(PriorityBasedLoadBalanceTarget)) - }); +export const PriorityBasedLoadBalancing: core.serialization.ObjectSchema< + serializers.PriorityBasedLoadBalancing.Raw, + TrueFoundry.PriorityBasedLoadBalancing +> = core.serialization.object({ + type: core.serialization.stringLiteral("priority-based-routing"), + loadBalanceTargets: core.serialization.property( + "load_balance_targets", + core.serialization.list(PriorityBasedLoadBalanceTarget), + ), +}); export declare namespace PriorityBasedLoadBalancing { export interface Raw { diff --git a/src/serialization/types/PriorityBasedLoadBalancingRule.ts b/src/serialization/types/PriorityBasedLoadBalancingRule.ts index 95d80b59..8d6fc7e5 100644 --- a/src/serialization/types/PriorityBasedLoadBalancingRule.ts +++ b/src/serialization/types/PriorityBasedLoadBalancingRule.ts @@ -1,15 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { LoadBalancingWhen } from "./LoadBalancingWhen.js"; import { PriorityBasedLoadBalancing } from "./PriorityBasedLoadBalancing.js"; -export const PriorityBasedLoadBalancingRule: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string(), - "when": LoadBalancingWhen - }).extend(PriorityBasedLoadBalancing); +export const PriorityBasedLoadBalancingRule: core.serialization.ObjectSchema< + serializers.PriorityBasedLoadBalancingRule.Raw, + TrueFoundry.PriorityBasedLoadBalancingRule +> = core.serialization + .object({ + id: core.serialization.string(), + when: LoadBalancingWhen, + }) + .extend(PriorityBasedLoadBalancing); export declare namespace PriorityBasedLoadBalancingRule { export interface Raw extends PriorityBasedLoadBalancing.Raw { diff --git a/src/serialization/types/PrivatePricingTier.ts b/src/serialization/types/PrivatePricingTier.ts index b492a614..afce40c8 100644 --- a/src/serialization/types/PrivatePricingTier.ts +++ b/src/serialization/types/PrivatePricingTier.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { NonNegativeFloat } from "./NonNegativeFloat.js"; -export const PrivatePricingTier: core.serialization.ObjectSchema = core.serialization.object({ - "from": core.serialization.number(), - "costPerToken": core.serialization.property("cost_per_token", NonNegativeFloat) - }); +export const PrivatePricingTier: core.serialization.ObjectSchema< + serializers.PrivatePricingTier.Raw, + TrueFoundry.PrivatePricingTier +> = core.serialization.object({ + from: core.serialization.number(), + costPerToken: core.serialization.property("cost_per_token", NonNegativeFloat), +}); export declare namespace PrivatePricingTier { export interface Raw { diff --git a/src/serialization/types/PrometheusAlertRule.ts b/src/serialization/types/PrometheusAlertRule.ts index 24dadbaf..de002607 100644 --- a/src/serialization/types/PrometheusAlertRule.ts +++ b/src/serialization/types/PrometheusAlertRule.ts @@ -1,26 +1,29 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AlertSeverity } from "./AlertSeverity.js"; -export const PrometheusAlertRule: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("prometheus-alert-rule"), - "name": core.serialization.string(), - "expression": core.serialization.string(), - "for": core.serialization.number(), - "severity": AlertSeverity, - "description": core.serialization.string().optional(), - "notificationEnabled": core.serialization.property("notification_enabled", core.serialization.boolean()) - }); +export const PrometheusAlertRule: core.serialization.ObjectSchema< + serializers.PrometheusAlertRule.Raw, + TrueFoundry.PrometheusAlertRule +> = core.serialization.object({ + type: core.serialization.stringLiteral("prometheus-alert-rule"), + name: core.serialization.string(), + expression: core.serialization.string(), + for: core.serialization.number(), + severity: AlertSeverity, + description: core.serialization.string().optional(), + notificationEnabled: core.serialization.property("notification_enabled", core.serialization.boolean()), +}); export declare namespace PrometheusAlertRule { export interface Raw { type: "prometheus-alert-rule"; name: string; expression: string; - "for": number; + for: number; severity: AlertSeverity.Raw; description?: string | null; notification_enabled: boolean; diff --git a/src/serialization/types/Prompt.ts b/src/serialization/types/Prompt.ts index 9706eedf..8d04f9c7 100644 --- a/src/serialization/types/Prompt.ts +++ b/src/serialization/types/Prompt.ts @@ -1,22 +1,26 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { PromptVersion } from "./PromptVersion.js"; import { Subject } from "./Subject.js"; -export const Prompt: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string(), - "mlRepoId": core.serialization.property("ml_repo_id", core.serialization.string()), - "type": core.serialization.stringLiteral("chat_prompt").optional(), - "name": core.serialization.string(), - "fqn": core.serialization.string(), - "createdBySubject": core.serialization.property("created_by_subject", Subject), - "createdAt": core.serialization.property("created_at", core.serialization.date().optional()), - "updatedAt": core.serialization.property("updated_at", core.serialization.date().optional()), - "latestVersion": core.serialization.property("latest_version", PromptVersion.optional()), - "runSteps": core.serialization.property("run_steps", core.serialization.list(core.serialization.number()).optional()) +export const Prompt: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string(), + mlRepoId: core.serialization.property("ml_repo_id", core.serialization.string()), + type: core.serialization.stringLiteral("chat_prompt").optional(), + name: core.serialization.string(), + fqn: core.serialization.string(), + createdBySubject: core.serialization.property("created_by_subject", Subject), + createdAt: core.serialization.property("created_at", core.serialization.date().optionalNullable()), + updatedAt: core.serialization.property("updated_at", core.serialization.date().optionalNullable()), + latestVersion: core.serialization.property("latest_version", PromptVersion.optionalNullable()), + runSteps: core.serialization.property( + "run_steps", + core.serialization.list(core.serialization.number()).optionalNullable(), + ), }); export declare namespace Prompt { @@ -27,9 +31,9 @@ export declare namespace Prompt { name: string; fqn: string; created_by_subject: Subject.Raw; - created_at?: string | null; - updated_at?: string | null; - latest_version?: PromptVersion.Raw | null; - run_steps?: number[] | null; + created_at?: (string | null | undefined) | null; + updated_at?: (string | null | undefined) | null; + latest_version?: (PromptVersion.Raw | null | undefined) | null; + run_steps?: (number[] | null | undefined) | null; } } diff --git a/src/serialization/types/PromptSource.ts b/src/serialization/types/PromptSource.ts index 1b77d45a..03912e07 100644 --- a/src/serialization/types/PromptSource.ts +++ b/src/serialization/types/PromptSource.ts @@ -1,14 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { A2AAgentSkill } from "./A2AAgentSkill.js"; -export const PromptSource: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("prompt"), - "promptVersionFqn": core.serialization.property("prompt_version_fqn", core.serialization.string()), - "skills": core.serialization.list(A2AAgentSkill).optional() +export const PromptSource: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("prompt"), + promptVersionFqn: core.serialization.property("prompt_version_fqn", core.serialization.string()), + skills: core.serialization.list(A2AAgentSkill).optional(), }); export declare namespace PromptSource { diff --git a/src/serialization/types/PromptVersion.ts b/src/serialization/types/PromptVersion.ts index 2371c871..7fa3ee2f 100644 --- a/src/serialization/types/PromptVersion.ts +++ b/src/serialization/types/PromptVersion.ts @@ -1,36 +1,43 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ChatPromptManifest } from "./ChatPromptManifest.js"; import { Subject } from "./Subject.js"; import { UsageCodeSnippet } from "./UsageCodeSnippet.js"; -export const PromptVersion: core.serialization.ObjectSchema = core.serialization.object({ - "createdAt": core.serialization.property("created_at", core.serialization.date().optional()), - "updatedAt": core.serialization.property("updated_at", core.serialization.date().optional()), - "manifest": ChatPromptManifest, - "id": core.serialization.string(), - "fqn": core.serialization.string(), - "createdBySubject": core.serialization.property("created_by_subject", Subject), - "mlRepoId": core.serialization.property("ml_repo_id", core.serialization.string()), - "usageCodeSnippet": core.serialization.property("usage_code_snippet", core.serialization.string().optional()), - "usageCodeSnippets": core.serialization.property("usage_code_snippets", core.serialization.list(UsageCodeSnippet).optional()), - "tags": core.serialization.list(core.serialization.string()).optional(), - "promptId": core.serialization.property("prompt_id", core.serialization.string()) +export const PromptVersion: core.serialization.ObjectSchema = + core.serialization.object({ + createdAt: core.serialization.property("created_at", core.serialization.date().optionalNullable()), + updatedAt: core.serialization.property("updated_at", core.serialization.date().optionalNullable()), + manifest: ChatPromptManifest, + id: core.serialization.string(), + fqn: core.serialization.string(), + createdBySubject: core.serialization.property("created_by_subject", Subject), + mlRepoId: core.serialization.property("ml_repo_id", core.serialization.string()), + usageCodeSnippet: core.serialization.property( + "usage_code_snippet", + core.serialization.string().optionalNullable(), + ), + usageCodeSnippets: core.serialization.property( + "usage_code_snippets", + core.serialization.list(UsageCodeSnippet).optional(), + ), + tags: core.serialization.list(core.serialization.string()).optional(), + promptId: core.serialization.property("prompt_id", core.serialization.string()), }); export declare namespace PromptVersion { export interface Raw { - created_at?: string | null; - updated_at?: string | null; + created_at?: (string | null | undefined) | null; + updated_at?: (string | null | undefined) | null; manifest: ChatPromptManifest.Raw; id: string; fqn: string; created_by_subject: Subject.Raw; ml_repo_id: string; - usage_code_snippet?: string | null; + usage_code_snippet?: (string | null | undefined) | null; usage_code_snippets?: UsageCodeSnippet.Raw[] | null; tags?: string[] | null; prompt_id: string; diff --git a/src/serialization/types/ProviderAccount.ts b/src/serialization/types/ProviderAccount.ts new file mode 100644 index 00000000..e509de8a --- /dev/null +++ b/src/serialization/types/ProviderAccount.ts @@ -0,0 +1,40 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import * as serializers from "../index.js"; +import { ProviderAccountProvider } from "./ProviderAccountProvider.js"; +import { Subject } from "./Subject.js"; + +export const ProviderAccount: core.serialization.ObjectSchema< + serializers.ProviderAccount.Raw, + TrueFoundry.ProviderAccount +> = core.serialization.object({ + id: core.serialization.string().optionalNullable(), + fqn: core.serialization.string(), + provider: ProviderAccountProvider, + manifest: core.serialization.record(core.serialization.string(), core.serialization.unknown()), + integrations: core.serialization + .list(core.serialization.lazyObject(() => serializers.ProviderIntegration)) + .optionalNullable(), + createdBySubject: Subject.optionalNullable(), + accountId: core.serialization.string(), + createdAt: core.serialization.date().optionalNullable(), + updatedAt: core.serialization.date().optionalNullable(), + createdBy: core.serialization.string().optionalNullable(), +}); + +export declare namespace ProviderAccount { + export interface Raw { + id?: (string | null | undefined) | null; + fqn: string; + provider: ProviderAccountProvider.Raw; + manifest: Record; + integrations?: (serializers.ProviderIntegration.Raw[] | null | undefined) | null; + createdBySubject?: (Subject.Raw | null | undefined) | null; + accountId: string; + createdAt?: (string | null | undefined) | null; + updatedAt?: (string | null | undefined) | null; + createdBy?: (string | null | undefined) | null; + } +} diff --git a/src/serialization/types/ProviderAccountProvider.ts b/src/serialization/types/ProviderAccountProvider.ts new file mode 100644 index 00000000..2d1be5dc --- /dev/null +++ b/src/serialization/types/ProviderAccountProvider.ts @@ -0,0 +1,129 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const ProviderAccountProvider: core.serialization.Schema< + serializers.ProviderAccountProvider.Raw, + TrueFoundry.ProviderAccountProvider +> = core.serialization.enum_([ + "aws", + "gcp", + "azure", + "dockerhub", + "openai", + "databricks", + "truefoundry", + "jfrog", + "ttl", + "custom", + "quay", + "github", + "gitlab", + "bitbucket", + "bitbucket_data_center", + "ai21", + "cohere", + "anthropic", + "anyscale", + "deepinfra", + "groq", + "mistral-ai", + "nomic", + "palm", + "perplexity-ai", + "together-ai", + "ollama", + "slack", + "aws-bedrock", + "google-vertex", + "google-gemini", + "azure-openai", + "azure-foundry", + "self-hosted-model", + "mcp-server-group", + "pagerduty", + "ms-teams", + "model-provider-accounts", + "guardrail-config-group", + "openrouter", + "sambanova", + "aws-sagemaker", + "cerebras", + "wafer", + "hashicorp", + "snowflake-cortex", + "cloudera", + "xai", + "baseten", + "virtual-model", + "elevenlabs", + "deepgram", + "cartesia", + "custom-endpoint", + "smallest-ai", + "aws-claude-platform", + "aws-bedrock-mantle", +]); + +export declare namespace ProviderAccountProvider { + export type Raw = + | "aws" + | "gcp" + | "azure" + | "dockerhub" + | "openai" + | "databricks" + | "truefoundry" + | "jfrog" + | "ttl" + | "custom" + | "quay" + | "github" + | "gitlab" + | "bitbucket" + | "bitbucket_data_center" + | "ai21" + | "cohere" + | "anthropic" + | "anyscale" + | "deepinfra" + | "groq" + | "mistral-ai" + | "nomic" + | "palm" + | "perplexity-ai" + | "together-ai" + | "ollama" + | "slack" + | "aws-bedrock" + | "google-vertex" + | "google-gemini" + | "azure-openai" + | "azure-foundry" + | "self-hosted-model" + | "mcp-server-group" + | "pagerduty" + | "ms-teams" + | "model-provider-accounts" + | "guardrail-config-group" + | "openrouter" + | "sambanova" + | "aws-sagemaker" + | "cerebras" + | "wafer" + | "hashicorp" + | "snowflake-cortex" + | "cloudera" + | "xai" + | "baseten" + | "virtual-model" + | "elevenlabs" + | "deepgram" + | "cartesia" + | "custom-endpoint" + | "smallest-ai" + | "aws-claude-platform" + | "aws-bedrock-mantle"; +} diff --git a/src/serialization/types/ProviderAccounts.ts b/src/serialization/types/ProviderAccounts.ts index 12bc7514..a155ee75 100644 --- a/src/serialization/types/ProviderAccounts.ts +++ b/src/serialization/types/ProviderAccounts.ts @@ -1,15 +1,27 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GuardrailConfigGroup } from "./GuardrailConfigGroup.js"; import { InfraProviderAccount } from "./InfraProviderAccount.js"; import { McpServerProviderAccount } from "./McpServerProviderAccount.js"; import { ModelProviderAccount } from "./ModelProviderAccount.js"; -export const ProviderAccounts: core.serialization.Schema = core.serialization.undiscriminatedUnion([InfraProviderAccount, ModelProviderAccount, McpServerProviderAccount, GuardrailConfigGroup]); +export const ProviderAccounts: core.serialization.Schema< + serializers.ProviderAccounts.Raw, + TrueFoundry.ProviderAccounts +> = core.serialization.undiscriminatedUnion([ + InfraProviderAccount, + ModelProviderAccount, + McpServerProviderAccount, + GuardrailConfigGroup, +]); export declare namespace ProviderAccounts { - export type Raw = InfraProviderAccount.Raw | ModelProviderAccount.Raw | McpServerProviderAccount.Raw | GuardrailConfigGroup.Raw; + export type Raw = + | InfraProviderAccount.Raw + | ModelProviderAccount.Raw + | McpServerProviderAccount.Raw + | GuardrailConfigGroup.Raw; } diff --git a/src/serialization/types/ProviderIntegration.ts b/src/serialization/types/ProviderIntegration.ts new file mode 100644 index 00000000..2025c8c6 --- /dev/null +++ b/src/serialization/types/ProviderIntegration.ts @@ -0,0 +1,44 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import * as serializers from "../index.js"; +import { ProviderIntegrationType } from "./ProviderIntegrationType.js"; +import { Subject } from "./Subject.js"; + +export const ProviderIntegration: core.serialization.ObjectSchema< + serializers.ProviderIntegration.Raw, + TrueFoundry.ProviderIntegration +> = core.serialization.object({ + id: core.serialization.string(), + name: core.serialization.string(), + fqn: core.serialization.string(), + type: ProviderIntegrationType, + manifest: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optionalNullable(), + metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optionalNullable(), + providerAccountFqn: core.serialization.string(), + tenantName: core.serialization.string(), + providerAccount: core.serialization.lazyObject(() => serializers.ProviderAccount).optionalNullable(), + createdBySubject: Subject, + createdAt: core.serialization.date().optionalNullable(), + updatedAt: core.serialization.date().optionalNullable(), + createdBy: core.serialization.string().optionalNullable(), +}); + +export declare namespace ProviderIntegration { + export interface Raw { + id: string; + name: string; + fqn: string; + type: ProviderIntegrationType.Raw; + manifest?: (Record | null | undefined) | null; + metadata?: (Record | null | undefined) | null; + providerAccountFqn: string; + tenantName: string; + providerAccount?: (serializers.ProviderAccount.Raw | null | undefined) | null; + createdBySubject: Subject.Raw; + createdAt?: (string | null | undefined) | null; + updatedAt?: (string | null | undefined) | null; + createdBy?: (string | null | undefined) | null; + } +} diff --git a/src/serialization/types/ProviderIntegrationType.ts b/src/serialization/types/ProviderIntegrationType.ts new file mode 100644 index 00000000..ef3975f1 --- /dev/null +++ b/src/serialization/types/ProviderIntegrationType.ts @@ -0,0 +1,37 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const ProviderIntegrationType: core.serialization.Schema< + serializers.ProviderIntegrationType.Raw, + TrueFoundry.ProviderIntegrationType +> = core.serialization.enum_([ + "blob-storage", + "secret-store", + "docker-registry", + "model", + "vcs", + "cluster", + "notification-channel", + "helm-repo", + "jwt-auth", + "mcp-server", + "guardrail-config", +]); + +export declare namespace ProviderIntegrationType { + export type Raw = + | "blob-storage" + | "secret-store" + | "docker-registry" + | "model" + | "vcs" + | "cluster" + | "notification-channel" + | "helm-repo" + | "jwt-auth" + | "mcp-server" + | "guardrail-config"; +} diff --git a/src/serialization/types/PublicCostMetric.ts b/src/serialization/types/PublicCostMetric.ts index 452ad8d6..c285d1b5 100644 --- a/src/serialization/types/PublicCostMetric.ts +++ b/src/serialization/types/PublicCostMetric.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const PublicCostMetric: core.serialization.ObjectSchema = core.serialization.object({ - "metric": core.serialization.string() - }); +export const PublicCostMetric: core.serialization.ObjectSchema< + serializers.PublicCostMetric.Raw, + TrueFoundry.PublicCostMetric +> = core.serialization.object({ + metric: core.serialization.string(), +}); export declare namespace PublicCostMetric { export interface Raw { diff --git a/src/serialization/types/PySparkTaskConfig.ts b/src/serialization/types/PySparkTaskConfig.ts index de2f9741..0a0ae02f 100644 --- a/src/serialization/types/PySparkTaskConfig.ts +++ b/src/serialization/types/PySparkTaskConfig.ts @@ -1,32 +1,42 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; +import { PySparkTaskConfigImage } from "./PySparkTaskConfigImage.js"; import { SparkDriverConfig } from "./SparkDriverConfig.js"; import { SparkExecutorConfig } from "./SparkExecutorConfig.js"; -import { TaskPySparkBuild } from "./TaskPySparkBuild.js"; import { VolumeMount } from "./VolumeMount.js"; -export const PySparkTaskConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("pyspark-task-config"), - "image": TaskPySparkBuild, - "driverConfig": core.serialization.property("driver_config", SparkDriverConfig), - "executorConfig": core.serialization.property("executor_config", SparkExecutorConfig), - "sparkConf": core.serialization.property("spark_conf", core.serialization.record(core.serialization.string(), core.serialization.string()).optional()), - "env": core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), - "mounts": core.serialization.list(VolumeMount).optional(), - "serviceAccount": core.serialization.property("service_account", core.serialization.string().optional()) - }); +export const PySparkTaskConfig: core.serialization.ObjectSchema< + serializers.PySparkTaskConfig.Raw, + TrueFoundry.PySparkTaskConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("pyspark-task-config"), + image: PySparkTaskConfigImage, + driverConfig: core.serialization.property("driver_config", SparkDriverConfig), + executorConfig: core.serialization.property("executor_config", SparkExecutorConfig), + sparkConf: core.serialization.property( + "spark_conf", + core.serialization + .record(core.serialization.string(), core.serialization.string().nullable()) + .optionalNullable(), + ), + env: core.serialization + .record(core.serialization.string(), core.serialization.string().nullable()) + .optionalNullable(), + mounts: core.serialization.list(VolumeMount).optional(), + serviceAccount: core.serialization.property("service_account", core.serialization.string().optional()), +}); export declare namespace PySparkTaskConfig { export interface Raw { type: "pyspark-task-config"; - image: TaskPySparkBuild.Raw; + image: PySparkTaskConfigImage.Raw; driver_config: SparkDriverConfig.Raw; executor_config: SparkExecutorConfig.Raw; - spark_conf?: Record | null; - env?: Record | null; + spark_conf?: (Record | null | undefined) | null; + env?: (Record | null | undefined) | null; mounts?: VolumeMount.Raw[] | null; service_account?: string | null; } diff --git a/src/serialization/types/PySparkTaskConfigImage.ts b/src/serialization/types/PySparkTaskConfigImage.ts new file mode 100644 index 00000000..5a116afe --- /dev/null +++ b/src/serialization/types/PySparkTaskConfigImage.ts @@ -0,0 +1,16 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { TaskPySparkBuild } from "./TaskPySparkBuild.js"; +import { TaskSparkImage } from "./TaskSparkImage.js"; + +export const PySparkTaskConfigImage: core.serialization.Schema< + serializers.PySparkTaskConfigImage.Raw, + TrueFoundry.PySparkTaskConfigImage +> = core.serialization.undiscriminatedUnion([TaskPySparkBuild, TaskSparkImage]); + +export declare namespace PySparkTaskConfigImage { + export type Raw = TaskPySparkBuild.Raw | TaskSparkImage.Raw; +} diff --git a/src/serialization/types/PyTorchFramework.ts b/src/serialization/types/PyTorchFramework.ts index a72cc4e3..c0180322 100644 --- a/src/serialization/types/PyTorchFramework.ts +++ b/src/serialization/types/PyTorchFramework.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const PyTorchFramework: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("pytorch") - }); +export const PyTorchFramework: core.serialization.ObjectSchema< + serializers.PyTorchFramework.Raw, + TrueFoundry.PyTorchFramework +> = core.serialization.object({ + type: core.serialization.stringLiteral("pytorch"), +}); export declare namespace PyTorchFramework { export interface Raw { diff --git a/src/serialization/types/PythonBuild.ts b/src/serialization/types/PythonBuild.ts index 047f4632..ca497d00 100644 --- a/src/serialization/types/PythonBuild.ts +++ b/src/serialization/types/PythonBuild.ts @@ -1,21 +1,31 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { PythonBuildCommand } from "./PythonBuildCommand.js"; import { PythonBuildPythonDependencies } from "./PythonBuildPythonDependencies.js"; -export const PythonBuild: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("tfy-python-buildpack"), - "pythonVersion": core.serialization.property("python_version", core.serialization.string().optional()), - "buildContextPath": core.serialization.property("build_context_path", core.serialization.string()), - "requirementsPath": core.serialization.property("requirements_path", core.serialization.string().optional()), - "pipPackages": core.serialization.property("pip_packages", core.serialization.list(core.serialization.string()).optional()), - "pythonDependencies": core.serialization.property("python_dependencies", PythonBuildPythonDependencies.optional()), - "aptPackages": core.serialization.property("apt_packages", core.serialization.list(core.serialization.string()).optional()), - "command": PythonBuildCommand, - "cudaVersion": core.serialization.property("cuda_version", core.serialization.string().optional()) +export const PythonBuild: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("tfy-python-buildpack"), + pythonVersion: core.serialization.property("python_version", core.serialization.string().optional()), + buildContextPath: core.serialization.property("build_context_path", core.serialization.string()), + requirementsPath: core.serialization.property("requirements_path", core.serialization.string().optional()), + pipPackages: core.serialization.property( + "pip_packages", + core.serialization.list(core.serialization.string()).optional(), + ), + pythonDependencies: core.serialization.property( + "python_dependencies", + PythonBuildPythonDependencies.optional(), + ), + aptPackages: core.serialization.property( + "apt_packages", + core.serialization.list(core.serialization.string()).optional(), + ), + command: PythonBuildCommand, + cudaVersion: core.serialization.property("cuda_version", core.serialization.string().optional()), }); export declare namespace PythonBuild { diff --git a/src/serialization/types/PythonBuildCommand.ts b/src/serialization/types/PythonBuildCommand.ts index dc2ef733..20a309ce 100644 --- a/src/serialization/types/PythonBuildCommand.ts +++ b/src/serialization/types/PythonBuildCommand.ts @@ -1,10 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const PythonBuildCommand: core.serialization.Schema = core.serialization.undiscriminatedUnion([core.serialization.string(), core.serialization.list(core.serialization.string())]); +export const PythonBuildCommand: core.serialization.Schema< + serializers.PythonBuildCommand.Raw, + TrueFoundry.PythonBuildCommand +> = core.serialization.undiscriminatedUnion([ + core.serialization.string(), + core.serialization.list(core.serialization.string()), +]); export declare namespace PythonBuildCommand { export type Raw = string | string[]; diff --git a/src/serialization/types/PythonBuildPythonDependencies.ts b/src/serialization/types/PythonBuildPythonDependencies.ts index 3b094c72..9be8785f 100644 --- a/src/serialization/types/PythonBuildPythonDependencies.ts +++ b/src/serialization/types/PythonBuildPythonDependencies.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Pip } from "./Pip.js"; import { Poetry } from "./Poetry.js"; import { Uv } from "./Uv.js"; -export const PythonBuildPythonDependencies: core.serialization.Schema = core.serialization.undiscriminatedUnion([Pip, Uv, Poetry]); +export const PythonBuildPythonDependencies: core.serialization.Schema< + serializers.PythonBuildPythonDependencies.Raw, + TrueFoundry.PythonBuildPythonDependencies +> = core.serialization.undiscriminatedUnion([Pip, Uv, Poetry]); export declare namespace PythonBuildPythonDependencies { export type Raw = Pip.Raw | Uv.Raw | Poetry.Raw; diff --git a/src/serialization/types/PythonTaskConfig.ts b/src/serialization/types/PythonTaskConfig.ts index 0070db09..7578562e 100644 --- a/src/serialization/types/PythonTaskConfig.ts +++ b/src/serialization/types/PythonTaskConfig.ts @@ -1,26 +1,31 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { PythonTaskConfigImage } from "./PythonTaskConfigImage.js"; import { PythonTaskConfigMountsItem } from "./PythonTaskConfigMountsItem.js"; import { Resources } from "./Resources.js"; -export const PythonTaskConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("python-task-config"), - "image": PythonTaskConfigImage, - "env": core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), - "resources": Resources.optional(), - "mounts": core.serialization.list(PythonTaskConfigMountsItem).optional(), - "serviceAccount": core.serialization.property("service_account", core.serialization.string().optional()) - }); +export const PythonTaskConfig: core.serialization.ObjectSchema< + serializers.PythonTaskConfig.Raw, + TrueFoundry.PythonTaskConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("python-task-config"), + image: PythonTaskConfigImage, + env: core.serialization + .record(core.serialization.string(), core.serialization.string().nullable()) + .optionalNullable(), + resources: Resources.optional(), + mounts: core.serialization.list(PythonTaskConfigMountsItem).optional(), + serviceAccount: core.serialization.property("service_account", core.serialization.string().optional()), +}); export declare namespace PythonTaskConfig { export interface Raw { type: "python-task-config"; image: PythonTaskConfigImage.Raw; - env?: Record | null; + env?: (Record | null | undefined) | null; resources?: Resources.Raw | null; mounts?: PythonTaskConfigMountsItem.Raw[] | null; service_account?: string | null; diff --git a/src/serialization/types/PythonTaskConfigImage.ts b/src/serialization/types/PythonTaskConfigImage.ts index e7081bad..5708b643 100644 --- a/src/serialization/types/PythonTaskConfigImage.ts +++ b/src/serialization/types/PythonTaskConfigImage.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { TaskDockerFileBuild } from "./TaskDockerFileBuild.js"; import { TaskPythonBuild } from "./TaskPythonBuild.js"; -export const PythonTaskConfigImage: core.serialization.Schema = core.serialization.undiscriminatedUnion([TaskPythonBuild, TaskDockerFileBuild]); +export const PythonTaskConfigImage: core.serialization.Schema< + serializers.PythonTaskConfigImage.Raw, + TrueFoundry.PythonTaskConfigImage +> = core.serialization.undiscriminatedUnion([TaskPythonBuild, TaskDockerFileBuild]); export declare namespace PythonTaskConfigImage { export type Raw = TaskPythonBuild.Raw | TaskDockerFileBuild.Raw; diff --git a/src/serialization/types/PythonTaskConfigMountsItem.ts b/src/serialization/types/PythonTaskConfigMountsItem.ts index 278f3972..8dfd3991 100644 --- a/src/serialization/types/PythonTaskConfigMountsItem.ts +++ b/src/serialization/types/PythonTaskConfigMountsItem.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { SecretMount } from "./SecretMount.js"; import { StringDataMount } from "./StringDataMount.js"; import { VolumeMount } from "./VolumeMount.js"; -export const PythonTaskConfigMountsItem: core.serialization.Schema = core.serialization.undiscriminatedUnion([SecretMount, StringDataMount, VolumeMount]); +export const PythonTaskConfigMountsItem: core.serialization.Schema< + serializers.PythonTaskConfigMountsItem.Raw, + TrueFoundry.PythonTaskConfigMountsItem +> = core.serialization.undiscriminatedUnion([SecretMount, StringDataMount, VolumeMount]); export declare namespace PythonTaskConfigMountsItem { export type Raw = SecretMount.Raw | StringDataMount.Raw | VolumeMount.Raw; diff --git a/src/serialization/types/QuayArtifactsRegistry.ts b/src/serialization/types/QuayArtifactsRegistry.ts index cbad28a6..04ee2f0c 100644 --- a/src/serialization/types/QuayArtifactsRegistry.ts +++ b/src/serialization/types/QuayArtifactsRegistry.ts @@ -1,17 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { QuayBasicAuth } from "./QuayBasicAuth.js"; -export const QuayArtifactsRegistry: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/docker-registry/quay"), - "name": core.serialization.string(), - "registryUrl": core.serialization.property("registry_url", core.serialization.string()), - "authData": core.serialization.property("auth_data", QuayBasicAuth.optional()), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const QuayArtifactsRegistry: core.serialization.ObjectSchema< + serializers.QuayArtifactsRegistry.Raw, + TrueFoundry.QuayArtifactsRegistry +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/docker-registry/quay"), + name: core.serialization.string(), + registryUrl: core.serialization.property("registry_url", core.serialization.string()), + authData: core.serialization.property("auth_data", QuayBasicAuth.optional()), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace QuayArtifactsRegistry { export interface Raw { diff --git a/src/serialization/types/QuayBasicAuth.ts b/src/serialization/types/QuayBasicAuth.ts index 6dfccedf..4155b2ac 100644 --- a/src/serialization/types/QuayBasicAuth.ts +++ b/src/serialization/types/QuayBasicAuth.ts @@ -1,13 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const QuayBasicAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("basic-auth"), - "username": core.serialization.string(), - "password": core.serialization.string() +export const QuayBasicAuth: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("basic-auth"), + username: core.serialization.string(), + password: core.serialization.string(), }); export declare namespace QuayBasicAuth { diff --git a/src/serialization/types/QuayIntegrations.ts b/src/serialization/types/QuayIntegrations.ts index 0e60382a..d48a93a2 100644 --- a/src/serialization/types/QuayIntegrations.ts +++ b/src/serialization/types/QuayIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { QuayArtifactsRegistry } from "./QuayArtifactsRegistry.js"; -export const QuayIntegrations: core.serialization.ObjectSchema = QuayArtifactsRegistry; +export const QuayIntegrations: core.serialization.ObjectSchema< + serializers.QuayIntegrations.Raw, + TrueFoundry.QuayIntegrations +> = QuayArtifactsRegistry; export declare namespace QuayIntegrations { export type Raw = QuayArtifactsRegistry.Raw; diff --git a/src/serialization/types/QuayProviderAccount.ts b/src/serialization/types/QuayProviderAccount.ts index 9d45576c..1e7e5564 100644 --- a/src/serialization/types/QuayProviderAccount.ts +++ b/src/serialization/types/QuayProviderAccount.ts @@ -1,20 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { OwnedBy } from "./OwnedBy.js"; import { QuayBasicAuth } from "./QuayBasicAuth.js"; import { QuayIntegrations } from "./QuayIntegrations.js"; -export const QuayProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/quay"), - "name": core.serialization.string(), - "accountName": core.serialization.property("account_name", core.serialization.string().optional()), - "authData": core.serialization.property("auth_data", QuayBasicAuth.optional()), - "integrations": core.serialization.list(QuayIntegrations), - "ownedBy": OwnedBy.optional() - }); +export const QuayProviderAccount: core.serialization.ObjectSchema< + serializers.QuayProviderAccount.Raw, + TrueFoundry.QuayProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/quay"), + name: core.serialization.string(), + accountName: core.serialization.property("account_name", core.serialization.string().optional()), + authData: core.serialization.property("auth_data", QuayBasicAuth.optional()), + integrations: core.serialization.list(QuayIntegrations), + ownedBy: OwnedBy.optional(), +}); export declare namespace QuayProviderAccount { export interface Raw { diff --git a/src/serialization/types/QuerySpansResponse.ts b/src/serialization/types/QuerySpansResponse.ts index 7a7ce3b0..dea04c45 100644 --- a/src/serialization/types/QuerySpansResponse.ts +++ b/src/serialization/types/QuerySpansResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { TokenPagination } from "./TokenPagination.js"; import { TraceSpan } from "./TraceSpan.js"; -export const QuerySpansResponse: core.serialization.ObjectSchema = core.serialization.object({ - "data": core.serialization.list(TraceSpan), - "pagination": TokenPagination - }); +export const QuerySpansResponse: core.serialization.ObjectSchema< + serializers.QuerySpansResponse.Raw, + TrueFoundry.QuerySpansResponse +> = core.serialization.object({ + data: core.serialization.list(TraceSpan), + pagination: TokenPagination, +}); export declare namespace QuerySpansResponse { export interface Raw { diff --git a/src/serialization/types/RStudio.ts b/src/serialization/types/RStudio.ts index 0aaac515..ec8cc287 100644 --- a/src/serialization/types/RStudio.ts +++ b/src/serialization/types/RStudio.ts @@ -1,15 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BaseWorkbenchInput } from "./BaseWorkbenchInput.js"; import { WorkbenchImage } from "./WorkbenchImage.js"; -export const RStudio: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("rstudio"), - "image": WorkbenchImage - }).extend(BaseWorkbenchInput); +export const RStudio: core.serialization.ObjectSchema = core.serialization + .object({ + type: core.serialization.stringLiteral("rstudio"), + image: WorkbenchImage, + }) + .extend(BaseWorkbenchInput); export declare namespace RStudio { export interface Raw extends BaseWorkbenchInput.Raw { diff --git a/src/serialization/types/RateLimitConfig.ts b/src/serialization/types/RateLimitConfig.ts index 4f3b07ee..5d5e457d 100644 --- a/src/serialization/types/RateLimitConfig.ts +++ b/src/serialization/types/RateLimitConfig.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { RateLimitRule } from "./RateLimitRule.js"; -export const RateLimitConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("gateway-rate-limiting-config"), - "rules": core.serialization.list(RateLimitRule) - }); +export const RateLimitConfig: core.serialization.ObjectSchema< + serializers.RateLimitConfig.Raw, + TrueFoundry.RateLimitConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("gateway-rate-limiting-config"), + rules: core.serialization.list(RateLimitRule), +}); export declare namespace RateLimitConfig { export interface Raw { diff --git a/src/serialization/types/RateLimitRule.ts b/src/serialization/types/RateLimitRule.ts index 65df855f..46b621ea 100644 --- a/src/serialization/types/RateLimitRule.ts +++ b/src/serialization/types/RateLimitRule.ts @@ -1,17 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { RateLimitUnit } from "./RateLimitUnit.js"; import { RateLimitWhen } from "./RateLimitWhen.js"; -export const RateLimitRule: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string(), - "when": RateLimitWhen, - "limitTo": core.serialization.property("limit_to", core.serialization.number()), - "unit": RateLimitUnit, - "rateLimitAppliesPer": core.serialization.property("rate_limit_applies_per", core.serialization.list(core.serialization.string()).optional()) +export const RateLimitRule: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string(), + when: RateLimitWhen, + limitTo: core.serialization.property("limit_to", core.serialization.number()), + unit: RateLimitUnit, + rateLimitAppliesPer: core.serialization.property( + "rate_limit_applies_per", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace RateLimitRule { diff --git a/src/serialization/types/RateLimitUnit.ts b/src/serialization/types/RateLimitUnit.ts index 9980352b..12b05b91 100644 --- a/src/serialization/types/RateLimitUnit.ts +++ b/src/serialization/types/RateLimitUnit.ts @@ -1,11 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const RateLimitUnit: core.serialization.Schema = core.serialization.enum_(["requests_per_day", "tokens_per_minute", "requests_per_minute", "tokens_per_day", "requests_per_hour", "tokens_per_hour"]); +export const RateLimitUnit: core.serialization.Schema = + core.serialization.enum_([ + "requests_per_day", + "tokens_per_minute", + "requests_per_minute", + "tokens_per_day", + "requests_per_hour", + "tokens_per_hour", + ]); export declare namespace RateLimitUnit { - export type Raw = "requests_per_day" | "tokens_per_minute" | "requests_per_minute" | "tokens_per_day" | "requests_per_hour" | "tokens_per_hour"; + export type Raw = + | "requests_per_day" + | "tokens_per_minute" + | "requests_per_minute" + | "tokens_per_day" + | "requests_per_hour" + | "tokens_per_hour"; } diff --git a/src/serialization/types/RateLimitWhen.ts b/src/serialization/types/RateLimitWhen.ts index 200be5f5..e2c399f4 100644 --- a/src/serialization/types/RateLimitWhen.ts +++ b/src/serialization/types/RateLimitWhen.ts @@ -1,13 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const RateLimitWhen: core.serialization.ObjectSchema = core.serialization.object({ - "subjects": core.serialization.list(core.serialization.string()).optional(), - "models": core.serialization.list(core.serialization.string()).optional(), - "metadata": core.serialization.record(core.serialization.string(), core.serialization.string()).optional() +export const RateLimitWhen: core.serialization.ObjectSchema = + core.serialization.object({ + subjects: core.serialization.list(core.serialization.string()).optional(), + models: core.serialization.list(core.serialization.string()).optional(), + metadata: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), }); export declare namespace RateLimitWhen { diff --git a/src/serialization/types/Recommendation.ts b/src/serialization/types/Recommendation.ts index 85017b15..df627952 100644 --- a/src/serialization/types/Recommendation.ts +++ b/src/serialization/types/Recommendation.ts @@ -1,35 +1,38 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const Recommendation: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string().optional(), - "clusterId": core.serialization.string().optional(), - "applicationId": core.serialization.string().optional(), - "deploymentId": core.serialization.string().optional(), - "applicationVersion": core.serialization.number().optional(), - "recommendationData": core.serialization.record(core.serialization.string(), core.serialization.unknown()), - "recommendationType": core.serialization.string(), - "appliedDeploymentId": core.serialization.string().optional(), - "expiryTimestamp": core.serialization.date(), - "createdAt": core.serialization.date().optional(), - "updatedAt": core.serialization.date().optional() - }); +export const Recommendation: core.serialization.ObjectSchema< + serializers.Recommendation.Raw, + TrueFoundry.Recommendation +> = core.serialization.object({ + id: core.serialization.string().optionalNullable(), + clusterId: core.serialization.string().optionalNullable(), + applicationId: core.serialization.string().optionalNullable(), + deploymentId: core.serialization.string().optionalNullable(), + applicationVersion: core.serialization.number().optionalNullable(), + recommendationData: core.serialization.record(core.serialization.string(), core.serialization.unknown()), + recommendationType: core.serialization.string(), + appliedDeploymentId: core.serialization.string().optionalNullable(), + expiryTimestamp: core.serialization.date(), + createdAt: core.serialization.date().optionalNullable(), + updatedAt: core.serialization.date().optionalNullable(), +}); export declare namespace Recommendation { export interface Raw { - id?: string | null; - clusterId?: string | null; - applicationId?: string | null; - deploymentId?: string | null; - applicationVersion?: number | null; + id?: (string | null | undefined) | null; + clusterId?: (string | null | undefined) | null; + applicationId?: (string | null | undefined) | null; + deploymentId?: (string | null | undefined) | null; + applicationVersion?: (number | null | undefined) | null; recommendationData: Record; recommendationType: string; - appliedDeploymentId?: string | null; + appliedDeploymentId?: (string | null | undefined) | null; expiryTimestamp: string; - createdAt?: string | null; - updatedAt?: string | null; + createdAt?: (string | null | undefined) | null; + updatedAt?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/Redaction.ts b/src/serialization/types/Redaction.ts new file mode 100644 index 00000000..325d6b62 --- /dev/null +++ b/src/serialization/types/Redaction.ts @@ -0,0 +1,23 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { CustomRegexPattern } from "./CustomRegexPattern.js"; +import { PresetRegexPatternEnum } from "./PresetRegexPatternEnum.js"; + +export const Redaction: core.serialization.ObjectSchema = + core.serialization.object({ + presets: core.serialization.list(PresetRegexPatternEnum).optional(), + customPatterns: core.serialization.property( + "custom_patterns", + core.serialization.list(CustomRegexPattern).optional(), + ), + }); + +export declare namespace Redaction { + export interface Raw { + presets?: PresetRegexPatternEnum.Raw[] | null; + custom_patterns?: CustomRegexPattern.Raw[] | null; + } +} diff --git a/src/serialization/types/RefusalContentPart.ts b/src/serialization/types/RefusalContentPart.ts index 335c3936..1d213b98 100644 --- a/src/serialization/types/RefusalContentPart.ts +++ b/src/serialization/types/RefusalContentPart.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const RefusalContentPart: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.string(), - "refusal": core.serialization.string() - }); +export const RefusalContentPart: core.serialization.ObjectSchema< + serializers.RefusalContentPart.Raw, + TrueFoundry.RefusalContentPart +> = core.serialization.object({ + type: core.serialization.string(), + refusal: core.serialization.string(), +}); export declare namespace RefusalContentPart { export interface Raw { diff --git a/src/serialization/types/RegexConstraint.ts b/src/serialization/types/RegexConstraint.ts index 0869a82d..2019ffc3 100644 --- a/src/serialization/types/RegexConstraint.ts +++ b/src/serialization/types/RegexConstraint.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const RegexConstraint: core.serialization.ObjectSchema = core.serialization.object({ - "constraint": core.serialization.stringLiteral("regex"), - "regex": core.serialization.string() - }); +export const RegexConstraint: core.serialization.ObjectSchema< + serializers.RegexConstraint.Raw, + TrueFoundry.RegexConstraint +> = core.serialization.object({ + constraint: core.serialization.stringLiteral("regex"), + regex: core.serialization.string(), +}); export declare namespace RegexConstraint { export interface Raw { diff --git a/src/serialization/types/RegexGuardrailConfig.ts b/src/serialization/types/RegexGuardrailConfig.ts index 5298b81c..4192c77e 100644 --- a/src/serialization/types/RegexGuardrailConfig.ts +++ b/src/serialization/types/RegexGuardrailConfig.ts @@ -1,21 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { EnforcingStrategy } from "./EnforcingStrategy.js"; import { RegexGuardrailConfigConfig } from "./RegexGuardrailConfigConfig.js"; import { RegexGuardrailConfigOperation } from "./RegexGuardrailConfigOperation.js"; -export const RegexGuardrailConfig: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string().optional(), - "type": core.serialization.stringLiteral("integration/guardrail-config/regex"), - "operation": RegexGuardrailConfigOperation, - "priority": core.serialization.number().optional(), - "enforcingStrategy": core.serialization.property("enforcing_strategy", EnforcingStrategy), - "config": RegexGuardrailConfigConfig - }); +export const RegexGuardrailConfig: core.serialization.ObjectSchema< + serializers.RegexGuardrailConfig.Raw, + TrueFoundry.RegexGuardrailConfig +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + type: core.serialization.stringLiteral("integration/guardrail-config/regex"), + operation: RegexGuardrailConfigOperation, + priority: core.serialization.number().optional(), + enforcingStrategy: core.serialization.property("enforcing_strategy", EnforcingStrategy), + config: RegexGuardrailConfigConfig, +}); export declare namespace RegexGuardrailConfig { export interface Raw { diff --git a/src/serialization/types/RegexGuardrailConfigConfig.ts b/src/serialization/types/RegexGuardrailConfigConfig.ts index 15a3fa25..f94570fc 100644 --- a/src/serialization/types/RegexGuardrailConfigConfig.ts +++ b/src/serialization/types/RegexGuardrailConfigConfig.ts @@ -1,15 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { CustomRegexPattern } from "./CustomRegexPattern.js"; import { PresetRegexPattern } from "./PresetRegexPattern.js"; -export const RegexGuardrailConfigConfig: core.serialization.ObjectSchema = core.serialization.object({ - "presetPatterns": core.serialization.property("preset_patterns", PresetRegexPattern.optional()), - "customPatterns": core.serialization.property("custom_patterns", core.serialization.list(CustomRegexPattern).optional()) - }); +export const RegexGuardrailConfigConfig: core.serialization.ObjectSchema< + serializers.RegexGuardrailConfigConfig.Raw, + TrueFoundry.RegexGuardrailConfigConfig +> = core.serialization.object({ + presetPatterns: core.serialization.property("preset_patterns", PresetRegexPattern.optional()), + customPatterns: core.serialization.property( + "custom_patterns", + core.serialization.list(CustomRegexPattern).optional(), + ), +}); export declare namespace RegexGuardrailConfigConfig { export interface Raw { diff --git a/src/serialization/types/RegexGuardrailConfigOperation.ts b/src/serialization/types/RegexGuardrailConfigOperation.ts index 2f5006ff..e3b5ad4a 100644 --- a/src/serialization/types/RegexGuardrailConfigOperation.ts +++ b/src/serialization/types/RegexGuardrailConfigOperation.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const RegexGuardrailConfigOperation: core.serialization.Schema = core.serialization.enum_(["validate", "mutate"]); +export const RegexGuardrailConfigOperation: core.serialization.Schema< + serializers.RegexGuardrailConfigOperation.Raw, + TrueFoundry.RegexGuardrailConfigOperation +> = core.serialization.enum_(["validate", "mutate"]); export declare namespace RegexGuardrailConfigOperation { export type Raw = "validate" | "mutate"; diff --git a/src/serialization/types/RegisterUsersResponse.ts b/src/serialization/types/RegisterUsersResponse.ts index 0cb265bb..8c0d06a5 100644 --- a/src/serialization/types/RegisterUsersResponse.ts +++ b/src/serialization/types/RegisterUsersResponse.ts @@ -1,12 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const RegisterUsersResponse: core.serialization.ObjectSchema = core.serialization.object({}); +export const RegisterUsersResponse: core.serialization.ObjectSchema< + serializers.RegisterUsersResponse.Raw, + TrueFoundry.RegisterUsersResponse +> = core.serialization.object({}); export declare namespace RegisterUsersResponse { - export interface Raw { - } + export type Raw = {}; } diff --git a/src/serialization/types/RemoteAgent.ts b/src/serialization/types/RemoteAgent.ts index acca7e47..1a8de00d 100644 --- a/src/serialization/types/RemoteAgent.ts +++ b/src/serialization/types/RemoteAgent.ts @@ -1,11 +1,12 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { SelfHostedAgent } from "./SelfHostedAgent.js"; -export const RemoteAgent: core.serialization.ObjectSchema = SelfHostedAgent; +export const RemoteAgent: core.serialization.ObjectSchema = + SelfHostedAgent; export declare namespace RemoteAgent { export type Raw = SelfHostedAgent.Raw; diff --git a/src/serialization/types/RemoteMcpServerManifest.ts b/src/serialization/types/RemoteMcpServerManifest.ts index d0a8d463..4f7ca62c 100644 --- a/src/serialization/types/RemoteMcpServerManifest.ts +++ b/src/serialization/types/RemoteMcpServerManifest.ts @@ -1,32 +1,40 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { CustomTlsSettings } from "./CustomTlsSettings.js"; import { McpServerAuth } from "./McpServerAuth.js"; import { McpToolSetting } from "./McpToolSetting.js"; import { OwnedBy } from "./OwnedBy.js"; -export const RemoteMcpServerManifest: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("mcp-server/remote"), - "name": core.serialization.string(), - "description": core.serialization.string(), - "url": core.serialization.string(), - "tlsSettings": core.serialization.property("tls_settings", CustomTlsSettings.optional()), - "toolSettings": core.serialization.property("tool_settings", core.serialization.list(McpToolSetting).optional()), - "authData": core.serialization.property("auth_data", McpServerAuth.optional()), - "collaborators": core.serialization.list(Collaborator), - "ownedBy": OwnedBy.optional(), - "additionalHeaders": core.serialization.property("additional_headers", core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional()), - "tags": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() - }); +export const RemoteMcpServerManifest: core.serialization.ObjectSchema< + serializers.RemoteMcpServerManifest.Raw, + TrueFoundry.RemoteMcpServerManifest +> = core.serialization.object({ + type: core.serialization.stringLiteral("mcp-server/remote"), + name: core.serialization.string(), + displayName: core.serialization.property("display_name", core.serialization.string().optional()), + description: core.serialization.string(), + url: core.serialization.string(), + tlsSettings: core.serialization.property("tls_settings", CustomTlsSettings.optional()), + toolSettings: core.serialization.property("tool_settings", core.serialization.list(McpToolSetting).optional()), + authData: core.serialization.property("auth_data", McpServerAuth.optional()), + collaborators: core.serialization.list(Collaborator), + ownedBy: OwnedBy.optional(), + additionalHeaders: core.serialization.property( + "additional_headers", + core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + ), + tags: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), +}); export declare namespace RemoteMcpServerManifest { export interface Raw { type: "mcp-server/remote"; name: string; + display_name?: string | null; description: string; url: string; tls_settings?: CustomTlsSettings.Raw | null; diff --git a/src/serialization/types/RemoteSource.ts b/src/serialization/types/RemoteSource.ts index 534c710e..b62343a7 100644 --- a/src/serialization/types/RemoteSource.ts +++ b/src/serialization/types/RemoteSource.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const RemoteSource: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("remote"), - "remoteUri": core.serialization.property("remote_uri", core.serialization.string()) +export const RemoteSource: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("remote"), + remoteUri: core.serialization.property("remote_uri", core.serialization.string()), }); export declare namespace RemoteSource { diff --git a/src/serialization/types/RemoteSpecSource.ts b/src/serialization/types/RemoteSpecSource.ts index e13057ec..3228bceb 100644 --- a/src/serialization/types/RemoteSpecSource.ts +++ b/src/serialization/types/RemoteSpecSource.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const RemoteSpecSource: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("remote"), - "url": core.serialization.string() - }); +export const RemoteSpecSource: core.serialization.ObjectSchema< + serializers.RemoteSpecSource.Raw, + TrueFoundry.RemoteSpecSource +> = core.serialization.object({ + type: core.serialization.stringLiteral("remote"), + url: core.serialization.string(), +}); export declare namespace RemoteSpecSource { export interface Raw { diff --git a/src/serialization/types/ResourceType.ts b/src/serialization/types/ResourceType.ts deleted file mode 100644 index 73eeb818..00000000 --- a/src/serialization/types/ResourceType.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; - -export const ResourceType: core.serialization.Schema = core.serialization.enum_(["role", "account", "cluster", "workspace", "environment", "secret-group", "deployment", "application", "secret", "docker-registry", "tenant", "vcs-integration", "mlf-project", "repository", "provider-integration", "team", "service-account", "llm-gateway", "policy", "role-binding", "settings", "provider-account", "user", "alert-config", "alert-rule", "gateway-config", "gateway-controls", "gateway-budget", "tracing-project", "tracing-application", "agent", "agent-app", "gateway-installation", "virtual-account", "sso-based-identity", "external-identity", "mcp-server", "external-identity-provider", "agent-identity"]); - -export declare namespace ResourceType { - export type Raw = "role" | "account" | "cluster" | "workspace" | "environment" | "secret-group" | "deployment" | "application" | "secret" | "docker-registry" | "tenant" | "vcs-integration" | "mlf-project" | "repository" | "provider-integration" | "team" | "service-account" | "llm-gateway" | "policy" | "role-binding" | "settings" | "provider-account" | "user" | "alert-config" | "alert-rule" | "gateway-config" | "gateway-controls" | "gateway-budget" | "tracing-project" | "tracing-application" | "agent" | "agent-app" | "gateway-installation" | "virtual-account" | "sso-based-identity" | "external-identity" | "mcp-server" | "external-identity-provider" | "agent-identity"; -} diff --git a/src/serialization/types/Resources.ts b/src/serialization/types/Resources.ts index 2b7ab6d6..d7df02b5 100644 --- a/src/serialization/types/Resources.ts +++ b/src/serialization/types/Resources.ts @@ -1,21 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ResourcesDevicesItem } from "./ResourcesDevicesItem.js"; import { ResourcesNode } from "./ResourcesNode.js"; -export const Resources: core.serialization.ObjectSchema = core.serialization.object({ - "cpuRequest": core.serialization.property("cpu_request", core.serialization.number()), - "cpuLimit": core.serialization.property("cpu_limit", core.serialization.number()), - "memoryRequest": core.serialization.property("memory_request", core.serialization.number()), - "memoryLimit": core.serialization.property("memory_limit", core.serialization.number()), - "ephemeralStorageRequest": core.serialization.property("ephemeral_storage_request", core.serialization.number()), - "ephemeralStorageLimit": core.serialization.property("ephemeral_storage_limit", core.serialization.number()), - "sharedMemorySize": core.serialization.property("shared_memory_size", core.serialization.number().optional()), - "node": ResourcesNode.optional(), - "devices": core.serialization.list(ResourcesDevicesItem).optional() +export const Resources: core.serialization.ObjectSchema = + core.serialization.object({ + cpuRequest: core.serialization.property("cpu_request", core.serialization.number()), + cpuLimit: core.serialization.property("cpu_limit", core.serialization.number()), + memoryRequest: core.serialization.property("memory_request", core.serialization.number()), + memoryLimit: core.serialization.property("memory_limit", core.serialization.number()), + ephemeralStorageRequest: core.serialization.property("ephemeral_storage_request", core.serialization.number()), + ephemeralStorageLimit: core.serialization.property("ephemeral_storage_limit", core.serialization.number()), + sharedMemorySize: core.serialization.property("shared_memory_size", core.serialization.number().optional()), + node: ResourcesNode.optional(), + devices: core.serialization.list(ResourcesDevicesItem).optional(), }); export declare namespace Resources { diff --git a/src/serialization/types/ResourcesDevicesItem.ts b/src/serialization/types/ResourcesDevicesItem.ts index 9016140b..ac692f6c 100644 --- a/src/serialization/types/ResourcesDevicesItem.ts +++ b/src/serialization/types/ResourcesDevicesItem.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsInferentia } from "./AwsInferentia.js"; import { GcpTpu } from "./GcpTpu.js"; import { NvidiaGpu } from "./NvidiaGpu.js"; import { NvidiaMiggpu } from "./NvidiaMiggpu.js"; import { NvidiaTimeslicingGpu } from "./NvidiaTimeslicingGpu.js"; -export const ResourcesDevicesItem: core.serialization.Schema = core.serialization.undiscriminatedUnion([NvidiaGpu, AwsInferentia, NvidiaMiggpu, NvidiaTimeslicingGpu, GcpTpu]); +export const ResourcesDevicesItem: core.serialization.Schema< + serializers.ResourcesDevicesItem.Raw, + TrueFoundry.ResourcesDevicesItem +> = core.serialization.undiscriminatedUnion([NvidiaGpu, AwsInferentia, NvidiaMiggpu, NvidiaTimeslicingGpu, GcpTpu]); export declare namespace ResourcesDevicesItem { export type Raw = NvidiaGpu.Raw | AwsInferentia.Raw | NvidiaMiggpu.Raw | NvidiaTimeslicingGpu.Raw | GcpTpu.Raw; diff --git a/src/serialization/types/ResourcesNode.ts b/src/serialization/types/ResourcesNode.ts index af868e6a..bcd6acdf 100644 --- a/src/serialization/types/ResourcesNode.ts +++ b/src/serialization/types/ResourcesNode.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { NodepoolSelector } from "./NodepoolSelector.js"; import { NodeSelector } from "./NodeSelector.js"; -export const ResourcesNode: core.serialization.Schema = core.serialization.undiscriminatedUnion([NodeSelector, NodepoolSelector]); +export const ResourcesNode: core.serialization.Schema = + core.serialization.undiscriminatedUnion([NodeSelector, NodepoolSelector]); export declare namespace ResourcesNode { export type Raw = NodeSelector.Raw | NodepoolSelector.Raw; diff --git a/src/serialization/types/ResponseFormatJsonObject.ts b/src/serialization/types/ResponseFormatJsonObject.ts index 2765795d..25dc3ae5 100644 --- a/src/serialization/types/ResponseFormatJsonObject.ts +++ b/src/serialization/types/ResponseFormatJsonObject.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const ResponseFormatJsonObject: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("json_object") - }); +export const ResponseFormatJsonObject: core.serialization.ObjectSchema< + serializers.ResponseFormatJsonObject.Raw, + TrueFoundry.ResponseFormatJsonObject +> = core.serialization.object({ + type: core.serialization.stringLiteral("json_object"), +}); export declare namespace ResponseFormatJsonObject { export interface Raw { diff --git a/src/serialization/types/ResponseFormatJsonSchema.ts b/src/serialization/types/ResponseFormatJsonSchema.ts index e427bcd4..c7724553 100644 --- a/src/serialization/types/ResponseFormatJsonSchema.ts +++ b/src/serialization/types/ResponseFormatJsonSchema.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ResponseFormatJsonSchemaJsonSchema } from "./ResponseFormatJsonSchemaJsonSchema.js"; -export const ResponseFormatJsonSchema: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("json_schema"), - "jsonSchema": core.serialization.property("json_schema", ResponseFormatJsonSchemaJsonSchema) - }); +export const ResponseFormatJsonSchema: core.serialization.ObjectSchema< + serializers.ResponseFormatJsonSchema.Raw, + TrueFoundry.ResponseFormatJsonSchema +> = core.serialization.object({ + type: core.serialization.stringLiteral("json_schema"), + jsonSchema: core.serialization.property("json_schema", ResponseFormatJsonSchemaJsonSchema), +}); export declare namespace ResponseFormatJsonSchema { export interface Raw { diff --git a/src/serialization/types/ResponseFormatJsonSchemaJsonSchema.ts b/src/serialization/types/ResponseFormatJsonSchemaJsonSchema.ts index 24c61638..83075d7a 100644 --- a/src/serialization/types/ResponseFormatJsonSchemaJsonSchema.ts +++ b/src/serialization/types/ResponseFormatJsonSchemaJsonSchema.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const ResponseFormatJsonSchemaJsonSchema: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string().optional(), - "schema": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - "strict": core.serialization.boolean().optional() - }); +export const ResponseFormatJsonSchemaJsonSchema: core.serialization.ObjectSchema< + serializers.ResponseFormatJsonSchemaJsonSchema.Raw, + TrueFoundry.ResponseFormatJsonSchemaJsonSchema +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + schema: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + strict: core.serialization.boolean().optional(), +}); export declare namespace ResponseFormatJsonSchemaJsonSchema { export interface Raw { diff --git a/src/serialization/types/ResponseFormatText.ts b/src/serialization/types/ResponseFormatText.ts index 93f10cde..dd13c5d8 100644 --- a/src/serialization/types/ResponseFormatText.ts +++ b/src/serialization/types/ResponseFormatText.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const ResponseFormatText: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("text") - }); +export const ResponseFormatText: core.serialization.ObjectSchema< + serializers.ResponseFormatText.Raw, + TrueFoundry.ResponseFormatText +> = core.serialization.object({ + type: core.serialization.stringLiteral("text"), +}); export declare namespace ResponseFormatText { export interface Raw { diff --git a/src/serialization/types/RetryConfig.ts b/src/serialization/types/RetryConfig.ts index 56259d83..084118f8 100644 --- a/src/serialization/types/RetryConfig.ts +++ b/src/serialization/types/RetryConfig.ts @@ -1,13 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const RetryConfig: core.serialization.ObjectSchema = core.serialization.object({ - "attempts": core.serialization.number(), - "delay": core.serialization.number().optional(), - "onStatusCodes": core.serialization.property("on_status_codes", core.serialization.list(core.serialization.string()).optional()) +export const RetryConfig: core.serialization.ObjectSchema = + core.serialization.object({ + attempts: core.serialization.number(), + delay: core.serialization.number().optional(), + onStatusCodes: core.serialization.property( + "on_status_codes", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace RetryConfig { diff --git a/src/serialization/types/RevokeAllPersonalAccessTokenResponse.ts b/src/serialization/types/RevokeAllPersonalAccessTokenResponse.ts index ade07dee..e3f977d5 100644 --- a/src/serialization/types/RevokeAllPersonalAccessTokenResponse.ts +++ b/src/serialization/types/RevokeAllPersonalAccessTokenResponse.ts @@ -1,12 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const RevokeAllPersonalAccessTokenResponse: core.serialization.ObjectSchema = core.serialization.object({}); +export const RevokeAllPersonalAccessTokenResponse: core.serialization.ObjectSchema< + serializers.RevokeAllPersonalAccessTokenResponse.Raw, + TrueFoundry.RevokeAllPersonalAccessTokenResponse +> = core.serialization.object({}); export declare namespace RevokeAllPersonalAccessTokenResponse { - export interface Raw { - } + export type Raw = {}; } diff --git a/src/serialization/types/Role.ts b/src/serialization/types/Role.ts new file mode 100644 index 00000000..868551e1 --- /dev/null +++ b/src/serialization/types/Role.ts @@ -0,0 +1,36 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { PermissionSetV2 } from "./PermissionSetV2.js"; +import { RoleManifest } from "./RoleManifest.js"; +import { RoleResourceType } from "./RoleResourceType.js"; + +export const Role: core.serialization.ObjectSchema = core.serialization.object({ + id: core.serialization.string(), + tenantName: core.serialization.string(), + accountId: core.serialization.string(), + resourceType: RoleResourceType, + manifest: RoleManifest, + createdBySubject: core.serialization.record(core.serialization.string(), core.serialization.unknown()), + permissionSetsV2: core.serialization.list(PermissionSetV2).optionalNullable(), + isEditable: core.serialization.boolean(), + isDefault: core.serialization.boolean(), + isReserved: core.serialization.boolean(), +}); + +export declare namespace Role { + export interface Raw { + id: string; + tenantName: string; + accountId: string; + resourceType: RoleResourceType.Raw; + manifest: RoleManifest.Raw; + createdBySubject: Record; + permissionSetsV2?: (PermissionSetV2.Raw[] | null | undefined) | null; + isEditable: boolean; + isDefault: boolean; + isReserved: boolean; + } +} diff --git a/src/serialization/types/RoleBinding.ts b/src/serialization/types/RoleBinding.ts new file mode 100644 index 00000000..3d31a7ca --- /dev/null +++ b/src/serialization/types/RoleBinding.ts @@ -0,0 +1,34 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { RoleBindingManifest } from "./RoleBindingManifest.js"; +import { Subject } from "./Subject.js"; + +export const RoleBinding: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string().optionalNullable(), + name: core.serialization.string(), + accountId: core.serialization.string(), + manifest: RoleBindingManifest, + metadata: core.serialization + .record(core.serialization.string(), core.serialization.unknown()) + .optionalNullable(), + createdBySubject: Subject, + createdAt: core.serialization.date().optionalNullable(), + updatedAt: core.serialization.date().optionalNullable(), + }); + +export declare namespace RoleBinding { + export interface Raw { + id?: (string | null | undefined) | null; + name: string; + accountId: string; + manifest: RoleBindingManifest.Raw; + metadata?: (Record | null | undefined) | null; + createdBySubject: Subject.Raw; + createdAt?: (string | null | undefined) | null; + updatedAt?: (string | null | undefined) | null; + } +} diff --git a/src/serialization/types/RoleBindingManifest.ts b/src/serialization/types/RoleBindingManifest.ts index 1211bdc5..0d6b8258 100644 --- a/src/serialization/types/RoleBindingManifest.ts +++ b/src/serialization/types/RoleBindingManifest.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { RoleBindingPermission } from "./RoleBindingPermission.js"; import { RoleBindingSubject } from "./RoleBindingSubject.js"; -export const RoleBindingManifest: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("role-binding"), - "name": core.serialization.string(), - "subjects": core.serialization.list(RoleBindingSubject), - "permissions": core.serialization.list(RoleBindingPermission) - }); +export const RoleBindingManifest: core.serialization.ObjectSchema< + serializers.RoleBindingManifest.Raw, + TrueFoundry.RoleBindingManifest +> = core.serialization.object({ + type: core.serialization.stringLiteral("role-binding"), + name: core.serialization.string(), + subjects: core.serialization.list(RoleBindingSubject), + permissions: core.serialization.list(RoleBindingPermission), +}); export declare namespace RoleBindingManifest { export interface Raw { diff --git a/src/serialization/types/RoleBindingPermission.ts b/src/serialization/types/RoleBindingPermission.ts index fb41e65e..650e4d4b 100644 --- a/src/serialization/types/RoleBindingPermission.ts +++ b/src/serialization/types/RoleBindingPermission.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const RoleBindingPermission: core.serialization.ObjectSchema = core.serialization.object({ - "resourceType": core.serialization.string(), - "resourceFqn": core.serialization.string(), - "role": core.serialization.string() - }); +export const RoleBindingPermission: core.serialization.ObjectSchema< + serializers.RoleBindingPermission.Raw, + TrueFoundry.RoleBindingPermission +> = core.serialization.object({ + resourceType: core.serialization.string(), + resourceFqn: core.serialization.string(), + role: core.serialization.string(), +}); export declare namespace RoleBindingPermission { export interface Raw { diff --git a/src/serialization/types/RoleBindingSubject.ts b/src/serialization/types/RoleBindingSubject.ts index a76f8e63..156687b2 100644 --- a/src/serialization/types/RoleBindingSubject.ts +++ b/src/serialization/types/RoleBindingSubject.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { RoleBindingSubjectType } from "./RoleBindingSubjectType.js"; -export const RoleBindingSubject: core.serialization.ObjectSchema = core.serialization.object({ - "type": RoleBindingSubjectType, - "name": core.serialization.string() - }); +export const RoleBindingSubject: core.serialization.ObjectSchema< + serializers.RoleBindingSubject.Raw, + TrueFoundry.RoleBindingSubject +> = core.serialization.object({ + type: RoleBindingSubjectType, + name: core.serialization.string(), +}); export declare namespace RoleBindingSubject { export interface Raw { diff --git a/src/serialization/types/RoleBindingSubjectType.ts b/src/serialization/types/RoleBindingSubjectType.ts index 289f7948..0fe92ba2 100644 --- a/src/serialization/types/RoleBindingSubjectType.ts +++ b/src/serialization/types/RoleBindingSubjectType.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const RoleBindingSubjectType: core.serialization.Schema = core.serialization.enum_(["user", "team", "virtualaccount", "external-identity"]); +export const RoleBindingSubjectType: core.serialization.Schema< + serializers.RoleBindingSubjectType.Raw, + TrueFoundry.RoleBindingSubjectType +> = core.serialization.enum_(["user", "team", "virtualaccount"]); export declare namespace RoleBindingSubjectType { - export type Raw = "user" | "team" | "virtualaccount" | "external-identity"; + export type Raw = "user" | "team" | "virtualaccount"; } diff --git a/src/serialization/types/RoleManifest.ts b/src/serialization/types/RoleManifest.ts index 659254db..4fe74d4f 100644 --- a/src/serialization/types/RoleManifest.ts +++ b/src/serialization/types/RoleManifest.ts @@ -1,16 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const RoleManifest: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("role"), - "name": core.serialization.string(), - "displayName": core.serialization.string(), - "description": core.serialization.string(), - "resourceType": core.serialization.string(), - "permissions": core.serialization.list(core.serialization.string()) +export const RoleManifest: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("role"), + name: core.serialization.string(), + displayName: core.serialization.string(), + description: core.serialization.string(), + resourceType: core.serialization.string(), + permissions: core.serialization.list(core.serialization.string()), }); export declare namespace RoleManifest { diff --git a/src/serialization/types/RoleResourceType.ts b/src/serialization/types/RoleResourceType.ts new file mode 100644 index 00000000..062ee6d1 --- /dev/null +++ b/src/serialization/types/RoleResourceType.ts @@ -0,0 +1,99 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const RoleResourceType: core.serialization.Schema< + serializers.RoleResourceType.Raw, + TrueFoundry.RoleResourceType +> = core.serialization.enum_([ + "role", + "account", + "cluster", + "workspace", + "environment", + "secret-group", + "deployment", + "application", + "secret", + "docker-registry", + "tenant", + "vcs-integration", + "mlf-project", + "repository", + "provider-integration", + "team", + "service-account", + "llm-gateway", + "policy", + "role-binding", + "settings", + "provider-account", + "user", + "alert-config", + "alert-rule", + "gateway-config", + "gateway-controls", + "gateway-budget", + "gateway-policy", + "gateway-approval-request", + "tracing-project", + "tracing-application", + "agent", + "agent-app", + "agent-channel", + "gateway-installation", + "virtual-account", + "sso-based-identity", + "external-identity", + "mcp-server", + "external-identity-provider", + "agent-identity", +]); + +export declare namespace RoleResourceType { + export type Raw = + | "role" + | "account" + | "cluster" + | "workspace" + | "environment" + | "secret-group" + | "deployment" + | "application" + | "secret" + | "docker-registry" + | "tenant" + | "vcs-integration" + | "mlf-project" + | "repository" + | "provider-integration" + | "team" + | "service-account" + | "llm-gateway" + | "policy" + | "role-binding" + | "settings" + | "provider-account" + | "user" + | "alert-config" + | "alert-rule" + | "gateway-config" + | "gateway-controls" + | "gateway-budget" + | "gateway-policy" + | "gateway-approval-request" + | "tracing-project" + | "tracing-application" + | "agent" + | "agent-app" + | "agent-channel" + | "gateway-installation" + | "virtual-account" + | "sso-based-identity" + | "external-identity" + | "mcp-server" + | "external-identity-provider" + | "agent-identity"; +} diff --git a/src/serialization/types/RoleWithResource.ts b/src/serialization/types/RoleWithResource.ts index 2e1928e4..675f8cab 100644 --- a/src/serialization/types/RoleWithResource.ts +++ b/src/serialization/types/RoleWithResource.ts @@ -1,16 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { RoleWithResourceResourceType } from "./RoleWithResourceResourceType.js"; -export const RoleWithResource: core.serialization.ObjectSchema = core.serialization.object({ - "roleId": core.serialization.string(), - "resourceType": RoleWithResourceResourceType, - "resourceId": core.serialization.string(), - "roleName": core.serialization.string() - }); +export const RoleWithResource: core.serialization.ObjectSchema< + serializers.RoleWithResource.Raw, + TrueFoundry.RoleWithResource +> = core.serialization.object({ + roleId: core.serialization.string(), + resourceType: RoleWithResourceResourceType, + resourceId: core.serialization.string(), + roleName: core.serialization.string(), +}); export declare namespace RoleWithResource { export interface Raw { diff --git a/src/serialization/types/RoleWithResourceResourceType.ts b/src/serialization/types/RoleWithResourceResourceType.ts index ae0a688f..935e9503 100644 --- a/src/serialization/types/RoleWithResourceResourceType.ts +++ b/src/serialization/types/RoleWithResourceResourceType.ts @@ -1,11 +1,99 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const RoleWithResourceResourceType: core.serialization.Schema = core.serialization.enum_(["role", "account", "cluster", "workspace", "environment", "secret-group", "deployment", "application", "secret", "docker-registry", "tenant", "vcs-integration", "mlf-project", "repository", "provider-integration", "team", "service-account", "llm-gateway", "policy", "role-binding", "settings", "provider-account", "user", "alert-config", "alert-rule", "gateway-config", "gateway-controls", "gateway-budget", "tracing-project", "tracing-application", "agent", "agent-app", "gateway-installation", "virtual-account", "sso-based-identity", "external-identity", "mcp-server", "external-identity-provider", "agent-identity"]); +export const RoleWithResourceResourceType: core.serialization.Schema< + serializers.RoleWithResourceResourceType.Raw, + TrueFoundry.RoleWithResourceResourceType +> = core.serialization.enum_([ + "role", + "account", + "cluster", + "workspace", + "environment", + "secret-group", + "deployment", + "application", + "secret", + "docker-registry", + "tenant", + "vcs-integration", + "mlf-project", + "repository", + "provider-integration", + "team", + "service-account", + "llm-gateway", + "policy", + "role-binding", + "settings", + "provider-account", + "user", + "alert-config", + "alert-rule", + "gateway-config", + "gateway-controls", + "gateway-budget", + "gateway-policy", + "gateway-approval-request", + "tracing-project", + "tracing-application", + "agent", + "agent-app", + "agent-channel", + "gateway-installation", + "virtual-account", + "sso-based-identity", + "external-identity", + "mcp-server", + "external-identity-provider", + "agent-identity", +]); export declare namespace RoleWithResourceResourceType { - export type Raw = "role" | "account" | "cluster" | "workspace" | "environment" | "secret-group" | "deployment" | "application" | "secret" | "docker-registry" | "tenant" | "vcs-integration" | "mlf-project" | "repository" | "provider-integration" | "team" | "service-account" | "llm-gateway" | "policy" | "role-binding" | "settings" | "provider-account" | "user" | "alert-config" | "alert-rule" | "gateway-config" | "gateway-controls" | "gateway-budget" | "tracing-project" | "tracing-application" | "agent" | "agent-app" | "gateway-installation" | "virtual-account" | "sso-based-identity" | "external-identity" | "mcp-server" | "external-identity-provider" | "agent-identity"; + export type Raw = + | "role" + | "account" + | "cluster" + | "workspace" + | "environment" + | "secret-group" + | "deployment" + | "application" + | "secret" + | "docker-registry" + | "tenant" + | "vcs-integration" + | "mlf-project" + | "repository" + | "provider-integration" + | "team" + | "service-account" + | "llm-gateway" + | "policy" + | "role-binding" + | "settings" + | "provider-account" + | "user" + | "alert-config" + | "alert-rule" + | "gateway-config" + | "gateway-controls" + | "gateway-budget" + | "gateway-policy" + | "gateway-approval-request" + | "tracing-project" + | "tracing-application" + | "agent" + | "agent-app" + | "agent-channel" + | "gateway-installation" + | "virtual-account" + | "sso-based-identity" + | "external-identity" + | "mcp-server" + | "external-identity-provider" + | "agent-identity"; } diff --git a/src/serialization/types/Rolling.ts b/src/serialization/types/Rolling.ts index 99d8b340..b3aa53ba 100644 --- a/src/serialization/types/Rolling.ts +++ b/src/serialization/types/Rolling.ts @@ -1,13 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const Rolling: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("rolling_update"), - "maxUnavailablePercentage": core.serialization.property("max_unavailable_percentage", core.serialization.number()), - "maxSurgePercentage": core.serialization.property("max_surge_percentage", core.serialization.number()) +export const Rolling: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("rolling_update"), + maxUnavailablePercentage: core.serialization.property( + "max_unavailable_percentage", + core.serialization.number(), + ), + maxSurgePercentage: core.serialization.property("max_surge_percentage", core.serialization.number()), }); export declare namespace Rolling { diff --git a/src/serialization/types/RpsMetric.ts b/src/serialization/types/RpsMetric.ts index 035d9156..ecc850f2 100644 --- a/src/serialization/types/RpsMetric.ts +++ b/src/serialization/types/RpsMetric.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const RpsMetric: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("rps"), - "value": core.serialization.number() +export const RpsMetric: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("rps"), + value: core.serialization.number(), }); export declare namespace RpsMetric { diff --git a/src/serialization/types/Run.ts b/src/serialization/types/Run.ts index 6816d2f8..884ef806 100644 --- a/src/serialization/types/Run.ts +++ b/src/serialization/types/Run.ts @@ -1,15 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { RunData } from "./RunData.js"; import { RunInfo } from "./RunInfo.js"; export const Run: core.serialization.ObjectSchema = core.serialization.object({ - "info": RunInfo, - "data": RunData - }); + info: RunInfo, + data: RunData, +}); export declare namespace Run { export interface Raw { diff --git a/src/serialization/types/RunData.ts b/src/serialization/types/RunData.ts index d9d0cc00..2cbfb11c 100644 --- a/src/serialization/types/RunData.ts +++ b/src/serialization/types/RunData.ts @@ -1,16 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Metric } from "./Metric.js"; import { RunParam } from "./RunParam.js"; import { RunTag } from "./RunTag.js"; -export const RunData: core.serialization.ObjectSchema = core.serialization.object({ - "metrics": core.serialization.list(Metric), - "params": core.serialization.list(RunParam), - "tags": core.serialization.list(RunTag) +export const RunData: core.serialization.ObjectSchema = + core.serialization.object({ + metrics: core.serialization.list(Metric), + params: core.serialization.list(RunParam), + tags: core.serialization.list(RunTag), }); export declare namespace RunData { diff --git a/src/serialization/types/RunInfo.ts b/src/serialization/types/RunInfo.ts index d77d053c..b2e50da4 100644 --- a/src/serialization/types/RunInfo.ts +++ b/src/serialization/types/RunInfo.ts @@ -1,24 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Subject } from "./Subject.js"; -export const RunInfo: core.serialization.ObjectSchema = core.serialization.object({ - "runUuid": core.serialization.property("run_uuid", core.serialization.string()), - "runId": core.serialization.property("run_id", core.serialization.string()), - "experimentId": core.serialization.property("experiment_id", core.serialization.string()), - "name": core.serialization.string(), - "fqn": core.serialization.string(), - "userId": core.serialization.property("user_id", core.serialization.string().optional()), - "createdBySubject": core.serialization.property("created_by_subject", Subject), - "status": core.serialization.string(), - "startTime": core.serialization.property("start_time", core.serialization.number().optional()), - "endTime": core.serialization.property("end_time", core.serialization.number().optional()), - "artifactUri": core.serialization.property("artifact_uri", core.serialization.string().optional()), - "lifecycleStage": core.serialization.property("lifecycle_stage", core.serialization.string().optional()), - "description": core.serialization.string().optional() +export const RunInfo: core.serialization.ObjectSchema = + core.serialization.object({ + runUuid: core.serialization.property("run_uuid", core.serialization.string()), + runId: core.serialization.property("run_id", core.serialization.string()), + experimentId: core.serialization.property("experiment_id", core.serialization.string()), + name: core.serialization.string(), + fqn: core.serialization.string(), + userId: core.serialization.property("user_id", core.serialization.string().optional()), + createdBySubject: core.serialization.property("created_by_subject", Subject), + status: core.serialization.string(), + startTime: core.serialization.property("start_time", core.serialization.number().optional()), + endTime: core.serialization.property("end_time", core.serialization.number().optional()), + artifactUri: core.serialization.property("artifact_uri", core.serialization.string().optional()), + lifecycleStage: core.serialization.property("lifecycle_stage", core.serialization.string().optional()), + description: core.serialization.string().optional(), }); export declare namespace RunInfo { diff --git a/src/serialization/types/RunParam.ts b/src/serialization/types/RunParam.ts index 46e37ea0..36ab164b 100644 --- a/src/serialization/types/RunParam.ts +++ b/src/serialization/types/RunParam.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const RunParam: core.serialization.ObjectSchema = core.serialization.object({ - "key": core.serialization.string(), - "value": core.serialization.string() +export const RunParam: core.serialization.ObjectSchema = + core.serialization.object({ + key: core.serialization.string(), + value: core.serialization.string(), }); export declare namespace RunParam { diff --git a/src/serialization/types/RunTag.ts b/src/serialization/types/RunTag.ts index 00cf130b..95522cd9 100644 --- a/src/serialization/types/RunTag.ts +++ b/src/serialization/types/RunTag.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const RunTag: core.serialization.ObjectSchema = core.serialization.object({ - "key": core.serialization.string(), - "value": core.serialization.string() +export const RunTag: core.serialization.ObjectSchema = + core.serialization.object({ + key: core.serialization.string(), + value: core.serialization.string(), }); export declare namespace RunTag { diff --git a/src/serialization/types/RunTagInput.ts b/src/serialization/types/RunTagInput.ts index 8219f5ae..fec0dbca 100644 --- a/src/serialization/types/RunTagInput.ts +++ b/src/serialization/types/RunTagInput.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const RunTagInput: core.serialization.ObjectSchema = core.serialization.object({ - "key": core.serialization.string(), - "value": core.serialization.string() +export const RunTagInput: core.serialization.ObjectSchema = + core.serialization.object({ + key: core.serialization.string(), + value: core.serialization.string(), }); export declare namespace RunTagInput { diff --git a/src/serialization/types/SagemakerAssumedRoleBasedAuth.ts b/src/serialization/types/SagemakerAssumedRoleBasedAuth.ts index 657383e3..e47812e1 100644 --- a/src/serialization/types/SagemakerAssumedRoleBasedAuth.ts +++ b/src/serialization/types/SagemakerAssumedRoleBasedAuth.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { AwsBedrockAssumedRoleBasedAuth } from "./AwsBedrockAssumedRoleBasedAuth.js"; -export const SagemakerAssumedRoleBasedAuth: core.serialization.ObjectSchema = AwsBedrockAssumedRoleBasedAuth; +export const SagemakerAssumedRoleBasedAuth: core.serialization.ObjectSchema< + serializers.SagemakerAssumedRoleBasedAuth.Raw, + TrueFoundry.SagemakerAssumedRoleBasedAuth +> = AwsBedrockAssumedRoleBasedAuth; export declare namespace SagemakerAssumedRoleBasedAuth { export type Raw = AwsBedrockAssumedRoleBasedAuth.Raw; diff --git a/src/serialization/types/SagemakerModel.ts b/src/serialization/types/SagemakerModel.ts index af5cd72d..0e34d1d6 100644 --- a/src/serialization/types/SagemakerModel.ts +++ b/src/serialization/types/SagemakerModel.ts @@ -1,21 +1,27 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsRegion } from "./AwsRegion.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const SagemakerModel: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "type": core.serialization.stringLiteral("integration/model/sagemaker"), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "region": AwsRegion.optional(), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const SagemakerModel: core.serialization.ObjectSchema< + serializers.SagemakerModel.Raw, + TrueFoundry.SagemakerModel +> = core.serialization.object({ + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + type: core.serialization.stringLiteral("integration/model/sagemaker"), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + region: AwsRegion.optional(), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace SagemakerModel { export interface Raw { diff --git a/src/serialization/types/SambaNovaIntegrations.ts b/src/serialization/types/SambaNovaIntegrations.ts index 79cdb7af..0bb1197e 100644 --- a/src/serialization/types/SambaNovaIntegrations.ts +++ b/src/serialization/types/SambaNovaIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { SambaNovaModel } from "./SambaNovaModel.js"; -export const SambaNovaIntegrations: core.serialization.ObjectSchema = SambaNovaModel; +export const SambaNovaIntegrations: core.serialization.ObjectSchema< + serializers.SambaNovaIntegrations.Raw, + TrueFoundry.SambaNovaIntegrations +> = SambaNovaModel; export declare namespace SambaNovaIntegrations { export type Raw = SambaNovaModel.Raw; diff --git a/src/serialization/types/SambaNovaKeyAuth.ts b/src/serialization/types/SambaNovaKeyAuth.ts index 83072f1d..b0aded3a 100644 --- a/src/serialization/types/SambaNovaKeyAuth.ts +++ b/src/serialization/types/SambaNovaKeyAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SambaNovaKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) - }); +export const SambaNovaKeyAuth: core.serialization.ObjectSchema< + serializers.SambaNovaKeyAuth.Raw, + TrueFoundry.SambaNovaKeyAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), +}); export declare namespace SambaNovaKeyAuth { export interface Raw { diff --git a/src/serialization/types/SambaNovaModel.ts b/src/serialization/types/SambaNovaModel.ts index 8891762d..e0cd6167 100644 --- a/src/serialization/types/SambaNovaModel.ts +++ b/src/serialization/types/SambaNovaModel.ts @@ -1,19 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const SambaNovaModel: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/model/sambanova"), - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const SambaNovaModel: core.serialization.ObjectSchema< + serializers.SambaNovaModel.Raw, + TrueFoundry.SambaNovaModel +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/model/sambanova"), + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace SambaNovaModel { export interface Raw { diff --git a/src/serialization/types/SambaNovaProviderAccount.ts b/src/serialization/types/SambaNovaProviderAccount.ts index 6116e2f8..9f54322d 100644 --- a/src/serialization/types/SambaNovaProviderAccount.ts +++ b/src/serialization/types/SambaNovaProviderAccount.ts @@ -1,22 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { OwnedBy } from "./OwnedBy.js"; import { SambaNovaIntegrations } from "./SambaNovaIntegrations.js"; import { SambaNovaKeyAuth } from "./SambaNovaKeyAuth.js"; -export const SambaNovaProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/sambanova"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", SambaNovaKeyAuth), - "integrations": core.serialization.list(SambaNovaIntegrations), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const SambaNovaProviderAccount: core.serialization.ObjectSchema< + serializers.SambaNovaProviderAccount.Raw, + TrueFoundry.SambaNovaProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/sambanova"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", SambaNovaKeyAuth), + integrations: core.serialization.list(SambaNovaIntegrations), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace SambaNovaProviderAccount { export interface Raw { diff --git a/src/serialization/types/SampleAgentInput.ts b/src/serialization/types/SampleAgentInput.ts index e536d043..bb084e99 100644 --- a/src/serialization/types/SampleAgentInput.ts +++ b/src/serialization/types/SampleAgentInput.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SampleAgentInput: core.serialization.ObjectSchema = core.serialization.object({ - "text": core.serialization.string().optional(), - "variables": core.serialization.record(core.serialization.string(), core.serialization.string()).optional() - }); +export const SampleAgentInput: core.serialization.ObjectSchema< + serializers.SampleAgentInput.Raw, + TrueFoundry.SampleAgentInput +> = core.serialization.object({ + text: core.serialization.string().optional(), + variables: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), +}); export declare namespace SampleAgentInput { export interface Raw { diff --git a/src/serialization/types/Schedule.ts b/src/serialization/types/Schedule.ts index c402c211..f4746c7f 100644 --- a/src/serialization/types/Schedule.ts +++ b/src/serialization/types/Schedule.ts @@ -1,15 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ScheduleConcurrencyPolicy } from "./ScheduleConcurrencyPolicy.js"; -export const Schedule: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("scheduled"), - "schedule": core.serialization.string(), - "concurrencyPolicy": core.serialization.property("concurrency_policy", ScheduleConcurrencyPolicy), - "timezone": core.serialization.string().optional() +export const Schedule: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("scheduled"), + schedule: core.serialization.string(), + concurrencyPolicy: core.serialization.property("concurrency_policy", ScheduleConcurrencyPolicy), + timezone: core.serialization.string().optional(), }); export declare namespace Schedule { diff --git a/src/serialization/types/ScheduleConcurrencyPolicy.ts b/src/serialization/types/ScheduleConcurrencyPolicy.ts index c8dc6922..2e669ffb 100644 --- a/src/serialization/types/ScheduleConcurrencyPolicy.ts +++ b/src/serialization/types/ScheduleConcurrencyPolicy.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const ScheduleConcurrencyPolicy: core.serialization.Schema = core.serialization.enum_(["Forbid", "Allow", "Replace"]); +export const ScheduleConcurrencyPolicy: core.serialization.Schema< + serializers.ScheduleConcurrencyPolicy.Raw, + TrueFoundry.ScheduleConcurrencyPolicy +> = core.serialization.enum_(["Forbid", "Allow", "Replace"]); export declare namespace ScheduleConcurrencyPolicy { export type Raw = "Forbid" | "Allow" | "Replace"; diff --git a/src/serialization/types/SearchRunsResponse.ts b/src/serialization/types/SearchRunsResponse.ts index 288e5ed8..a8db5267 100644 --- a/src/serialization/types/SearchRunsResponse.ts +++ b/src/serialization/types/SearchRunsResponse.ts @@ -1,20 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Run } from "./Run.js"; -export const SearchRunsResponse: core.serialization.ObjectSchema = core.serialization.object({ - "runs": core.serialization.list(Run), - "total": core.serialization.number().optional(), - "nextPageToken": core.serialization.property("next_page_token", core.serialization.string().optional()) - }); +export const SearchRunsResponse: core.serialization.ObjectSchema< + serializers.SearchRunsResponse.Raw, + TrueFoundry.SearchRunsResponse +> = core.serialization.object({ + runs: core.serialization.list(Run), + total: core.serialization.number().optionalNullable(), + nextPageToken: core.serialization.property("next_page_token", core.serialization.string().optionalNullable()), +}); export declare namespace SearchRunsResponse { export interface Raw { runs: Run.Raw[]; - total?: number | null; - next_page_token?: string | null; + total?: (number | null | undefined) | null; + next_page_token?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/Secret.ts b/src/serialization/types/Secret.ts index 418cc6d1..0a01051d 100644 --- a/src/serialization/types/Secret.ts +++ b/src/serialization/types/Secret.ts @@ -1,22 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; import * as serializers from "../index.js"; import { Subject } from "./Subject.js"; -export const Secret: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string(), - "fqn": core.serialization.string(), - "name": core.serialization.string(), - "secretGroupId": core.serialization.string(), - "value": core.serialization.string().optional(), - "createdBySubject": Subject.optional(), - "createdAt": core.serialization.date().optional(), - "updatedAt": core.serialization.date().optional(), - "secretVersions": core.serialization.list(core.serialization.lazyObject(() => serializers.SecretVersion)).optional(), - "activeDeploymentsCount": core.serialization.number().optional(), - "createdBy": core.serialization.string().optional() +export const Secret: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string(), + fqn: core.serialization.string(), + name: core.serialization.string(), + secretGroupId: core.serialization.string(), + value: core.serialization.string().optionalNullable(), + createdBySubject: Subject.optionalNullable(), + createdAt: core.serialization.date().optionalNullable(), + updatedAt: core.serialization.date().optionalNullable(), + secretVersions: core.serialization + .list(core.serialization.lazyObject(() => serializers.SecretVersion)) + .optionalNullable(), + activeDeploymentsCount: core.serialization.number().optionalNullable(), + createdBy: core.serialization.string().optionalNullable(), }); export declare namespace Secret { @@ -25,12 +28,12 @@ export declare namespace Secret { fqn: string; name: string; secretGroupId: string; - value?: string | null; - createdBySubject?: Subject.Raw | null; - createdAt?: string | null; - updatedAt?: string | null; - secretVersions?: serializers.SecretVersion.Raw[] | null; - activeDeploymentsCount?: number | null; - createdBy?: string | null; + value?: (string | null | undefined) | null; + createdBySubject?: (Subject.Raw | null | undefined) | null; + createdAt?: (string | null | undefined) | null; + updatedAt?: (string | null | undefined) | null; + secretVersions?: (serializers.SecretVersion.Raw[] | null | undefined) | null; + activeDeploymentsCount?: (number | null | undefined) | null; + createdBy?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/SecretDetectionGuardrailConfig.ts b/src/serialization/types/SecretDetectionGuardrailConfig.ts index a0d409eb..90c2adcd 100644 --- a/src/serialization/types/SecretDetectionGuardrailConfig.ts +++ b/src/serialization/types/SecretDetectionGuardrailConfig.ts @@ -1,21 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { EnforcingStrategy } from "./EnforcingStrategy.js"; import { SecretDetectionGuardrailConfigConfig } from "./SecretDetectionGuardrailConfigConfig.js"; import { SecretDetectionGuardrailConfigOperation } from "./SecretDetectionGuardrailConfigOperation.js"; -export const SecretDetectionGuardrailConfig: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string().optional(), - "type": core.serialization.stringLiteral("integration/guardrail-config/secret-detection"), - "operation": SecretDetectionGuardrailConfigOperation, - "priority": core.serialization.number().optional(), - "enforcingStrategy": core.serialization.property("enforcing_strategy", EnforcingStrategy), - "config": SecretDetectionGuardrailConfigConfig.optional() - }); +export const SecretDetectionGuardrailConfig: core.serialization.ObjectSchema< + serializers.SecretDetectionGuardrailConfig.Raw, + TrueFoundry.SecretDetectionGuardrailConfig +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + type: core.serialization.stringLiteral("integration/guardrail-config/secret-detection"), + operation: SecretDetectionGuardrailConfigOperation, + priority: core.serialization.number().optional(), + enforcingStrategy: core.serialization.property("enforcing_strategy", EnforcingStrategy), + config: SecretDetectionGuardrailConfigConfig.optional(), +}); export declare namespace SecretDetectionGuardrailConfig { export interface Raw { diff --git a/src/serialization/types/SecretDetectionGuardrailConfigConfig.ts b/src/serialization/types/SecretDetectionGuardrailConfigConfig.ts index decd8456..7157ae6a 100644 --- a/src/serialization/types/SecretDetectionGuardrailConfigConfig.ts +++ b/src/serialization/types/SecretDetectionGuardrailConfigConfig.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SecretDetectionGuardrailConfigConfig: core.serialization.ObjectSchema = core.serialization.object({ - "redactionText": core.serialization.property("redaction_text", core.serialization.string().optional()) - }); +export const SecretDetectionGuardrailConfigConfig: core.serialization.ObjectSchema< + serializers.SecretDetectionGuardrailConfigConfig.Raw, + TrueFoundry.SecretDetectionGuardrailConfigConfig +> = core.serialization.object({ + redactionText: core.serialization.property("redaction_text", core.serialization.string().optional()), +}); export declare namespace SecretDetectionGuardrailConfigConfig { export interface Raw { diff --git a/src/serialization/types/SecretDetectionGuardrailConfigOperation.ts b/src/serialization/types/SecretDetectionGuardrailConfigOperation.ts index a1438380..f3fca1b0 100644 --- a/src/serialization/types/SecretDetectionGuardrailConfigOperation.ts +++ b/src/serialization/types/SecretDetectionGuardrailConfigOperation.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SecretDetectionGuardrailConfigOperation: core.serialization.Schema = core.serialization.enum_(["validate", "mutate"]); +export const SecretDetectionGuardrailConfigOperation: core.serialization.Schema< + serializers.SecretDetectionGuardrailConfigOperation.Raw, + TrueFoundry.SecretDetectionGuardrailConfigOperation +> = core.serialization.enum_(["validate", "mutate"]); export declare namespace SecretDetectionGuardrailConfigOperation { export type Raw = "validate" | "mutate"; diff --git a/src/serialization/types/SecretGroup.ts b/src/serialization/types/SecretGroup.ts index 8a142fae..842b8ec3 100644 --- a/src/serialization/types/SecretGroup.ts +++ b/src/serialization/types/SecretGroup.ts @@ -1,36 +1,39 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; import * as serializers from "../index.js"; import { Subject } from "./Subject.js"; -export const SecretGroup: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string().optional(), - "fqn": core.serialization.string().optional(), - "tenantName": core.serialization.string(), - "createdBySubject": Subject, - "associatedSecrets": core.serialization.list(core.serialization.lazyObject(() => serializers.Secret)), - "integrationId": core.serialization.string().optional(), - "manifest": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - "accountId": core.serialization.string(), - "createdAt": core.serialization.date(), - "updatedAt": core.serialization.date(), - "createdBy": core.serialization.string().optional() +export const SecretGroup: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string().optionalNullable(), + fqn: core.serialization.string().optionalNullable(), + tenantName: core.serialization.string(), + createdBySubject: Subject, + associatedSecrets: core.serialization.list(core.serialization.lazyObject(() => serializers.Secret)), + integrationId: core.serialization.string().optionalNullable(), + manifest: core.serialization + .record(core.serialization.string(), core.serialization.unknown()) + .optionalNullable(), + accountId: core.serialization.string(), + createdAt: core.serialization.date(), + updatedAt: core.serialization.date(), + createdBy: core.serialization.string().optionalNullable(), }); export declare namespace SecretGroup { export interface Raw { - id?: string | null; - fqn?: string | null; + id?: (string | null | undefined) | null; + fqn?: (string | null | undefined) | null; tenantName: string; createdBySubject: Subject.Raw; associatedSecrets: serializers.Secret.Raw[]; - integrationId?: string | null; - manifest?: Record | null; + integrationId?: (string | null | undefined) | null; + manifest?: (Record | null | undefined) | null; accountId: string; createdAt: string; updatedAt: string; - createdBy?: string | null; + createdBy?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/SecretGroupManifest.ts b/src/serialization/types/SecretGroupManifest.ts index 43677eb8..6ec939f3 100644 --- a/src/serialization/types/SecretGroupManifest.ts +++ b/src/serialization/types/SecretGroupManifest.ts @@ -1,18 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { OwnedBy } from "./OwnedBy.js"; -export const SecretGroupManifest: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("secret-group"), - "name": core.serialization.string(), - "integrationFqn": core.serialization.property("integration_fqn", core.serialization.string()), - "collaborators": core.serialization.list(Collaborator), - "ownedBy": OwnedBy.optional() - }); +export const SecretGroupManifest: core.serialization.ObjectSchema< + serializers.SecretGroupManifest.Raw, + TrueFoundry.SecretGroupManifest +> = core.serialization.object({ + type: core.serialization.stringLiteral("secret-group"), + name: core.serialization.string(), + integrationFqn: core.serialization.property("integration_fqn", core.serialization.string()), + collaborators: core.serialization.list(Collaborator), + ownedBy: OwnedBy.optional(), +}); export declare namespace SecretGroupManifest { export interface Raw { diff --git a/src/serialization/types/SecretInput.ts b/src/serialization/types/SecretInput.ts index 97f37386..73dc3f74 100644 --- a/src/serialization/types/SecretInput.ts +++ b/src/serialization/types/SecretInput.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SecretInput: core.serialization.ObjectSchema = core.serialization.object({ - "key": core.serialization.string(), - "value": core.serialization.string() +export const SecretInput: core.serialization.ObjectSchema = + core.serialization.object({ + key: core.serialization.string(), + value: core.serialization.string(), }); export declare namespace SecretInput { diff --git a/src/serialization/types/SecretMount.ts b/src/serialization/types/SecretMount.ts index e62236db..28383687 100644 --- a/src/serialization/types/SecretMount.ts +++ b/src/serialization/types/SecretMount.ts @@ -1,13 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SecretMount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("secret"), - "mountPath": core.serialization.property("mount_path", core.serialization.string()), - "secretFqn": core.serialization.property("secret_fqn", core.serialization.string()) +export const SecretMount: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("secret"), + mountPath: core.serialization.property("mount_path", core.serialization.string()), + secretFqn: core.serialization.property("secret_fqn", core.serialization.string()), }); export declare namespace SecretMount { diff --git a/src/serialization/types/SecretStoreConfig.ts b/src/serialization/types/SecretStoreConfig.ts index a2e68290..9113724f 100644 --- a/src/serialization/types/SecretStoreConfig.ts +++ b/src/serialization/types/SecretStoreConfig.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SecretStoreConfig: core.serialization.ObjectSchema = core.serialization.object({ - "integrationFqn": core.serialization.property("integration_fqn", core.serialization.string()), - "secretPath": core.serialization.property("secret_path", core.serialization.string()) - }); +export const SecretStoreConfig: core.serialization.ObjectSchema< + serializers.SecretStoreConfig.Raw, + TrueFoundry.SecretStoreConfig +> = core.serialization.object({ + integrationFqn: core.serialization.property("integration_fqn", core.serialization.string()), + secretPath: core.serialization.property("secret_path", core.serialization.string()), +}); export declare namespace SecretStoreConfig { export interface Raw { diff --git a/src/serialization/types/SecretVersion.ts b/src/serialization/types/SecretVersion.ts index 01a248e1..bd4a1d4e 100644 --- a/src/serialization/types/SecretVersion.ts +++ b/src/serialization/types/SecretVersion.ts @@ -1,29 +1,30 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; import * as serializers from "../index.js"; -export const SecretVersion: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string(), - "fqn": core.serialization.string(), - "value": core.serialization.string().optional(), - "version": core.serialization.number().optional(), - "secret": core.serialization.lazyObject(() => serializers.Secret).optional(), - "secretId": core.serialization.string().optional(), - "createdAt": core.serialization.date().optional(), - "updatedAt": core.serialization.date().optional() +export const SecretVersion: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string(), + fqn: core.serialization.string(), + value: core.serialization.string().optionalNullable(), + version: core.serialization.number().optionalNullable(), + secret: core.serialization.lazyObject(() => serializers.Secret).optionalNullable(), + secretId: core.serialization.string().optionalNullable(), + createdAt: core.serialization.date().optionalNullable(), + updatedAt: core.serialization.date().optionalNullable(), }); export declare namespace SecretVersion { export interface Raw { id: string; fqn: string; - value?: string | null; - version?: number | null; - secret?: serializers.Secret.Raw | null; - secretId?: string | null; - createdAt?: string | null; - updatedAt?: string | null; + value?: (string | null | undefined) | null; + version?: (number | null | undefined) | null; + secret?: (serializers.Secret.Raw | null | undefined) | null; + secretId?: (string | null | undefined) | null; + createdAt?: (string | null | undefined) | null; + updatedAt?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/SelfHostedAgent.ts b/src/serialization/types/SelfHostedAgent.ts index 4f66648f..04bc84de 100644 --- a/src/serialization/types/SelfHostedAgent.ts +++ b/src/serialization/types/SelfHostedAgent.ts @@ -1,18 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AgentFramework } from "./AgentFramework.js"; import { BaseRemoteAgent } from "./BaseRemoteAgent.js"; import { CustomAgentServerAuth } from "./CustomAgentServerAuth.js"; -export const SelfHostedAgent: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("remote-agent/self-hosted"), - "url": core.serialization.string(), - "authData": core.serialization.property("auth_data", CustomAgentServerAuth.optional()), - "framework": AgentFramework - }).extend(BaseRemoteAgent); +export const SelfHostedAgent: core.serialization.ObjectSchema< + serializers.SelfHostedAgent.Raw, + TrueFoundry.SelfHostedAgent +> = core.serialization + .object({ + type: core.serialization.stringLiteral("remote-agent/self-hosted"), + url: core.serialization.string(), + authData: core.serialization.property("auth_data", CustomAgentServerAuth.optional()), + framework: AgentFramework, + }) + .extend(BaseRemoteAgent); export declare namespace SelfHostedAgent { export interface Raw extends BaseRemoteAgent.Raw { diff --git a/src/serialization/types/SelfHostedModel.ts b/src/serialization/types/SelfHostedModel.ts index 0d10bc10..1488e44b 100644 --- a/src/serialization/types/SelfHostedModel.ts +++ b/src/serialization/types/SelfHostedModel.ts @@ -1,28 +1,34 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { CustomTlsSettings } from "./CustomTlsSettings.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; import { SelfHostedModelAuthData } from "./SelfHostedModelAuthData.js"; import { SelfHostedModelModelServer } from "./SelfHostedModelModelServer.js"; -export const SelfHostedModel: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/model/self-hosted-model"), - "name": core.serialization.string(), - "hostedModelName": core.serialization.property("hosted_model_name", core.serialization.string()), - "url": core.serialization.string(), - "modelServer": core.serialization.property("model_server", SelfHostedModelModelServer), - "tfyApplicationId": core.serialization.property("tfy_application_id", core.serialization.string().optional()), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "tlsSettings": core.serialization.property("tls_settings", CustomTlsSettings.optional()), - "authData": core.serialization.property("auth_data", SelfHostedModelAuthData.optional()), - "headers": core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const SelfHostedModel: core.serialization.ObjectSchema< + serializers.SelfHostedModel.Raw, + TrueFoundry.SelfHostedModel +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/model/self-hosted-model"), + name: core.serialization.string(), + hostedModelName: core.serialization.property("hosted_model_name", core.serialization.string()), + url: core.serialization.string(), + modelServer: core.serialization.property("model_server", SelfHostedModelModelServer), + tfyApplicationId: core.serialization.property("tfy_application_id", core.serialization.string().optional()), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + tlsSettings: core.serialization.property("tls_settings", CustomTlsSettings.optional()), + authData: core.serialization.property("auth_data", SelfHostedModelAuthData.optional()), + headers: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace SelfHostedModel { export interface Raw { diff --git a/src/serialization/types/SelfHostedModelAuthData.ts b/src/serialization/types/SelfHostedModelAuthData.ts index 92955ea4..7048a421 100644 --- a/src/serialization/types/SelfHostedModelAuthData.ts +++ b/src/serialization/types/SelfHostedModelAuthData.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { CustomBasicAuth } from "./CustomBasicAuth.js"; import { CustomBearerAuth } from "./CustomBearerAuth.js"; -export const SelfHostedModelAuthData: core.serialization.Schema = core.serialization.undiscriminatedUnion([CustomBasicAuth, CustomBearerAuth]); +export const SelfHostedModelAuthData: core.serialization.Schema< + serializers.SelfHostedModelAuthData.Raw, + TrueFoundry.SelfHostedModelAuthData +> = core.serialization.undiscriminatedUnion([CustomBasicAuth, CustomBearerAuth]); export declare namespace SelfHostedModelAuthData { export type Raw = CustomBasicAuth.Raw | CustomBearerAuth.Raw; diff --git a/src/serialization/types/SelfHostedModelIntegrations.ts b/src/serialization/types/SelfHostedModelIntegrations.ts index c250161d..3bac1679 100644 --- a/src/serialization/types/SelfHostedModelIntegrations.ts +++ b/src/serialization/types/SelfHostedModelIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { SelfHostedModel } from "./SelfHostedModel.js"; -export const SelfHostedModelIntegrations: core.serialization.ObjectSchema = SelfHostedModel; +export const SelfHostedModelIntegrations: core.serialization.ObjectSchema< + serializers.SelfHostedModelIntegrations.Raw, + TrueFoundry.SelfHostedModelIntegrations +> = SelfHostedModel; export declare namespace SelfHostedModelIntegrations { export type Raw = SelfHostedModel.Raw; diff --git a/src/serialization/types/SelfHostedModelModelServer.ts b/src/serialization/types/SelfHostedModelModelServer.ts index 390c844b..40af5351 100644 --- a/src/serialization/types/SelfHostedModelModelServer.ts +++ b/src/serialization/types/SelfHostedModelModelServer.ts @@ -1,10 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SelfHostedModelModelServer: core.serialization.Schema = core.serialization.enum_(["openai-compatible", "cohere-rerank-v2", "nemo-retriever", "infinity", "tei", "vllm-openai"]); +export const SelfHostedModelModelServer: core.serialization.Schema< + serializers.SelfHostedModelModelServer.Raw, + TrueFoundry.SelfHostedModelModelServer +> = core.serialization.enum_([ + "openai-compatible", + "cohere-rerank-v2", + "nemo-retriever", + "infinity", + "tei", + "vllm-openai", +]); export declare namespace SelfHostedModelModelServer { export type Raw = "openai-compatible" | "cohere-rerank-v2" | "nemo-retriever" | "infinity" | "tei" | "vllm-openai"; diff --git a/src/serialization/types/SelfHostedModelProviderAccount.ts b/src/serialization/types/SelfHostedModelProviderAccount.ts index c3bdc46d..b98e5332 100644 --- a/src/serialization/types/SelfHostedModelProviderAccount.ts +++ b/src/serialization/types/SelfHostedModelProviderAccount.ts @@ -1,20 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { OwnedBy } from "./OwnedBy.js"; import { SelfHostedModelIntegrations } from "./SelfHostedModelIntegrations.js"; -export const SelfHostedModelProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/self-hosted-model"), - "name": core.serialization.string(), - "integrations": core.serialization.list(SelfHostedModelIntegrations), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const SelfHostedModelProviderAccount: core.serialization.ObjectSchema< + serializers.SelfHostedModelProviderAccount.Raw, + TrueFoundry.SelfHostedModelProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/self-hosted-model"), + name: core.serialization.string(), + integrations: core.serialization.list(SelfHostedModelIntegrations), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace SelfHostedModelProviderAccount { export interface Raw { diff --git a/src/serialization/types/SemanticCacheConfig.ts b/src/serialization/types/SemanticCacheConfig.ts index 90e354ac..58dad60b 100644 --- a/src/serialization/types/SemanticCacheConfig.ts +++ b/src/serialization/types/SemanticCacheConfig.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SemanticCacheConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("semantic"), - "similarityThreshold": core.serialization.property("similarity_threshold", core.serialization.number()), - "namespace": core.serialization.string().optional(), - "ttl": core.serialization.number() - }); +export const SemanticCacheConfig: core.serialization.ObjectSchema< + serializers.SemanticCacheConfig.Raw, + TrueFoundry.SemanticCacheConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("semantic"), + similarityThreshold: core.serialization.property("similarity_threshold", core.serialization.number()), + namespace: core.serialization.string().optional(), + ttl: core.serialization.number(), +}); export declare namespace SemanticCacheConfig { export interface Raw { diff --git a/src/serialization/types/SemanticCacheSettings.ts b/src/serialization/types/SemanticCacheSettings.ts index c44ac764..87573daa 100644 --- a/src/serialization/types/SemanticCacheSettings.ts +++ b/src/serialization/types/SemanticCacheSettings.ts @@ -1,12 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SemanticCacheSettings: core.serialization.ObjectSchema = core.serialization.object({ - "semanticCacheEmbeddingModel": core.serialization.property("semantic_cache_embedding_model", core.serialization.string()) - }); +export const SemanticCacheSettings: core.serialization.ObjectSchema< + serializers.SemanticCacheSettings.Raw, + TrueFoundry.SemanticCacheSettings +> = core.serialization.object({ + semanticCacheEmbeddingModel: core.serialization.property( + "semantic_cache_embedding_model", + core.serialization.string(), + ), +}); export declare namespace SemanticCacheSettings { export interface Raw { diff --git a/src/serialization/types/Service.ts b/src/serialization/types/Service.ts index 49a132b5..99d0088b 100644 --- a/src/serialization/types/Service.ts +++ b/src/serialization/types/Service.ts @@ -1,20 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Autoshutdown } from "./Autoshutdown.js"; import { BaseService } from "./BaseService.js"; import { ServiceReplicas } from "./ServiceReplicas.js"; import { ServiceRolloutStrategy } from "./ServiceRolloutStrategy.js"; -export const Service: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("service"), - "replicas": ServiceReplicas, - "autoShutdown": core.serialization.property("auto_shutdown", Autoshutdown.optional()), - "allowInterception": core.serialization.property("allow_interception", core.serialization.boolean().optional()), - "rolloutStrategy": core.serialization.property("rollout_strategy", ServiceRolloutStrategy.optional()) - }).extend(BaseService); +export const Service: core.serialization.ObjectSchema = core.serialization + .object({ + type: core.serialization.stringLiteral("service"), + replicas: ServiceReplicas, + autoShutdown: core.serialization.property("auto_shutdown", Autoshutdown.optional()), + allowInterception: core.serialization.property("allow_interception", core.serialization.boolean().optional()), + rolloutStrategy: core.serialization.property("rollout_strategy", ServiceRolloutStrategy.optional()), + }) + .extend(BaseService); export declare namespace Service { export interface Raw extends BaseService.Raw { diff --git a/src/serialization/types/ServiceAutoscaling.ts b/src/serialization/types/ServiceAutoscaling.ts index 064d68fd..aa42775a 100644 --- a/src/serialization/types/ServiceAutoscaling.ts +++ b/src/serialization/types/ServiceAutoscaling.ts @@ -1,14 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BaseAutoscaling } from "./BaseAutoscaling.js"; import { ServiceAutoscalingMetrics } from "./ServiceAutoscalingMetrics.js"; -export const ServiceAutoscaling: core.serialization.ObjectSchema = core.serialization.object({ - "metrics": ServiceAutoscalingMetrics - }).extend(BaseAutoscaling); +export const ServiceAutoscaling: core.serialization.ObjectSchema< + serializers.ServiceAutoscaling.Raw, + TrueFoundry.ServiceAutoscaling +> = core.serialization + .object({ + metrics: ServiceAutoscalingMetrics, + }) + .extend(BaseAutoscaling); export declare namespace ServiceAutoscaling { export interface Raw extends BaseAutoscaling.Raw { diff --git a/src/serialization/types/ServiceAutoscalingMetrics.ts b/src/serialization/types/ServiceAutoscalingMetrics.ts index 9a0f0c95..107f810f 100644 --- a/src/serialization/types/ServiceAutoscalingMetrics.ts +++ b/src/serialization/types/ServiceAutoscalingMetrics.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { CpuUtilizationMetric } from "./CpuUtilizationMetric.js"; import { CronMetric } from "./CronMetric.js"; import { RpsMetric } from "./RpsMetric.js"; -export const ServiceAutoscalingMetrics: core.serialization.Schema = core.serialization.undiscriminatedUnion([CpuUtilizationMetric, RpsMetric, CronMetric]); +export const ServiceAutoscalingMetrics: core.serialization.Schema< + serializers.ServiceAutoscalingMetrics.Raw, + TrueFoundry.ServiceAutoscalingMetrics +> = core.serialization.undiscriminatedUnion([CpuUtilizationMetric, RpsMetric, CronMetric]); export declare namespace ServiceAutoscalingMetrics { export type Raw = CpuUtilizationMetric.Raw | RpsMetric.Raw | CronMetric.Raw; diff --git a/src/serialization/types/ServiceReplicas.ts b/src/serialization/types/ServiceReplicas.ts index b811b774..46c4a2ff 100644 --- a/src/serialization/types/ServiceReplicas.ts +++ b/src/serialization/types/ServiceReplicas.ts @@ -1,11 +1,12 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ServiceAutoscaling } from "./ServiceAutoscaling.js"; -export const ServiceReplicas: core.serialization.Schema = core.serialization.undiscriminatedUnion([core.serialization.number(), ServiceAutoscaling]); +export const ServiceReplicas: core.serialization.Schema = + core.serialization.undiscriminatedUnion([core.serialization.number(), ServiceAutoscaling]); export declare namespace ServiceReplicas { export type Raw = number | ServiceAutoscaling.Raw; diff --git a/src/serialization/types/ServiceRolloutStrategy.ts b/src/serialization/types/ServiceRolloutStrategy.ts index b8ea97c0..0fb93ac0 100644 --- a/src/serialization/types/ServiceRolloutStrategy.ts +++ b/src/serialization/types/ServiceRolloutStrategy.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BlueGreen } from "./BlueGreen.js"; import { Canary } from "./Canary.js"; import { Rolling } from "./Rolling.js"; -export const ServiceRolloutStrategy: core.serialization.Schema = core.serialization.undiscriminatedUnion([Rolling, Canary, BlueGreen]); +export const ServiceRolloutStrategy: core.serialization.Schema< + serializers.ServiceRolloutStrategy.Raw, + TrueFoundry.ServiceRolloutStrategy +> = core.serialization.undiscriminatedUnion([Rolling, Canary, BlueGreen]); export declare namespace ServiceRolloutStrategy { export type Raw = Rolling.Raw | Canary.Raw | BlueGreen.Raw; diff --git a/src/serialization/types/Session.ts b/src/serialization/types/Session.ts index 7a474840..dde447d5 100644 --- a/src/serialization/types/Session.ts +++ b/src/serialization/types/Session.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Account } from "./Account.js"; import { SessionAccount } from "./SessionAccount.js"; import { SessionActor } from "./SessionActor.js"; @@ -10,50 +10,53 @@ import { SessionTeam } from "./SessionTeam.js"; import { SubjectType } from "./SubjectType.js"; import { UserMetadata } from "./UserMetadata.js"; -export const Session: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string(), - "userName": core.serialization.string().optional(), - "subjectSlug": core.serialization.string(), - "subjectControllerName": core.serialization.string().optional(), - "subjectPatName": core.serialization.string().optional(), - "subjectExternalIdentitySlug": core.serialization.string().optional(), - "email": core.serialization.string().optional(), - "subjectType": SubjectType, - "tenantName": core.serialization.string().optional(), - "roles": core.serialization.list(core.serialization.string()), - "teams": core.serialization.list(SessionTeam), - "accounts": core.serialization.list(SessionAccount), - "metadata": UserMetadata.optional(), - "createdAt": core.serialization.date().optional(), - "isBillingEnabled": core.serialization.boolean().optional(), - "actor": SessionActor.optional(), - "serviceAccountMetadata": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - "account": Account.optional(), - "rootAccount": Account.optional(), - "effectiveUserId": core.serialization.string() +export const Session: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string(), + userName: core.serialization.string().optionalNullable(), + subjectSlug: core.serialization.string(), + subjectControllerName: core.serialization.string().optionalNullable(), + subjectPatName: core.serialization.string().optionalNullable(), + subjectExternalIdentitySlug: core.serialization.string().optionalNullable(), + email: core.serialization.string().optionalNullable(), + subjectType: SubjectType, + tenantName: core.serialization.string().optionalNullable(), + roles: core.serialization.list(core.serialization.string()), + teams: core.serialization.list(SessionTeam), + accounts: core.serialization.list(SessionAccount), + metadata: UserMetadata.optionalNullable(), + createdAt: core.serialization.date().optionalNullable(), + isBillingEnabled: core.serialization.boolean().optionalNullable(), + actor: SessionActor.optionalNullable(), + serviceAccountMetadata: core.serialization + .record(core.serialization.string(), core.serialization.unknown()) + .optionalNullable(), + account: Account.optionalNullable(), + rootAccount: Account.optionalNullable(), + effectiveUserId: core.serialization.string(), }); export declare namespace Session { export interface Raw { id: string; - userName?: string | null; + userName?: (string | null | undefined) | null; subjectSlug: string; - subjectControllerName?: string | null; - subjectPatName?: string | null; - subjectExternalIdentitySlug?: string | null; - email?: string | null; + subjectControllerName?: (string | null | undefined) | null; + subjectPatName?: (string | null | undefined) | null; + subjectExternalIdentitySlug?: (string | null | undefined) | null; + email?: (string | null | undefined) | null; subjectType: SubjectType.Raw; - tenantName?: string | null; + tenantName?: (string | null | undefined) | null; roles: string[]; teams: SessionTeam.Raw[]; accounts: SessionAccount.Raw[]; - metadata?: UserMetadata.Raw | null; - createdAt?: string | null; - isBillingEnabled?: boolean | null; - actor?: SessionActor.Raw | null; - serviceAccountMetadata?: Record | null; - account?: Account.Raw | null; - rootAccount?: Account.Raw | null; + metadata?: (UserMetadata.Raw | null | undefined) | null; + createdAt?: (string | null | undefined) | null; + isBillingEnabled?: (boolean | null | undefined) | null; + actor?: (SessionActor.Raw | null | undefined) | null; + serviceAccountMetadata?: (Record | null | undefined) | null; + account?: (Account.Raw | null | undefined) | null; + rootAccount?: (Account.Raw | null | undefined) | null; effectiveUserId: string; } } diff --git a/src/serialization/types/SessionAccount.ts b/src/serialization/types/SessionAccount.ts index 86400999..83bfc3ae 100644 --- a/src/serialization/types/SessionAccount.ts +++ b/src/serialization/types/SessionAccount.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SessionAccount: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "id": core.serialization.string() - }); +export const SessionAccount: core.serialization.ObjectSchema< + serializers.SessionAccount.Raw, + TrueFoundry.SessionAccount +> = core.serialization.object({ + name: core.serialization.string(), + id: core.serialization.string(), +}); export declare namespace SessionAccount { export interface Raw { diff --git a/src/serialization/types/SessionActor.ts b/src/serialization/types/SessionActor.ts index cf000d78..9b958477 100644 --- a/src/serialization/types/SessionActor.ts +++ b/src/serialization/types/SessionActor.ts @@ -1,15 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SessionActor: core.serialization.ObjectSchema = core.serialization.object({ - "organization": core.serialization.string().optional() +export const SessionActor: core.serialization.ObjectSchema = + core.serialization.object({ + organization: core.serialization.string().optionalNullable(), }); export declare namespace SessionActor { export interface Raw { - organization?: string | null; + organization?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/SessionTeam.ts b/src/serialization/types/SessionTeam.ts index d238b6f0..927addd4 100644 --- a/src/serialization/types/SessionTeam.ts +++ b/src/serialization/types/SessionTeam.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SessionTeam: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "id": core.serialization.string() +export const SessionTeam: core.serialization.ObjectSchema = + core.serialization.object({ + name: core.serialization.string(), + id: core.serialization.string(), }); export declare namespace SessionTeam { diff --git a/src/serialization/types/Settings.ts b/src/serialization/types/Settings.ts new file mode 100644 index 00000000..24e0606a --- /dev/null +++ b/src/serialization/types/Settings.ts @@ -0,0 +1,29 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { Subject } from "./Subject.js"; + +export const Settings: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string().optionalNullable(), + tenantName: core.serialization.string(), + type: core.serialization.string(), + manifest: core.serialization.record(core.serialization.string(), core.serialization.unknown()), + createdBySubject: Subject, + metadata: core.serialization + .record(core.serialization.string(), core.serialization.unknown()) + .optionalNullable(), + }); + +export declare namespace Settings { + export interface Raw { + id?: (string | null | undefined) | null; + tenantName: string; + type: string; + manifest: Record; + createdBySubject: Subject.Raw; + metadata?: (Record | null | undefined) | null; + } +} diff --git a/src/serialization/types/SignedUrl.ts b/src/serialization/types/SignedUrl.ts index 4238df9a..23b06603 100644 --- a/src/serialization/types/SignedUrl.ts +++ b/src/serialization/types/SignedUrl.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SignedUrl: core.serialization.ObjectSchema = core.serialization.object({ - "path": core.serialization.string(), - "signedUrl": core.serialization.property("signed_url", core.serialization.string()) +export const SignedUrl: core.serialization.ObjectSchema = + core.serialization.object({ + path: core.serialization.string(), + signedUrl: core.serialization.property("signed_url", core.serialization.string()), }); export declare namespace SignedUrl { diff --git a/src/serialization/types/SklearnFramework.ts b/src/serialization/types/SklearnFramework.ts index 0af62580..cc6fec95 100644 --- a/src/serialization/types/SklearnFramework.ts +++ b/src/serialization/types/SklearnFramework.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { SklearnModelSchema } from "./SklearnModelSchema.js"; import { SklearnSerializationFormat } from "./SklearnSerializationFormat.js"; -export const SklearnFramework: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("sklearn"), - "modelFilepath": core.serialization.property("model_filepath", core.serialization.string().optional()), - "serializationFormat": core.serialization.property("serialization_format", SklearnSerializationFormat.optional()), - "modelSchema": core.serialization.property("model_schema", SklearnModelSchema.optional()) - }); +export const SklearnFramework: core.serialization.ObjectSchema< + serializers.SklearnFramework.Raw, + TrueFoundry.SklearnFramework +> = core.serialization.object({ + type: core.serialization.stringLiteral("sklearn"), + modelFilepath: core.serialization.property("model_filepath", core.serialization.string().optional()), + serializationFormat: core.serialization.property("serialization_format", SklearnSerializationFormat.optional()), + modelSchema: core.serialization.property("model_schema", SklearnModelSchema.optional()), +}); export declare namespace SklearnFramework { export interface Raw { diff --git a/src/serialization/types/SklearnModelSchema.ts b/src/serialization/types/SklearnModelSchema.ts index 4d0104d9..ffe20765 100644 --- a/src/serialization/types/SklearnModelSchema.ts +++ b/src/serialization/types/SklearnModelSchema.ts @@ -1,15 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { InferMethodName } from "./InferMethodName.js"; -export const SklearnModelSchema: core.serialization.ObjectSchema = core.serialization.object({ - "inferMethodName": core.serialization.property("infer_method_name", InferMethodName), - "inputs": core.serialization.list(core.serialization.record(core.serialization.string(), core.serialization.unknown())), - "outputs": core.serialization.list(core.serialization.record(core.serialization.string(), core.serialization.unknown())) - }); +export const SklearnModelSchema: core.serialization.ObjectSchema< + serializers.SklearnModelSchema.Raw, + TrueFoundry.SklearnModelSchema +> = core.serialization.object({ + inferMethodName: core.serialization.property("infer_method_name", InferMethodName), + inputs: core.serialization.list( + core.serialization.record(core.serialization.string(), core.serialization.unknown()), + ), + outputs: core.serialization.list( + core.serialization.record(core.serialization.string(), core.serialization.unknown()), + ), +}); export declare namespace SklearnModelSchema { export interface Raw { diff --git a/src/serialization/types/SklearnSerializationFormat.ts b/src/serialization/types/SklearnSerializationFormat.ts index 80eed4d9..d14a8e25 100644 --- a/src/serialization/types/SklearnSerializationFormat.ts +++ b/src/serialization/types/SklearnSerializationFormat.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SklearnSerializationFormat: core.serialization.Schema = core.serialization.enum_(["cloudpickle", "joblib", "pickle"]); +export const SklearnSerializationFormat: core.serialization.Schema< + serializers.SklearnSerializationFormat.Raw, + TrueFoundry.SklearnSerializationFormat +> = core.serialization.enum_(["cloudpickle", "joblib", "pickle"]); export declare namespace SklearnSerializationFormat { export type Raw = "cloudpickle" | "joblib" | "pickle"; diff --git a/src/serialization/types/SlaCutoff.ts b/src/serialization/types/SlaCutoff.ts index eb5579f1..2c820667 100644 --- a/src/serialization/types/SlaCutoff.ts +++ b/src/serialization/types/SlaCutoff.ts @@ -1,12 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SlaCutoff: core.serialization.ObjectSchema = core.serialization.object({ - "timePerOutputTokenMs": core.serialization.property("time_per_output_token_ms", core.serialization.number().optional()), - "timeToFirstTokenMs": core.serialization.property("time_to_first_token_ms", core.serialization.number().optional()) +export const SlaCutoff: core.serialization.ObjectSchema = + core.serialization.object({ + timePerOutputTokenMs: core.serialization.property( + "time_per_output_token_ms", + core.serialization.number().optional(), + ), + timeToFirstTokenMs: core.serialization.property( + "time_to_first_token_ms", + core.serialization.number().optional(), + ), }); export declare namespace SlaCutoff { diff --git a/src/serialization/types/SlackBot.ts b/src/serialization/types/SlackBot.ts index 32a5a16d..578e90e8 100644 --- a/src/serialization/types/SlackBot.ts +++ b/src/serialization/types/SlackBot.ts @@ -1,13 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SlackBot: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("slack-bot"), - "notificationChannel": core.serialization.property("notification_channel", core.serialization.string()), - "channels": core.serialization.list(core.serialization.string()) +export const SlackBot: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("slack-bot"), + notificationChannel: core.serialization.property("notification_channel", core.serialization.string()), + channels: core.serialization.list(core.serialization.string()), }); export declare namespace SlackBot { diff --git a/src/serialization/types/SlackBotAuth.ts b/src/serialization/types/SlackBotAuth.ts index fda836d2..19cf70cf 100644 --- a/src/serialization/types/SlackBotAuth.ts +++ b/src/serialization/types/SlackBotAuth.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SlackBotAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("slack-bot"), - "botToken": core.serialization.property("bot_token", core.serialization.string()) +export const SlackBotAuth: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("slack-bot"), + botToken: core.serialization.property("bot_token", core.serialization.string()), }); export declare namespace SlackBotAuth { diff --git a/src/serialization/types/SlackBotIntegration.ts b/src/serialization/types/SlackBotIntegration.ts index fa306c54..961098e2 100644 --- a/src/serialization/types/SlackBotIntegration.ts +++ b/src/serialization/types/SlackBotIntegration.ts @@ -1,16 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { SlackBotAuth } from "./SlackBotAuth.js"; -export const SlackBotIntegration: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/notification-channel/slack-bot"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", SlackBotAuth), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const SlackBotIntegration: core.serialization.ObjectSchema< + serializers.SlackBotIntegration.Raw, + TrueFoundry.SlackBotIntegration +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/notification-channel/slack-bot"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", SlackBotAuth), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace SlackBotIntegration { export interface Raw { diff --git a/src/serialization/types/SlackIntegrations.ts b/src/serialization/types/SlackIntegrations.ts index a1c2127e..9a23d428 100644 --- a/src/serialization/types/SlackIntegrations.ts +++ b/src/serialization/types/SlackIntegrations.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { SlackBotIntegration } from "./SlackBotIntegration.js"; import { SlackWebhookIntegration } from "./SlackWebhookIntegration.js"; -export const SlackIntegrations: core.serialization.Schema = core.serialization.undiscriminatedUnion([SlackWebhookIntegration, SlackBotIntegration]); +export const SlackIntegrations: core.serialization.Schema< + serializers.SlackIntegrations.Raw, + TrueFoundry.SlackIntegrations +> = core.serialization.undiscriminatedUnion([SlackWebhookIntegration, SlackBotIntegration]); export declare namespace SlackIntegrations { export type Raw = SlackWebhookIntegration.Raw | SlackBotIntegration.Raw; diff --git a/src/serialization/types/SlackProviderAccount.ts b/src/serialization/types/SlackProviderAccount.ts index 7425bade..d1c6cd16 100644 --- a/src/serialization/types/SlackProviderAccount.ts +++ b/src/serialization/types/SlackProviderAccount.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { OwnedBy } from "./OwnedBy.js"; import { SlackIntegrations } from "./SlackIntegrations.js"; -export const SlackProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/slack"), - "name": core.serialization.string(), - "integrations": core.serialization.list(SlackIntegrations), - "ownedBy": OwnedBy.optional() - }); +export const SlackProviderAccount: core.serialization.ObjectSchema< + serializers.SlackProviderAccount.Raw, + TrueFoundry.SlackProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/slack"), + name: core.serialization.string(), + integrations: core.serialization.list(SlackIntegrations), + ownedBy: OwnedBy.optional(), +}); export declare namespace SlackProviderAccount { export interface Raw { diff --git a/src/serialization/types/SlackWebhook.ts b/src/serialization/types/SlackWebhook.ts index 3b2d508c..2cca7a31 100644 --- a/src/serialization/types/SlackWebhook.ts +++ b/src/serialization/types/SlackWebhook.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SlackWebhook: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("slack-webhook"), - "notificationChannel": core.serialization.property("notification_channel", core.serialization.string()) +export const SlackWebhook: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("slack-webhook"), + notificationChannel: core.serialization.property("notification_channel", core.serialization.string()), }); export declare namespace SlackWebhook { diff --git a/src/serialization/types/SlackWebhookAuth.ts b/src/serialization/types/SlackWebhookAuth.ts index e43012f9..0e804692 100644 --- a/src/serialization/types/SlackWebhookAuth.ts +++ b/src/serialization/types/SlackWebhookAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SlackWebhookAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("slack-webhook"), - "webhookUrl": core.serialization.property("webhook_url", core.serialization.string()) - }); +export const SlackWebhookAuth: core.serialization.ObjectSchema< + serializers.SlackWebhookAuth.Raw, + TrueFoundry.SlackWebhookAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("slack-webhook"), + webhookUrl: core.serialization.property("webhook_url", core.serialization.string()), +}); export declare namespace SlackWebhookAuth { export interface Raw { diff --git a/src/serialization/types/SlackWebhookIntegration.ts b/src/serialization/types/SlackWebhookIntegration.ts index d498d546..19280a2e 100644 --- a/src/serialization/types/SlackWebhookIntegration.ts +++ b/src/serialization/types/SlackWebhookIntegration.ts @@ -1,16 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { SlackWebhookAuth } from "./SlackWebhookAuth.js"; -export const SlackWebhookIntegration: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/notification-channel/slack-webhook"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", SlackWebhookAuth), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const SlackWebhookIntegration: core.serialization.ObjectSchema< + serializers.SlackWebhookIntegration.Raw, + TrueFoundry.SlackWebhookIntegration +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/notification-channel/slack-webhook"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", SlackWebhookAuth), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace SlackWebhookIntegration { export interface Raw { diff --git a/src/serialization/types/SmallestAiApiKeyAuth.ts b/src/serialization/types/SmallestAiApiKeyAuth.ts index 3082f3f5..f2ae4b96 100644 --- a/src/serialization/types/SmallestAiApiKeyAuth.ts +++ b/src/serialization/types/SmallestAiApiKeyAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SmallestAiApiKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) - }); +export const SmallestAiApiKeyAuth: core.serialization.ObjectSchema< + serializers.SmallestAiApiKeyAuth.Raw, + TrueFoundry.SmallestAiApiKeyAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), +}); export declare namespace SmallestAiApiKeyAuth { export interface Raw { diff --git a/src/serialization/types/SmallestAiModel.ts b/src/serialization/types/SmallestAiModel.ts index bfc55945..fc8adc44 100644 --- a/src/serialization/types/SmallestAiModel.ts +++ b/src/serialization/types/SmallestAiModel.ts @@ -1,19 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const SmallestAiModel: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/model/smallest-ai"), - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const SmallestAiModel: core.serialization.ObjectSchema< + serializers.SmallestAiModel.Raw, + TrueFoundry.SmallestAiModel +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/model/smallest-ai"), + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace SmallestAiModel { export interface Raw { diff --git a/src/serialization/types/SmallestAiProviderAccount.ts b/src/serialization/types/SmallestAiProviderAccount.ts index ea0a6d2b..f942feb8 100644 --- a/src/serialization/types/SmallestAiProviderAccount.ts +++ b/src/serialization/types/SmallestAiProviderAccount.ts @@ -1,23 +1,26 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { OwnedBy } from "./OwnedBy.js"; import { SmallestAiApiKeyAuth } from "./SmallestAiApiKeyAuth.js"; import { SmallestAiModel } from "./SmallestAiModel.js"; -export const SmallestAiProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/smallest-ai"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", SmallestAiApiKeyAuth), - "baseUrl": core.serialization.property("base_url", core.serialization.string().optional()), - "integrations": core.serialization.list(SmallestAiModel), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const SmallestAiProviderAccount: core.serialization.ObjectSchema< + serializers.SmallestAiProviderAccount.Raw, + TrueFoundry.SmallestAiProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/smallest-ai"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", SmallestAiApiKeyAuth), + baseUrl: core.serialization.property("base_url", core.serialization.string().optional()), + integrations: core.serialization.list(SmallestAiModel), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace SmallestAiProviderAccount { export interface Raw { diff --git a/src/serialization/types/SmtpCredentials.ts b/src/serialization/types/SmtpCredentials.ts index b0838357..63b959ed 100644 --- a/src/serialization/types/SmtpCredentials.ts +++ b/src/serialization/types/SmtpCredentials.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SmtpCredentials: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("smtp-credentials"), - "host": core.serialization.string(), - "username": core.serialization.string().optional(), - "password": core.serialization.string().optional(), - "port": core.serialization.number(), - "tls": core.serialization.boolean() - }); +export const SmtpCredentials: core.serialization.ObjectSchema< + serializers.SmtpCredentials.Raw, + TrueFoundry.SmtpCredentials +> = core.serialization.object({ + type: core.serialization.stringLiteral("smtp-credentials"), + host: core.serialization.string(), + username: core.serialization.string().optional(), + password: core.serialization.string().optional(), + port: core.serialization.number(), + tls: core.serialization.boolean(), +}); export declare namespace SmtpCredentials { export interface Raw { diff --git a/src/serialization/types/SnowflakeConfig.ts b/src/serialization/types/SnowflakeConfig.ts index 8910b496..4385be78 100644 --- a/src/serialization/types/SnowflakeConfig.ts +++ b/src/serialization/types/SnowflakeConfig.ts @@ -1,16 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SnowflakeConfig: core.serialization.ObjectSchema = core.serialization.object({ - "account": core.serialization.string(), - "schema": core.serialization.string(), - "user": core.serialization.string(), - "warehouse": core.serialization.string(), - "database": core.serialization.string() - }); +export const SnowflakeConfig: core.serialization.ObjectSchema< + serializers.SnowflakeConfig.Raw, + TrueFoundry.SnowflakeConfig +> = core.serialization.object({ + account: core.serialization.string(), + schema: core.serialization.string(), + user: core.serialization.string(), + warehouse: core.serialization.string(), + database: core.serialization.string(), +}); export declare namespace SnowflakeConfig { export interface Raw { diff --git a/src/serialization/types/SnowflakeCortexIntegrations.ts b/src/serialization/types/SnowflakeCortexIntegrations.ts index bec6ad5e..930d2355 100644 --- a/src/serialization/types/SnowflakeCortexIntegrations.ts +++ b/src/serialization/types/SnowflakeCortexIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { SnowflakeCortexModel } from "./SnowflakeCortexModel.js"; -export const SnowflakeCortexIntegrations: core.serialization.ObjectSchema = SnowflakeCortexModel; +export const SnowflakeCortexIntegrations: core.serialization.ObjectSchema< + serializers.SnowflakeCortexIntegrations.Raw, + TrueFoundry.SnowflakeCortexIntegrations +> = SnowflakeCortexModel; export declare namespace SnowflakeCortexIntegrations { export type Raw = SnowflakeCortexModel.Raw; diff --git a/src/serialization/types/SnowflakeCortexModel.ts b/src/serialization/types/SnowflakeCortexModel.ts index 9a0b079c..c36e7551 100644 --- a/src/serialization/types/SnowflakeCortexModel.ts +++ b/src/serialization/types/SnowflakeCortexModel.ts @@ -1,19 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const SnowflakeCortexModel: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/model/snowflake-cortex"), - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const SnowflakeCortexModel: core.serialization.ObjectSchema< + serializers.SnowflakeCortexModel.Raw, + TrueFoundry.SnowflakeCortexModel +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/model/snowflake-cortex"), + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace SnowflakeCortexModel { export interface Raw { diff --git a/src/serialization/types/SnowflakeCortexPatTokenAuth.ts b/src/serialization/types/SnowflakeCortexPatTokenAuth.ts index cef57dcb..c6baa715 100644 --- a/src/serialization/types/SnowflakeCortexPatTokenAuth.ts +++ b/src/serialization/types/SnowflakeCortexPatTokenAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SnowflakeCortexPatTokenAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("pat-token"), - "patToken": core.serialization.property("pat_token", core.serialization.string()) - }); +export const SnowflakeCortexPatTokenAuth: core.serialization.ObjectSchema< + serializers.SnowflakeCortexPatTokenAuth.Raw, + TrueFoundry.SnowflakeCortexPatTokenAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("pat-token"), + patToken: core.serialization.property("pat_token", core.serialization.string()), +}); export declare namespace SnowflakeCortexPatTokenAuth { export interface Raw { diff --git a/src/serialization/types/SnowflakeCortexProviderAccount.ts b/src/serialization/types/SnowflakeCortexProviderAccount.ts index 090af5be..476fe548 100644 --- a/src/serialization/types/SnowflakeCortexProviderAccount.ts +++ b/src/serialization/types/SnowflakeCortexProviderAccount.ts @@ -1,23 +1,26 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { OwnedBy } from "./OwnedBy.js"; import { SnowflakeCortexIntegrations } from "./SnowflakeCortexIntegrations.js"; import { SnowflakeCortexPatTokenAuth } from "./SnowflakeCortexPatTokenAuth.js"; -export const SnowflakeCortexProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/snowflake-cortex"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", SnowflakeCortexPatTokenAuth), - "accountIdentifier": core.serialization.property("account_identifier", core.serialization.string()), - "integrations": core.serialization.list(SnowflakeCortexIntegrations), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const SnowflakeCortexProviderAccount: core.serialization.ObjectSchema< + serializers.SnowflakeCortexProviderAccount.Raw, + TrueFoundry.SnowflakeCortexProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/snowflake-cortex"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", SnowflakeCortexPatTokenAuth), + accountIdentifier: core.serialization.property("account_identifier", core.serialization.string()), + integrations: core.serialization.list(SnowflakeCortexIntegrations), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace SnowflakeCortexProviderAccount { export interface Raw { diff --git a/src/serialization/types/SnowflakeSql.ts b/src/serialization/types/SnowflakeSql.ts index 949e730e..20c0acd2 100644 --- a/src/serialization/types/SnowflakeSql.ts +++ b/src/serialization/types/SnowflakeSql.ts @@ -1,11 +1,12 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SnowflakeSql: core.serialization.ObjectSchema = core.serialization.object({ - "statement": core.serialization.string() +export const SnowflakeSql: core.serialization.ObjectSchema = + core.serialization.object({ + statement: core.serialization.string(), }); export declare namespace SnowflakeSql { diff --git a/src/serialization/types/SnowflakeTaskConfig.ts b/src/serialization/types/SnowflakeTaskConfig.ts index 686ba3b5..a333434f 100644 --- a/src/serialization/types/SnowflakeTaskConfig.ts +++ b/src/serialization/types/SnowflakeTaskConfig.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SnowflakeTaskConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("snowflake-task-config"), - "user": core.serialization.string(), - "account": core.serialization.string(), - "database": core.serialization.string(), - "schemaName": core.serialization.property("schema_name", core.serialization.string()), - "warehouse": core.serialization.string() - }); +export const SnowflakeTaskConfig: core.serialization.ObjectSchema< + serializers.SnowflakeTaskConfig.Raw, + TrueFoundry.SnowflakeTaskConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("snowflake-task-config"), + user: core.serialization.string(), + account: core.serialization.string(), + database: core.serialization.string(), + schemaName: core.serialization.property("schema_name", core.serialization.string()), + warehouse: core.serialization.string(), +}); export declare namespace SnowflakeTaskConfig { export interface Raw { diff --git a/src/serialization/types/SortDirection.ts b/src/serialization/types/SortDirection.ts index 384f5539..7a4687cf 100644 --- a/src/serialization/types/SortDirection.ts +++ b/src/serialization/types/SortDirection.ts @@ -1,10 +1,11 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SortDirection: core.serialization.Schema = core.serialization.enum_(["asc", "desc"]); +export const SortDirection: core.serialization.Schema = + core.serialization.enum_(["asc", "desc"]); export declare namespace SortDirection { export type Raw = "asc" | "desc"; diff --git a/src/serialization/types/SpaCyFramework.ts b/src/serialization/types/SpaCyFramework.ts index 0c7e63ee..7d4a29f1 100644 --- a/src/serialization/types/SpaCyFramework.ts +++ b/src/serialization/types/SpaCyFramework.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SpaCyFramework: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("spacy") - }); +export const SpaCyFramework: core.serialization.ObjectSchema< + serializers.SpaCyFramework.Raw, + TrueFoundry.SpaCyFramework +> = core.serialization.object({ + type: core.serialization.stringLiteral("spacy"), +}); export declare namespace SpaCyFramework { export interface Raw { diff --git a/src/serialization/types/SpanAttributeFilter.ts b/src/serialization/types/SpanAttributeFilter.ts index 708c0955..6fc41ecf 100644 --- a/src/serialization/types/SpanAttributeFilter.ts +++ b/src/serialization/types/SpanAttributeFilter.ts @@ -1,16 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { SpanAttributeFilterOperator } from "./SpanAttributeFilterOperator.js"; import { SpanAttributeFilterValue } from "./SpanAttributeFilterValue.js"; -export const SpanAttributeFilter: core.serialization.ObjectSchema = core.serialization.object({ - "spanAttributeKey": core.serialization.string(), - "operator": SpanAttributeFilterOperator, - "value": SpanAttributeFilterValue - }); +export const SpanAttributeFilter: core.serialization.ObjectSchema< + serializers.SpanAttributeFilter.Raw, + TrueFoundry.SpanAttributeFilter +> = core.serialization.object({ + spanAttributeKey: core.serialization.string(), + operator: SpanAttributeFilterOperator, + value: SpanAttributeFilterValue, +}); export declare namespace SpanAttributeFilter { export interface Raw { diff --git a/src/serialization/types/SpanAttributeFilterOperator.ts b/src/serialization/types/SpanAttributeFilterOperator.ts index c9ac4b41..d1fb8307 100644 --- a/src/serialization/types/SpanAttributeFilterOperator.ts +++ b/src/serialization/types/SpanAttributeFilterOperator.ts @@ -1,11 +1,53 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SpanAttributeFilterOperator: core.serialization.Schema = core.serialization.enum_(["EQUAL", "NOT_EQUAL", "GREATER_THAN", "LESS_THAN", "GREATER_THAN_EQUAL", "LESS_THAN_EQUAL", "BETWEEN", "IN", "NOT_IN", "STRING_CONTAINS", "STRING_NOT_CONTAINS", "STRING_STARTS_WITH", "STRING_NOT_STARTS_WITH", "STRING_ENDS_WITH", "STRING_NOT_ENDS_WITH", "ARRAY_HAS_ANY", "ARRAY_HAS_NONE", "PRESENT", "IS_NULL"]); +export const SpanAttributeFilterOperator: core.serialization.Schema< + serializers.SpanAttributeFilterOperator.Raw, + TrueFoundry.SpanAttributeFilterOperator +> = core.serialization.enum_([ + "EQUAL", + "NOT_EQUAL", + "GREATER_THAN", + "LESS_THAN", + "GREATER_THAN_EQUAL", + "LESS_THAN_EQUAL", + "BETWEEN", + "IN", + "NOT_IN", + "STRING_CONTAINS", + "STRING_NOT_CONTAINS", + "STRING_STARTS_WITH", + "STRING_NOT_STARTS_WITH", + "STRING_ENDS_WITH", + "STRING_NOT_ENDS_WITH", + "ARRAY_HAS_ANY", + "ARRAY_HAS_NONE", + "PRESENT", + "IS_NULL", +]); export declare namespace SpanAttributeFilterOperator { - export type Raw = "EQUAL" | "NOT_EQUAL" | "GREATER_THAN" | "LESS_THAN" | "GREATER_THAN_EQUAL" | "LESS_THAN_EQUAL" | "BETWEEN" | "IN" | "NOT_IN" | "STRING_CONTAINS" | "STRING_NOT_CONTAINS" | "STRING_STARTS_WITH" | "STRING_NOT_STARTS_WITH" | "STRING_ENDS_WITH" | "STRING_NOT_ENDS_WITH" | "ARRAY_HAS_ANY" | "ARRAY_HAS_NONE" | "PRESENT" | "IS_NULL"; + export type Raw = + | "EQUAL" + | "NOT_EQUAL" + | "GREATER_THAN" + | "LESS_THAN" + | "GREATER_THAN_EQUAL" + | "LESS_THAN_EQUAL" + | "BETWEEN" + | "IN" + | "NOT_IN" + | "STRING_CONTAINS" + | "STRING_NOT_CONTAINS" + | "STRING_STARTS_WITH" + | "STRING_NOT_STARTS_WITH" + | "STRING_ENDS_WITH" + | "STRING_NOT_ENDS_WITH" + | "ARRAY_HAS_ANY" + | "ARRAY_HAS_NONE" + | "PRESENT" + | "IS_NULL"; } diff --git a/src/serialization/types/SpanAttributeFilterValue.ts b/src/serialization/types/SpanAttributeFilterValue.ts index 25dd8a17..4dfbc764 100644 --- a/src/serialization/types/SpanAttributeFilterValue.ts +++ b/src/serialization/types/SpanAttributeFilterValue.ts @@ -1,10 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SpanAttributeFilterValue: core.serialization.Schema = core.serialization.undiscriminatedUnion([core.serialization.list(core.serialization.string()), core.serialization.list(core.serialization.number()), core.serialization.list(core.serialization.boolean()), core.serialization.string(), core.serialization.number(), core.serialization.boolean()]); +export const SpanAttributeFilterValue: core.serialization.Schema< + serializers.SpanAttributeFilterValue.Raw, + TrueFoundry.SpanAttributeFilterValue +> = core.serialization.undiscriminatedUnion([ + core.serialization.list(core.serialization.string()), + core.serialization.list(core.serialization.number()), + core.serialization.list(core.serialization.boolean()), + core.serialization.string(), + core.serialization.number(), + core.serialization.boolean(), +]); export declare namespace SpanAttributeFilterValue { export type Raw = string[] | number[] | boolean[] | string | number | boolean; diff --git a/src/serialization/types/SpanFieldFilter.ts b/src/serialization/types/SpanFieldFilter.ts index 15b5ca66..cab29754 100644 --- a/src/serialization/types/SpanFieldFilter.ts +++ b/src/serialization/types/SpanFieldFilter.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { SpanFieldFilterOperator } from "./SpanFieldFilterOperator.js"; import { SpanFieldFilterSpanFieldName } from "./SpanFieldFilterSpanFieldName.js"; import { SpanFieldFilterValue } from "./SpanFieldFilterValue.js"; -export const SpanFieldFilter: core.serialization.ObjectSchema = core.serialization.object({ - "spanFieldName": SpanFieldFilterSpanFieldName, - "operator": SpanFieldFilterOperator, - "value": SpanFieldFilterValue - }); +export const SpanFieldFilter: core.serialization.ObjectSchema< + serializers.SpanFieldFilter.Raw, + TrueFoundry.SpanFieldFilter +> = core.serialization.object({ + spanFieldName: SpanFieldFilterSpanFieldName, + operator: SpanFieldFilterOperator, + value: SpanFieldFilterValue, +}); export declare namespace SpanFieldFilter { export interface Raw { diff --git a/src/serialization/types/SpanFieldFilterOperator.ts b/src/serialization/types/SpanFieldFilterOperator.ts index 1022bbff..1571a3ff 100644 --- a/src/serialization/types/SpanFieldFilterOperator.ts +++ b/src/serialization/types/SpanFieldFilterOperator.ts @@ -1,11 +1,53 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SpanFieldFilterOperator: core.serialization.Schema = core.serialization.enum_(["EQUAL", "NOT_EQUAL", "GREATER_THAN", "LESS_THAN", "GREATER_THAN_EQUAL", "LESS_THAN_EQUAL", "BETWEEN", "IN", "NOT_IN", "STRING_CONTAINS", "STRING_NOT_CONTAINS", "STRING_STARTS_WITH", "STRING_NOT_STARTS_WITH", "STRING_ENDS_WITH", "STRING_NOT_ENDS_WITH", "ARRAY_HAS_ANY", "ARRAY_HAS_NONE", "PRESENT", "IS_NULL"]); +export const SpanFieldFilterOperator: core.serialization.Schema< + serializers.SpanFieldFilterOperator.Raw, + TrueFoundry.SpanFieldFilterOperator +> = core.serialization.enum_([ + "EQUAL", + "NOT_EQUAL", + "GREATER_THAN", + "LESS_THAN", + "GREATER_THAN_EQUAL", + "LESS_THAN_EQUAL", + "BETWEEN", + "IN", + "NOT_IN", + "STRING_CONTAINS", + "STRING_NOT_CONTAINS", + "STRING_STARTS_WITH", + "STRING_NOT_STARTS_WITH", + "STRING_ENDS_WITH", + "STRING_NOT_ENDS_WITH", + "ARRAY_HAS_ANY", + "ARRAY_HAS_NONE", + "PRESENT", + "IS_NULL", +]); export declare namespace SpanFieldFilterOperator { - export type Raw = "EQUAL" | "NOT_EQUAL" | "GREATER_THAN" | "LESS_THAN" | "GREATER_THAN_EQUAL" | "LESS_THAN_EQUAL" | "BETWEEN" | "IN" | "NOT_IN" | "STRING_CONTAINS" | "STRING_NOT_CONTAINS" | "STRING_STARTS_WITH" | "STRING_NOT_STARTS_WITH" | "STRING_ENDS_WITH" | "STRING_NOT_ENDS_WITH" | "ARRAY_HAS_ANY" | "ARRAY_HAS_NONE" | "PRESENT" | "IS_NULL"; + export type Raw = + | "EQUAL" + | "NOT_EQUAL" + | "GREATER_THAN" + | "LESS_THAN" + | "GREATER_THAN_EQUAL" + | "LESS_THAN_EQUAL" + | "BETWEEN" + | "IN" + | "NOT_IN" + | "STRING_CONTAINS" + | "STRING_NOT_CONTAINS" + | "STRING_STARTS_WITH" + | "STRING_NOT_STARTS_WITH" + | "STRING_ENDS_WITH" + | "STRING_NOT_ENDS_WITH" + | "ARRAY_HAS_ANY" + | "ARRAY_HAS_NONE" + | "PRESENT" + | "IS_NULL"; } diff --git a/src/serialization/types/SpanFieldFilterSpanFieldName.ts b/src/serialization/types/SpanFieldFilterSpanFieldName.ts index d44f2e7c..aa2010b7 100644 --- a/src/serialization/types/SpanFieldFilterSpanFieldName.ts +++ b/src/serialization/types/SpanFieldFilterSpanFieldName.ts @@ -1,11 +1,43 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SpanFieldFilterSpanFieldName: core.serialization.Schema = core.serialization.enum_(["spanName", "spanId", "traceId", "parentSpanId", "applicationName", "createdBySubjectSlug", "createdBySubjectType", "durationInNs", "durationInMs", "spanStatusCode", "tag", "scopeName", "environment", "feedbacks"]); +export const SpanFieldFilterSpanFieldName: core.serialization.Schema< + serializers.SpanFieldFilterSpanFieldName.Raw, + TrueFoundry.SpanFieldFilterSpanFieldName +> = core.serialization.enum_([ + "spanName", + "spanId", + "traceId", + "parentSpanId", + "applicationName", + "createdBySubjectSlug", + "createdBySubjectType", + "durationInNs", + "durationInMs", + "spanStatusCode", + "tag", + "scopeName", + "environment", + "feedbacks", +]); export declare namespace SpanFieldFilterSpanFieldName { - export type Raw = "spanName" | "spanId" | "traceId" | "parentSpanId" | "applicationName" | "createdBySubjectSlug" | "createdBySubjectType" | "durationInNs" | "durationInMs" | "spanStatusCode" | "tag" | "scopeName" | "environment" | "feedbacks"; + export type Raw = + | "spanName" + | "spanId" + | "traceId" + | "parentSpanId" + | "applicationName" + | "createdBySubjectSlug" + | "createdBySubjectType" + | "durationInNs" + | "durationInMs" + | "spanStatusCode" + | "tag" + | "scopeName" + | "environment" + | "feedbacks"; } diff --git a/src/serialization/types/SpanFieldFilterValue.ts b/src/serialization/types/SpanFieldFilterValue.ts index 837bf686..450a7717 100644 --- a/src/serialization/types/SpanFieldFilterValue.ts +++ b/src/serialization/types/SpanFieldFilterValue.ts @@ -1,10 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SpanFieldFilterValue: core.serialization.Schema = core.serialization.undiscriminatedUnion([core.serialization.string(), core.serialization.number(), core.serialization.boolean(), core.serialization.list(core.serialization.string()), core.serialization.list(core.serialization.number())]); +export const SpanFieldFilterValue: core.serialization.Schema< + serializers.SpanFieldFilterValue.Raw, + TrueFoundry.SpanFieldFilterValue +> = core.serialization.undiscriminatedUnion([ + core.serialization.string(), + core.serialization.number(), + core.serialization.boolean(), + core.serialization.list(core.serialization.string()), + core.serialization.list(core.serialization.number()), +]); export declare namespace SpanFieldFilterValue { export type Raw = string | number | boolean | string[] | number[]; diff --git a/src/serialization/types/SparkBuild.ts b/src/serialization/types/SparkBuild.ts index 82acf087..913dbccc 100644 --- a/src/serialization/types/SparkBuild.ts +++ b/src/serialization/types/SparkBuild.ts @@ -1,14 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SparkBuild: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("tfy-spark-buildpack"), - "sparkVersion": core.serialization.property("spark_version", core.serialization.string()), - "buildContextPath": core.serialization.property("build_context_path", core.serialization.string()), - "requirementsPath": core.serialization.property("requirements_path", core.serialization.string().optional()) +export const SparkBuild: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("tfy-spark-buildpack"), + sparkVersion: core.serialization.property("spark_version", core.serialization.string()), + buildContextPath: core.serialization.property("build_context_path", core.serialization.string()), + requirementsPath: core.serialization.property("requirements_path", core.serialization.string().optional()), }); export declare namespace SparkBuild { diff --git a/src/serialization/types/SparkConfig.ts b/src/serialization/types/SparkConfig.ts index 341ab73e..2e52bfa4 100644 --- a/src/serialization/types/SparkConfig.ts +++ b/src/serialization/types/SparkConfig.ts @@ -1,11 +1,12 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SparkConfig: core.serialization.ObjectSchema = core.serialization.object({ - "uiBaseDomain": core.serialization.property("ui_base_domain", core.serialization.string()) +export const SparkConfig: core.serialization.ObjectSchema = + core.serialization.object({ + uiBaseDomain: core.serialization.property("ui_base_domain", core.serialization.string()), }); export declare namespace SparkConfig { diff --git a/src/serialization/types/SparkDriverConfig.ts b/src/serialization/types/SparkDriverConfig.ts index 0966a973..e738c6d0 100644 --- a/src/serialization/types/SparkDriverConfig.ts +++ b/src/serialization/types/SparkDriverConfig.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Resources } from "./Resources.js"; -export const SparkDriverConfig: core.serialization.ObjectSchema = core.serialization.object({ - "resources": Resources.optional() - }); +export const SparkDriverConfig: core.serialization.ObjectSchema< + serializers.SparkDriverConfig.Raw, + TrueFoundry.SparkDriverConfig +> = core.serialization.object({ + resources: Resources.optional(), +}); export declare namespace SparkDriverConfig { export interface Raw { diff --git a/src/serialization/types/SparkExecutorConfig.ts b/src/serialization/types/SparkExecutorConfig.ts index 91c0ce2fa..ff717b9c 100644 --- a/src/serialization/types/SparkExecutorConfig.ts +++ b/src/serialization/types/SparkExecutorConfig.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Resources } from "./Resources.js"; import { SparkExecutorConfigInstances } from "./SparkExecutorConfigInstances.js"; -export const SparkExecutorConfig: core.serialization.ObjectSchema = core.serialization.object({ - "instances": SparkExecutorConfigInstances, - "resources": Resources.optional() - }); +export const SparkExecutorConfig: core.serialization.ObjectSchema< + serializers.SparkExecutorConfig.Raw, + TrueFoundry.SparkExecutorConfig +> = core.serialization.object({ + instances: SparkExecutorConfigInstances, + resources: Resources.optional(), +}); export declare namespace SparkExecutorConfig { export interface Raw { diff --git a/src/serialization/types/SparkExecutorConfigInstances.ts b/src/serialization/types/SparkExecutorConfigInstances.ts index 1c896325..74c9cb8b 100644 --- a/src/serialization/types/SparkExecutorConfigInstances.ts +++ b/src/serialization/types/SparkExecutorConfigInstances.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { SparkExecutorDynamicScaling } from "./SparkExecutorDynamicScaling.js"; import { SparkExecutorFixedInstances } from "./SparkExecutorFixedInstances.js"; -export const SparkExecutorConfigInstances: core.serialization.Schema = core.serialization.undiscriminatedUnion([SparkExecutorFixedInstances, SparkExecutorDynamicScaling]); +export const SparkExecutorConfigInstances: core.serialization.Schema< + serializers.SparkExecutorConfigInstances.Raw, + TrueFoundry.SparkExecutorConfigInstances +> = core.serialization.undiscriminatedUnion([SparkExecutorFixedInstances, SparkExecutorDynamicScaling]); export declare namespace SparkExecutorConfigInstances { export type Raw = SparkExecutorFixedInstances.Raw | SparkExecutorDynamicScaling.Raw; diff --git a/src/serialization/types/SparkExecutorDynamicScaling.ts b/src/serialization/types/SparkExecutorDynamicScaling.ts index 9cda3a9c..2528ef19 100644 --- a/src/serialization/types/SparkExecutorDynamicScaling.ts +++ b/src/serialization/types/SparkExecutorDynamicScaling.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SparkExecutorDynamicScaling: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("dynamic"), - "min": core.serialization.number(), - "max": core.serialization.number() - }); +export const SparkExecutorDynamicScaling: core.serialization.ObjectSchema< + serializers.SparkExecutorDynamicScaling.Raw, + TrueFoundry.SparkExecutorDynamicScaling +> = core.serialization.object({ + type: core.serialization.stringLiteral("dynamic"), + min: core.serialization.number(), + max: core.serialization.number(), +}); export declare namespace SparkExecutorDynamicScaling { export interface Raw { diff --git a/src/serialization/types/SparkExecutorFixedInstances.ts b/src/serialization/types/SparkExecutorFixedInstances.ts index 31e40ec1..c988f307 100644 --- a/src/serialization/types/SparkExecutorFixedInstances.ts +++ b/src/serialization/types/SparkExecutorFixedInstances.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SparkExecutorFixedInstances: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("fixed"), - "count": core.serialization.number() - }); +export const SparkExecutorFixedInstances: core.serialization.ObjectSchema< + serializers.SparkExecutorFixedInstances.Raw, + TrueFoundry.SparkExecutorFixedInstances +> = core.serialization.object({ + type: core.serialization.stringLiteral("fixed"), + count: core.serialization.number(), +}); export declare namespace SparkExecutorFixedInstances { export interface Raw { diff --git a/src/serialization/types/SparkImage.ts b/src/serialization/types/SparkImage.ts index 4c0c80cc..60977d97 100644 --- a/src/serialization/types/SparkImage.ts +++ b/src/serialization/types/SparkImage.ts @@ -1,14 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SparkImage: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("spark-image"), - "sparkVersion": core.serialization.property("spark_version", core.serialization.string()), - "imageUri": core.serialization.property("image_uri", core.serialization.string()), - "dockerRegistry": core.serialization.property("docker_registry", core.serialization.string().optional()) +export const SparkImage: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("spark-image"), + sparkVersion: core.serialization.property("spark_version", core.serialization.string()), + imageUri: core.serialization.property("image_uri", core.serialization.string()), + dockerRegistry: core.serialization.property("docker_registry", core.serialization.string().optional()), }); export declare namespace SparkImage { diff --git a/src/serialization/types/SparkImageBuild.ts b/src/serialization/types/SparkImageBuild.ts index 5347859b..4de69bb2 100644 --- a/src/serialization/types/SparkImageBuild.ts +++ b/src/serialization/types/SparkImageBuild.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { SparkBuild } from "./SparkBuild.js"; import { SparkImageBuildBuildSource } from "./SparkImageBuildBuildSource.js"; -export const SparkImageBuild: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("spark-image-build"), - "dockerRegistry": core.serialization.property("docker_registry", core.serialization.string().optional()), - "buildSource": core.serialization.property("build_source", SparkImageBuildBuildSource), - "buildSpec": core.serialization.property("build_spec", SparkBuild) - }); +export const SparkImageBuild: core.serialization.ObjectSchema< + serializers.SparkImageBuild.Raw, + TrueFoundry.SparkImageBuild +> = core.serialization.object({ + type: core.serialization.stringLiteral("spark-image-build"), + dockerRegistry: core.serialization.property("docker_registry", core.serialization.string().optional()), + buildSource: core.serialization.property("build_source", SparkImageBuildBuildSource), + buildSpec: core.serialization.property("build_spec", SparkBuild), +}); export declare namespace SparkImageBuild { export interface Raw { diff --git a/src/serialization/types/SparkImageBuildBuildSource.ts b/src/serialization/types/SparkImageBuildBuildSource.ts index 98da4e21..d6394ab5 100644 --- a/src/serialization/types/SparkImageBuildBuildSource.ts +++ b/src/serialization/types/SparkImageBuildBuildSource.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { GitSource } from "./GitSource.js"; import { RemoteSource } from "./RemoteSource.js"; -export const SparkImageBuildBuildSource: core.serialization.Schema = core.serialization.undiscriminatedUnion([GitSource, RemoteSource]); +export const SparkImageBuildBuildSource: core.serialization.Schema< + serializers.SparkImageBuildBuildSource.Raw, + TrueFoundry.SparkImageBuildBuildSource +> = core.serialization.undiscriminatedUnion([GitSource, RemoteSource]); export declare namespace SparkImageBuildBuildSource { export type Raw = GitSource.Raw | RemoteSource.Raw; diff --git a/src/serialization/types/SparkJob.ts b/src/serialization/types/SparkJob.ts index 84cf2290..12b616a8 100644 --- a/src/serialization/types/SparkJob.ts +++ b/src/serialization/types/SparkJob.ts @@ -1,27 +1,35 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { SparkDriverConfig } from "./SparkDriverConfig.js"; import { SparkExecutorConfig } from "./SparkExecutorConfig.js"; import { SparkJobEntrypoint } from "./SparkJobEntrypoint.js"; import { SparkJobImage } from "./SparkJobImage.js"; +import { SparkJobTrigger } from "./SparkJobTrigger.js"; import { VolumeMount } from "./VolumeMount.js"; -export const SparkJob: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("spark-job"), - "name": core.serialization.string(), - "image": SparkJobImage, - "entrypoint": SparkJobEntrypoint, - "driverConfig": core.serialization.property("driver_config", SparkDriverConfig), - "executorConfig": core.serialization.property("executor_config", SparkExecutorConfig), - "env": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - "sparkConf": core.serialization.property("spark_conf", core.serialization.record(core.serialization.string(), core.serialization.string()).optional()), - "mounts": core.serialization.list(VolumeMount).optional(), - "retries": core.serialization.number().optional(), - "serviceAccount": core.serialization.property("service_account", core.serialization.string().optional()), - "workspaceFqn": core.serialization.property("workspace_fqn", core.serialization.string().optional()) +export const SparkJob: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("spark-job"), + name: core.serialization.string(), + image: SparkJobImage, + entrypoint: SparkJobEntrypoint, + trigger: SparkJobTrigger.optional(), + driverConfig: core.serialization.property("driver_config", SparkDriverConfig), + executorConfig: core.serialization.property("executor_config", SparkExecutorConfig), + env: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optionalNullable(), + sparkConf: core.serialization.property( + "spark_conf", + core.serialization + .record(core.serialization.string(), core.serialization.string().nullable()) + .optionalNullable(), + ), + mounts: core.serialization.list(VolumeMount).optional(), + retries: core.serialization.number().optional(), + serviceAccount: core.serialization.property("service_account", core.serialization.string().optional()), + workspaceFqn: core.serialization.property("workspace_fqn", core.serialization.string().optional()), }); export declare namespace SparkJob { @@ -30,10 +38,11 @@ export declare namespace SparkJob { name: string; image: SparkJobImage.Raw; entrypoint: SparkJobEntrypoint.Raw; + trigger?: SparkJobTrigger.Raw | null; driver_config: SparkDriverConfig.Raw; executor_config: SparkExecutorConfig.Raw; - env?: Record | null; - spark_conf?: Record | null; + env?: (Record | null | undefined) | null; + spark_conf?: (Record | null | undefined) | null; mounts?: VolumeMount.Raw[] | null; retries?: number | null; service_account?: string | null; diff --git a/src/serialization/types/SparkJobEntrypoint.ts b/src/serialization/types/SparkJobEntrypoint.ts index 9a7c150f..f3002f39 100644 --- a/src/serialization/types/SparkJobEntrypoint.ts +++ b/src/serialization/types/SparkJobEntrypoint.ts @@ -1,16 +1,30 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { SparkJobJavaEntrypoint } from "./SparkJobJavaEntrypoint.js"; import { SparkJobPythonEntrypoint } from "./SparkJobPythonEntrypoint.js"; import { SparkJobPythonNotebookEntrypoint } from "./SparkJobPythonNotebookEntrypoint.js"; import { SparkJobScalaEntrypoint } from "./SparkJobScalaEntrypoint.js"; import { SparkJobScalaNotebookEntrypoint } from "./SparkJobScalaNotebookEntrypoint.js"; -export const SparkJobEntrypoint: core.serialization.Schema = core.serialization.undiscriminatedUnion([SparkJobPythonEntrypoint, SparkJobScalaEntrypoint, SparkJobJavaEntrypoint, SparkJobPythonNotebookEntrypoint, SparkJobScalaNotebookEntrypoint]); +export const SparkJobEntrypoint: core.serialization.Schema< + serializers.SparkJobEntrypoint.Raw, + TrueFoundry.SparkJobEntrypoint +> = core.serialization.undiscriminatedUnion([ + SparkJobPythonEntrypoint, + SparkJobScalaEntrypoint, + SparkJobJavaEntrypoint, + SparkJobPythonNotebookEntrypoint, + SparkJobScalaNotebookEntrypoint, +]); export declare namespace SparkJobEntrypoint { - export type Raw = SparkJobPythonEntrypoint.Raw | SparkJobScalaEntrypoint.Raw | SparkJobJavaEntrypoint.Raw | SparkJobPythonNotebookEntrypoint.Raw | SparkJobScalaNotebookEntrypoint.Raw; + export type Raw = + | SparkJobPythonEntrypoint.Raw + | SparkJobScalaEntrypoint.Raw + | SparkJobJavaEntrypoint.Raw + | SparkJobPythonNotebookEntrypoint.Raw + | SparkJobScalaNotebookEntrypoint.Raw; } diff --git a/src/serialization/types/SparkJobImage.ts b/src/serialization/types/SparkJobImage.ts index 9bd8412a..c69e350c 100644 --- a/src/serialization/types/SparkJobImage.ts +++ b/src/serialization/types/SparkJobImage.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { SparkImage } from "./SparkImage.js"; import { SparkImageBuild } from "./SparkImageBuild.js"; -export const SparkJobImage: core.serialization.Schema = core.serialization.undiscriminatedUnion([SparkImage, SparkImageBuild]); +export const SparkJobImage: core.serialization.Schema = + core.serialization.undiscriminatedUnion([SparkImage, SparkImageBuild]); export declare namespace SparkJobImage { export type Raw = SparkImage.Raw | SparkImageBuild.Raw; diff --git a/src/serialization/types/SparkJobJavaEntrypoint.ts b/src/serialization/types/SparkJobJavaEntrypoint.ts index 62067ade..8aef6f79 100644 --- a/src/serialization/types/SparkJobJavaEntrypoint.ts +++ b/src/serialization/types/SparkJobJavaEntrypoint.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SparkJobJavaEntrypoint: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("java"), - "mainApplicationFile": core.serialization.property("main_application_file", core.serialization.string()), - "mainClass": core.serialization.property("main_class", core.serialization.string()), - "arguments": core.serialization.string().optional() - }); +export const SparkJobJavaEntrypoint: core.serialization.ObjectSchema< + serializers.SparkJobJavaEntrypoint.Raw, + TrueFoundry.SparkJobJavaEntrypoint +> = core.serialization.object({ + type: core.serialization.stringLiteral("java"), + mainApplicationFile: core.serialization.property("main_application_file", core.serialization.string()), + mainClass: core.serialization.property("main_class", core.serialization.string()), + arguments: core.serialization.string().optional(), +}); export declare namespace SparkJobJavaEntrypoint { export interface Raw { diff --git a/src/serialization/types/SparkJobPythonEntrypoint.ts b/src/serialization/types/SparkJobPythonEntrypoint.ts index 861513f5..df148063 100644 --- a/src/serialization/types/SparkJobPythonEntrypoint.ts +++ b/src/serialization/types/SparkJobPythonEntrypoint.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SparkJobPythonEntrypoint: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("python"), - "mainApplicationFile": core.serialization.property("main_application_file", core.serialization.string()), - "arguments": core.serialization.string().optional() - }); +export const SparkJobPythonEntrypoint: core.serialization.ObjectSchema< + serializers.SparkJobPythonEntrypoint.Raw, + TrueFoundry.SparkJobPythonEntrypoint +> = core.serialization.object({ + type: core.serialization.stringLiteral("python"), + mainApplicationFile: core.serialization.property("main_application_file", core.serialization.string()), + arguments: core.serialization.string().optional(), +}); export declare namespace SparkJobPythonEntrypoint { export interface Raw { diff --git a/src/serialization/types/SparkJobPythonNotebookEntrypoint.ts b/src/serialization/types/SparkJobPythonNotebookEntrypoint.ts index 27240384..f37da2de 100644 --- a/src/serialization/types/SparkJobPythonNotebookEntrypoint.ts +++ b/src/serialization/types/SparkJobPythonNotebookEntrypoint.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SparkJobPythonNotebookEntrypoint: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("python-notebook"), - "mainApplicationFile": core.serialization.property("main_application_file", core.serialization.string()) - }); +export const SparkJobPythonNotebookEntrypoint: core.serialization.ObjectSchema< + serializers.SparkJobPythonNotebookEntrypoint.Raw, + TrueFoundry.SparkJobPythonNotebookEntrypoint +> = core.serialization.object({ + type: core.serialization.stringLiteral("python-notebook"), + mainApplicationFile: core.serialization.property("main_application_file", core.serialization.string()), +}); export declare namespace SparkJobPythonNotebookEntrypoint { export interface Raw { diff --git a/src/serialization/types/SparkJobScalaEntrypoint.ts b/src/serialization/types/SparkJobScalaEntrypoint.ts index bfd8a2ef..ba22d854 100644 --- a/src/serialization/types/SparkJobScalaEntrypoint.ts +++ b/src/serialization/types/SparkJobScalaEntrypoint.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SparkJobScalaEntrypoint: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("scala"), - "mainApplicationFile": core.serialization.property("main_application_file", core.serialization.string()), - "mainClass": core.serialization.property("main_class", core.serialization.string()), - "arguments": core.serialization.string().optional() - }); +export const SparkJobScalaEntrypoint: core.serialization.ObjectSchema< + serializers.SparkJobScalaEntrypoint.Raw, + TrueFoundry.SparkJobScalaEntrypoint +> = core.serialization.object({ + type: core.serialization.stringLiteral("scala"), + mainApplicationFile: core.serialization.property("main_application_file", core.serialization.string()), + mainClass: core.serialization.property("main_class", core.serialization.string()), + arguments: core.serialization.string().optional(), +}); export declare namespace SparkJobScalaEntrypoint { export interface Raw { diff --git a/src/serialization/types/SparkJobScalaNotebookEntrypoint.ts b/src/serialization/types/SparkJobScalaNotebookEntrypoint.ts index 8b371123..a9f91b1c 100644 --- a/src/serialization/types/SparkJobScalaNotebookEntrypoint.ts +++ b/src/serialization/types/SparkJobScalaNotebookEntrypoint.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SparkJobScalaNotebookEntrypoint: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("scala-notebook"), - "mainApplicationFile": core.serialization.property("main_application_file", core.serialization.string()) - }); +export const SparkJobScalaNotebookEntrypoint: core.serialization.ObjectSchema< + serializers.SparkJobScalaNotebookEntrypoint.Raw, + TrueFoundry.SparkJobScalaNotebookEntrypoint +> = core.serialization.object({ + type: core.serialization.stringLiteral("scala-notebook"), + mainApplicationFile: core.serialization.property("main_application_file", core.serialization.string()), +}); export declare namespace SparkJobScalaNotebookEntrypoint { export interface Raw { diff --git a/src/serialization/types/SparkJobTrigger.ts b/src/serialization/types/SparkJobTrigger.ts new file mode 100644 index 00000000..b2ad5446 --- /dev/null +++ b/src/serialization/types/SparkJobTrigger.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { Manual } from "./Manual.js"; +import { Schedule } from "./Schedule.js"; + +export const SparkJobTrigger: core.serialization.Schema = + core.serialization.undiscriminatedUnion([Manual, Schedule]); + +export declare namespace SparkJobTrigger { + export type Raw = Manual.Raw | Schedule.Raw; +} diff --git a/src/serialization/types/SparkJobTriggerInput.ts b/src/serialization/types/SparkJobTriggerInput.ts index 243639b5..d6c54def 100644 --- a/src/serialization/types/SparkJobTriggerInput.ts +++ b/src/serialization/types/SparkJobTriggerInput.ts @@ -1,19 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SparkJobTriggerInput: core.serialization.ObjectSchema = core.serialization.object({ - "mainClass": core.serialization.string().optional(), - "mainApplicationFile": core.serialization.string().optional(), - "arguments": core.serialization.string().optional() - }); +export const SparkJobTriggerInput: core.serialization.ObjectSchema< + serializers.SparkJobTriggerInput.Raw, + TrueFoundry.SparkJobTriggerInput +> = core.serialization.object({ + mainClass: core.serialization.string().optionalNullable(), + mainApplicationFile: core.serialization.string().optionalNullable(), + arguments: core.serialization.string().optionalNullable(), +}); export declare namespace SparkJobTriggerInput { export interface Raw { - mainClass?: string | null; - mainApplicationFile?: string | null; - arguments?: string | null; + mainClass?: (string | null | undefined) | null; + mainApplicationFile?: (string | null | undefined) | null; + arguments?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/SqlSanitizerGuardrailConfig.ts b/src/serialization/types/SqlSanitizerGuardrailConfig.ts index e0d46862..94661fae 100644 --- a/src/serialization/types/SqlSanitizerGuardrailConfig.ts +++ b/src/serialization/types/SqlSanitizerGuardrailConfig.ts @@ -1,21 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { EnforcingStrategy } from "./EnforcingStrategy.js"; import { SqlSanitizerGuardrailConfigConfig } from "./SqlSanitizerGuardrailConfigConfig.js"; import { SqlSanitizerGuardrailConfigOperation } from "./SqlSanitizerGuardrailConfigOperation.js"; -export const SqlSanitizerGuardrailConfig: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string().optional(), - "type": core.serialization.stringLiteral("integration/guardrail-config/sql-sanitizer"), - "operation": SqlSanitizerGuardrailConfigOperation, - "priority": core.serialization.number().optional(), - "enforcingStrategy": core.serialization.property("enforcing_strategy", EnforcingStrategy), - "config": SqlSanitizerGuardrailConfigConfig - }); +export const SqlSanitizerGuardrailConfig: core.serialization.ObjectSchema< + serializers.SqlSanitizerGuardrailConfig.Raw, + TrueFoundry.SqlSanitizerGuardrailConfig +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + type: core.serialization.stringLiteral("integration/guardrail-config/sql-sanitizer"), + operation: SqlSanitizerGuardrailConfigOperation, + priority: core.serialization.number().optional(), + enforcingStrategy: core.serialization.property("enforcing_strategy", EnforcingStrategy), + config: SqlSanitizerGuardrailConfigConfig, +}); export declare namespace SqlSanitizerGuardrailConfig { export interface Raw { diff --git a/src/serialization/types/SqlSanitizerGuardrailConfigConfig.ts b/src/serialization/types/SqlSanitizerGuardrailConfigConfig.ts index 34840ba5..6c5b4fcc 100644 --- a/src/serialization/types/SqlSanitizerGuardrailConfigConfig.ts +++ b/src/serialization/types/SqlSanitizerGuardrailConfigConfig.ts @@ -1,20 +1,32 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SqlSanitizerGuardrailConfigConfig: core.serialization.ObjectSchema = core.serialization.object({ - "blockDrop": core.serialization.property("block_drop", core.serialization.boolean().optional()), - "blockTruncate": core.serialization.property("block_truncate", core.serialization.boolean().optional()), - "blockAlter": core.serialization.property("block_alter", core.serialization.boolean().optional()), - "blockGrant": core.serialization.property("block_grant", core.serialization.boolean().optional()), - "blockRevoke": core.serialization.property("block_revoke", core.serialization.boolean().optional()), - "stripComments": core.serialization.property("strip_comments", core.serialization.boolean().optional()), - "blockDeleteWithoutWhere": core.serialization.property("block_delete_without_where", core.serialization.boolean().optional()), - "blockUpdateWithoutWhere": core.serialization.property("block_update_without_where", core.serialization.boolean().optional()), - "requireParameterization": core.serialization.property("require_parameterization", core.serialization.boolean().optional()) - }); +export const SqlSanitizerGuardrailConfigConfig: core.serialization.ObjectSchema< + serializers.SqlSanitizerGuardrailConfigConfig.Raw, + TrueFoundry.SqlSanitizerGuardrailConfigConfig +> = core.serialization.object({ + blockDrop: core.serialization.property("block_drop", core.serialization.boolean().optional()), + blockTruncate: core.serialization.property("block_truncate", core.serialization.boolean().optional()), + blockAlter: core.serialization.property("block_alter", core.serialization.boolean().optional()), + blockGrant: core.serialization.property("block_grant", core.serialization.boolean().optional()), + blockRevoke: core.serialization.property("block_revoke", core.serialization.boolean().optional()), + stripComments: core.serialization.property("strip_comments", core.serialization.boolean().optional()), + blockDeleteWithoutWhere: core.serialization.property( + "block_delete_without_where", + core.serialization.boolean().optional(), + ), + blockUpdateWithoutWhere: core.serialization.property( + "block_update_without_where", + core.serialization.boolean().optional(), + ), + requireParameterization: core.serialization.property( + "require_parameterization", + core.serialization.boolean().optional(), + ), +}); export declare namespace SqlSanitizerGuardrailConfigConfig { export interface Raw { diff --git a/src/serialization/types/SqlSanitizerGuardrailConfigOperation.ts b/src/serialization/types/SqlSanitizerGuardrailConfigOperation.ts index b5f948ed..4a67f2c4 100644 --- a/src/serialization/types/SqlSanitizerGuardrailConfigOperation.ts +++ b/src/serialization/types/SqlSanitizerGuardrailConfigOperation.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SqlSanitizerGuardrailConfigOperation: core.serialization.Schema = core.serialization.enum_(["validate", "mutate"]); +export const SqlSanitizerGuardrailConfigOperation: core.serialization.Schema< + serializers.SqlSanitizerGuardrailConfigOperation.Raw, + TrueFoundry.SqlSanitizerGuardrailConfigOperation +> = core.serialization.enum_(["validate", "mutate"]); export declare namespace SqlSanitizerGuardrailConfigOperation { export type Raw = "validate" | "mutate"; diff --git a/src/serialization/types/SqsInputConfig.ts b/src/serialization/types/SqsInputConfig.ts index 4fe568e3..514e3809 100644 --- a/src/serialization/types/SqsInputConfig.ts +++ b/src/serialization/types/SqsInputConfig.ts @@ -1,18 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsAccessKeyAuth } from "./AwsAccessKeyAuth.js"; -export const SqsInputConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("sqs"), - "queueUrl": core.serialization.property("queue_url", core.serialization.string()), - "regionName": core.serialization.property("region_name", core.serialization.string()), - "visibilityTimeout": core.serialization.property("visibility_timeout", core.serialization.number()), - "waitTimeSeconds": core.serialization.property("wait_time_seconds", core.serialization.number()), - "auth": AwsAccessKeyAuth.optional() - }); +export const SqsInputConfig: core.serialization.ObjectSchema< + serializers.SqsInputConfig.Raw, + TrueFoundry.SqsInputConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("sqs"), + queueUrl: core.serialization.property("queue_url", core.serialization.string()), + regionName: core.serialization.property("region_name", core.serialization.string()), + visibilityTimeout: core.serialization.property("visibility_timeout", core.serialization.number()), + waitTimeSeconds: core.serialization.property("wait_time_seconds", core.serialization.number()), + auth: AwsAccessKeyAuth.optional(), +}); export declare namespace SqsInputConfig { export interface Raw { diff --git a/src/serialization/types/SqsOutputConfig.ts b/src/serialization/types/SqsOutputConfig.ts index f0649df1..26ea3ff4 100644 --- a/src/serialization/types/SqsOutputConfig.ts +++ b/src/serialization/types/SqsOutputConfig.ts @@ -1,16 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsAccessKeyAuth } from "./AwsAccessKeyAuth.js"; -export const SqsOutputConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("sqs"), - "queueUrl": core.serialization.property("queue_url", core.serialization.string()), - "regionName": core.serialization.property("region_name", core.serialization.string()), - "auth": AwsAccessKeyAuth.optional() - }); +export const SqsOutputConfig: core.serialization.ObjectSchema< + serializers.SqsOutputConfig.Raw, + TrueFoundry.SqsOutputConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("sqs"), + queueUrl: core.serialization.property("queue_url", core.serialization.string()), + regionName: core.serialization.property("region_name", core.serialization.string()), + auth: AwsAccessKeyAuth.optional(), +}); export declare namespace SqsOutputConfig { export interface Raw { diff --git a/src/serialization/types/SqsQueueMetricConfig.ts b/src/serialization/types/SqsQueueMetricConfig.ts index 6c6cba74..df2f1c34 100644 --- a/src/serialization/types/SqsQueueMetricConfig.ts +++ b/src/serialization/types/SqsQueueMetricConfig.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { SqsQueueMetricConfigAuth } from "./SqsQueueMetricConfigAuth.js"; -export const SqsQueueMetricConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("sqs"), - "queueLength": core.serialization.property("queue_length", core.serialization.number()), - "auth": SqsQueueMetricConfigAuth.optional() - }); +export const SqsQueueMetricConfig: core.serialization.ObjectSchema< + serializers.SqsQueueMetricConfig.Raw, + TrueFoundry.SqsQueueMetricConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("sqs"), + queueLength: core.serialization.property("queue_length", core.serialization.number()), + auth: SqsQueueMetricConfigAuth.optional(), +}); export declare namespace SqsQueueMetricConfig { export interface Raw { diff --git a/src/serialization/types/SqsQueueMetricConfigAuth.ts b/src/serialization/types/SqsQueueMetricConfigAuth.ts index dc595047..01d547ec 100644 --- a/src/serialization/types/SqsQueueMetricConfigAuth.ts +++ b/src/serialization/types/SqsQueueMetricConfigAuth.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AwsSqsAccessKeyBasedAuth } from "./AwsSqsAccessKeyBasedAuth.js"; import { AwsSqsAssumedRoleBasedAuth } from "./AwsSqsAssumedRoleBasedAuth.js"; -export const SqsQueueMetricConfigAuth: core.serialization.Schema = core.serialization.undiscriminatedUnion([AwsSqsAccessKeyBasedAuth, AwsSqsAssumedRoleBasedAuth]); +export const SqsQueueMetricConfigAuth: core.serialization.Schema< + serializers.SqsQueueMetricConfigAuth.Raw, + TrueFoundry.SqsQueueMetricConfigAuth +> = core.serialization.undiscriminatedUnion([AwsSqsAccessKeyBasedAuth, AwsSqsAssumedRoleBasedAuth]); export declare namespace SqsQueueMetricConfigAuth { export type Raw = AwsSqsAccessKeyBasedAuth.Raw | AwsSqsAssumedRoleBasedAuth.Raw; diff --git a/src/serialization/types/SshServer.ts b/src/serialization/types/SshServer.ts index f41a423d..059dd5cf 100644 --- a/src/serialization/types/SshServer.ts +++ b/src/serialization/types/SshServer.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BaseWorkbenchInput } from "./BaseWorkbenchInput.js"; import { WorkbenchImage } from "./WorkbenchImage.js"; -export const SshServer: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("ssh-server"), - "image": WorkbenchImage, - "sshPublicKey": core.serialization.property("ssh_public_key", core.serialization.string()), - "cullTimeout": core.serialization.property("cull_timeout", core.serialization.number().optional()) - }).extend(BaseWorkbenchInput); +export const SshServer: core.serialization.ObjectSchema = + core.serialization + .object({ + type: core.serialization.stringLiteral("ssh-server"), + image: WorkbenchImage, + sshPublicKey: core.serialization.property("ssh_public_key", core.serialization.string()), + cullTimeout: core.serialization.property("cull_timeout", core.serialization.number().optional()), + }) + .extend(BaseWorkbenchInput); export declare namespace SshServer { export interface Raw extends BaseWorkbenchInput.Raw { diff --git a/src/serialization/types/SshServerConfig.ts b/src/serialization/types/SshServerConfig.ts index 48ce9d57..33188e18 100644 --- a/src/serialization/types/SshServerConfig.ts +++ b/src/serialization/types/SshServerConfig.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SshServerConfig: core.serialization.ObjectSchema = core.serialization.object({ - "baseDomain": core.serialization.property("base_domain", core.serialization.string()), - "port": core.serialization.number() - }); +export const SshServerConfig: core.serialization.ObjectSchema< + serializers.SshServerConfig.Raw, + TrueFoundry.SshServerConfig +> = core.serialization.object({ + baseDomain: core.serialization.property("base_domain", core.serialization.string()), + port: core.serialization.number(), +}); export declare namespace SshServerConfig { export interface Raw { diff --git a/src/serialization/types/StageArtifactResponse.ts b/src/serialization/types/StageArtifactResponse.ts index ec0ab34c..389be4f5 100644 --- a/src/serialization/types/StageArtifactResponse.ts +++ b/src/serialization/types/StageArtifactResponse.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const StageArtifactResponse: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string(), - "storageRoot": core.serialization.property("storage_root", core.serialization.string()), - "artifactId": core.serialization.property("artifact_id", core.serialization.string()) - }); +export const StageArtifactResponse: core.serialization.ObjectSchema< + serializers.StageArtifactResponse.Raw, + TrueFoundry.StageArtifactResponse +> = core.serialization.object({ + id: core.serialization.string(), + storageRoot: core.serialization.property("storage_root", core.serialization.string()), + artifactId: core.serialization.property("artifact_id", core.serialization.string()), +}); export declare namespace StageArtifactResponse { export interface Raw { diff --git a/src/serialization/types/StaticFallbackStrategy.ts b/src/serialization/types/StaticFallbackStrategy.ts new file mode 100644 index 00000000..4d51822d --- /dev/null +++ b/src/serialization/types/StaticFallbackStrategy.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { StaticFallbackStrategyDefaultTier } from "./StaticFallbackStrategyDefaultTier.js"; + +export const StaticFallbackStrategy: core.serialization.ObjectSchema< + serializers.StaticFallbackStrategy.Raw, + TrueFoundry.StaticFallbackStrategy +> = core.serialization.object({ + type: core.serialization.stringLiteral("static"), + defaultTier: core.serialization.property("default_tier", StaticFallbackStrategyDefaultTier), +}); + +export declare namespace StaticFallbackStrategy { + export interface Raw { + type: "static"; + default_tier: StaticFallbackStrategyDefaultTier.Raw; + } +} diff --git a/src/serialization/types/StaticFallbackStrategyDefaultTier.ts b/src/serialization/types/StaticFallbackStrategyDefaultTier.ts new file mode 100644 index 00000000..6cadff02 --- /dev/null +++ b/src/serialization/types/StaticFallbackStrategyDefaultTier.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const StaticFallbackStrategyDefaultTier: core.serialization.Schema< + serializers.StaticFallbackStrategyDefaultTier.Raw, + TrueFoundry.StaticFallbackStrategyDefaultTier +> = core.serialization.enum_(["medium", "simple", "complex"]); + +export declare namespace StaticFallbackStrategyDefaultTier { + export type Raw = "medium" | "simple" | "complex"; +} diff --git a/src/serialization/types/StaticVolumeConfig.ts b/src/serialization/types/StaticVolumeConfig.ts index 77f840d9..2d069ad8 100644 --- a/src/serialization/types/StaticVolumeConfig.ts +++ b/src/serialization/types/StaticVolumeConfig.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const StaticVolumeConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("static"), - "persistentVolumeName": core.serialization.property("persistent_volume_name", core.serialization.string()) - }); +export const StaticVolumeConfig: core.serialization.ObjectSchema< + serializers.StaticVolumeConfig.Raw, + TrueFoundry.StaticVolumeConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("static"), + persistentVolumeName: core.serialization.property("persistent_volume_name", core.serialization.string()), +}); export declare namespace StaticVolumeConfig { export interface Raw { diff --git a/src/serialization/types/StatsModelsFramework.ts b/src/serialization/types/StatsModelsFramework.ts index 2845fc5c..637d65af 100644 --- a/src/serialization/types/StatsModelsFramework.ts +++ b/src/serialization/types/StatsModelsFramework.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const StatsModelsFramework: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("statsmodels") - }); +export const StatsModelsFramework: core.serialization.ObjectSchema< + serializers.StatsModelsFramework.Raw, + TrueFoundry.StatsModelsFramework +> = core.serialization.object({ + type: core.serialization.stringLiteral("statsmodels"), +}); export declare namespace StatsModelsFramework { export interface Raw { diff --git a/src/serialization/types/StdioMcpServerManifest.ts b/src/serialization/types/StdioMcpServerManifest.ts index c7060141..03647188 100644 --- a/src/serialization/types/StdioMcpServerManifest.ts +++ b/src/serialization/types/StdioMcpServerManifest.ts @@ -1,29 +1,34 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { McpServerEnvAuth } from "./McpServerEnvAuth.js"; import { McpToolSetting } from "./McpToolSetting.js"; import { OwnedBy } from "./OwnedBy.js"; -export const StdioMcpServerManifest: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string(), - "collaborators": core.serialization.list(Collaborator), - "type": core.serialization.stringLiteral("mcp-server/stdio"), - "command": core.serialization.string(), - "args": core.serialization.list(core.serialization.string()).optional(), - "toolSettings": core.serialization.property("tool_settings", core.serialization.list(McpToolSetting).optional()), - "authData": core.serialization.property("auth_data", McpServerEnvAuth.optional()), - "ownedBy": OwnedBy.optional(), - "tags": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() - }); +export const StdioMcpServerManifest: core.serialization.ObjectSchema< + serializers.StdioMcpServerManifest.Raw, + TrueFoundry.StdioMcpServerManifest +> = core.serialization.object({ + name: core.serialization.string(), + displayName: core.serialization.property("display_name", core.serialization.string().optional()), + description: core.serialization.string(), + collaborators: core.serialization.list(Collaborator), + type: core.serialization.stringLiteral("mcp-server/stdio"), + command: core.serialization.string(), + args: core.serialization.list(core.serialization.string()).optional(), + toolSettings: core.serialization.property("tool_settings", core.serialization.list(McpToolSetting).optional()), + authData: core.serialization.property("auth_data", McpServerEnvAuth.optional()), + ownedBy: OwnedBy.optional(), + tags: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), +}); export declare namespace StdioMcpServerManifest { export interface Raw { name: string; + display_name?: string | null; description: string; collaborators: Collaborator.Raw[]; type: "mcp-server/stdio"; diff --git a/src/serialization/types/StickyRouting.ts b/src/serialization/types/StickyRouting.ts index 023311cc..a14288b8 100644 --- a/src/serialization/types/StickyRouting.ts +++ b/src/serialization/types/StickyRouting.ts @@ -1,13 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { StickySessionIdentifier } from "./StickySessionIdentifier.js"; -export const StickyRouting: core.serialization.ObjectSchema = core.serialization.object({ - "ttlSeconds": core.serialization.property("ttl_seconds", core.serialization.number()), - "sessionIdentifiers": core.serialization.property("session_identifiers", core.serialization.list(StickySessionIdentifier)) +export const StickyRouting: core.serialization.ObjectSchema = + core.serialization.object({ + ttlSeconds: core.serialization.property("ttl_seconds", core.serialization.number()), + sessionIdentifiers: core.serialization.property( + "session_identifiers", + core.serialization.list(StickySessionIdentifier), + ), }); export declare namespace StickyRouting { diff --git a/src/serialization/types/StickySessionIdentifier.ts b/src/serialization/types/StickySessionIdentifier.ts index 48094a18..3fa79a53 100644 --- a/src/serialization/types/StickySessionIdentifier.ts +++ b/src/serialization/types/StickySessionIdentifier.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { StickySessionIdentifierSource } from "./StickySessionIdentifierSource.js"; -export const StickySessionIdentifier: core.serialization.ObjectSchema = core.serialization.object({ - "source": StickySessionIdentifierSource, - "key": core.serialization.string() - }); +export const StickySessionIdentifier: core.serialization.ObjectSchema< + serializers.StickySessionIdentifier.Raw, + TrueFoundry.StickySessionIdentifier +> = core.serialization.object({ + source: StickySessionIdentifierSource, + key: core.serialization.string(), +}); export declare namespace StickySessionIdentifier { export interface Raw { diff --git a/src/serialization/types/StickySessionIdentifierSource.ts b/src/serialization/types/StickySessionIdentifierSource.ts index b9bff10b..134c6307 100644 --- a/src/serialization/types/StickySessionIdentifierSource.ts +++ b/src/serialization/types/StickySessionIdentifierSource.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const StickySessionIdentifierSource: core.serialization.Schema = core.serialization.enum_(["headers", "metadata"]); +export const StickySessionIdentifierSource: core.serialization.Schema< + serializers.StickySessionIdentifierSource.Raw, + TrueFoundry.StickySessionIdentifierSource +> = core.serialization.enum_(["headers", "metadata"]); export declare namespace StickySessionIdentifierSource { export type Raw = "headers" | "metadata"; diff --git a/src/serialization/types/StringDataMount.ts b/src/serialization/types/StringDataMount.ts index b6d85fac..77bdc97b 100644 --- a/src/serialization/types/StringDataMount.ts +++ b/src/serialization/types/StringDataMount.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const StringDataMount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("string"), - "mountPath": core.serialization.property("mount_path", core.serialization.string()), - "data": core.serialization.string() - }); +export const StringDataMount: core.serialization.ObjectSchema< + serializers.StringDataMount.Raw, + TrueFoundry.StringDataMount +> = core.serialization.object({ + type: core.serialization.stringLiteral("string"), + mountPath: core.serialization.property("mount_path", core.serialization.string()), + data: core.serialization.string(), +}); export declare namespace StringDataMount { export interface Raw { diff --git a/src/serialization/types/SubAgent.ts b/src/serialization/types/SubAgent.ts index a5887bef..49b6a3a1 100644 --- a/src/serialization/types/SubAgent.ts +++ b/src/serialization/types/SubAgent.ts @@ -1,11 +1,12 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SubAgent: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string() +export const SubAgent: core.serialization.ObjectSchema = + core.serialization.object({ + name: core.serialization.string(), }); export declare namespace SubAgent { diff --git a/src/serialization/types/Subject.ts b/src/serialization/types/Subject.ts index 32d384ad..64680ca2 100644 --- a/src/serialization/types/Subject.ts +++ b/src/serialization/types/Subject.ts @@ -1,28 +1,29 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; -import { SubjectType } from "./SubjectType.js"; +import type * as serializers from "../index.js"; +import { SubjectSubjectType } from "./SubjectSubjectType.js"; -export const Subject: core.serialization.ObjectSchema = core.serialization.object({ - "subjectId": core.serialization.string(), - "subjectType": SubjectType, - "subjectSlug": core.serialization.string().optional(), - "subjectDisplayName": core.serialization.string().optional(), - "subjectPatName": core.serialization.string().optional(), - "subjectControllerName": core.serialization.string().optional(), - "subjectExternalIdentitySlug": core.serialization.string().optional() +export const Subject: core.serialization.ObjectSchema = + core.serialization.object({ + subjectId: core.serialization.string(), + subjectType: SubjectSubjectType, + subjectSlug: core.serialization.string().optionalNullable(), + subjectDisplayName: core.serialization.string().optionalNullable(), + subjectPatName: core.serialization.string().optionalNullable(), + subjectControllerName: core.serialization.string().optionalNullable(), + subjectExternalIdentitySlug: core.serialization.string().optionalNullable(), }); export declare namespace Subject { export interface Raw { subjectId: string; - subjectType: SubjectType.Raw; - subjectSlug?: string | null; - subjectDisplayName?: string | null; - subjectPatName?: string | null; - subjectControllerName?: string | null; - subjectExternalIdentitySlug?: string | null; + subjectType: SubjectSubjectType.Raw; + subjectSlug?: (string | null | undefined) | null; + subjectDisplayName?: (string | null | undefined) | null; + subjectPatName?: (string | null | undefined) | null; + subjectControllerName?: (string | null | undefined) | null; + subjectExternalIdentitySlug?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/SubjectClause.ts b/src/serialization/types/SubjectClause.ts index 2e70f944..d6f0daf0 100644 --- a/src/serialization/types/SubjectClause.ts +++ b/src/serialization/types/SubjectClause.ts @@ -1,17 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SubjectClause: core.serialization.ObjectSchema = core.serialization.object({ - "in": core.serialization.list(core.serialization.string()).optional(), - "notIn": core.serialization.property("not_in", core.serialization.list(core.serialization.string()).optional()) +export const SubjectClause: core.serialization.ObjectSchema = + core.serialization.object({ + in: core.serialization.list(core.serialization.string()).optional(), + notIn: core.serialization.property("not_in", core.serialization.list(core.serialization.string()).optional()), }); export declare namespace SubjectClause { export interface Raw { - "in"?: string[] | null; + in?: string[] | null; not_in?: string[] | null; } } diff --git a/src/serialization/types/SubjectConditionGroup.ts b/src/serialization/types/SubjectConditionGroup.ts index 8fc3bd67..d6a844c6 100644 --- a/src/serialization/types/SubjectConditionGroup.ts +++ b/src/serialization/types/SubjectConditionGroup.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { SubjectClause } from "./SubjectClause.js"; import { SubjectConditionGroupOperator } from "./SubjectConditionGroupOperator.js"; -export const SubjectConditionGroup: core.serialization.ObjectSchema = core.serialization.object({ - "operator": SubjectConditionGroupOperator, - "conditions": SubjectClause - }); +export const SubjectConditionGroup: core.serialization.ObjectSchema< + serializers.SubjectConditionGroup.Raw, + TrueFoundry.SubjectConditionGroup +> = core.serialization.object({ + operator: SubjectConditionGroupOperator, + conditions: SubjectClause, +}); export declare namespace SubjectConditionGroup { export interface Raw { diff --git a/src/serialization/types/SubjectConditionGroupOperator.ts b/src/serialization/types/SubjectConditionGroupOperator.ts index 0a0391e5..3860c108 100644 --- a/src/serialization/types/SubjectConditionGroupOperator.ts +++ b/src/serialization/types/SubjectConditionGroupOperator.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SubjectConditionGroupOperator: core.serialization.Schema = core.serialization.enum_(["and", "or"]); +export const SubjectConditionGroupOperator: core.serialization.Schema< + serializers.SubjectConditionGroupOperator.Raw, + TrueFoundry.SubjectConditionGroupOperator +> = core.serialization.enum_(["and", "or"]); export declare namespace SubjectConditionGroupOperator { export type Raw = "and" | "or"; diff --git a/src/serialization/types/SubjectPermission.ts b/src/serialization/types/SubjectPermission.ts index 6e061053..e91077e0 100644 --- a/src/serialization/types/SubjectPermission.ts +++ b/src/serialization/types/SubjectPermission.ts @@ -1,26 +1,29 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SubjectPermission: core.serialization.ObjectSchema = core.serialization.object({ - "resourceType": core.serialization.string(), - "resourceId": core.serialization.string(), - "resourceName": core.serialization.string().optional(), - "resourceFqn": core.serialization.string().optional(), - "roleId": core.serialization.string(), - "roleName": core.serialization.string(), - "subjectId": core.serialization.string(), - "subjectType": core.serialization.string() - }); +export const SubjectPermission: core.serialization.ObjectSchema< + serializers.SubjectPermission.Raw, + TrueFoundry.SubjectPermission +> = core.serialization.object({ + resourceType: core.serialization.string(), + resourceId: core.serialization.string(), + resourceName: core.serialization.string().optionalNullable(), + resourceFqn: core.serialization.string().optionalNullable(), + roleId: core.serialization.string(), + roleName: core.serialization.string(), + subjectId: core.serialization.string(), + subjectType: core.serialization.string(), +}); export declare namespace SubjectPermission { export interface Raw { resourceType: string; resourceId: string; - resourceName?: string | null; - resourceFqn?: string | null; + resourceName?: (string | null | undefined) | null; + resourceFqn?: (string | null | undefined) | null; roleId: string; roleName: string; subjectId: string; diff --git a/src/serialization/types/SubjectSubjectType.ts b/src/serialization/types/SubjectSubjectType.ts new file mode 100644 index 00000000..227d1ec2 --- /dev/null +++ b/src/serialization/types/SubjectSubjectType.ts @@ -0,0 +1,31 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const SubjectSubjectType: core.serialization.Schema< + serializers.SubjectSubjectType.Raw, + TrueFoundry.SubjectSubjectType +> = core.serialization.enum_([ + "user", + "team", + "serviceaccount", + "virtualaccount", + "agent-identity", + "agent", + "agent-channel-identity", + "role", +]); + +export declare namespace SubjectSubjectType { + export type Raw = + | "user" + | "team" + | "serviceaccount" + | "virtualaccount" + | "agent-identity" + | "agent" + | "agent-channel-identity" + | "role"; +} diff --git a/src/serialization/types/SubjectType.ts b/src/serialization/types/SubjectType.ts index 2728e15e..f3b5c88c 100644 --- a/src/serialization/types/SubjectType.ts +++ b/src/serialization/types/SubjectType.ts @@ -1,11 +1,29 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SubjectType: core.serialization.Schema = core.serialization.enum_(["user", "team", "serviceaccount", "virtualaccount", "external-identity", "agent-identity", "role"]); +export const SubjectType: core.serialization.Schema = + core.serialization.enum_([ + "user", + "team", + "serviceaccount", + "virtualaccount", + "agent-identity", + "agent", + "agent-channel-identity", + "role", + ]); export declare namespace SubjectType { - export type Raw = "user" | "team" | "serviceaccount" | "virtualaccount" | "external-identity" | "agent-identity" | "role"; + export type Raw = + | "user" + | "team" + | "serviceaccount" + | "virtualaccount" + | "agent-identity" + | "agent" + | "agent-channel-identity" + | "role"; } diff --git a/src/serialization/types/SyncTokenInSecretStoreInfo.ts b/src/serialization/types/SyncTokenInSecretStoreInfo.ts index c3ffe3cf..d3027a95 100644 --- a/src/serialization/types/SyncTokenInSecretStoreInfo.ts +++ b/src/serialization/types/SyncTokenInSecretStoreInfo.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const SyncTokenInSecretStoreInfo: core.serialization.ObjectSchema = core.serialization.object({ - "updatedAt": core.serialization.string(), - "error": core.serialization.string().optional() - }); +export const SyncTokenInSecretStoreInfo: core.serialization.ObjectSchema< + serializers.SyncTokenInSecretStoreInfo.Raw, + TrueFoundry.SyncTokenInSecretStoreInfo +> = core.serialization.object({ + updatedAt: core.serialization.string(), + error: core.serialization.string().optionalNullable(), +}); export declare namespace SyncTokenInSecretStoreInfo { export interface Raw { updatedAt: string; - error?: string | null; + error?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/SyncVirtualAccountTokenResponse.ts b/src/serialization/types/SyncVirtualAccountTokenResponse.ts index 6d93fd7f..28b15846 100644 --- a/src/serialization/types/SyncVirtualAccountTokenResponse.ts +++ b/src/serialization/types/SyncVirtualAccountTokenResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { SyncTokenInSecretStoreInfo } from "./SyncTokenInSecretStoreInfo.js"; -export const SyncVirtualAccountTokenResponse: core.serialization.ObjectSchema = core.serialization.object({ - "syncTokenInSecretStoreInfo": SyncTokenInSecretStoreInfo - }); +export const SyncVirtualAccountTokenResponse: core.serialization.ObjectSchema< + serializers.SyncVirtualAccountTokenResponse.Raw, + TrueFoundry.SyncVirtualAccountTokenResponse +> = core.serialization.object({ + syncTokenInSecretStoreInfo: SyncTokenInSecretStoreInfo, +}); export declare namespace SyncVirtualAccountTokenResponse { export interface Raw { diff --git a/src/serialization/types/SystemMessage.ts b/src/serialization/types/SystemMessage.ts index 308d31c5..4cc2479f 100644 --- a/src/serialization/types/SystemMessage.ts +++ b/src/serialization/types/SystemMessage.ts @@ -1,14 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { SystemMessageContent } from "./SystemMessageContent.js"; -export const SystemMessage: core.serialization.ObjectSchema = core.serialization.object({ - "role": core.serialization.stringLiteral("system"), - "content": SystemMessageContent, - "name": core.serialization.string().optional() +export const SystemMessage: core.serialization.ObjectSchema = + core.serialization.object({ + role: core.serialization.stringLiteral("system"), + content: SystemMessageContent, + name: core.serialization.string().optional(), }); export declare namespace SystemMessage { diff --git a/src/serialization/types/SystemMessageContent.ts b/src/serialization/types/SystemMessageContent.ts index 1cff1be8..57e73c26 100644 --- a/src/serialization/types/SystemMessageContent.ts +++ b/src/serialization/types/SystemMessageContent.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BlobStorageReference } from "./BlobStorageReference.js"; -export const SystemMessageContent: core.serialization.Schema = core.serialization.undiscriminatedUnion([core.serialization.string(), BlobStorageReference]); +export const SystemMessageContent: core.serialization.Schema< + serializers.SystemMessageContent.Raw, + TrueFoundry.SystemMessageContent +> = core.serialization.undiscriminatedUnion([core.serialization.string(), BlobStorageReference]); export declare namespace SystemMessageContent { export type Raw = string | BlobStorageReference.Raw; diff --git a/src/serialization/types/TargetClause.ts b/src/serialization/types/TargetClause.ts index 0c8b7ea4..7fed986c 100644 --- a/src/serialization/types/TargetClause.ts +++ b/src/serialization/types/TargetClause.ts @@ -1,15 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { InNotInOperator } from "./InNotInOperator.js"; import { McpToolsOperator } from "./McpToolsOperator.js"; -export const TargetClause: core.serialization.ObjectSchema = core.serialization.object({ - "mcpServers": InNotInOperator.optional(), - "mcpTools": McpToolsOperator.optional(), - "model": InNotInOperator.optional() +export const TargetClause: core.serialization.ObjectSchema = + core.serialization.object({ + mcpServers: InNotInOperator.optional(), + mcpTools: McpToolsOperator.optional(), + model: InNotInOperator.optional(), }); export declare namespace TargetClause { diff --git a/src/serialization/types/TargetConditionGroup.ts b/src/serialization/types/TargetConditionGroup.ts index 1417d492..a6a5240d 100644 --- a/src/serialization/types/TargetConditionGroup.ts +++ b/src/serialization/types/TargetConditionGroup.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { TargetClause } from "./TargetClause.js"; -export const TargetConditionGroup: core.serialization.ObjectSchema = core.serialization.object({ - "operator": core.serialization.stringLiteral("or"), - "conditions": TargetClause - }); +export const TargetConditionGroup: core.serialization.ObjectSchema< + serializers.TargetConditionGroup.Raw, + TrueFoundry.TargetConditionGroup +> = core.serialization.object({ + operator: core.serialization.stringLiteral("or"), + conditions: TargetClause, +}); export declare namespace TargetConditionGroup { export interface Raw { diff --git a/src/serialization/types/TaskDockerFileBuild.ts b/src/serialization/types/TaskDockerFileBuild.ts index 27c4bda7..8f5c491b 100644 --- a/src/serialization/types/TaskDockerFileBuild.ts +++ b/src/serialization/types/TaskDockerFileBuild.ts @@ -1,15 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TaskDockerFileBuild: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("task-dockerfile-build"), - "dockerRegistry": core.serialization.property("docker_registry", core.serialization.string().optional()), - "dockerfilePath": core.serialization.property("dockerfile_path", core.serialization.string()), - "buildArgs": core.serialization.property("build_args", core.serialization.record(core.serialization.string(), core.serialization.string()).optional()) - }); +export const TaskDockerFileBuild: core.serialization.ObjectSchema< + serializers.TaskDockerFileBuild.Raw, + TrueFoundry.TaskDockerFileBuild +> = core.serialization.object({ + type: core.serialization.stringLiteral("task-dockerfile-build"), + dockerRegistry: core.serialization.property("docker_registry", core.serialization.string().optional()), + dockerfilePath: core.serialization.property("dockerfile_path", core.serialization.string()), + buildArgs: core.serialization.property( + "build_args", + core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), + ), +}); export declare namespace TaskDockerFileBuild { export interface Raw { diff --git a/src/serialization/types/TaskPySparkBuild.ts b/src/serialization/types/TaskPySparkBuild.ts index d9cca29a..e198f9a3 100644 --- a/src/serialization/types/TaskPySparkBuild.ts +++ b/src/serialization/types/TaskPySparkBuild.ts @@ -1,18 +1,27 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TaskPySparkBuild: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("task-pyspark-build"), - "sparkVersion": core.serialization.property("spark_version", core.serialization.string()), - "containerImage": core.serialization.property("container_image", core.serialization.string().optional()), - "dockerRegistry": core.serialization.property("docker_registry", core.serialization.string().optional()), - "requirementsPath": core.serialization.property("requirements_path", core.serialization.string().optional()), - "pipPackages": core.serialization.property("pip_packages", core.serialization.list(core.serialization.string()).optional()), - "aptPackages": core.serialization.property("apt_packages", core.serialization.list(core.serialization.string()).optional()) - }); +export const TaskPySparkBuild: core.serialization.ObjectSchema< + serializers.TaskPySparkBuild.Raw, + TrueFoundry.TaskPySparkBuild +> = core.serialization.object({ + type: core.serialization.stringLiteral("task-pyspark-build"), + sparkVersion: core.serialization.property("spark_version", core.serialization.string()), + containerImage: core.serialization.property("container_image", core.serialization.string().optional()), + dockerRegistry: core.serialization.property("docker_registry", core.serialization.string().optional()), + requirementsPath: core.serialization.property("requirements_path", core.serialization.string().optional()), + pipPackages: core.serialization.property( + "pip_packages", + core.serialization.list(core.serialization.string()).optional(), + ), + aptPackages: core.serialization.property( + "apt_packages", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace TaskPySparkBuild { export interface Raw { diff --git a/src/serialization/types/TaskPythonBuild.ts b/src/serialization/types/TaskPythonBuild.ts index 89b12587..1c9b502d 100644 --- a/src/serialization/types/TaskPythonBuild.ts +++ b/src/serialization/types/TaskPythonBuild.ts @@ -1,18 +1,27 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TaskPythonBuild: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("task-python-build"), - "dockerRegistry": core.serialization.property("docker_registry", core.serialization.string().optional()), - "pythonVersion": core.serialization.property("python_version", core.serialization.string().optional()), - "requirementsPath": core.serialization.property("requirements_path", core.serialization.string().optional()), - "pipPackages": core.serialization.property("pip_packages", core.serialization.list(core.serialization.string()).optional()), - "aptPackages": core.serialization.property("apt_packages", core.serialization.list(core.serialization.string()).optional()), - "cudaVersion": core.serialization.property("cuda_version", core.serialization.string().optional()) - }); +export const TaskPythonBuild: core.serialization.ObjectSchema< + serializers.TaskPythonBuild.Raw, + TrueFoundry.TaskPythonBuild +> = core.serialization.object({ + type: core.serialization.stringLiteral("task-python-build"), + dockerRegistry: core.serialization.property("docker_registry", core.serialization.string().optional()), + pythonVersion: core.serialization.property("python_version", core.serialization.string().optional()), + requirementsPath: core.serialization.property("requirements_path", core.serialization.string().optional()), + pipPackages: core.serialization.property( + "pip_packages", + core.serialization.list(core.serialization.string()).optional(), + ), + aptPackages: core.serialization.property( + "apt_packages", + core.serialization.list(core.serialization.string()).optional(), + ), + cudaVersion: core.serialization.property("cuda_version", core.serialization.string().optional()), +}); export declare namespace TaskPythonBuild { export interface Raw { diff --git a/src/serialization/types/TaskSparkImage.ts b/src/serialization/types/TaskSparkImage.ts new file mode 100644 index 00000000..6628fe32 --- /dev/null +++ b/src/serialization/types/TaskSparkImage.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const TaskSparkImage: core.serialization.ObjectSchema< + serializers.TaskSparkImage.Raw, + TrueFoundry.TaskSparkImage +> = core.serialization.object({ + type: core.serialization.stringLiteral("task-spark-image"), + sparkVersion: core.serialization.property("spark_version", core.serialization.string()), + containerImage: core.serialization.property("container_image", core.serialization.string()), + dockerRegistry: core.serialization.property("docker_registry", core.serialization.string().optional()), +}); + +export declare namespace TaskSparkImage { + export interface Raw { + type: "task-spark-image"; + spark_version: string; + container_image: string; + docker_registry?: string | null; + } +} diff --git a/src/serialization/types/Team.ts b/src/serialization/types/Team.ts index 2b2b443b..99d695e4 100644 --- a/src/serialization/types/Team.ts +++ b/src/serialization/types/Team.ts @@ -1,30 +1,30 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Subject } from "./Subject.js"; import { TeamManifest } from "./TeamManifest.js"; import { TeamMetadata } from "./TeamMetadata.js"; export const Team: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string(), - "description": core.serialization.string(), - "tenantName": core.serialization.string(), - "accountId": core.serialization.string(), - "createdBySubject": Subject, - "members": core.serialization.list(core.serialization.string()).optional(), - "createdAt": core.serialization.date(), - "updatedAt": core.serialization.date(), - "manifest": TeamManifest, - "metadata": TeamMetadata.optional(), - "isEditable": core.serialization.boolean(), - "roles": core.serialization.list(core.serialization.string()).optional(), - "topMembers": core.serialization.list(core.serialization.string()).optional(), - "topManagers": core.serialization.list(core.serialization.string()).optional(), - "totalMemberCount": core.serialization.number().optional(), - "totalManagerCount": core.serialization.number().optional() - }); + id: core.serialization.string(), + description: core.serialization.string(), + tenantName: core.serialization.string(), + accountId: core.serialization.string(), + createdBySubject: Subject, + members: core.serialization.list(core.serialization.string()).optionalNullable(), + createdAt: core.serialization.date(), + updatedAt: core.serialization.date(), + manifest: TeamManifest, + metadata: TeamMetadata.optionalNullable(), + isEditable: core.serialization.boolean(), + roles: core.serialization.list(core.serialization.string()).optionalNullable(), + topMembers: core.serialization.list(core.serialization.string()).optional(), + topManagers: core.serialization.list(core.serialization.string()).optional(), + totalMemberCount: core.serialization.number().optional(), + totalManagerCount: core.serialization.number().optional(), +}); export declare namespace Team { export interface Raw { @@ -33,13 +33,13 @@ export declare namespace Team { tenantName: string; accountId: string; createdBySubject: Subject.Raw; - members?: string[] | null; + members?: (string[] | null | undefined) | null; createdAt: string; updatedAt: string; manifest: TeamManifest.Raw; - metadata?: TeamMetadata.Raw | null; + metadata?: (TeamMetadata.Raw | null | undefined) | null; isEditable: boolean; - roles?: string[] | null; + roles?: (string[] | null | undefined) | null; topMembers?: string[] | null; topManagers?: string[] | null; totalMemberCount?: number | null; diff --git a/src/serialization/types/TeamBudgetConfig.ts b/src/serialization/types/TeamBudgetConfig.ts index 8d26c1e4..78772da8 100644 --- a/src/serialization/types/TeamBudgetConfig.ts +++ b/src/serialization/types/TeamBudgetConfig.ts @@ -1,31 +1,34 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BudgetV2Alert } from "./BudgetV2Alert.js"; import { BudgetV2AppliesTo } from "./BudgetV2AppliesTo.js"; import { BudgetV2Limits } from "./BudgetV2Limits.js"; import { BudgetV2WhenTeamScoped } from "./BudgetV2WhenTeamScoped.js"; import { TeamBudgetConfigMode } from "./TeamBudgetConfigMode.js"; -export const TeamBudgetConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("team-budget-config"), - "teamName": core.serialization.property("team_name", core.serialization.string()), - "name": core.serialization.string(), - "when": BudgetV2WhenTeamScoped, - "limits": BudgetV2Limits, - "appliesTo": core.serialization.property("applies_to", BudgetV2AppliesTo), - "mode": TeamBudgetConfigMode, - "alerts": BudgetV2Alert.optional() - }); +export const TeamBudgetConfig: core.serialization.ObjectSchema< + serializers.TeamBudgetConfig.Raw, + TrueFoundry.TeamBudgetConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("team-budget-config"), + teamName: core.serialization.property("team_name", core.serialization.string()), + name: core.serialization.string(), + when: BudgetV2WhenTeamScoped.optional(), + limits: BudgetV2Limits, + appliesTo: core.serialization.property("applies_to", BudgetV2AppliesTo), + mode: TeamBudgetConfigMode, + alerts: BudgetV2Alert.optional(), +}); export declare namespace TeamBudgetConfig { export interface Raw { type: "team-budget-config"; team_name: string; name: string; - when: BudgetV2WhenTeamScoped.Raw; + when?: BudgetV2WhenTeamScoped.Raw | null; limits: BudgetV2Limits.Raw; applies_to: BudgetV2AppliesTo.Raw; mode: TeamBudgetConfigMode.Raw; diff --git a/src/serialization/types/TeamBudgetConfigMode.ts b/src/serialization/types/TeamBudgetConfigMode.ts index 383ad543..fec644da 100644 --- a/src/serialization/types/TeamBudgetConfigMode.ts +++ b/src/serialization/types/TeamBudgetConfigMode.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TeamBudgetConfigMode: core.serialization.Schema = core.serialization.enum_(["enforce", "audit"]); +export const TeamBudgetConfigMode: core.serialization.Schema< + serializers.TeamBudgetConfigMode.Raw, + TrueFoundry.TeamBudgetConfigMode +> = core.serialization.enum_(["enforce", "audit", "soft_enforce"]); export declare namespace TeamBudgetConfigMode { - export type Raw = "enforce" | "audit"; + export type Raw = "enforce" | "audit" | "soft_enforce"; } diff --git a/src/serialization/types/TeamDataAccessRule.ts b/src/serialization/types/TeamDataAccessRule.ts index 0fe9ba52..f9a70f21 100644 --- a/src/serialization/types/TeamDataAccessRule.ts +++ b/src/serialization/types/TeamDataAccessRule.ts @@ -1,13 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { DataAccessRuleBase } from "./DataAccessRuleBase.js"; -export const TeamDataAccessRule: core.serialization.ObjectSchema = core.serialization.object({ - "scope": core.serialization.stringLiteral("team_data") - }).extend(DataAccessRuleBase); +export const TeamDataAccessRule: core.serialization.ObjectSchema< + serializers.TeamDataAccessRule.Raw, + TrueFoundry.TeamDataAccessRule +> = core.serialization + .object({ + scope: core.serialization.stringLiteral("team_data"), + }) + .extend(DataAccessRuleBase); export declare namespace TeamDataAccessRule { export interface Raw extends DataAccessRuleBase.Raw { diff --git a/src/serialization/types/TeamManifest.ts b/src/serialization/types/TeamManifest.ts index fe74c32e..bfa0bea3 100644 --- a/src/serialization/types/TeamManifest.ts +++ b/src/serialization/types/TeamManifest.ts @@ -1,21 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { IdentityProviderMapping } from "./IdentityProviderMapping.js"; import { TeamOwnedBy } from "./TeamOwnedBy.js"; -export const TeamManifest: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("team"), - "name": core.serialization.string(), - "displayName": core.serialization.string().optional(), - "description": core.serialization.string().optional(), - "managers": core.serialization.list(core.serialization.string()).optional(), - "members": core.serialization.list(core.serialization.string()), - "ownedBy": TeamOwnedBy.optional(), - "tags": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - "identityProviderMapping": core.serialization.property("identity_provider_mapping", core.serialization.list(IdentityProviderMapping).optional()) +export const TeamManifest: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("team"), + name: core.serialization.string(), + displayName: core.serialization.string().optional(), + description: core.serialization.string().optional(), + managers: core.serialization.list(core.serialization.string()).optional(), + members: core.serialization.list(core.serialization.string()), + ownedBy: TeamOwnedBy.optional(), + tags: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + identityProviderMapping: core.serialization.property( + "identity_provider_mapping", + core.serialization.list(IdentityProviderMapping).optional(), + ), }); export declare namespace TeamManifest { diff --git a/src/serialization/types/TeamMetadata.ts b/src/serialization/types/TeamMetadata.ts index 6aa986fa..7b94fbfd 100644 --- a/src/serialization/types/TeamMetadata.ts +++ b/src/serialization/types/TeamMetadata.ts @@ -1,17 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TeamMetadata: core.serialization.ObjectSchema = core.serialization.object({ - "createdByScim": core.serialization.boolean().optional(), - "scimExternalId": core.serialization.string().optional() +export const TeamMetadata: core.serialization.ObjectSchema = + core.serialization.object({ + createdByScim: core.serialization.boolean().optionalNullable(), + scimExternalId: core.serialization.string().optionalNullable(), }); export declare namespace TeamMetadata { export interface Raw { - createdByScim?: boolean | null; - scimExternalId?: string | null; + createdByScim?: (boolean | null | undefined) | null; + scimExternalId?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/TeamOwnedBy.ts b/src/serialization/types/TeamOwnedBy.ts index 0d502cdc..f443e8d1 100644 --- a/src/serialization/types/TeamOwnedBy.ts +++ b/src/serialization/types/TeamOwnedBy.ts @@ -1,11 +1,12 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TeamOwnedBy: core.serialization.ObjectSchema = core.serialization.object({ - "account": core.serialization.string() +export const TeamOwnedBy: core.serialization.ObjectSchema = + core.serialization.object({ + account: core.serialization.string(), }); export declare namespace TeamOwnedBy { diff --git a/src/serialization/types/TeamSubjectRow.ts b/src/serialization/types/TeamSubjectRow.ts index 2f84968c..0d24fc20 100644 --- a/src/serialization/types/TeamSubjectRow.ts +++ b/src/serialization/types/TeamSubjectRow.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { SubjectType } from "./SubjectType.js"; -export const TeamSubjectRow: core.serialization.ObjectSchema = core.serialization.object({ - "subjectId": core.serialization.string(), - "subjectSlug": core.serialization.string(), - "subjectType": SubjectType - }); +export const TeamSubjectRow: core.serialization.ObjectSchema< + serializers.TeamSubjectRow.Raw, + TrueFoundry.TeamSubjectRow +> = core.serialization.object({ + subjectId: core.serialization.string(), + subjectSlug: core.serialization.string(), + subjectType: SubjectType, +}); export declare namespace TeamSubjectRow { export interface Raw { diff --git a/src/serialization/types/TenantBudgetConfig.ts b/src/serialization/types/TenantBudgetConfig.ts index ea1b12af..5fc1281b 100644 --- a/src/serialization/types/TenantBudgetConfig.ts +++ b/src/serialization/types/TenantBudgetConfig.ts @@ -1,29 +1,32 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BudgetV2Alert } from "./BudgetV2Alert.js"; import { BudgetV2AppliesTo } from "./BudgetV2AppliesTo.js"; import { BudgetV2Limits } from "./BudgetV2Limits.js"; import { BudgetV2WhenTenantScoped } from "./BudgetV2WhenTenantScoped.js"; import { TenantBudgetConfigMode } from "./TenantBudgetConfigMode.js"; -export const TenantBudgetConfig: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("tenant-budget-config"), - "name": core.serialization.string(), - "when": BudgetV2WhenTenantScoped, - "limits": BudgetV2Limits, - "appliesTo": core.serialization.property("applies_to", BudgetV2AppliesTo), - "mode": TenantBudgetConfigMode, - "alerts": BudgetV2Alert.optional() - }); +export const TenantBudgetConfig: core.serialization.ObjectSchema< + serializers.TenantBudgetConfig.Raw, + TrueFoundry.TenantBudgetConfig +> = core.serialization.object({ + type: core.serialization.stringLiteral("tenant-budget-config"), + name: core.serialization.string(), + when: BudgetV2WhenTenantScoped.optional(), + limits: BudgetV2Limits, + appliesTo: core.serialization.property("applies_to", BudgetV2AppliesTo), + mode: TenantBudgetConfigMode, + alerts: BudgetV2Alert.optional(), +}); export declare namespace TenantBudgetConfig { export interface Raw { type: "tenant-budget-config"; name: string; - when: BudgetV2WhenTenantScoped.Raw; + when?: BudgetV2WhenTenantScoped.Raw | null; limits: BudgetV2Limits.Raw; applies_to: BudgetV2AppliesTo.Raw; mode: TenantBudgetConfigMode.Raw; diff --git a/src/serialization/types/TenantBudgetConfigMode.ts b/src/serialization/types/TenantBudgetConfigMode.ts index de7beb12..16c82dbc 100644 --- a/src/serialization/types/TenantBudgetConfigMode.ts +++ b/src/serialization/types/TenantBudgetConfigMode.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TenantBudgetConfigMode: core.serialization.Schema = core.serialization.enum_(["enforce", "audit"]); +export const TenantBudgetConfigMode: core.serialization.Schema< + serializers.TenantBudgetConfigMode.Raw, + TrueFoundry.TenantBudgetConfigMode +> = core.serialization.enum_(["enforce", "audit", "soft_enforce"]); export declare namespace TenantBudgetConfigMode { - export type Raw = "enforce" | "audit"; + export type Raw = "enforce" | "audit" | "soft_enforce"; } diff --git a/src/serialization/types/TensorFlowFramework.ts b/src/serialization/types/TensorFlowFramework.ts index f6d2212d..7eeff3a8 100644 --- a/src/serialization/types/TensorFlowFramework.ts +++ b/src/serialization/types/TensorFlowFramework.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TensorFlowFramework: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("tensorflow") - }); +export const TensorFlowFramework: core.serialization.ObjectSchema< + serializers.TensorFlowFramework.Raw, + TrueFoundry.TensorFlowFramework +> = core.serialization.object({ + type: core.serialization.stringLiteral("tensorflow"), +}); export declare namespace TensorFlowFramework { export interface Raw { diff --git a/src/serialization/types/TerminateJobResponse.ts b/src/serialization/types/TerminateJobResponse.ts index 6c264b8b..a3462114 100644 --- a/src/serialization/types/TerminateJobResponse.ts +++ b/src/serialization/types/TerminateJobResponse.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { JobRunStatus } from "./JobRunStatus.js"; -export const TerminateJobResponse: core.serialization.ObjectSchema = core.serialization.object({ - "message": core.serialization.string(), - "jobRunStatus": JobRunStatus - }); +export const TerminateJobResponse: core.serialization.ObjectSchema< + serializers.TerminateJobResponse.Raw, + TrueFoundry.TerminateJobResponse +> = core.serialization.object({ + message: core.serialization.string(), + jobRunStatus: JobRunStatus, +}); export declare namespace TerminateJobResponse { export interface Raw { diff --git a/src/serialization/types/TextContentPart.ts b/src/serialization/types/TextContentPart.ts index 2063eeea..a320f7b1 100644 --- a/src/serialization/types/TextContentPart.ts +++ b/src/serialization/types/TextContentPart.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { TextContentPartText } from "./TextContentPartText.js"; -export const TextContentPart: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("text"), - "text": TextContentPartText - }); +export const TextContentPart: core.serialization.ObjectSchema< + serializers.TextContentPart.Raw, + TrueFoundry.TextContentPart +> = core.serialization.object({ + type: core.serialization.stringLiteral("text"), + text: TextContentPartText, +}); export declare namespace TextContentPart { export interface Raw { diff --git a/src/serialization/types/TextContentPartText.ts b/src/serialization/types/TextContentPartText.ts index 9442c963..e83dc503 100644 --- a/src/serialization/types/TextContentPartText.ts +++ b/src/serialization/types/TextContentPartText.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BlobStorageReference } from "./BlobStorageReference.js"; -export const TextContentPartText: core.serialization.Schema = core.serialization.undiscriminatedUnion([core.serialization.string(), BlobStorageReference]); +export const TextContentPartText: core.serialization.Schema< + serializers.TextContentPartText.Raw, + TrueFoundry.TextContentPartText +> = core.serialization.undiscriminatedUnion([core.serialization.string(), BlobStorageReference]); export declare namespace TextContentPartText { export type Raw = string | BlobStorageReference.Raw; diff --git a/src/serialization/types/TfyContentModerationGuardrailConfig.ts b/src/serialization/types/TfyContentModerationGuardrailConfig.ts index c65be3e1..ec82fe1f 100644 --- a/src/serialization/types/TfyContentModerationGuardrailConfig.ts +++ b/src/serialization/types/TfyContentModerationGuardrailConfig.ts @@ -1,19 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { EnforcingStrategy } from "./EnforcingStrategy.js"; import { TfyContentModerationGuardrailConfigConfig } from "./TfyContentModerationGuardrailConfigConfig.js"; -export const TfyContentModerationGuardrailConfig: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string().optional(), - "type": core.serialization.stringLiteral("integration/guardrail-config/tfy-content-moderation"), - "operation": core.serialization.stringLiteral("validate"), - "enforcingStrategy": core.serialization.property("enforcing_strategy", EnforcingStrategy), - "config": TfyContentModerationGuardrailConfigConfig - }); +export const TfyContentModerationGuardrailConfig: core.serialization.ObjectSchema< + serializers.TfyContentModerationGuardrailConfig.Raw, + TrueFoundry.TfyContentModerationGuardrailConfig +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + type: core.serialization.stringLiteral("integration/guardrail-config/tfy-content-moderation"), + operation: core.serialization.stringLiteral("validate"), + enforcingStrategy: core.serialization.property("enforcing_strategy", EnforcingStrategy), + config: TfyContentModerationGuardrailConfigConfig, +}); export declare namespace TfyContentModerationGuardrailConfig { export interface Raw { diff --git a/src/serialization/types/TfyContentModerationGuardrailConfigConfig.ts b/src/serialization/types/TfyContentModerationGuardrailConfigConfig.ts index 3f17407d..a5fe522a 100644 --- a/src/serialization/types/TfyContentModerationGuardrailConfigConfig.ts +++ b/src/serialization/types/TfyContentModerationGuardrailConfigConfig.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AzureContentSafetyCategory } from "./AzureContentSafetyCategory.js"; -export const TfyContentModerationGuardrailConfigConfig: core.serialization.ObjectSchema = core.serialization.object({ - "severityThreshold": core.serialization.property("severity_threshold", core.serialization.number()), - "categories": core.serialization.list(AzureContentSafetyCategory) - }); +export const TfyContentModerationGuardrailConfigConfig: core.serialization.ObjectSchema< + serializers.TfyContentModerationGuardrailConfigConfig.Raw, + TrueFoundry.TfyContentModerationGuardrailConfigConfig +> = core.serialization.object({ + severityThreshold: core.serialization.property("severity_threshold", core.serialization.number()), + categories: core.serialization.list(AzureContentSafetyCategory), +}); export declare namespace TfyContentModerationGuardrailConfigConfig { export interface Raw { diff --git a/src/serialization/types/TfyManagedMcpServerManifest.ts b/src/serialization/types/TfyManagedMcpServerManifest.ts index 2954d2c1..d43c0c9d 100644 --- a/src/serialization/types/TfyManagedMcpServerManifest.ts +++ b/src/serialization/types/TfyManagedMcpServerManifest.ts @@ -1,29 +1,34 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { McpToolSetting } from "./McpToolSetting.js"; import { OwnedBy } from "./OwnedBy.js"; import { TfyManagedMcpServerOAuth } from "./TfyManagedMcpServerOAuth.js"; -export const TfyManagedMcpServerManifest: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("mcp-server/tfy-managed"), - "name": core.serialization.string(), - "description": core.serialization.string(), - "serverIdentifier": core.serialization.property("server_identifier", core.serialization.string()), - "toolSettings": core.serialization.property("tool_settings", core.serialization.list(McpToolSetting).optional()), - "collaborators": core.serialization.list(Collaborator), - "ownedBy": OwnedBy.optional(), - "authData": core.serialization.property("auth_data", TfyManagedMcpServerOAuth.optional()), - "tags": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() - }); +export const TfyManagedMcpServerManifest: core.serialization.ObjectSchema< + serializers.TfyManagedMcpServerManifest.Raw, + TrueFoundry.TfyManagedMcpServerManifest +> = core.serialization.object({ + type: core.serialization.stringLiteral("mcp-server/tfy-managed"), + name: core.serialization.string(), + displayName: core.serialization.property("display_name", core.serialization.string().optional()), + description: core.serialization.string(), + serverIdentifier: core.serialization.property("server_identifier", core.serialization.string()), + toolSettings: core.serialization.property("tool_settings", core.serialization.list(McpToolSetting).optional()), + collaborators: core.serialization.list(Collaborator), + ownedBy: OwnedBy.optional(), + authData: core.serialization.property("auth_data", TfyManagedMcpServerOAuth.optional()), + tags: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), +}); export declare namespace TfyManagedMcpServerManifest { export interface Raw { type: "mcp-server/tfy-managed"; name: string; + display_name?: string | null; description: string; server_identifier: string; tool_settings?: McpToolSetting.Raw[] | null; diff --git a/src/serialization/types/TfyManagedMcpServerOAuth.ts b/src/serialization/types/TfyManagedMcpServerOAuth.ts index 93143f44..f3a0d1fd 100644 --- a/src/serialization/types/TfyManagedMcpServerOAuth.ts +++ b/src/serialization/types/TfyManagedMcpServerOAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TfyManagedMcpServerOAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("oauth2"), - "grantType": core.serialization.property("grant_type", core.serialization.stringLiteral("authorization_code")) - }); +export const TfyManagedMcpServerOAuth: core.serialization.ObjectSchema< + serializers.TfyManagedMcpServerOAuth.Raw, + TrueFoundry.TfyManagedMcpServerOAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("oauth2"), + grantType: core.serialization.property("grant_type", core.serialization.stringLiteral("authorization_code")), +}); export declare namespace TfyManagedMcpServerOAuth { export interface Raw { diff --git a/src/serialization/types/TfyMetadataGuardrailConfig.ts b/src/serialization/types/TfyMetadataGuardrailConfig.ts index ddc49679..f1e28d62 100644 --- a/src/serialization/types/TfyMetadataGuardrailConfig.ts +++ b/src/serialization/types/TfyMetadataGuardrailConfig.ts @@ -1,19 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { EnforcingStrategy } from "./EnforcingStrategy.js"; import { TfyMetadataGuardrailConfigConfig } from "./TfyMetadataGuardrailConfigConfig.js"; -export const TfyMetadataGuardrailConfig: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string().optional(), - "type": core.serialization.stringLiteral("integration/guardrail-config/tfy-metadata"), - "operation": core.serialization.stringLiteral("validate"), - "enforcingStrategy": core.serialization.property("enforcing_strategy", EnforcingStrategy), - "config": TfyMetadataGuardrailConfigConfig - }); +export const TfyMetadataGuardrailConfig: core.serialization.ObjectSchema< + serializers.TfyMetadataGuardrailConfig.Raw, + TrueFoundry.TfyMetadataGuardrailConfig +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + type: core.serialization.stringLiteral("integration/guardrail-config/tfy-metadata"), + operation: core.serialization.stringLiteral("validate"), + enforcingStrategy: core.serialization.property("enforcing_strategy", EnforcingStrategy), + config: TfyMetadataGuardrailConfigConfig, +}); export declare namespace TfyMetadataGuardrailConfig { export interface Raw { diff --git a/src/serialization/types/TfyMetadataGuardrailConfigConfig.ts b/src/serialization/types/TfyMetadataGuardrailConfigConfig.ts index 0db83635..3ae527e5 100644 --- a/src/serialization/types/TfyMetadataGuardrailConfigConfig.ts +++ b/src/serialization/types/TfyMetadataGuardrailConfigConfig.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { KeySpec } from "./KeySpec.js"; -export const TfyMetadataGuardrailConfigConfig: core.serialization.ObjectSchema = core.serialization.object({ - "allowUnknownKeys": core.serialization.property("allow_unknown_keys", core.serialization.boolean()), - "keys": core.serialization.record(core.serialization.string(), KeySpec) - }); +export const TfyMetadataGuardrailConfigConfig: core.serialization.ObjectSchema< + serializers.TfyMetadataGuardrailConfigConfig.Raw, + TrueFoundry.TfyMetadataGuardrailConfigConfig +> = core.serialization.object({ + allowUnknownKeys: core.serialization.property("allow_unknown_keys", core.serialization.boolean()), + keys: core.serialization.record(core.serialization.string(), KeySpec), +}); export declare namespace TfyMetadataGuardrailConfigConfig { export interface Raw { diff --git a/src/serialization/types/TfyPiiGuardrailConfig.ts b/src/serialization/types/TfyPiiGuardrailConfig.ts index 4363169f..37226dfd 100644 --- a/src/serialization/types/TfyPiiGuardrailConfig.ts +++ b/src/serialization/types/TfyPiiGuardrailConfig.ts @@ -1,21 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { EnforcingStrategy } from "./EnforcingStrategy.js"; import { TfyPiiGuardrailConfigConfig } from "./TfyPiiGuardrailConfigConfig.js"; import { TfyPiiGuardrailConfigOperation } from "./TfyPiiGuardrailConfigOperation.js"; -export const TfyPiiGuardrailConfig: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string().optional(), - "type": core.serialization.stringLiteral("integration/guardrail-config/tfy-pii"), - "operation": TfyPiiGuardrailConfigOperation, - "priority": core.serialization.number().optional(), - "enforcingStrategy": core.serialization.property("enforcing_strategy", EnforcingStrategy), - "config": TfyPiiGuardrailConfigConfig - }); +export const TfyPiiGuardrailConfig: core.serialization.ObjectSchema< + serializers.TfyPiiGuardrailConfig.Raw, + TrueFoundry.TfyPiiGuardrailConfig +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + type: core.serialization.stringLiteral("integration/guardrail-config/tfy-pii"), + operation: TfyPiiGuardrailConfigOperation, + priority: core.serialization.number().optional(), + enforcingStrategy: core.serialization.property("enforcing_strategy", EnforcingStrategy), + config: TfyPiiGuardrailConfigConfig, +}); export declare namespace TfyPiiGuardrailConfig { export interface Raw { diff --git a/src/serialization/types/TfyPiiGuardrailConfigConfig.ts b/src/serialization/types/TfyPiiGuardrailConfigConfig.ts index 54809380..5e9caae7 100644 --- a/src/serialization/types/TfyPiiGuardrailConfigConfig.ts +++ b/src/serialization/types/TfyPiiGuardrailConfigConfig.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AzurePiiCategory } from "./AzurePiiCategory.js"; -export const TfyPiiGuardrailConfigConfig: core.serialization.ObjectSchema = core.serialization.object({ - "piiCategories": core.serialization.property("pii_categories", core.serialization.list(AzurePiiCategory)) - }); +export const TfyPiiGuardrailConfigConfig: core.serialization.ObjectSchema< + serializers.TfyPiiGuardrailConfigConfig.Raw, + TrueFoundry.TfyPiiGuardrailConfigConfig +> = core.serialization.object({ + piiCategories: core.serialization.property("pii_categories", core.serialization.list(AzurePiiCategory)), +}); export declare namespace TfyPiiGuardrailConfigConfig { export interface Raw { diff --git a/src/serialization/types/TfyPiiGuardrailConfigOperation.ts b/src/serialization/types/TfyPiiGuardrailConfigOperation.ts index 8cbaa834..05cef222 100644 --- a/src/serialization/types/TfyPiiGuardrailConfigOperation.ts +++ b/src/serialization/types/TfyPiiGuardrailConfigOperation.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TfyPiiGuardrailConfigOperation: core.serialization.Schema = core.serialization.enum_(["mutate", "validate"]); +export const TfyPiiGuardrailConfigOperation: core.serialization.Schema< + serializers.TfyPiiGuardrailConfigOperation.Raw, + TrueFoundry.TfyPiiGuardrailConfigOperation +> = core.serialization.enum_(["mutate", "validate"]); export declare namespace TfyPiiGuardrailConfigOperation { export type Raw = "mutate" | "validate"; diff --git a/src/serialization/types/TfyPromptInjectionGuardrailConfig.ts b/src/serialization/types/TfyPromptInjectionGuardrailConfig.ts index 25421cc1..c62850a3 100644 --- a/src/serialization/types/TfyPromptInjectionGuardrailConfig.ts +++ b/src/serialization/types/TfyPromptInjectionGuardrailConfig.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { EnforcingStrategy } from "./EnforcingStrategy.js"; -export const TfyPromptInjectionGuardrailConfig: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string().optional(), - "type": core.serialization.stringLiteral("integration/guardrail-config/tfy-prompt-injection"), - "operation": core.serialization.stringLiteral("validate"), - "enforcingStrategy": core.serialization.property("enforcing_strategy", EnforcingStrategy) - }); +export const TfyPromptInjectionGuardrailConfig: core.serialization.ObjectSchema< + serializers.TfyPromptInjectionGuardrailConfig.Raw, + TrueFoundry.TfyPromptInjectionGuardrailConfig +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + type: core.serialization.stringLiteral("integration/guardrail-config/tfy-prompt-injection"), + operation: core.serialization.stringLiteral("validate"), + enforcingStrategy: core.serialization.property("enforcing_strategy", EnforcingStrategy), +}); export declare namespace TfyPromptInjectionGuardrailConfig { export interface Raw { diff --git a/src/serialization/types/TogetherAiIntegrations.ts b/src/serialization/types/TogetherAiIntegrations.ts index 8a05a376..537f460b 100644 --- a/src/serialization/types/TogetherAiIntegrations.ts +++ b/src/serialization/types/TogetherAiIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { TogetherAiModel } from "./TogetherAiModel.js"; -export const TogetherAiIntegrations: core.serialization.ObjectSchema = TogetherAiModel; +export const TogetherAiIntegrations: core.serialization.ObjectSchema< + serializers.TogetherAiIntegrations.Raw, + TrueFoundry.TogetherAiIntegrations +> = TogetherAiModel; export declare namespace TogetherAiIntegrations { export type Raw = TogetherAiModel.Raw; diff --git a/src/serialization/types/TogetherAiKeyAuth.ts b/src/serialization/types/TogetherAiKeyAuth.ts index cb59d857..64bc67a3 100644 --- a/src/serialization/types/TogetherAiKeyAuth.ts +++ b/src/serialization/types/TogetherAiKeyAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TogetherAiKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) - }); +export const TogetherAiKeyAuth: core.serialization.ObjectSchema< + serializers.TogetherAiKeyAuth.Raw, + TrueFoundry.TogetherAiKeyAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), +}); export declare namespace TogetherAiKeyAuth { export interface Raw { diff --git a/src/serialization/types/TogetherAiModel.ts b/src/serialization/types/TogetherAiModel.ts index e8acae9d..cd4686ea 100644 --- a/src/serialization/types/TogetherAiModel.ts +++ b/src/serialization/types/TogetherAiModel.ts @@ -1,19 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const TogetherAiModel: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/model/together-ai"), - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const TogetherAiModel: core.serialization.ObjectSchema< + serializers.TogetherAiModel.Raw, + TrueFoundry.TogetherAiModel +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/model/together-ai"), + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace TogetherAiModel { export interface Raw { diff --git a/src/serialization/types/TogetherAiProviderAccount.ts b/src/serialization/types/TogetherAiProviderAccount.ts index 01170c5d..7b053567 100644 --- a/src/serialization/types/TogetherAiProviderAccount.ts +++ b/src/serialization/types/TogetherAiProviderAccount.ts @@ -1,22 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { OwnedBy } from "./OwnedBy.js"; import { TogetherAiIntegrations } from "./TogetherAiIntegrations.js"; import { TogetherAiKeyAuth } from "./TogetherAiKeyAuth.js"; -export const TogetherAiProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/together-ai"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", TogetherAiKeyAuth), - "integrations": core.serialization.list(TogetherAiIntegrations), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const TogetherAiProviderAccount: core.serialization.ObjectSchema< + serializers.TogetherAiProviderAccount.Raw, + TrueFoundry.TogetherAiProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/together-ai"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", TogetherAiKeyAuth), + integrations: core.serialization.list(TogetherAiIntegrations), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace TogetherAiProviderAccount { export interface Raw { diff --git a/src/serialization/types/TokenPagination.ts b/src/serialization/types/TokenPagination.ts index cb4643c8..2943a543 100644 --- a/src/serialization/types/TokenPagination.ts +++ b/src/serialization/types/TokenPagination.ts @@ -1,19 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TokenPagination: core.serialization.ObjectSchema = core.serialization.object({ - "limit": core.serialization.number().optional(), - "nextPageToken": core.serialization.string().optional(), - "previousPageToken": core.serialization.string().optional() - }); +export const TokenPagination: core.serialization.ObjectSchema< + serializers.TokenPagination.Raw, + TrueFoundry.TokenPagination +> = core.serialization.object({ + limit: core.serialization.number().optionalNullable(), + nextPageToken: core.serialization.string().optionalNullable(), + previousPageToken: core.serialization.string().optionalNullable(), +}); export declare namespace TokenPagination { export interface Raw { - limit?: number | null; - nextPageToken?: string | null; - previousPageToken?: string | null; + limit?: (number | null | undefined) | null; + nextPageToken?: (string | null | undefined) | null; + previousPageToken?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/ToolCall.ts b/src/serialization/types/ToolCall.ts index 54952e4f..9279b1c4 100644 --- a/src/serialization/types/ToolCall.ts +++ b/src/serialization/types/ToolCall.ts @@ -1,20 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Function } from "./Function.js"; -export const ToolCall: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("function"), - "id": core.serialization.string(), - "function": Function +export const ToolCall: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("function"), + id: core.serialization.string(), + function: Function, }); export declare namespace ToolCall { export interface Raw { type: "function"; id: string; - "function": Function.Raw; + function: Function.Raw; } } diff --git a/src/serialization/types/ToolMessage.ts b/src/serialization/types/ToolMessage.ts index a28cbe9c..1c60ef4b 100644 --- a/src/serialization/types/ToolMessage.ts +++ b/src/serialization/types/ToolMessage.ts @@ -1,14 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ToolMessageContent } from "./ToolMessageContent.js"; -export const ToolMessage: core.serialization.ObjectSchema = core.serialization.object({ - "role": core.serialization.stringLiteral("tool"), - "content": ToolMessageContent, - "toolCallId": core.serialization.property("tool_call_id", core.serialization.string()) +export const ToolMessage: core.serialization.ObjectSchema = + core.serialization.object({ + role: core.serialization.stringLiteral("tool"), + content: ToolMessageContent, + toolCallId: core.serialization.property("tool_call_id", core.serialization.string()), }); export declare namespace ToolMessage { diff --git a/src/serialization/types/ToolMessageContent.ts b/src/serialization/types/ToolMessageContent.ts index cefb419a..e11c1f66 100644 --- a/src/serialization/types/ToolMessageContent.ts +++ b/src/serialization/types/ToolMessageContent.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BlobStorageReference } from "./BlobStorageReference.js"; -export const ToolMessageContent: core.serialization.Schema = core.serialization.undiscriminatedUnion([core.serialization.string(), BlobStorageReference]); +export const ToolMessageContent: core.serialization.Schema< + serializers.ToolMessageContent.Raw, + TrueFoundry.ToolMessageContent +> = core.serialization.undiscriminatedUnion([core.serialization.string(), BlobStorageReference]); export declare namespace ToolMessageContent { export type Raw = string | BlobStorageReference.Raw; diff --git a/src/serialization/types/ToolSchema.ts b/src/serialization/types/ToolSchema.ts index 579ed10d..3e26dbee 100644 --- a/src/serialization/types/ToolSchema.ts +++ b/src/serialization/types/ToolSchema.ts @@ -1,18 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { FunctionSchema } from "./FunctionSchema.js"; -export const ToolSchema: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("function"), - "function": FunctionSchema +export const ToolSchema: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("function"), + function: FunctionSchema, }); export declare namespace ToolSchema { export interface Raw { type: "function"; - "function": FunctionSchema.Raw; + function: FunctionSchema.Raw; } } diff --git a/src/serialization/types/TraceSpan.ts b/src/serialization/types/TraceSpan.ts index 27d364a1..b5fe1527 100644 --- a/src/serialization/types/TraceSpan.ts +++ b/src/serialization/types/TraceSpan.ts @@ -1,27 +1,30 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Subject } from "./Subject.js"; -export const TraceSpan: core.serialization.ObjectSchema = core.serialization.object({ - "spanId": core.serialization.string(), - "traceId": core.serialization.string(), - "parentSpanId": core.serialization.string(), - "serviceName": core.serialization.string(), - "spanName": core.serialization.string(), - "spanKind": core.serialization.string(), - "scopeName": core.serialization.string(), - "scopeVersion": core.serialization.string(), - "timestamp": core.serialization.string(), - "durationNs": core.serialization.number(), - "statusCode": core.serialization.string(), - "statusMessage": core.serialization.string(), - "spanAttributes": core.serialization.record(core.serialization.string(), core.serialization.unknown()), - "events": core.serialization.list(core.serialization.record(core.serialization.string(), core.serialization.unknown())), - "createdBySubject": Subject, - "feedbacks": core.serialization.list(core.serialization.list(core.serialization.unknown())).optional() +export const TraceSpan: core.serialization.ObjectSchema = + core.serialization.object({ + spanId: core.serialization.string(), + traceId: core.serialization.string(), + parentSpanId: core.serialization.string(), + serviceName: core.serialization.string(), + spanName: core.serialization.string(), + spanKind: core.serialization.string(), + scopeName: core.serialization.string(), + scopeVersion: core.serialization.string(), + timestamp: core.serialization.string(), + durationNs: core.serialization.number(), + statusCode: core.serialization.string(), + statusMessage: core.serialization.string(), + spanAttributes: core.serialization.record(core.serialization.string(), core.serialization.unknown()), + events: core.serialization.list( + core.serialization.record(core.serialization.string(), core.serialization.unknown()), + ), + createdBySubject: Subject, + feedbacks: core.serialization.list(core.serialization.list(core.serialization.unknown())).optionalNullable(), }); export declare namespace TraceSpan { @@ -41,6 +44,6 @@ export declare namespace TraceSpan { spanAttributes: Record; events: Record[]; createdBySubject: Subject.Raw; - feedbacks?: unknown[][] | null; + feedbacks?: (unknown[][] | null | undefined) | null; } } diff --git a/src/serialization/types/TracingProject.ts b/src/serialization/types/TracingProject.ts new file mode 100644 index 00000000..2ed4ddfa --- /dev/null +++ b/src/serialization/types/TracingProject.ts @@ -0,0 +1,39 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { Subject } from "./Subject.js"; + +export const TracingProject: core.serialization.ObjectSchema< + serializers.TracingProject.Raw, + TrueFoundry.TracingProject +> = core.serialization.object({ + id: core.serialization.string().optionalNullable(), + fqn: core.serialization.string(), + createdBySubject: Subject, + tenantName: core.serialization.string(), + accountId: core.serialization.string(), + manifest: core.serialization.record(core.serialization.string(), core.serialization.unknown()), + createdAt: core.serialization.date().optionalNullable(), + updatedAt: core.serialization.date().optionalNullable(), + storageType: core.serialization.string(), + storageRoot: core.serialization.string(), + storageIntegrationId: core.serialization.string().optionalNullable(), +}); + +export declare namespace TracingProject { + export interface Raw { + id?: (string | null | undefined) | null; + fqn: string; + createdBySubject: Subject.Raw; + tenantName: string; + accountId: string; + manifest: Record; + createdAt?: (string | null | undefined) | null; + updatedAt?: (string | null | undefined) | null; + storageType: string; + storageRoot: string; + storageIntegrationId?: (string | null | undefined) | null; + } +} diff --git a/src/serialization/types/TracingProjectControlPlaneManagedStorage.ts b/src/serialization/types/TracingProjectControlPlaneManagedStorage.ts index 6eb6d74d..8e175eed 100644 --- a/src/serialization/types/TracingProjectControlPlaneManagedStorage.ts +++ b/src/serialization/types/TracingProjectControlPlaneManagedStorage.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TracingProjectControlPlaneManagedStorage: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("controlplane-managed") - }); +export const TracingProjectControlPlaneManagedStorage: core.serialization.ObjectSchema< + serializers.TracingProjectControlPlaneManagedStorage.Raw, + TrueFoundry.TracingProjectControlPlaneManagedStorage +> = core.serialization.object({ + type: core.serialization.stringLiteral("controlplane-managed"), +}); export declare namespace TracingProjectControlPlaneManagedStorage { export interface Raw { diff --git a/src/serialization/types/TracingProjectCustomerManagedStorage.ts b/src/serialization/types/TracingProjectCustomerManagedStorage.ts index 3272c915..45f604ff 100644 --- a/src/serialization/types/TracingProjectCustomerManagedStorage.ts +++ b/src/serialization/types/TracingProjectCustomerManagedStorage.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TracingProjectCustomerManagedStorage: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("customer-managed"), - "storageIntegrationFqn": core.serialization.property("storage_integration_fqn", core.serialization.string()) - }); +export const TracingProjectCustomerManagedStorage: core.serialization.ObjectSchema< + serializers.TracingProjectCustomerManagedStorage.Raw, + TrueFoundry.TracingProjectCustomerManagedStorage +> = core.serialization.object({ + type: core.serialization.stringLiteral("customer-managed"), + storageIntegrationFqn: core.serialization.property("storage_integration_fqn", core.serialization.string()), +}); export declare namespace TracingProjectCustomerManagedStorage { export interface Raw { diff --git a/src/serialization/types/TracingProjectManifest.ts b/src/serialization/types/TracingProjectManifest.ts index 39b34a91..77ec2b39 100644 --- a/src/serialization/types/TracingProjectManifest.ts +++ b/src/serialization/types/TracingProjectManifest.ts @@ -1,21 +1,27 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { OwnedBy } from "./OwnedBy.js"; import { TracingProjectStorageConfig } from "./TracingProjectStorageConfig.js"; -export const TracingProjectManifest: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("tracing-project"), - "name": core.serialization.string(), - "storage": TracingProjectStorageConfig, - "description": core.serialization.string().optional(), - "collaborators": core.serialization.list(Collaborator), - "tracesRetentionDurationDays": core.serialization.property("traces_retention_duration_days", core.serialization.number().optional()), - "ownedBy": OwnedBy.optional() - }); +export const TracingProjectManifest: core.serialization.ObjectSchema< + serializers.TracingProjectManifest.Raw, + TrueFoundry.TracingProjectManifest +> = core.serialization.object({ + type: core.serialization.stringLiteral("tracing-project"), + name: core.serialization.string(), + storage: TracingProjectStorageConfig, + description: core.serialization.string().optional(), + collaborators: core.serialization.list(Collaborator), + tracesRetentionDurationDays: core.serialization.property( + "traces_retention_duration_days", + core.serialization.number().optional(), + ), + ownedBy: OwnedBy.optional(), +}); export declare namespace TracingProjectManifest { export interface Raw { diff --git a/src/serialization/types/TracingProjectStorageConfig.ts b/src/serialization/types/TracingProjectStorageConfig.ts index 3e35a951..c44ce7b3 100644 --- a/src/serialization/types/TracingProjectStorageConfig.ts +++ b/src/serialization/types/TracingProjectStorageConfig.ts @@ -1,12 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { TracingProjectControlPlaneManagedStorage } from "./TracingProjectControlPlaneManagedStorage.js"; import { TracingProjectCustomerManagedStorage } from "./TracingProjectCustomerManagedStorage.js"; -export const TracingProjectStorageConfig: core.serialization.Schema = core.serialization.undiscriminatedUnion([TracingProjectControlPlaneManagedStorage, TracingProjectCustomerManagedStorage]); +export const TracingProjectStorageConfig: core.serialization.Schema< + serializers.TracingProjectStorageConfig.Raw, + TrueFoundry.TracingProjectStorageConfig +> = core.serialization.undiscriminatedUnion([ + TracingProjectControlPlaneManagedStorage, + TracingProjectCustomerManagedStorage, +]); export declare namespace TracingProjectStorageConfig { export type Raw = TracingProjectControlPlaneManagedStorage.Raw | TracingProjectCustomerManagedStorage.Raw; diff --git a/src/serialization/types/TransformersFramework.ts b/src/serialization/types/TransformersFramework.ts index 657851e4..79618aae 100644 --- a/src/serialization/types/TransformersFramework.ts +++ b/src/serialization/types/TransformersFramework.ts @@ -1,22 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { LibraryName } from "./LibraryName.js"; -export const TransformersFramework: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("transformers"), - "libraryName": core.serialization.property("library_name", LibraryName.optional()), - "pipelineTag": core.serialization.property("pipeline_tag", core.serialization.string().optional()), - "baseModel": core.serialization.property("base_model", core.serialization.string().optional()) - }); +export const TransformersFramework: core.serialization.ObjectSchema< + serializers.TransformersFramework.Raw, + TrueFoundry.TransformersFramework +> = core.serialization.object({ + type: core.serialization.stringLiteral("transformers"), + libraryName: core.serialization.property("library_name", LibraryName.optionalNullable()), + pipelineTag: core.serialization.property("pipeline_tag", core.serialization.string().optionalNullable()), + baseModel: core.serialization.property("base_model", core.serialization.string().optionalNullable()), +}); export declare namespace TransformersFramework { export interface Raw { type: "transformers"; - library_name?: LibraryName.Raw | null; - pipeline_tag?: string | null; - base_model?: string | null; + library_name?: (LibraryName.Raw | null | undefined) | null; + pipeline_tag?: (string | null | undefined) | null; + base_model?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/TriggerJobRunResponse.ts b/src/serialization/types/TriggerJobRunResponse.ts index dbef8fae..1d51ac7f 100644 --- a/src/serialization/types/TriggerJobRunResponse.ts +++ b/src/serialization/types/TriggerJobRunResponse.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { JobRun } from "./JobRun.js"; -export const TriggerJobRunResponse: core.serialization.ObjectSchema = core.serialization.object({ - "message": core.serialization.string(), - "jobRunName": core.serialization.string(), - "data": JobRun - }); +export const TriggerJobRunResponse: core.serialization.ObjectSchema< + serializers.TriggerJobRunResponse.Raw, + TrueFoundry.TriggerJobRunResponse +> = core.serialization.object({ + message: core.serialization.string(), + jobRunName: core.serialization.string(), + data: JobRun, +}); export declare namespace TriggerJobRunResponse { export interface Raw { diff --git a/src/serialization/types/TrojAiClientIdAuth.ts b/src/serialization/types/TrojAiClientIdAuth.ts index 30b242da..2a3f78ff 100644 --- a/src/serialization/types/TrojAiClientIdAuth.ts +++ b/src/serialization/types/TrojAiClientIdAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TrojAiClientIdAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("client-id"), - "clientId": core.serialization.property("client_id", core.serialization.string()) - }); +export const TrojAiClientIdAuth: core.serialization.ObjectSchema< + serializers.TrojAiClientIdAuth.Raw, + TrueFoundry.TrojAiClientIdAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("client-id"), + clientId: core.serialization.property("client_id", core.serialization.string()), +}); export declare namespace TrojAiClientIdAuth { export interface Raw { diff --git a/src/serialization/types/TrojAiGuardrailConfig.ts b/src/serialization/types/TrojAiGuardrailConfig.ts index b7d381c7..a49ad22c 100644 --- a/src/serialization/types/TrojAiGuardrailConfig.ts +++ b/src/serialization/types/TrojAiGuardrailConfig.ts @@ -1,23 +1,26 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { EnforcingStrategy } from "./EnforcingStrategy.js"; import { TrojAiClientIdAuth } from "./TrojAiClientIdAuth.js"; import { TrojAiGuardrailConfigConfig } from "./TrojAiGuardrailConfigConfig.js"; import { TrojAiGuardrailConfigOperation } from "./TrojAiGuardrailConfigOperation.js"; -export const TrojAiGuardrailConfig: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "description": core.serialization.string().optional(), - "type": core.serialization.stringLiteral("integration/guardrail-config/trojai"), - "authData": core.serialization.property("auth_data", TrojAiClientIdAuth), - "operation": TrojAiGuardrailConfigOperation, - "priority": core.serialization.number().optional(), - "enforcingStrategy": core.serialization.property("enforcing_strategy", EnforcingStrategy), - "config": TrojAiGuardrailConfigConfig - }); +export const TrojAiGuardrailConfig: core.serialization.ObjectSchema< + serializers.TrojAiGuardrailConfig.Raw, + TrueFoundry.TrojAiGuardrailConfig +> = core.serialization.object({ + name: core.serialization.string(), + description: core.serialization.string().optional(), + type: core.serialization.stringLiteral("integration/guardrail-config/trojai"), + authData: core.serialization.property("auth_data", TrojAiClientIdAuth), + operation: TrojAiGuardrailConfigOperation, + priority: core.serialization.number().optional(), + enforcingStrategy: core.serialization.property("enforcing_strategy", EnforcingStrategy), + config: TrojAiGuardrailConfigConfig, +}); export declare namespace TrojAiGuardrailConfig { export interface Raw { diff --git a/src/serialization/types/TrojAiGuardrailConfigConfig.ts b/src/serialization/types/TrojAiGuardrailConfigConfig.ts index 1451dc84..16f50518 100644 --- a/src/serialization/types/TrojAiGuardrailConfigConfig.ts +++ b/src/serialization/types/TrojAiGuardrailConfigConfig.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TrojAiGuardrailConfigConfig: core.serialization.ObjectSchema = core.serialization.object({ - "baseUrl": core.serialization.property("base_url", core.serialization.string()) - }); +export const TrojAiGuardrailConfigConfig: core.serialization.ObjectSchema< + serializers.TrojAiGuardrailConfigConfig.Raw, + TrueFoundry.TrojAiGuardrailConfigConfig +> = core.serialization.object({ + baseUrl: core.serialization.property("base_url", core.serialization.string()), +}); export declare namespace TrojAiGuardrailConfigConfig { export interface Raw { diff --git a/src/serialization/types/TrojAiGuardrailConfigOperation.ts b/src/serialization/types/TrojAiGuardrailConfigOperation.ts index 75c822bc..761971c8 100644 --- a/src/serialization/types/TrojAiGuardrailConfigOperation.ts +++ b/src/serialization/types/TrojAiGuardrailConfigOperation.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TrojAiGuardrailConfigOperation: core.serialization.Schema = core.serialization.enum_(["validate", "mutate"]); +export const TrojAiGuardrailConfigOperation: core.serialization.Schema< + serializers.TrojAiGuardrailConfigOperation.Raw, + TrueFoundry.TrojAiGuardrailConfigOperation +> = core.serialization.enum_(["validate", "mutate"]); export declare namespace TrojAiGuardrailConfigOperation { export type Raw = "validate" | "mutate"; diff --git a/src/serialization/types/TrueFoundryAgentAskUserQuestionsConfig.ts b/src/serialization/types/TrueFoundryAgentAskUserQuestionsConfig.ts index 79b512f3..8c12d12a 100644 --- a/src/serialization/types/TrueFoundryAgentAskUserQuestionsConfig.ts +++ b/src/serialization/types/TrueFoundryAgentAskUserQuestionsConfig.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TrueFoundryAgentAskUserQuestionsConfig: core.serialization.ObjectSchema = core.serialization.object({ - "enabled": core.serialization.boolean() - }); +export const TrueFoundryAgentAskUserQuestionsConfig: core.serialization.ObjectSchema< + serializers.TrueFoundryAgentAskUserQuestionsConfig.Raw, + TrueFoundry.TrueFoundryAgentAskUserQuestionsConfig +> = core.serialization.object({ + enabled: core.serialization.boolean(), +}); export declare namespace TrueFoundryAgentAskUserQuestionsConfig { export interface Raw { diff --git a/src/serialization/types/TrueFoundryAgentCompactionConfig.ts b/src/serialization/types/TrueFoundryAgentCompactionConfig.ts index 61d0ea83..7f9d9e17 100644 --- a/src/serialization/types/TrueFoundryAgentCompactionConfig.ts +++ b/src/serialization/types/TrueFoundryAgentCompactionConfig.ts @@ -1,13 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TrueFoundryAgentCompactionConfig: core.serialization.ObjectSchema = core.serialization.object({ - "enabled": core.serialization.boolean(), - "compactionThresholdTokens": core.serialization.property("compaction_threshold_tokens", core.serialization.number().optional()) - }); +export const TrueFoundryAgentCompactionConfig: core.serialization.ObjectSchema< + serializers.TrueFoundryAgentCompactionConfig.Raw, + TrueFoundry.TrueFoundryAgentCompactionConfig +> = core.serialization.object({ + enabled: core.serialization.boolean(), + compactionThresholdTokens: core.serialization.property( + "compaction_threshold_tokens", + core.serialization.number().optional(), + ), +}); export declare namespace TrueFoundryAgentCompactionConfig { export interface Raw { diff --git a/src/serialization/types/TrueFoundryAgentConfig.ts b/src/serialization/types/TrueFoundryAgentConfig.ts index 6b08a498..2f176fee 100644 --- a/src/serialization/types/TrueFoundryAgentConfig.ts +++ b/src/serialization/types/TrueFoundryAgentConfig.ts @@ -1,22 +1,34 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { TrueFoundryAgentAskUserQuestionsConfig } from "./TrueFoundryAgentAskUserQuestionsConfig.js"; import { TrueFoundryAgentContextManagementConfig } from "./TrueFoundryAgentContextManagementConfig.js"; import { TrueFoundryAgentDynamicSubAgentsConfig } from "./TrueFoundryAgentDynamicSubAgentsConfig.js"; import { TrueFoundryAgentGenerativeUiConfig } from "./TrueFoundryAgentGenerativeUiConfig.js"; import { TrueFoundryAgentSandboxConfig } from "./TrueFoundryAgentSandboxConfig.js"; -export const TrueFoundryAgentConfig: core.serialization.ObjectSchema = core.serialization.object({ - "iterationLimit": core.serialization.property("iteration_limit", core.serialization.number().optional()), - "sandbox": TrueFoundryAgentSandboxConfig.optional(), - "dynamicSubAgents": core.serialization.property("dynamic_sub_agents", TrueFoundryAgentDynamicSubAgentsConfig.optional()), - "contextManagement": core.serialization.property("context_management", TrueFoundryAgentContextManagementConfig.optional()), - "generativeUi": core.serialization.property("generative_ui", TrueFoundryAgentGenerativeUiConfig.optional()), - "askUserQuestions": core.serialization.property("ask_user_questions", TrueFoundryAgentAskUserQuestionsConfig.optional()) - }); +export const TrueFoundryAgentConfig: core.serialization.ObjectSchema< + serializers.TrueFoundryAgentConfig.Raw, + TrueFoundry.TrueFoundryAgentConfig +> = core.serialization.object({ + iterationLimit: core.serialization.property("iteration_limit", core.serialization.number().optional()), + sandbox: TrueFoundryAgentSandboxConfig.optional(), + dynamicSubAgents: core.serialization.property( + "dynamic_sub_agents", + TrueFoundryAgentDynamicSubAgentsConfig.optional(), + ), + contextManagement: core.serialization.property( + "context_management", + TrueFoundryAgentContextManagementConfig.optional(), + ), + generativeUi: core.serialization.property("generative_ui", TrueFoundryAgentGenerativeUiConfig.optional()), + askUserQuestions: core.serialization.property( + "ask_user_questions", + TrueFoundryAgentAskUserQuestionsConfig.optional(), + ), +}); export declare namespace TrueFoundryAgentConfig { export interface Raw { diff --git a/src/serialization/types/TrueFoundryAgentContextManagementConfig.ts b/src/serialization/types/TrueFoundryAgentContextManagementConfig.ts index 4d018e29..7c0884a0 100644 --- a/src/serialization/types/TrueFoundryAgentContextManagementConfig.ts +++ b/src/serialization/types/TrueFoundryAgentContextManagementConfig.ts @@ -1,15 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { TrueFoundryAgentCompactionConfig } from "./TrueFoundryAgentCompactionConfig.js"; import { TrueFoundryAgentLargeToolResponseConfig } from "./TrueFoundryAgentLargeToolResponseConfig.js"; -export const TrueFoundryAgentContextManagementConfig: core.serialization.ObjectSchema = core.serialization.object({ - "compaction": TrueFoundryAgentCompactionConfig.optional(), - "largeToolResponse": core.serialization.property("large_tool_response", TrueFoundryAgentLargeToolResponseConfig.optional()) - }); +export const TrueFoundryAgentContextManagementConfig: core.serialization.ObjectSchema< + serializers.TrueFoundryAgentContextManagementConfig.Raw, + TrueFoundry.TrueFoundryAgentContextManagementConfig +> = core.serialization.object({ + compaction: TrueFoundryAgentCompactionConfig.optional(), + largeToolResponse: core.serialization.property( + "large_tool_response", + TrueFoundryAgentLargeToolResponseConfig.optional(), + ), +}); export declare namespace TrueFoundryAgentContextManagementConfig { export interface Raw { diff --git a/src/serialization/types/TrueFoundryAgentDynamicSubAgentsConfig.ts b/src/serialization/types/TrueFoundryAgentDynamicSubAgentsConfig.ts index 706540aa..a9c4f760 100644 --- a/src/serialization/types/TrueFoundryAgentDynamicSubAgentsConfig.ts +++ b/src/serialization/types/TrueFoundryAgentDynamicSubAgentsConfig.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TrueFoundryAgentDynamicSubAgentsConfig: core.serialization.ObjectSchema = core.serialization.object({ - "enabled": core.serialization.boolean() - }); +export const TrueFoundryAgentDynamicSubAgentsConfig: core.serialization.ObjectSchema< + serializers.TrueFoundryAgentDynamicSubAgentsConfig.Raw, + TrueFoundry.TrueFoundryAgentDynamicSubAgentsConfig +> = core.serialization.object({ + enabled: core.serialization.boolean(), +}); export declare namespace TrueFoundryAgentDynamicSubAgentsConfig { export interface Raw { diff --git a/src/serialization/types/TrueFoundryAgentGenerativeUiConfig.ts b/src/serialization/types/TrueFoundryAgentGenerativeUiConfig.ts index 048cc3b8..364c6925 100644 --- a/src/serialization/types/TrueFoundryAgentGenerativeUiConfig.ts +++ b/src/serialization/types/TrueFoundryAgentGenerativeUiConfig.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TrueFoundryAgentGenerativeUiConfig: core.serialization.ObjectSchema = core.serialization.object({ - "enabled": core.serialization.boolean() - }); +export const TrueFoundryAgentGenerativeUiConfig: core.serialization.ObjectSchema< + serializers.TrueFoundryAgentGenerativeUiConfig.Raw, + TrueFoundry.TrueFoundryAgentGenerativeUiConfig +> = core.serialization.object({ + enabled: core.serialization.boolean(), +}); export declare namespace TrueFoundryAgentGenerativeUiConfig { export interface Raw { diff --git a/src/serialization/types/TrueFoundryAgentGitSourceSkill.ts b/src/serialization/types/TrueFoundryAgentGitSourceSkill.ts new file mode 100644 index 00000000..fdea2bb9 --- /dev/null +++ b/src/serialization/types/TrueFoundryAgentGitSourceSkill.ts @@ -0,0 +1,26 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const TrueFoundryAgentGitSourceSkill: core.serialization.ObjectSchema< + serializers.TrueFoundryAgentGitSourceSkill.Raw, + TrueFoundry.TrueFoundryAgentGitSourceSkill +> = core.serialization.object({ + type: core.serialization.stringLiteral("git"), + url: core.serialization.string(), + path: core.serialization.string().optional(), + name: core.serialization.string(), + ref: core.serialization.string(), +}); + +export declare namespace TrueFoundryAgentGitSourceSkill { + export interface Raw { + type: "git"; + url: string; + path?: string | null; + name: string; + ref: string; + } +} diff --git a/src/serialization/types/TrueFoundryAgentLargeToolResponseConfig.ts b/src/serialization/types/TrueFoundryAgentLargeToolResponseConfig.ts index 8d297d02..cf22b339 100644 --- a/src/serialization/types/TrueFoundryAgentLargeToolResponseConfig.ts +++ b/src/serialization/types/TrueFoundryAgentLargeToolResponseConfig.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TrueFoundryAgentLargeToolResponseConfig: core.serialization.ObjectSchema = core.serialization.object({ - "enabled": core.serialization.boolean() - }); +export const TrueFoundryAgentLargeToolResponseConfig: core.serialization.ObjectSchema< + serializers.TrueFoundryAgentLargeToolResponseConfig.Raw, + TrueFoundry.TrueFoundryAgentLargeToolResponseConfig +> = core.serialization.object({ + enabled: core.serialization.boolean(), +}); export declare namespace TrueFoundryAgentLargeToolResponseConfig { export interface Raw { diff --git a/src/serialization/types/TrueFoundryAgentManifest.ts b/src/serialization/types/TrueFoundryAgentManifest.ts index 0811437e..819e91af 100644 --- a/src/serialization/types/TrueFoundryAgentManifest.ts +++ b/src/serialization/types/TrueFoundryAgentManifest.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { OwnedBy } from "./OwnedBy.js"; import { SampleAgentInput } from "./SampleAgentInput.js"; @@ -14,23 +14,29 @@ import { TrueFoundryAgentSkill } from "./TrueFoundryAgentSkill.js"; import { TrueFoundryAgentUserMessage } from "./TrueFoundryAgentUserMessage.js"; import { TrueFoundryAgentVariable } from "./TrueFoundryAgentVariable.js"; -export const TrueFoundryAgentManifest: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("truefoundry-agent"), - "name": core.serialization.string(), - "description": core.serialization.string(), - "tags": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - "model": TrueFoundryAgentModel, - "skills": core.serialization.list(TrueFoundryAgentSkill).optional(), - "mcpServers": core.serialization.property("mcp_servers", core.serialization.list(TrueFoundryAgentMcpServer).optional()), - "instructions": core.serialization.string().optional(), - "messages": core.serialization.list(TrueFoundryAgentUserMessage).optional(), - "variables": core.serialization.record(core.serialization.string(), TrueFoundryAgentVariable).optional(), - "sampleInputs": core.serialization.property("sample_inputs", core.serialization.list(SampleAgentInput).optional()), - "responseFormat": core.serialization.property("response_format", TrueFoundryAgentResponseFormat.optional()), - "config": TrueFoundryAgentConfig.optional(), - "collaborators": core.serialization.list(Collaborator), - "ownedBy": OwnedBy.optional() - }); +export const TrueFoundryAgentManifest: core.serialization.ObjectSchema< + serializers.TrueFoundryAgentManifest.Raw, + TrueFoundry.TrueFoundryAgentManifest +> = core.serialization.object({ + type: core.serialization.stringLiteral("truefoundry-agent"), + name: core.serialization.string(), + description: core.serialization.string(), + tags: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + model: TrueFoundryAgentModel, + skills: core.serialization.list(TrueFoundryAgentSkill).optional(), + mcpServers: core.serialization.property( + "mcp_servers", + core.serialization.list(TrueFoundryAgentMcpServer).optional(), + ), + instructions: core.serialization.string().optional(), + messages: core.serialization.list(TrueFoundryAgentUserMessage).optional(), + variables: core.serialization.record(core.serialization.string(), TrueFoundryAgentVariable).optional(), + sampleInputs: core.serialization.property("sample_inputs", core.serialization.list(SampleAgentInput).optional()), + responseFormat: core.serialization.property("response_format", TrueFoundryAgentResponseFormat.optional()), + config: TrueFoundryAgentConfig.optional(), + collaborators: core.serialization.list(Collaborator), + ownedBy: OwnedBy.optional(), +}); export declare namespace TrueFoundryAgentManifest { export interface Raw { diff --git a/src/serialization/types/TrueFoundryAgentMcpServer.ts b/src/serialization/types/TrueFoundryAgentMcpServer.ts index 8992accc..c1442c6b 100644 --- a/src/serialization/types/TrueFoundryAgentMcpServer.ts +++ b/src/serialization/types/TrueFoundryAgentMcpServer.ts @@ -1,25 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; +import { TrueFoundryAgentMcpServerInline } from "./TrueFoundryAgentMcpServerInline.js"; +import { TrueFoundryAgentMcpServerRegistry } from "./TrueFoundryAgentMcpServerRegistry.js"; -export const TrueFoundryAgentMcpServer: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "preload": core.serialization.boolean().optional(), - "enableTools": core.serialization.property("enable_tools", core.serialization.list(core.serialization.string()).optional()), - "disableTools": core.serialization.property("disable_tools", core.serialization.list(core.serialization.string()).optional()), - "preloadTools": core.serialization.property("preload_tools", core.serialization.list(core.serialization.string()).optional()), - "requireApprovalForTools": core.serialization.property("require_approval_for_tools", core.serialization.list(core.serialization.string()).optional()) - }); +export const TrueFoundryAgentMcpServer: core.serialization.Schema< + serializers.TrueFoundryAgentMcpServer.Raw, + TrueFoundry.TrueFoundryAgentMcpServer +> = core.serialization.undiscriminatedUnion([TrueFoundryAgentMcpServerRegistry, TrueFoundryAgentMcpServerInline]); export declare namespace TrueFoundryAgentMcpServer { - export interface Raw { - name: string; - preload?: boolean | null; - enable_tools?: string[] | null; - disable_tools?: string[] | null; - preload_tools?: string[] | null; - require_approval_for_tools?: string[] | null; - } + export type Raw = TrueFoundryAgentMcpServerRegistry.Raw | TrueFoundryAgentMcpServerInline.Raw; } diff --git a/src/serialization/types/TrueFoundryAgentMcpServerInline.ts b/src/serialization/types/TrueFoundryAgentMcpServerInline.ts new file mode 100644 index 00000000..0dd8c930 --- /dev/null +++ b/src/serialization/types/TrueFoundryAgentMcpServerInline.ts @@ -0,0 +1,44 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const TrueFoundryAgentMcpServerInline: core.serialization.ObjectSchema< + serializers.TrueFoundryAgentMcpServerInline.Raw, + TrueFoundry.TrueFoundryAgentMcpServerInline +> = core.serialization.object({ + type: core.serialization.stringLiteral("inline"), + name: core.serialization.string(), + url: core.serialization.string(), + preload: core.serialization.boolean().optional(), + enableTools: core.serialization.property( + "enable_tools", + core.serialization.list(core.serialization.string()).optional(), + ), + disableTools: core.serialization.property( + "disable_tools", + core.serialization.list(core.serialization.string()).optional(), + ), + preloadTools: core.serialization.property( + "preload_tools", + core.serialization.list(core.serialization.string()).optional(), + ), + requireApprovalForTools: core.serialization.property( + "require_approval_for_tools", + core.serialization.list(core.serialization.string()).optional(), + ), +}); + +export declare namespace TrueFoundryAgentMcpServerInline { + export interface Raw { + type: "inline"; + name: string; + url: string; + preload?: boolean | null; + enable_tools?: string[] | null; + disable_tools?: string[] | null; + preload_tools?: string[] | null; + require_approval_for_tools?: string[] | null; + } +} diff --git a/src/serialization/types/TrueFoundryAgentMcpServerRegistry.ts b/src/serialization/types/TrueFoundryAgentMcpServerRegistry.ts new file mode 100644 index 00000000..7370efd7 --- /dev/null +++ b/src/serialization/types/TrueFoundryAgentMcpServerRegistry.ts @@ -0,0 +1,42 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const TrueFoundryAgentMcpServerRegistry: core.serialization.ObjectSchema< + serializers.TrueFoundryAgentMcpServerRegistry.Raw, + TrueFoundry.TrueFoundryAgentMcpServerRegistry +> = core.serialization.object({ + type: core.serialization.stringLiteral("truefoundry-mcp-registry"), + name: core.serialization.string(), + preload: core.serialization.boolean().optional(), + enableTools: core.serialization.property( + "enable_tools", + core.serialization.list(core.serialization.string()).optional(), + ), + disableTools: core.serialization.property( + "disable_tools", + core.serialization.list(core.serialization.string()).optional(), + ), + preloadTools: core.serialization.property( + "preload_tools", + core.serialization.list(core.serialization.string()).optional(), + ), + requireApprovalForTools: core.serialization.property( + "require_approval_for_tools", + core.serialization.list(core.serialization.string()).optional(), + ), +}); + +export declare namespace TrueFoundryAgentMcpServerRegistry { + export interface Raw { + type: "truefoundry-mcp-registry"; + name: string; + preload?: boolean | null; + enable_tools?: string[] | null; + disable_tools?: string[] | null; + preload_tools?: string[] | null; + require_approval_for_tools?: string[] | null; + } +} diff --git a/src/serialization/types/TrueFoundryAgentModel.ts b/src/serialization/types/TrueFoundryAgentModel.ts index 94ee4952..ca2e97ba 100644 --- a/src/serialization/types/TrueFoundryAgentModel.ts +++ b/src/serialization/types/TrueFoundryAgentModel.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { TrueFoundryAgentModelParams } from "./TrueFoundryAgentModelParams.js"; -export const TrueFoundryAgentModel: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "params": TrueFoundryAgentModelParams.optional() - }); +export const TrueFoundryAgentModel: core.serialization.ObjectSchema< + serializers.TrueFoundryAgentModel.Raw, + TrueFoundry.TrueFoundryAgentModel +> = core.serialization.object({ + name: core.serialization.string(), + params: TrueFoundryAgentModelParams.optional(), +}); export declare namespace TrueFoundryAgentModel { export interface Raw { diff --git a/src/serialization/types/TrueFoundryAgentModelParams.ts b/src/serialization/types/TrueFoundryAgentModelParams.ts index ddd7c41c..2f994dec 100644 --- a/src/serialization/types/TrueFoundryAgentModelParams.ts +++ b/src/serialization/types/TrueFoundryAgentModelParams.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TrueFoundryAgentModelParams: core.serialization.ObjectSchema = core.serialization.object({ - "maxTokens": core.serialization.property("max_tokens", core.serialization.number().optional()), - "reasoningEffort": core.serialization.property("reasoning_effort", core.serialization.string().optional()), - "temperature": core.serialization.number().optional(), - "topP": core.serialization.property("top_p", core.serialization.number().optional()), - "topK": core.serialization.property("top_k", core.serialization.number().optional()), - "parallelToolCalls": core.serialization.property("parallel_tool_calls", core.serialization.boolean().optional()) - }); +export const TrueFoundryAgentModelParams: core.serialization.ObjectSchema< + serializers.TrueFoundryAgentModelParams.Raw, + TrueFoundry.TrueFoundryAgentModelParams +> = core.serialization.object({ + maxTokens: core.serialization.property("max_tokens", core.serialization.number().optional()), + reasoningEffort: core.serialization.property("reasoning_effort", core.serialization.string().optional()), + temperature: core.serialization.number().optional(), + topP: core.serialization.property("top_p", core.serialization.number().optional()), + topK: core.serialization.property("top_k", core.serialization.number().optional()), + parallelToolCalls: core.serialization.property("parallel_tool_calls", core.serialization.boolean().optional()), +}); export declare namespace TrueFoundryAgentModelParams { export interface Raw { diff --git a/src/serialization/types/TrueFoundryAgentResponseFormat.ts b/src/serialization/types/TrueFoundryAgentResponseFormat.ts index 0eb8b718..21742801 100644 --- a/src/serialization/types/TrueFoundryAgentResponseFormat.ts +++ b/src/serialization/types/TrueFoundryAgentResponseFormat.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ResponseFormatJsonObject } from "./ResponseFormatJsonObject.js"; import { ResponseFormatJsonSchema } from "./ResponseFormatJsonSchema.js"; import { ResponseFormatText } from "./ResponseFormatText.js"; -export const TrueFoundryAgentResponseFormat: core.serialization.Schema = core.serialization.undiscriminatedUnion([ResponseFormatText, ResponseFormatJsonSchema, ResponseFormatJsonObject]); +export const TrueFoundryAgentResponseFormat: core.serialization.Schema< + serializers.TrueFoundryAgentResponseFormat.Raw, + TrueFoundry.TrueFoundryAgentResponseFormat +> = core.serialization.undiscriminatedUnion([ResponseFormatText, ResponseFormatJsonSchema, ResponseFormatJsonObject]); export declare namespace TrueFoundryAgentResponseFormat { export type Raw = ResponseFormatText.Raw | ResponseFormatJsonSchema.Raw | ResponseFormatJsonObject.Raw; diff --git a/src/serialization/types/TrueFoundryAgentSandboxAuthData.ts b/src/serialization/types/TrueFoundryAgentSandboxAuthData.ts new file mode 100644 index 00000000..cc7e7522 --- /dev/null +++ b/src/serialization/types/TrueFoundryAgentSandboxAuthData.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { TrueFoundryAgentSandboxBasicAuthData } from "./TrueFoundryAgentSandboxBasicAuthData.js"; + +export const TrueFoundryAgentSandboxAuthData: core.serialization.ObjectSchema< + serializers.TrueFoundryAgentSandboxAuthData.Raw, + TrueFoundry.TrueFoundryAgentSandboxAuthData +> = TrueFoundryAgentSandboxBasicAuthData; + +export declare namespace TrueFoundryAgentSandboxAuthData { + export type Raw = TrueFoundryAgentSandboxBasicAuthData.Raw; +} diff --git a/src/serialization/types/TrueFoundryAgentSandboxAuthInject.ts b/src/serialization/types/TrueFoundryAgentSandboxAuthInject.ts new file mode 100644 index 00000000..2e363f18 --- /dev/null +++ b/src/serialization/types/TrueFoundryAgentSandboxAuthInject.ts @@ -0,0 +1,15 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { TrueFoundryAgentSandboxGitAuthInject } from "./TrueFoundryAgentSandboxGitAuthInject.js"; + +export const TrueFoundryAgentSandboxAuthInject: core.serialization.ObjectSchema< + serializers.TrueFoundryAgentSandboxAuthInject.Raw, + TrueFoundry.TrueFoundryAgentSandboxAuthInject +> = TrueFoundryAgentSandboxGitAuthInject; + +export declare namespace TrueFoundryAgentSandboxAuthInject { + export type Raw = TrueFoundryAgentSandboxGitAuthInject.Raw; +} diff --git a/src/serialization/types/TrueFoundryAgentSandboxAuthInjectMatch.ts b/src/serialization/types/TrueFoundryAgentSandboxAuthInjectMatch.ts new file mode 100644 index 00000000..16eb2283 --- /dev/null +++ b/src/serialization/types/TrueFoundryAgentSandboxAuthInjectMatch.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const TrueFoundryAgentSandboxAuthInjectMatch: core.serialization.ObjectSchema< + serializers.TrueFoundryAgentSandboxAuthInjectMatch.Raw, + TrueFoundry.TrueFoundryAgentSandboxAuthInjectMatch +> = core.serialization.object({ + hosts: core.serialization.list(core.serialization.string()), +}); + +export declare namespace TrueFoundryAgentSandboxAuthInjectMatch { + export interface Raw { + hosts: string[]; + } +} diff --git a/src/serialization/types/TrueFoundryAgentSandboxBasicAuthData.ts b/src/serialization/types/TrueFoundryAgentSandboxBasicAuthData.ts new file mode 100644 index 00000000..198ad16e --- /dev/null +++ b/src/serialization/types/TrueFoundryAgentSandboxBasicAuthData.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const TrueFoundryAgentSandboxBasicAuthData: core.serialization.ObjectSchema< + serializers.TrueFoundryAgentSandboxBasicAuthData.Raw, + TrueFoundry.TrueFoundryAgentSandboxBasicAuthData +> = core.serialization.object({ + type: core.serialization.stringLiteral("basic"), + username: core.serialization.string(), + password: core.serialization.string(), +}); + +export declare namespace TrueFoundryAgentSandboxBasicAuthData { + export interface Raw { + type: "basic"; + username: string; + password: string; + } +} diff --git a/src/serialization/types/TrueFoundryAgentSandboxConfig.ts b/src/serialization/types/TrueFoundryAgentSandboxConfig.ts index 73d2c459..ca01a96c 100644 --- a/src/serialization/types/TrueFoundryAgentSandboxConfig.ts +++ b/src/serialization/types/TrueFoundryAgentSandboxConfig.ts @@ -1,17 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; +import { TrueFoundryAgentSandboxNetworkPolicy } from "./TrueFoundryAgentSandboxNetworkPolicy.js"; -export const TrueFoundryAgentSandboxConfig: core.serialization.ObjectSchema = core.serialization.object({ - "enabled": core.serialization.boolean(), - "fileDownloads": core.serialization.property("file_downloads", core.serialization.boolean().optional()) - }); +export const TrueFoundryAgentSandboxConfig: core.serialization.ObjectSchema< + serializers.TrueFoundryAgentSandboxConfig.Raw, + TrueFoundry.TrueFoundryAgentSandboxConfig +> = core.serialization.object({ + enabled: core.serialization.boolean(), + fileDownloads: core.serialization.property("file_downloads", core.serialization.boolean().optional()), + networkPolicy: core.serialization.property("network_policy", TrueFoundryAgentSandboxNetworkPolicy.optional()), +}); export declare namespace TrueFoundryAgentSandboxConfig { export interface Raw { enabled: boolean; file_downloads?: boolean | null; + network_policy?: TrueFoundryAgentSandboxNetworkPolicy.Raw | null; } } diff --git a/src/serialization/types/TrueFoundryAgentSandboxGitAuthInject.ts b/src/serialization/types/TrueFoundryAgentSandboxGitAuthInject.ts new file mode 100644 index 00000000..889f4e0f --- /dev/null +++ b/src/serialization/types/TrueFoundryAgentSandboxGitAuthInject.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { TrueFoundryAgentSandboxAuthData } from "./TrueFoundryAgentSandboxAuthData.js"; +import { TrueFoundryAgentSandboxAuthInjectMatch } from "./TrueFoundryAgentSandboxAuthInjectMatch.js"; + +export const TrueFoundryAgentSandboxGitAuthInject: core.serialization.ObjectSchema< + serializers.TrueFoundryAgentSandboxGitAuthInject.Raw, + TrueFoundry.TrueFoundryAgentSandboxGitAuthInject +> = core.serialization.object({ + type: core.serialization.stringLiteral("git"), + match: TrueFoundryAgentSandboxAuthInjectMatch, + authData: core.serialization.property("auth_data", TrueFoundryAgentSandboxAuthData), +}); + +export declare namespace TrueFoundryAgentSandboxGitAuthInject { + export interface Raw { + type: "git"; + match: TrueFoundryAgentSandboxAuthInjectMatch.Raw; + auth_data: TrueFoundryAgentSandboxAuthData.Raw; + } +} diff --git a/src/serialization/types/TrueFoundryAgentSandboxNetworkPolicy.ts b/src/serialization/types/TrueFoundryAgentSandboxNetworkPolicy.ts new file mode 100644 index 00000000..baf568b2 --- /dev/null +++ b/src/serialization/types/TrueFoundryAgentSandboxNetworkPolicy.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { TrueFoundryAgentSandboxAuthInject } from "./TrueFoundryAgentSandboxAuthInject.js"; + +export const TrueFoundryAgentSandboxNetworkPolicy: core.serialization.ObjectSchema< + serializers.TrueFoundryAgentSandboxNetworkPolicy.Raw, + TrueFoundry.TrueFoundryAgentSandboxNetworkPolicy +> = core.serialization.object({ + authInject: core.serialization.property( + "auth_inject", + core.serialization.list(TrueFoundryAgentSandboxAuthInject).optional(), + ), +}); + +export declare namespace TrueFoundryAgentSandboxNetworkPolicy { + export interface Raw { + auth_inject?: TrueFoundryAgentSandboxAuthInject.Raw[] | null; + } +} diff --git a/src/serialization/types/TrueFoundryAgentSkill.ts b/src/serialization/types/TrueFoundryAgentSkill.ts index 669c5d22..808eb72b 100644 --- a/src/serialization/types/TrueFoundryAgentSkill.ts +++ b/src/serialization/types/TrueFoundryAgentSkill.ts @@ -1,17 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; +import { TrueFoundryAgentGitSourceSkill } from "./TrueFoundryAgentGitSourceSkill.js"; +import { TrueFoundryAgentTrueFoundrySkill } from "./TrueFoundryAgentTrueFoundrySkill.js"; -export const TrueFoundryAgentSkill: core.serialization.ObjectSchema = core.serialization.object({ - "fqn": core.serialization.string(), - "preload": core.serialization.boolean() - }); +export const TrueFoundryAgentSkill: core.serialization.Schema< + serializers.TrueFoundryAgentSkill.Raw, + TrueFoundry.TrueFoundryAgentSkill +> = core.serialization.undiscriminatedUnion([TrueFoundryAgentTrueFoundrySkill, TrueFoundryAgentGitSourceSkill]); export declare namespace TrueFoundryAgentSkill { - export interface Raw { - fqn: string; - preload: boolean; - } + export type Raw = TrueFoundryAgentTrueFoundrySkill.Raw | TrueFoundryAgentGitSourceSkill.Raw; } diff --git a/src/serialization/types/TrueFoundryAgentTrueFoundrySkill.ts b/src/serialization/types/TrueFoundryAgentTrueFoundrySkill.ts new file mode 100644 index 00000000..86f7f42e --- /dev/null +++ b/src/serialization/types/TrueFoundryAgentTrueFoundrySkill.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; + +export const TrueFoundryAgentTrueFoundrySkill: core.serialization.ObjectSchema< + serializers.TrueFoundryAgentTrueFoundrySkill.Raw, + TrueFoundry.TrueFoundryAgentTrueFoundrySkill +> = core.serialization.object({ + type: core.serialization.stringLiteral("truefoundry-skills-registry"), + fqn: core.serialization.string(), + preload: core.serialization.boolean(), +}); + +export declare namespace TrueFoundryAgentTrueFoundrySkill { + export interface Raw { + type: "truefoundry-skills-registry"; + fqn: string; + preload: boolean; + } +} diff --git a/src/serialization/types/TrueFoundryAgentUserMessage.ts b/src/serialization/types/TrueFoundryAgentUserMessage.ts index 6d213174..9ab44a3d 100644 --- a/src/serialization/types/TrueFoundryAgentUserMessage.ts +++ b/src/serialization/types/TrueFoundryAgentUserMessage.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TrueFoundryAgentUserMessage: core.serialization.ObjectSchema = core.serialization.object({ - "role": core.serialization.stringLiteral("user"), - "content": core.serialization.string() - }); +export const TrueFoundryAgentUserMessage: core.serialization.ObjectSchema< + serializers.TrueFoundryAgentUserMessage.Raw, + TrueFoundry.TrueFoundryAgentUserMessage +> = core.serialization.object({ + type: core.serialization.stringLiteral("user.message"), + content: core.serialization.string(), +}); export declare namespace TrueFoundryAgentUserMessage { export interface Raw { - role: "user"; + type: "user.message"; content: string; } } diff --git a/src/serialization/types/TrueFoundryAgentVariable.ts b/src/serialization/types/TrueFoundryAgentVariable.ts index 03e3c7b4..766cd022 100644 --- a/src/serialization/types/TrueFoundryAgentVariable.ts +++ b/src/serialization/types/TrueFoundryAgentVariable.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TrueFoundryAgentVariable: core.serialization.ObjectSchema = core.serialization.object({ - "defaultValue": core.serialization.property("default_value", core.serialization.string().optional()), - "description": core.serialization.string().optional() - }); +export const TrueFoundryAgentVariable: core.serialization.ObjectSchema< + serializers.TrueFoundryAgentVariable.Raw, + TrueFoundry.TrueFoundryAgentVariable +> = core.serialization.object({ + defaultValue: core.serialization.property("default_value", core.serialization.string().optional()), + description: core.serialization.string().optional(), +}); export declare namespace TrueFoundryAgentVariable { export interface Raw { diff --git a/src/serialization/types/TrueFoundryApplyRequestManifest.ts b/src/serialization/types/TrueFoundryApplyRequestManifest.ts index 5980987c..be6a03f5 100644 --- a/src/serialization/types/TrueFoundryApplyRequestManifest.ts +++ b/src/serialization/types/TrueFoundryApplyRequestManifest.ts @@ -1,8 +1,9 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; +import { AgentChannelManifest } from "./AgentChannelManifest.js"; import { AgentIdentityManifest } from "./AgentIdentityManifest.js"; import { AgentManifest } from "./AgentManifest.js"; import { AiFeaturesSettings } from "./AiFeaturesSettings.js"; @@ -38,8 +39,82 @@ import { Volume } from "./Volume.js"; import { Workflow } from "./Workflow.js"; import { WorkspaceManifest } from "./WorkspaceManifest.js"; -export const TrueFoundryApplyRequestManifest: core.serialization.Schema = core.serialization.undiscriminatedUnion([MlRepoManifest, ArtifactManifest, ModelManifest, ChatPromptManifest, DataDirectoryManifest, Service, ApplicationSet, ProviderAccounts, ClusterManifest, WorkspaceManifest, Job, Helm, Volume, Notebook, RStudio, Workflow, AsyncService, SshServer, SparkJob, GatewayConfig, TeamManifest, PolicyManifest, RoleManifest, AlertConfig, VirtualAccountManifest, CommonToolsSettings, AiFeaturesSettings, SecretGroupManifest, AgentManifest, EnvironmentManifest, TracingProjectManifest, McpServerManifest, RoleBindingManifest, AgentIdentityManifest]); +export const TrueFoundryApplyRequestManifest: core.serialization.Schema< + serializers.TrueFoundryApplyRequestManifest.Raw, + TrueFoundry.TrueFoundryApplyRequestManifest +> = core.serialization.undiscriminatedUnion([ + MlRepoManifest, + ArtifactManifest, + ModelManifest, + ChatPromptManifest, + DataDirectoryManifest, + Service, + ApplicationSet, + ProviderAccounts, + ClusterManifest, + WorkspaceManifest, + Job, + Helm, + Volume, + Notebook, + RStudio, + Workflow, + AsyncService, + SshServer, + SparkJob, + GatewayConfig, + TeamManifest, + PolicyManifest, + RoleManifest, + AlertConfig, + VirtualAccountManifest, + CommonToolsSettings, + AiFeaturesSettings, + SecretGroupManifest, + AgentManifest, + EnvironmentManifest, + TracingProjectManifest, + McpServerManifest, + RoleBindingManifest, + AgentIdentityManifest, + AgentChannelManifest, +]); export declare namespace TrueFoundryApplyRequestManifest { - export type Raw = MlRepoManifest.Raw | ArtifactManifest.Raw | ModelManifest.Raw | ChatPromptManifest.Raw | DataDirectoryManifest.Raw | Service.Raw | ApplicationSet.Raw | ProviderAccounts.Raw | ClusterManifest.Raw | WorkspaceManifest.Raw | Job.Raw | Helm.Raw | Volume.Raw | Notebook.Raw | RStudio.Raw | Workflow.Raw | AsyncService.Raw | SshServer.Raw | SparkJob.Raw | GatewayConfig.Raw | TeamManifest.Raw | PolicyManifest.Raw | RoleManifest.Raw | AlertConfig.Raw | VirtualAccountManifest.Raw | CommonToolsSettings.Raw | AiFeaturesSettings.Raw | SecretGroupManifest.Raw | AgentManifest.Raw | EnvironmentManifest.Raw | TracingProjectManifest.Raw | McpServerManifest.Raw | RoleBindingManifest.Raw | AgentIdentityManifest.Raw; + export type Raw = + | MlRepoManifest.Raw + | ArtifactManifest.Raw + | ModelManifest.Raw + | ChatPromptManifest.Raw + | DataDirectoryManifest.Raw + | Service.Raw + | ApplicationSet.Raw + | ProviderAccounts.Raw + | ClusterManifest.Raw + | WorkspaceManifest.Raw + | Job.Raw + | Helm.Raw + | Volume.Raw + | Notebook.Raw + | RStudio.Raw + | Workflow.Raw + | AsyncService.Raw + | SshServer.Raw + | SparkJob.Raw + | GatewayConfig.Raw + | TeamManifest.Raw + | PolicyManifest.Raw + | RoleManifest.Raw + | AlertConfig.Raw + | VirtualAccountManifest.Raw + | CommonToolsSettings.Raw + | AiFeaturesSettings.Raw + | SecretGroupManifest.Raw + | AgentManifest.Raw + | EnvironmentManifest.Raw + | TracingProjectManifest.Raw + | McpServerManifest.Raw + | RoleBindingManifest.Raw + | AgentIdentityManifest.Raw + | AgentChannelManifest.Raw; } diff --git a/src/serialization/types/TrueFoundryApplyResponse.ts b/src/serialization/types/TrueFoundryApplyResponse.ts index a31f23f1..a57da6dd 100644 --- a/src/serialization/types/TrueFoundryApplyResponse.ts +++ b/src/serialization/types/TrueFoundryApplyResponse.ts @@ -1,21 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { TrueFoundryApplyResponseAction } from "./TrueFoundryApplyResponseAction.js"; +import { TrueFoundryApplyResponseData } from "./TrueFoundryApplyResponseData.js"; import { TrueFoundryApplyResponseExistingManifest } from "./TrueFoundryApplyResponseExistingManifest.js"; -export const TrueFoundryApplyResponse: core.serialization.ObjectSchema = core.serialization.object({ - "existingManifest": TrueFoundryApplyResponseExistingManifest.optional(), - "action": TrueFoundryApplyResponseAction.optional(), - "data": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() - }); +export const TrueFoundryApplyResponse: core.serialization.ObjectSchema< + serializers.TrueFoundryApplyResponse.Raw, + TrueFoundry.TrueFoundryApplyResponse +> = core.serialization.object({ + existingManifest: TrueFoundryApplyResponseExistingManifest.optionalNullable(), + action: TrueFoundryApplyResponseAction.optionalNullable(), + data: TrueFoundryApplyResponseData.optionalNullable(), +}); export declare namespace TrueFoundryApplyResponse { export interface Raw { - existingManifest?: TrueFoundryApplyResponseExistingManifest.Raw | null; - action?: TrueFoundryApplyResponseAction.Raw | null; - data?: Record | null; + existingManifest?: (TrueFoundryApplyResponseExistingManifest.Raw | null | undefined) | null; + action?: (TrueFoundryApplyResponseAction.Raw | null | undefined) | null; + data?: (TrueFoundryApplyResponseData.Raw | null | undefined) | null; } } diff --git a/src/serialization/types/TrueFoundryApplyResponseAction.ts b/src/serialization/types/TrueFoundryApplyResponseAction.ts index 4e1c0437..c2abedc7 100644 --- a/src/serialization/types/TrueFoundryApplyResponseAction.ts +++ b/src/serialization/types/TrueFoundryApplyResponseAction.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TrueFoundryApplyResponseAction: core.serialization.Schema = core.serialization.enum_(["CREATE", "UPDATE"]); +export const TrueFoundryApplyResponseAction: core.serialization.Schema< + serializers.TrueFoundryApplyResponseAction.Raw, + TrueFoundry.TrueFoundryApplyResponseAction +> = core.serialization.enum_(["CREATE", "UPDATE"]); export declare namespace TrueFoundryApplyResponseAction { export type Raw = "CREATE" | "UPDATE"; diff --git a/src/serialization/types/TrueFoundryApplyResponseData.ts b/src/serialization/types/TrueFoundryApplyResponseData.ts new file mode 100644 index 00000000..afa1c556 --- /dev/null +++ b/src/serialization/types/TrueFoundryApplyResponseData.ts @@ -0,0 +1,98 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as TrueFoundry from "../../api/index.js"; +import * as core from "../../core/index.js"; +import * as serializers from "../index.js"; +import { Agent } from "./Agent.js"; +import { AgentChannel } from "./AgentChannel.js"; +import { AgentIdentity } from "./AgentIdentity.js"; +import { AgentSkillVersion } from "./AgentSkillVersion.js"; +import { AlertConfigEntity } from "./AlertConfigEntity.js"; +import { ArtifactVersion } from "./ArtifactVersion.js"; +import { Cluster } from "./Cluster.js"; +import { DataDirectory } from "./DataDirectory.js"; +import { Deployment } from "./Deployment.js"; +import { Environment } from "./Environment.js"; +import { ExternalIdentityProvider } from "./ExternalIdentityProvider.js"; +import { GatewayBudget } from "./GatewayBudget.js"; +import { GatewayConfiguration } from "./GatewayConfiguration.js"; +import { GatewayInstallation } from "./GatewayInstallation.js"; +import { McpServer } from "./McpServer.js"; +import { MlRepo } from "./MlRepo.js"; +import { ModelVersion } from "./ModelVersion.js"; +import { Policy } from "./Policy.js"; +import { PromptVersion } from "./PromptVersion.js"; +import { Role } from "./Role.js"; +import { RoleBinding } from "./RoleBinding.js"; +import { SecretGroup } from "./SecretGroup.js"; +import { Settings } from "./Settings.js"; +import { Team } from "./Team.js"; +import { TracingProject } from "./TracingProject.js"; +import { VirtualAccount } from "./VirtualAccount.js"; +import { Workspace } from "./Workspace.js"; + +export const TrueFoundryApplyResponseData: core.serialization.Schema< + serializers.TrueFoundryApplyResponseData.Raw, + TrueFoundry.TrueFoundryApplyResponseData +> = core.serialization.undiscriminatedUnion([ + core.serialization.lazyObject(() => serializers.ProviderAccount), + Cluster, + Workspace, + MlRepo, + Deployment, + GatewayConfiguration, + Team, + Policy, + Role, + Settings, + AlertConfigEntity, + VirtualAccount, + Agent, + Environment, + TracingProject, + McpServer, + RoleBinding, + SecretGroup, + AgentIdentity, + ExternalIdentityProvider, + GatewayInstallation, + GatewayBudget, + ArtifactVersion, + ModelVersion, + PromptVersion, + AgentSkillVersion, + DataDirectory, + AgentChannel, +]); + +export declare namespace TrueFoundryApplyResponseData { + export type Raw = + | serializers.ProviderAccount.Raw + | Cluster.Raw + | Workspace.Raw + | MlRepo.Raw + | Deployment.Raw + | GatewayConfiguration.Raw + | Team.Raw + | Policy.Raw + | Role.Raw + | Settings.Raw + | AlertConfigEntity.Raw + | VirtualAccount.Raw + | Agent.Raw + | Environment.Raw + | TracingProject.Raw + | McpServer.Raw + | RoleBinding.Raw + | SecretGroup.Raw + | AgentIdentity.Raw + | ExternalIdentityProvider.Raw + | GatewayInstallation.Raw + | GatewayBudget.Raw + | ArtifactVersion.Raw + | ModelVersion.Raw + | PromptVersion.Raw + | AgentSkillVersion.Raw + | DataDirectory.Raw + | AgentChannel.Raw; +} diff --git a/src/serialization/types/TrueFoundryApplyResponseExistingManifest.ts b/src/serialization/types/TrueFoundryApplyResponseExistingManifest.ts index 8b943612..a635547c 100644 --- a/src/serialization/types/TrueFoundryApplyResponseExistingManifest.ts +++ b/src/serialization/types/TrueFoundryApplyResponseExistingManifest.ts @@ -1,8 +1,9 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; +import { AgentChannelManifest } from "./AgentChannelManifest.js"; import { AgentIdentityManifest } from "./AgentIdentityManifest.js"; import { AgentManifest } from "./AgentManifest.js"; import { AiFeaturesSettings } from "./AiFeaturesSettings.js"; @@ -38,8 +39,82 @@ import { Volume } from "./Volume.js"; import { Workflow } from "./Workflow.js"; import { WorkspaceManifest } from "./WorkspaceManifest.js"; -export const TrueFoundryApplyResponseExistingManifest: core.serialization.Schema = core.serialization.undiscriminatedUnion([MlRepoManifest, ArtifactManifest, ModelManifest, ChatPromptManifest, DataDirectoryManifest, Service, ApplicationSet, ProviderAccounts, ClusterManifest, WorkspaceManifest, Job, Helm, Volume, Notebook, RStudio, Workflow, AsyncService, SshServer, SparkJob, GatewayConfig, TeamManifest, PolicyManifest, RoleManifest, AlertConfig, VirtualAccountManifest, CommonToolsSettings, AiFeaturesSettings, SecretGroupManifest, AgentManifest, EnvironmentManifest, TracingProjectManifest, McpServerManifest, RoleBindingManifest, AgentIdentityManifest]); +export const TrueFoundryApplyResponseExistingManifest: core.serialization.Schema< + serializers.TrueFoundryApplyResponseExistingManifest.Raw, + TrueFoundry.TrueFoundryApplyResponseExistingManifest +> = core.serialization.undiscriminatedUnion([ + MlRepoManifest, + ArtifactManifest, + ModelManifest, + ChatPromptManifest, + DataDirectoryManifest, + Service, + ApplicationSet, + ProviderAccounts, + ClusterManifest, + WorkspaceManifest, + Job, + Helm, + Volume, + Notebook, + RStudio, + Workflow, + AsyncService, + SshServer, + SparkJob, + GatewayConfig, + TeamManifest, + PolicyManifest, + RoleManifest, + AlertConfig, + VirtualAccountManifest, + CommonToolsSettings, + AiFeaturesSettings, + SecretGroupManifest, + AgentManifest, + EnvironmentManifest, + TracingProjectManifest, + McpServerManifest, + RoleBindingManifest, + AgentIdentityManifest, + AgentChannelManifest, +]); export declare namespace TrueFoundryApplyResponseExistingManifest { - export type Raw = MlRepoManifest.Raw | ArtifactManifest.Raw | ModelManifest.Raw | ChatPromptManifest.Raw | DataDirectoryManifest.Raw | Service.Raw | ApplicationSet.Raw | ProviderAccounts.Raw | ClusterManifest.Raw | WorkspaceManifest.Raw | Job.Raw | Helm.Raw | Volume.Raw | Notebook.Raw | RStudio.Raw | Workflow.Raw | AsyncService.Raw | SshServer.Raw | SparkJob.Raw | GatewayConfig.Raw | TeamManifest.Raw | PolicyManifest.Raw | RoleManifest.Raw | AlertConfig.Raw | VirtualAccountManifest.Raw | CommonToolsSettings.Raw | AiFeaturesSettings.Raw | SecretGroupManifest.Raw | AgentManifest.Raw | EnvironmentManifest.Raw | TracingProjectManifest.Raw | McpServerManifest.Raw | RoleBindingManifest.Raw | AgentIdentityManifest.Raw; + export type Raw = + | MlRepoManifest.Raw + | ArtifactManifest.Raw + | ModelManifest.Raw + | ChatPromptManifest.Raw + | DataDirectoryManifest.Raw + | Service.Raw + | ApplicationSet.Raw + | ProviderAccounts.Raw + | ClusterManifest.Raw + | WorkspaceManifest.Raw + | Job.Raw + | Helm.Raw + | Volume.Raw + | Notebook.Raw + | RStudio.Raw + | Workflow.Raw + | AsyncService.Raw + | SshServer.Raw + | SparkJob.Raw + | GatewayConfig.Raw + | TeamManifest.Raw + | PolicyManifest.Raw + | RoleManifest.Raw + | AlertConfig.Raw + | VirtualAccountManifest.Raw + | CommonToolsSettings.Raw + | AiFeaturesSettings.Raw + | SecretGroupManifest.Raw + | AgentManifest.Raw + | EnvironmentManifest.Raw + | TracingProjectManifest.Raw + | McpServerManifest.Raw + | RoleBindingManifest.Raw + | AgentIdentityManifest.Raw + | AgentChannelManifest.Raw; } diff --git a/src/serialization/types/TrueFoundryArtifactSource.ts b/src/serialization/types/TrueFoundryArtifactSource.ts index 8e47547e..0f215ee0 100644 --- a/src/serialization/types/TrueFoundryArtifactSource.ts +++ b/src/serialization/types/TrueFoundryArtifactSource.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TrueFoundryArtifactSource: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("truefoundry-artifact"), - "artifactVersionFqn": core.serialization.property("artifact_version_fqn", core.serialization.string()), - "downloadPathEnvVariable": core.serialization.property("download_path_env_variable", core.serialization.string()) - }); +export const TrueFoundryArtifactSource: core.serialization.ObjectSchema< + serializers.TrueFoundryArtifactSource.Raw, + TrueFoundry.TrueFoundryArtifactSource +> = core.serialization.object({ + type: core.serialization.stringLiteral("truefoundry-artifact"), + artifactVersionFqn: core.serialization.property("artifact_version_fqn", core.serialization.string()), + downloadPathEnvVariable: core.serialization.property("download_path_env_variable", core.serialization.string()), +}); export declare namespace TrueFoundryArtifactSource { export interface Raw { diff --git a/src/serialization/types/TrueFoundryDbssm.ts b/src/serialization/types/TrueFoundryDbssm.ts index e5d95813..a63ba7c7 100644 --- a/src/serialization/types/TrueFoundryDbssm.ts +++ b/src/serialization/types/TrueFoundryDbssm.ts @@ -1,14 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TrueFoundryDbssm: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/secret-store/truefoundry/db"), - "name": core.serialization.string(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const TrueFoundryDbssm: core.serialization.ObjectSchema< + serializers.TrueFoundryDbssm.Raw, + TrueFoundry.TrueFoundryDbssm +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/secret-store/truefoundry/db"), + name: core.serialization.string(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace TrueFoundryDbssm { export interface Raw { diff --git a/src/serialization/types/TrueFoundryDeleteRequestManifest.ts b/src/serialization/types/TrueFoundryDeleteRequestManifest.ts index 7d3ea043..21f12281 100644 --- a/src/serialization/types/TrueFoundryDeleteRequestManifest.ts +++ b/src/serialization/types/TrueFoundryDeleteRequestManifest.ts @@ -1,8 +1,9 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; +import { AgentChannelManifest } from "./AgentChannelManifest.js"; import { AgentIdentityManifest } from "./AgentIdentityManifest.js"; import { AgentManifest } from "./AgentManifest.js"; import { AiFeaturesSettings } from "./AiFeaturesSettings.js"; @@ -38,8 +39,82 @@ import { Volume } from "./Volume.js"; import { Workflow } from "./Workflow.js"; import { WorkspaceManifest } from "./WorkspaceManifest.js"; -export const TrueFoundryDeleteRequestManifest: core.serialization.Schema = core.serialization.undiscriminatedUnion([MlRepoManifest, ArtifactManifest, ModelManifest, ChatPromptManifest, DataDirectoryManifest, Service, ApplicationSet, ProviderAccounts, ClusterManifest, WorkspaceManifest, Job, Helm, Volume, Notebook, RStudio, Workflow, AsyncService, SshServer, SparkJob, GatewayConfig, TeamManifest, PolicyManifest, RoleManifest, AlertConfig, VirtualAccountManifest, CommonToolsSettings, AiFeaturesSettings, SecretGroupManifest, AgentManifest, EnvironmentManifest, TracingProjectManifest, McpServerManifest, RoleBindingManifest, AgentIdentityManifest]); +export const TrueFoundryDeleteRequestManifest: core.serialization.Schema< + serializers.TrueFoundryDeleteRequestManifest.Raw, + TrueFoundry.TrueFoundryDeleteRequestManifest +> = core.serialization.undiscriminatedUnion([ + MlRepoManifest, + ArtifactManifest, + ModelManifest, + ChatPromptManifest, + DataDirectoryManifest, + Service, + ApplicationSet, + ProviderAccounts, + ClusterManifest, + WorkspaceManifest, + Job, + Helm, + Volume, + Notebook, + RStudio, + Workflow, + AsyncService, + SshServer, + SparkJob, + GatewayConfig, + TeamManifest, + PolicyManifest, + RoleManifest, + AlertConfig, + VirtualAccountManifest, + CommonToolsSettings, + AiFeaturesSettings, + SecretGroupManifest, + AgentManifest, + EnvironmentManifest, + TracingProjectManifest, + McpServerManifest, + RoleBindingManifest, + AgentIdentityManifest, + AgentChannelManifest, +]); export declare namespace TrueFoundryDeleteRequestManifest { - export type Raw = MlRepoManifest.Raw | ArtifactManifest.Raw | ModelManifest.Raw | ChatPromptManifest.Raw | DataDirectoryManifest.Raw | Service.Raw | ApplicationSet.Raw | ProviderAccounts.Raw | ClusterManifest.Raw | WorkspaceManifest.Raw | Job.Raw | Helm.Raw | Volume.Raw | Notebook.Raw | RStudio.Raw | Workflow.Raw | AsyncService.Raw | SshServer.Raw | SparkJob.Raw | GatewayConfig.Raw | TeamManifest.Raw | PolicyManifest.Raw | RoleManifest.Raw | AlertConfig.Raw | VirtualAccountManifest.Raw | CommonToolsSettings.Raw | AiFeaturesSettings.Raw | SecretGroupManifest.Raw | AgentManifest.Raw | EnvironmentManifest.Raw | TracingProjectManifest.Raw | McpServerManifest.Raw | RoleBindingManifest.Raw | AgentIdentityManifest.Raw; + export type Raw = + | MlRepoManifest.Raw + | ArtifactManifest.Raw + | ModelManifest.Raw + | ChatPromptManifest.Raw + | DataDirectoryManifest.Raw + | Service.Raw + | ApplicationSet.Raw + | ProviderAccounts.Raw + | ClusterManifest.Raw + | WorkspaceManifest.Raw + | Job.Raw + | Helm.Raw + | Volume.Raw + | Notebook.Raw + | RStudio.Raw + | Workflow.Raw + | AsyncService.Raw + | SshServer.Raw + | SparkJob.Raw + | GatewayConfig.Raw + | TeamManifest.Raw + | PolicyManifest.Raw + | RoleManifest.Raw + | AlertConfig.Raw + | VirtualAccountManifest.Raw + | CommonToolsSettings.Raw + | AiFeaturesSettings.Raw + | SecretGroupManifest.Raw + | AgentManifest.Raw + | EnvironmentManifest.Raw + | TracingProjectManifest.Raw + | McpServerManifest.Raw + | RoleBindingManifest.Raw + | AgentIdentityManifest.Raw + | AgentChannelManifest.Raw; } diff --git a/src/serialization/types/TrueFoundryDeleteResponse.ts b/src/serialization/types/TrueFoundryDeleteResponse.ts index 4e597586..6f76c512 100644 --- a/src/serialization/types/TrueFoundryDeleteResponse.ts +++ b/src/serialization/types/TrueFoundryDeleteResponse.ts @@ -1,12 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TrueFoundryDeleteResponse: core.serialization.ObjectSchema = core.serialization.object({}); +export const TrueFoundryDeleteResponse: core.serialization.ObjectSchema< + serializers.TrueFoundryDeleteResponse.Raw, + TrueFoundry.TrueFoundryDeleteResponse +> = core.serialization.object({}); export declare namespace TrueFoundryDeleteResponse { - export interface Raw { - } + export type Raw = {}; } diff --git a/src/serialization/types/TrueFoundryIntegrations.ts b/src/serialization/types/TrueFoundryIntegrations.ts index 83bb0f4f..7653ef1b 100644 --- a/src/serialization/types/TrueFoundryIntegrations.ts +++ b/src/serialization/types/TrueFoundryIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { TrueFoundryDbssm } from "./TrueFoundryDbssm.js"; -export const TrueFoundryIntegrations: core.serialization.ObjectSchema = TrueFoundryDbssm; +export const TrueFoundryIntegrations: core.serialization.ObjectSchema< + serializers.TrueFoundryIntegrations.Raw, + TrueFoundry.TrueFoundryIntegrations +> = TrueFoundryDbssm; export declare namespace TrueFoundryIntegrations { export type Raw = TrueFoundryDbssm.Raw; diff --git a/src/serialization/types/TrueFoundryInteractiveLogin.ts b/src/serialization/types/TrueFoundryInteractiveLogin.ts index 0d44918b..eafc0a01 100644 --- a/src/serialization/types/TrueFoundryInteractiveLogin.ts +++ b/src/serialization/types/TrueFoundryInteractiveLogin.ts @@ -1,13 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TrueFoundryInteractiveLogin: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("truefoundry_oauth"), - "bypassAuthPaths": core.serialization.property("bypass_auth_paths", core.serialization.list(core.serialization.string()).optional()) - }); +export const TrueFoundryInteractiveLogin: core.serialization.ObjectSchema< + serializers.TrueFoundryInteractiveLogin.Raw, + TrueFoundry.TrueFoundryInteractiveLogin +> = core.serialization.object({ + type: core.serialization.stringLiteral("truefoundry_oauth"), + bypassAuthPaths: core.serialization.property( + "bypass_auth_paths", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace TrueFoundryInteractiveLogin { export interface Raw { diff --git a/src/serialization/types/TrueFoundryManagedSource.ts b/src/serialization/types/TrueFoundryManagedSource.ts index d932af71..ac7c2d69 100644 --- a/src/serialization/types/TrueFoundryManagedSource.ts +++ b/src/serialization/types/TrueFoundryManagedSource.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TrueFoundryManagedSource: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("truefoundry"), - "uri": core.serialization.string().optional() - }); +export const TrueFoundryManagedSource: core.serialization.ObjectSchema< + serializers.TrueFoundryManagedSource.Raw, + TrueFoundry.TrueFoundryManagedSource +> = core.serialization.object({ + type: core.serialization.stringLiteral("truefoundry"), + uri: core.serialization.string().optional(), +}); export declare namespace TrueFoundryManagedSource { export interface Raw { diff --git a/src/serialization/types/TrueFoundryProviderAccount.ts b/src/serialization/types/TrueFoundryProviderAccount.ts index e458c786..6db86fce 100644 --- a/src/serialization/types/TrueFoundryProviderAccount.ts +++ b/src/serialization/types/TrueFoundryProviderAccount.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { OwnedBy } from "./OwnedBy.js"; import { TrueFoundryIntegrations } from "./TrueFoundryIntegrations.js"; -export const TrueFoundryProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/truefoundry"), - "name": core.serialization.string(), - "integrations": core.serialization.list(TrueFoundryIntegrations).optional(), - "ownedBy": OwnedBy.optional() - }); +export const TrueFoundryProviderAccount: core.serialization.ObjectSchema< + serializers.TrueFoundryProviderAccount.Raw, + TrueFoundry.TrueFoundryProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/truefoundry"), + name: core.serialization.string(), + integrations: core.serialization.list(TrueFoundryIntegrations).optional(), + ownedBy: OwnedBy.optional(), +}); export declare namespace TrueFoundryProviderAccount { export interface Raw { diff --git a/src/serialization/types/TruefoundryBackedIdentity.ts b/src/serialization/types/TruefoundryBackedIdentity.ts index d14ad61e..d3fa1b20 100644 --- a/src/serialization/types/TruefoundryBackedIdentity.ts +++ b/src/serialization/types/TruefoundryBackedIdentity.ts @@ -1,19 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AgentIdentityAutoRotate } from "./AgentIdentityAutoRotate.js"; import { AgentIdentitySecretStoreConfig } from "./AgentIdentitySecretStoreConfig.js"; import { NotificationTarget } from "./NotificationTarget.js"; -export const TruefoundryBackedIdentity: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("truefoundry-backed"), - "expirationDate": core.serialization.property("expiration_date", core.serialization.string().optional()), - "autoRotate": core.serialization.property("auto_rotate", AgentIdentityAutoRotate.optional()), - "notificationTarget": core.serialization.property("notification_target", NotificationTarget.optional()), - "secretStoreConfig": core.serialization.property("secret_store_config", AgentIdentitySecretStoreConfig.optional()) - }); +export const TruefoundryBackedIdentity: core.serialization.ObjectSchema< + serializers.TruefoundryBackedIdentity.Raw, + TrueFoundry.TruefoundryBackedIdentity +> = core.serialization.object({ + type: core.serialization.stringLiteral("truefoundry-backed"), + expirationDate: core.serialization.property("expiration_date", core.serialization.string().optional()), + autoRotate: core.serialization.property("auto_rotate", AgentIdentityAutoRotate.optional()), + notificationTarget: core.serialization.property("notification_target", NotificationTarget.optional()), + secretStoreConfig: core.serialization.property("secret_store_config", AgentIdentitySecretStoreConfig.optional()), +}); export declare namespace TruefoundryBackedIdentity { export interface Raw { diff --git a/src/serialization/types/TruefoundryFlyteTaskTemplate.ts b/src/serialization/types/TruefoundryFlyteTaskTemplate.ts index f6e780ad..38358ab8 100644 --- a/src/serialization/types/TruefoundryFlyteTaskTemplate.ts +++ b/src/serialization/types/TruefoundryFlyteTaskTemplate.ts @@ -1,15 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { FlyteTaskCustom } from "./FlyteTaskCustom.js"; import { FlyteTaskId } from "./FlyteTaskId.js"; -export const TruefoundryFlyteTaskTemplate: core.serialization.ObjectSchema = core.serialization.object({ - "id": FlyteTaskId, - "custom": FlyteTaskCustom - }); +export const TruefoundryFlyteTaskTemplate: core.serialization.ObjectSchema< + serializers.TruefoundryFlyteTaskTemplate.Raw, + TrueFoundry.TruefoundryFlyteTaskTemplate +> = core.serialization.object({ + id: FlyteTaskId, + custom: FlyteTaskCustom, +}); export declare namespace TruefoundryFlyteTaskTemplate { export interface Raw { diff --git a/src/serialization/types/TtlIntegrations.ts b/src/serialization/types/TtlIntegrations.ts index f47f8ecf..fb309cc6 100644 --- a/src/serialization/types/TtlIntegrations.ts +++ b/src/serialization/types/TtlIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { TtlRegistry } from "./TtlRegistry.js"; -export const TtlIntegrations: core.serialization.ObjectSchema = TtlRegistry; +export const TtlIntegrations: core.serialization.ObjectSchema< + serializers.TtlIntegrations.Raw, + TrueFoundry.TtlIntegrations +> = TtlRegistry; export declare namespace TtlIntegrations { export type Raw = TtlRegistry.Raw; diff --git a/src/serialization/types/TtlProviderAccount.ts b/src/serialization/types/TtlProviderAccount.ts index 98294808..dfc151cf 100644 --- a/src/serialization/types/TtlProviderAccount.ts +++ b/src/serialization/types/TtlProviderAccount.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { OwnedBy } from "./OwnedBy.js"; import { TtlIntegrations } from "./TtlIntegrations.js"; -export const TtlProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/ttl"), - "name": core.serialization.string(), - "integrations": core.serialization.list(TtlIntegrations), - "ownedBy": OwnedBy.optional() - }); +export const TtlProviderAccount: core.serialization.ObjectSchema< + serializers.TtlProviderAccount.Raw, + TrueFoundry.TtlProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/ttl"), + name: core.serialization.string(), + integrations: core.serialization.list(TtlIntegrations), + ownedBy: OwnedBy.optional(), +}); export declare namespace TtlProviderAccount { export interface Raw { diff --git a/src/serialization/types/TtlRegistry.ts b/src/serialization/types/TtlRegistry.ts index 1935568c..434062b7 100644 --- a/src/serialization/types/TtlRegistry.ts +++ b/src/serialization/types/TtlRegistry.ts @@ -1,14 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const TtlRegistry: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/docker-registry/ttl"), - "name": core.serialization.string(), - "registryUrl": core.serialization.property("registry_url", core.serialization.string()), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) +export const TtlRegistry: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("integration/docker-registry/ttl"), + name: core.serialization.string(), + registryUrl: core.serialization.property("registry_url", core.serialization.string()), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace TtlRegistry { diff --git a/src/serialization/types/UpdateRunResponse.ts b/src/serialization/types/UpdateRunResponse.ts index d300522b..f3b57c26 100644 --- a/src/serialization/types/UpdateRunResponse.ts +++ b/src/serialization/types/UpdateRunResponse.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { RunInfo } from "./RunInfo.js"; -export const UpdateRunResponse: core.serialization.ObjectSchema = core.serialization.object({ - "runInfo": core.serialization.property("run_info", RunInfo) - }); +export const UpdateRunResponse: core.serialization.ObjectSchema< + serializers.UpdateRunResponse.Raw, + TrueFoundry.UpdateRunResponse +> = core.serialization.object({ + runInfo: core.serialization.property("run_info", RunInfo), +}); export declare namespace UpdateRunResponse { export interface Raw { diff --git a/src/serialization/types/UpdateSecretInput.ts b/src/serialization/types/UpdateSecretInput.ts index c3963156..f6f40e39 100644 --- a/src/serialization/types/UpdateSecretInput.ts +++ b/src/serialization/types/UpdateSecretInput.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const UpdateSecretInput: core.serialization.ObjectSchema = core.serialization.object({ - "key": core.serialization.string(), - "value": core.serialization.string().optional() - }); +export const UpdateSecretInput: core.serialization.ObjectSchema< + serializers.UpdateSecretInput.Raw, + TrueFoundry.UpdateSecretInput +> = core.serialization.object({ + key: core.serialization.string(), + value: core.serialization.string().optionalNullable(), +}); export declare namespace UpdateSecretInput { export interface Raw { key: string; - value?: string | null; + value?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/UpdateUserRolesResponse.ts b/src/serialization/types/UpdateUserRolesResponse.ts index d5ceeaeb..df6d13eb 100644 --- a/src/serialization/types/UpdateUserRolesResponse.ts +++ b/src/serialization/types/UpdateUserRolesResponse.ts @@ -1,12 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const UpdateUserRolesResponse: core.serialization.ObjectSchema = core.serialization.object({}); +export const UpdateUserRolesResponse: core.serialization.ObjectSchema< + serializers.UpdateUserRolesResponse.Raw, + TrueFoundry.UpdateUserRolesResponse +> = core.serialization.object({}); export declare namespace UpdateUserRolesResponse { - export interface Raw { - } + export type Raw = {}; } diff --git a/src/serialization/types/UpgradeData.ts b/src/serialization/types/UpgradeData.ts index ccec0f28..5e6a9f0c 100644 --- a/src/serialization/types/UpgradeData.ts +++ b/src/serialization/types/UpgradeData.ts @@ -1,26 +1,27 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; import * as serializers from "../index.js"; import { Helm } from "./Helm.js"; -export const UpgradeData: core.serialization.ObjectSchema = core.serialization.object({ - "diff": core.serialization.list(core.serialization.lazyObject(() => serializers.IChange)).optional(), - "currentManifest": Helm.optional(), - "desiredManifest": Helm.optional(), - "upgradePossible": core.serialization.boolean().optional(), - "conflictFields": core.serialization.list(core.serialization.string()).optional(), - "hasConflict": core.serialization.boolean().optional() +export const UpgradeData: core.serialization.ObjectSchema = + core.serialization.object({ + diff: core.serialization.list(core.serialization.lazyObject(() => serializers.IChange)).optionalNullable(), + currentManifest: Helm.optionalNullable(), + desiredManifest: Helm.optionalNullable(), + upgradePossible: core.serialization.boolean().optionalNullable(), + conflictFields: core.serialization.list(core.serialization.string()).optionalNullable(), + hasConflict: core.serialization.boolean().optionalNullable(), }); export declare namespace UpgradeData { export interface Raw { - diff?: serializers.IChange.Raw[] | null; - currentManifest?: Helm.Raw | null; - desiredManifest?: Helm.Raw | null; - upgradePossible?: boolean | null; - conflictFields?: string[] | null; - hasConflict?: boolean | null; + diff?: (serializers.IChange.Raw[] | null | undefined) | null; + currentManifest?: (Helm.Raw | null | undefined) | null; + desiredManifest?: (Helm.Raw | null | undefined) | null; + upgradePossible?: (boolean | null | undefined) | null; + conflictFields?: (string[] | null | undefined) | null; + hasConflict?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/types/UploadSpecSource.ts b/src/serialization/types/UploadSpecSource.ts index f5adaa55..2b6bb583 100644 --- a/src/serialization/types/UploadSpecSource.ts +++ b/src/serialization/types/UploadSpecSource.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const UploadSpecSource: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("upload"), - "url": core.serialization.string() - }); +export const UploadSpecSource: core.serialization.ObjectSchema< + serializers.UploadSpecSource.Raw, + TrueFoundry.UploadSpecSource +> = core.serialization.object({ + type: core.serialization.stringLiteral("upload"), + url: core.serialization.string(), +}); export declare namespace UploadSpecSource { export interface Raw { diff --git a/src/serialization/types/UsageCodeSnippet.ts b/src/serialization/types/UsageCodeSnippet.ts index 505f1ed1..819e291e 100644 --- a/src/serialization/types/UsageCodeSnippet.ts +++ b/src/serialization/types/UsageCodeSnippet.ts @@ -1,23 +1,26 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const UsageCodeSnippet: core.serialization.ObjectSchema = core.serialization.object({ - "displayName": core.serialization.property("display_name", core.serialization.string()), - "language": core.serialization.string(), - "libraries": core.serialization.list(core.serialization.string()).optional(), - "code": core.serialization.string(), - "icon": core.serialization.string().optional() - }); +export const UsageCodeSnippet: core.serialization.ObjectSchema< + serializers.UsageCodeSnippet.Raw, + TrueFoundry.UsageCodeSnippet +> = core.serialization.object({ + displayName: core.serialization.property("display_name", core.serialization.string()), + language: core.serialization.string(), + libraries: core.serialization.list(core.serialization.string()).optionalNullable(), + code: core.serialization.string(), + icon: core.serialization.string().optionalNullable(), +}); export declare namespace UsageCodeSnippet { export interface Raw { display_name: string; language: string; - libraries?: string[] | null; + libraries?: (string[] | null | undefined) | null; code: string; - icon?: string | null; + icon?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/User.ts b/src/serialization/types/User.ts index 08405b31..1adcf7eb 100644 --- a/src/serialization/types/User.ts +++ b/src/serialization/types/User.ts @@ -1,26 +1,26 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AccountInfo } from "./AccountInfo.js"; import { RoleWithResource } from "./RoleWithResource.js"; import { UserMetadata } from "./UserMetadata.js"; export const User: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string(), - "email": core.serialization.string(), - "tenantName": core.serialization.string(), - "metadata": UserMetadata, - "roles": core.serialization.list(core.serialization.string()).optional(), - "rolesWithResource": core.serialization.list(RoleWithResource).optional(), - "accounts": core.serialization.list(AccountInfo).optional(), - "active": core.serialization.boolean(), - "isEditable": core.serialization.boolean(), - "createdAt": core.serialization.date(), - "updatedAt": core.serialization.date(), - "lastAccessedAt": core.serialization.date().optional() - }); + id: core.serialization.string(), + email: core.serialization.string(), + tenantName: core.serialization.string(), + metadata: UserMetadata, + roles: core.serialization.list(core.serialization.string()).optionalNullable(), + rolesWithResource: core.serialization.list(RoleWithResource).optionalNullable(), + accounts: core.serialization.list(AccountInfo).optionalNullable(), + active: core.serialization.boolean(), + isEditable: core.serialization.boolean(), + createdAt: core.serialization.date(), + updatedAt: core.serialization.date(), + lastAccessedAt: core.serialization.date().optionalNullable(), +}); export declare namespace User { export interface Raw { @@ -28,13 +28,13 @@ export declare namespace User { email: string; tenantName: string; metadata: UserMetadata.Raw; - roles?: string[] | null; - rolesWithResource?: RoleWithResource.Raw[] | null; - accounts?: AccountInfo.Raw[] | null; + roles?: (string[] | null | undefined) | null; + rolesWithResource?: (RoleWithResource.Raw[] | null | undefined) | null; + accounts?: (AccountInfo.Raw[] | null | undefined) | null; active: boolean; isEditable: boolean; createdAt: string; updatedAt: string; - lastAccessedAt?: string | null; + lastAccessedAt?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/UserMessage.ts b/src/serialization/types/UserMessage.ts index 728b9b22..12412595 100644 --- a/src/serialization/types/UserMessage.ts +++ b/src/serialization/types/UserMessage.ts @@ -1,14 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { UserMessageContent } from "./UserMessageContent.js"; -export const UserMessage: core.serialization.ObjectSchema = core.serialization.object({ - "role": core.serialization.stringLiteral("user"), - "content": UserMessageContent, - "name": core.serialization.string().optional() +export const UserMessage: core.serialization.ObjectSchema = + core.serialization.object({ + role: core.serialization.stringLiteral("user"), + content: UserMessageContent, + name: core.serialization.string().optional(), }); export declare namespace UserMessage { diff --git a/src/serialization/types/UserMessageContent.ts b/src/serialization/types/UserMessageContent.ts index aefbdc18..b1fb2f07 100644 --- a/src/serialization/types/UserMessageContent.ts +++ b/src/serialization/types/UserMessageContent.ts @@ -1,12 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { BlobStorageReference } from "./BlobStorageReference.js"; import { UserMessageContentOneItem } from "./UserMessageContentOneItem.js"; -export const UserMessageContent: core.serialization.Schema = core.serialization.undiscriminatedUnion([core.serialization.string(), core.serialization.list(UserMessageContentOneItem), BlobStorageReference]); +export const UserMessageContent: core.serialization.Schema< + serializers.UserMessageContent.Raw, + TrueFoundry.UserMessageContent +> = core.serialization.undiscriminatedUnion([ + core.serialization.string(), + core.serialization.list(UserMessageContentOneItem), + BlobStorageReference, +]); export declare namespace UserMessageContent { export type Raw = string | UserMessageContentOneItem.Raw[] | BlobStorageReference.Raw; diff --git a/src/serialization/types/UserMessageContentOneItem.ts b/src/serialization/types/UserMessageContentOneItem.ts index 305d8cb8..031b76df 100644 --- a/src/serialization/types/UserMessageContentOneItem.ts +++ b/src/serialization/types/UserMessageContentOneItem.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ImageContentPart } from "./ImageContentPart.js"; import { TextContentPart } from "./TextContentPart.js"; -export const UserMessageContentOneItem: core.serialization.Schema = core.serialization.undiscriminatedUnion([TextContentPart, ImageContentPart]); +export const UserMessageContentOneItem: core.serialization.Schema< + serializers.UserMessageContentOneItem.Raw, + TrueFoundry.UserMessageContentOneItem +> = core.serialization.undiscriminatedUnion([TextContentPart, ImageContentPart]); export declare namespace UserMessageContentOneItem { export type Raw = TextContentPart.Raw | ImageContentPart.Raw; diff --git a/src/serialization/types/UserMetadata.ts b/src/serialization/types/UserMetadata.ts index 6375a2d3..d1c56bba 100644 --- a/src/serialization/types/UserMetadata.ts +++ b/src/serialization/types/UserMetadata.ts @@ -1,40 +1,47 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { UserMetadataTenantRoleManagedBy } from "./UserMetadataTenantRoleManagedBy.js"; -export const UserMetadata: core.serialization.ObjectSchema = core.serialization.object({ - "sub": core.serialization.string().optional(), - "imageUrl": core.serialization.property("imageURL", core.serialization.string().optional()), - "pictureDownloadPath": core.serialization.string().optional(), - "displayName": core.serialization.string().optional(), - "userObject": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - "inviteAccepted": core.serialization.boolean().optional(), - "registeredInIdp": core.serialization.boolean().optional(), - "preference": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - "groups": core.serialization.list(core.serialization.string()).optional(), - "tenantRoleManagedBy": UserMetadataTenantRoleManagedBy.optional(), - "ssoName": core.serialization.string().optional(), - "scimUserObject": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - "createdByScim": core.serialization.boolean().optional() +export const UserMetadata: core.serialization.ObjectSchema = + core.serialization.object({ + sub: core.serialization.string().optionalNullable(), + imageUrl: core.serialization.property("imageURL", core.serialization.string().optionalNullable()), + pictureDownloadPath: core.serialization.string().optionalNullable(), + displayName: core.serialization.string().optionalNullable(), + userObject: core.serialization + .record(core.serialization.string(), core.serialization.unknown()) + .optionalNullable(), + inviteAccepted: core.serialization.boolean().optionalNullable(), + registeredInIdp: core.serialization.boolean().optionalNullable(), + preference: core.serialization + .record(core.serialization.string(), core.serialization.unknown()) + .optionalNullable(), + groups: core.serialization.list(core.serialization.string()).optionalNullable(), + tenantRoleManagedBy: UserMetadataTenantRoleManagedBy.optionalNullable(), + ssoName: core.serialization.string().optionalNullable(), + scimUserObject: core.serialization + .record(core.serialization.string(), core.serialization.unknown()) + .optionalNullable(), + createdByScim: core.serialization.boolean().optionalNullable(), }); export declare namespace UserMetadata { export interface Raw { - sub?: string | null; - imageURL?: string | null; - pictureDownloadPath?: string | null; - displayName?: string | null; - userObject?: Record | null; - inviteAccepted?: boolean | null; - registeredInIdp?: boolean | null; - preference?: Record | null; - groups?: string[] | null; - tenantRoleManagedBy?: UserMetadataTenantRoleManagedBy.Raw | null; - ssoName?: string | null; - scimUserObject?: Record | null; - createdByScim?: boolean | null; + sub?: (string | null | undefined) | null; + imageURL?: (string | null | undefined) | null; + pictureDownloadPath?: (string | null | undefined) | null; + displayName?: (string | null | undefined) | null; + userObject?: (Record | null | undefined) | null; + inviteAccepted?: (boolean | null | undefined) | null; + registeredInIdp?: (boolean | null | undefined) | null; + preference?: (Record | null | undefined) | null; + groups?: (string[] | null | undefined) | null; + tenantRoleManagedBy?: (UserMetadataTenantRoleManagedBy.Raw | null | undefined) | null; + ssoName?: (string | null | undefined) | null; + scimUserObject?: (Record | null | undefined) | null; + createdByScim?: (boolean | null | undefined) | null; } } diff --git a/src/serialization/types/UserMetadataTenantRoleManagedBy.ts b/src/serialization/types/UserMetadataTenantRoleManagedBy.ts index 77b3fe72..e6110e0d 100644 --- a/src/serialization/types/UserMetadataTenantRoleManagedBy.ts +++ b/src/serialization/types/UserMetadataTenantRoleManagedBy.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const UserMetadataTenantRoleManagedBy: core.serialization.Schema = core.serialization.enum_(["manual", "group", "initial"]); +export const UserMetadataTenantRoleManagedBy: core.serialization.Schema< + serializers.UserMetadataTenantRoleManagedBy.Raw, + TrueFoundry.UserMetadataTenantRoleManagedBy +> = core.serialization.enum_(["manual", "group", "initial"]); export declare namespace UserMetadataTenantRoleManagedBy { export type Raw = "manual" | "group" | "initial"; diff --git a/src/serialization/types/UserResource.ts b/src/serialization/types/UserResource.ts index 33033c4f..561f6e3c 100644 --- a/src/serialization/types/UserResource.ts +++ b/src/serialization/types/UserResource.ts @@ -1,14 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const UserResource: core.serialization.ObjectSchema = core.serialization.object({ - "resourceType": core.serialization.string(), - "resourceId": core.serialization.string(), - "roleId": core.serialization.string(), - "resourceName": core.serialization.string().optional() +export const UserResource: core.serialization.ObjectSchema = + core.serialization.object({ + resourceType: core.serialization.string(), + resourceId: core.serialization.string(), + roleId: core.serialization.string(), + resourceName: core.serialization.string().optionalNullable(), }); export declare namespace UserResource { @@ -16,6 +17,6 @@ export declare namespace UserResource { resourceType: string; resourceId: string; roleId: string; - resourceName?: string | null; + resourceName?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/UserTeamInfo.ts b/src/serialization/types/UserTeamInfo.ts index c519ea14..f79d5ab4 100644 --- a/src/serialization/types/UserTeamInfo.ts +++ b/src/serialization/types/UserTeamInfo.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const UserTeamInfo: core.serialization.ObjectSchema = core.serialization.object({ - "teamName": core.serialization.string(), - "roles": core.serialization.list(core.serialization.string()) +export const UserTeamInfo: core.serialization.ObjectSchema = + core.serialization.object({ + teamName: core.serialization.string(), + roles: core.serialization.list(core.serialization.string()), }); export declare namespace UserTeamInfo { diff --git a/src/serialization/types/Uv.ts b/src/serialization/types/Uv.ts index b3db24fd..857805ce 100644 --- a/src/serialization/types/Uv.ts +++ b/src/serialization/types/Uv.ts @@ -1,14 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; export const Uv: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("uv"), - "uvVersion": core.serialization.property("uv_version", core.serialization.string().optional()), - "syncOptions": core.serialization.property("sync_options", core.serialization.string().optional()) - }); + type: core.serialization.stringLiteral("uv"), + uvVersion: core.serialization.property("uv_version", core.serialization.string().optional()), + syncOptions: core.serialization.property("sync_options", core.serialization.string().optional()), +}); export declare namespace Uv { export interface Raw { diff --git a/src/serialization/types/ValueConstraint.ts b/src/serialization/types/ValueConstraint.ts index 818c9dd2..38a34d52 100644 --- a/src/serialization/types/ValueConstraint.ts +++ b/src/serialization/types/ValueConstraint.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AllowedValuesConstraint } from "./AllowedValuesConstraint.js"; import { RegexConstraint } from "./RegexConstraint.js"; -export const ValueConstraint: core.serialization.Schema = core.serialization.undiscriminatedUnion([RegexConstraint, AllowedValuesConstraint]); +export const ValueConstraint: core.serialization.Schema = + core.serialization.undiscriminatedUnion([RegexConstraint, AllowedValuesConstraint]); export declare namespace ValueConstraint { export type Raw = RegexConstraint.Raw | AllowedValuesConstraint.Raw; diff --git a/src/serialization/types/VcsTokenAuthData.ts b/src/serialization/types/VcsTokenAuthData.ts index 6a065062..99bd4286 100644 --- a/src/serialization/types/VcsTokenAuthData.ts +++ b/src/serialization/types/VcsTokenAuthData.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const VcsTokenAuthData: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("token"), - "token": core.serialization.string() - }); +export const VcsTokenAuthData: core.serialization.ObjectSchema< + serializers.VcsTokenAuthData.Raw, + TrueFoundry.VcsTokenAuthData +> = core.serialization.object({ + type: core.serialization.stringLiteral("token"), + token: core.serialization.string(), +}); export declare namespace VcsTokenAuthData { export interface Raw { diff --git a/src/serialization/types/VcsoAuthAuthData.ts b/src/serialization/types/VcsoAuthAuthData.ts index 1003d6a4..ab22e2e2 100644 --- a/src/serialization/types/VcsoAuthAuthData.ts +++ b/src/serialization/types/VcsoAuthAuthData.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const VcsoAuthAuthData: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("oauth") - }); +export const VcsoAuthAuthData: core.serialization.ObjectSchema< + serializers.VcsoAuthAuthData.Raw, + TrueFoundry.VcsoAuthAuthData +> = core.serialization.object({ + type: core.serialization.stringLiteral("oauth"), +}); export declare namespace VcsoAuthAuthData { export interface Raw { diff --git a/src/serialization/types/VertexKeyFileAuth.ts b/src/serialization/types/VertexKeyFileAuth.ts index 5b9c6103..4214d3d9 100644 --- a/src/serialization/types/VertexKeyFileAuth.ts +++ b/src/serialization/types/VertexKeyFileAuth.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { VertexKeyFileAuthKeyFileContent } from "./VertexKeyFileAuthKeyFileContent.js"; -export const VertexKeyFileAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("key-file"), - "keyFileContent": core.serialization.property("key_file_content", VertexKeyFileAuthKeyFileContent) - }); +export const VertexKeyFileAuth: core.serialization.ObjectSchema< + serializers.VertexKeyFileAuth.Raw, + TrueFoundry.VertexKeyFileAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("key-file"), + keyFileContent: core.serialization.property("key_file_content", VertexKeyFileAuthKeyFileContent), +}); export declare namespace VertexKeyFileAuth { export interface Raw { diff --git a/src/serialization/types/VertexKeyFileAuthKeyFileContent.ts b/src/serialization/types/VertexKeyFileAuthKeyFileContent.ts index b0fc04ad..463b7a9b 100644 --- a/src/serialization/types/VertexKeyFileAuthKeyFileContent.ts +++ b/src/serialization/types/VertexKeyFileAuthKeyFileContent.ts @@ -1,10 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const VertexKeyFileAuthKeyFileContent: core.serialization.Schema = core.serialization.undiscriminatedUnion([core.serialization.string(), core.serialization.record(core.serialization.string(), core.serialization.unknown())]); +export const VertexKeyFileAuthKeyFileContent: core.serialization.Schema< + serializers.VertexKeyFileAuthKeyFileContent.Raw, + TrueFoundry.VertexKeyFileAuthKeyFileContent +> = core.serialization.undiscriminatedUnion([ + core.serialization.string(), + core.serialization.record(core.serialization.string(), core.serialization.unknown()), +]); export declare namespace VertexKeyFileAuthKeyFileContent { export type Raw = string | Record; diff --git a/src/serialization/types/VertexModel.ts b/src/serialization/types/VertexModel.ts index 855f028b..1497a2ab 100644 --- a/src/serialization/types/VertexModel.ts +++ b/src/serialization/types/VertexModel.ts @@ -1,20 +1,24 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; import { VertexRegion } from "./VertexRegion.js"; -export const VertexModel: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/model/vertex"), - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "region": VertexRegion.optional(), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) +export const VertexModel: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("integration/model/vertex"), + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + region: VertexRegion.optional(), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace VertexModel { diff --git a/src/serialization/types/VertexRegion.ts b/src/serialization/types/VertexRegion.ts index 3797d22d..96dbf45e 100644 --- a/src/serialization/types/VertexRegion.ts +++ b/src/serialization/types/VertexRegion.ts @@ -1,11 +1,105 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const VertexRegion: core.serialization.Schema = core.serialization.enum_(["global", "northamerica-northeast1", "northamerica-northeast2", "southamerica-east1", "us-central1", "us-east1", "us-east4", "us-east5", "us-south1", "us-west1", "us-west2", "us-west3", "us-west4", "asia-east1", "asia-east2", "asia-northeast1", "asia-northeast2", "asia-northeast3", "asia-south1", "asia-south2", "asia-southeast1", "asia-southeast2", "australia-southeast1", "australia-southeast2", "europe-central2", "europe-north1", "europe-southwest1", "europe-west1", "europe-west2", "europe-west3", "europe-west4", "europe-west6", "europe-west8", "europe-west9", "me-central1", "me-central2", "me-west1", "eu", "us"]); +export const VertexRegion: core.serialization.Schema = + core.serialization.enum_([ + "global", + "africa-south1", + "asia-east1", + "asia-east2", + "asia-northeast1", + "asia-northeast2", + "asia-northeast3", + "asia-south1", + "asia-south2", + "asia-southeast1", + "asia-southeast2", + "asia-southeast3", + "australia-southeast1", + "australia-southeast2", + "europe-central2", + "europe-north1", + "europe-north2", + "europe-southwest1", + "europe-west1", + "europe-west2", + "europe-west3", + "europe-west4", + "europe-west6", + "europe-west8", + "europe-west9", + "europe-west10", + "europe-west12", + "me-central1", + "me-central2", + "me-west1", + "northamerica-northeast1", + "northamerica-northeast2", + "northamerica-south1", + "southamerica-east1", + "southamerica-west1", + "us-central1", + "us-east1", + "us-east4", + "us-east5", + "us-south1", + "us-west1", + "us-west2", + "us-west3", + "us-west4", + "eu", + "us", + ]); export declare namespace VertexRegion { - export type Raw = "global" | "northamerica-northeast1" | "northamerica-northeast2" | "southamerica-east1" | "us-central1" | "us-east1" | "us-east4" | "us-east5" | "us-south1" | "us-west1" | "us-west2" | "us-west3" | "us-west4" | "asia-east1" | "asia-east2" | "asia-northeast1" | "asia-northeast2" | "asia-northeast3" | "asia-south1" | "asia-south2" | "asia-southeast1" | "asia-southeast2" | "australia-southeast1" | "australia-southeast2" | "europe-central2" | "europe-north1" | "europe-southwest1" | "europe-west1" | "europe-west2" | "europe-west3" | "europe-west4" | "europe-west6" | "europe-west8" | "europe-west9" | "me-central1" | "me-central2" | "me-west1" | "eu" | "us"; + export type Raw = + | "global" + | "africa-south1" + | "asia-east1" + | "asia-east2" + | "asia-northeast1" + | "asia-northeast2" + | "asia-northeast3" + | "asia-south1" + | "asia-south2" + | "asia-southeast1" + | "asia-southeast2" + | "asia-southeast3" + | "australia-southeast1" + | "australia-southeast2" + | "europe-central2" + | "europe-north1" + | "europe-north2" + | "europe-southwest1" + | "europe-west1" + | "europe-west2" + | "europe-west3" + | "europe-west4" + | "europe-west6" + | "europe-west8" + | "europe-west9" + | "europe-west10" + | "europe-west12" + | "me-central1" + | "me-central2" + | "me-west1" + | "northamerica-northeast1" + | "northamerica-northeast2" + | "northamerica-south1" + | "southamerica-east1" + | "southamerica-west1" + | "us-central1" + | "us-east1" + | "us-east4" + | "us-east5" + | "us-south1" + | "us-west1" + | "us-west2" + | "us-west3" + | "us-west4" + | "eu" + | "us"; } diff --git a/src/serialization/types/VertexWifFileAuth.ts b/src/serialization/types/VertexWifFileAuth.ts index a29cb9ea..87dce905 100644 --- a/src/serialization/types/VertexWifFileAuth.ts +++ b/src/serialization/types/VertexWifFileAuth.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { VertexWifFileAuthKeyFileContent } from "./VertexWifFileAuthKeyFileContent.js"; -export const VertexWifFileAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("workload-identity-federation-file"), - "keyFileContent": core.serialization.property("key_file_content", VertexWifFileAuthKeyFileContent) - }); +export const VertexWifFileAuth: core.serialization.ObjectSchema< + serializers.VertexWifFileAuth.Raw, + TrueFoundry.VertexWifFileAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("workload-identity-federation-file"), + keyFileContent: core.serialization.property("key_file_content", VertexWifFileAuthKeyFileContent), +}); export declare namespace VertexWifFileAuth { export interface Raw { diff --git a/src/serialization/types/VertexWifFileAuthKeyFileContent.ts b/src/serialization/types/VertexWifFileAuthKeyFileContent.ts index a3ad19c8..df5ee402 100644 --- a/src/serialization/types/VertexWifFileAuthKeyFileContent.ts +++ b/src/serialization/types/VertexWifFileAuthKeyFileContent.ts @@ -1,10 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const VertexWifFileAuthKeyFileContent: core.serialization.Schema = core.serialization.undiscriminatedUnion([core.serialization.string(), core.serialization.record(core.serialization.string(), core.serialization.unknown())]); +export const VertexWifFileAuthKeyFileContent: core.serialization.Schema< + serializers.VertexWifFileAuthKeyFileContent.Raw, + TrueFoundry.VertexWifFileAuthKeyFileContent +> = core.serialization.undiscriminatedUnion([ + core.serialization.string(), + core.serialization.record(core.serialization.string(), core.serialization.unknown()), +]); export declare namespace VertexWifFileAuthKeyFileContent { export type Raw = string | Record; diff --git a/src/serialization/types/VirtualAccount.ts b/src/serialization/types/VirtualAccount.ts index bdb81848..5052c199 100644 --- a/src/serialization/types/VirtualAccount.ts +++ b/src/serialization/types/VirtualAccount.ts @@ -1,51 +1,54 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Jwt } from "./Jwt.js"; import { RoleWithResource } from "./RoleWithResource.js"; import { Subject } from "./Subject.js"; import { VirtualAccountManifest } from "./VirtualAccountManifest.js"; -export const VirtualAccount: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string(), - "type": core.serialization.string(), - "tenantName": core.serialization.string(), - "manifest": VirtualAccountManifest.optional(), - "jwtId": core.serialization.string().optional(), - "createdBySubject": Subject, - "createdAt": core.serialization.date(), - "updatedAt": core.serialization.date(), - "lastAccessedAt": core.serialization.date().optional(), - "isExpired": core.serialization.boolean().optional(), - "jwts": core.serialization.list(Jwt).optional(), - "accountId": core.serialization.string(), - "metadata": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - "roleIds": core.serialization.list(core.serialization.string()).optional(), - "rolesWithResource": core.serialization.list(RoleWithResource).optional(), - "createdBy": core.serialization.string().optional(), - "nextScheduledRotation": core.serialization.string().optional() - }); +export const VirtualAccount: core.serialization.ObjectSchema< + serializers.VirtualAccount.Raw, + TrueFoundry.VirtualAccount +> = core.serialization.object({ + id: core.serialization.string(), + type: core.serialization.string(), + tenantName: core.serialization.string(), + manifest: VirtualAccountManifest.optionalNullable(), + jwtId: core.serialization.string().optionalNullable(), + createdBySubject: Subject, + createdAt: core.serialization.date(), + updatedAt: core.serialization.date(), + lastAccessedAt: core.serialization.date().optionalNullable(), + isExpired: core.serialization.boolean().optionalNullable(), + jwts: core.serialization.list(Jwt).optionalNullable(), + accountId: core.serialization.string(), + metadata: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optionalNullable(), + roleIds: core.serialization.list(core.serialization.string()).optionalNullable(), + rolesWithResource: core.serialization.list(RoleWithResource).optionalNullable(), + createdBy: core.serialization.string().optionalNullable(), + nextScheduledRotation: core.serialization.string().optionalNullable(), +}); export declare namespace VirtualAccount { export interface Raw { id: string; type: string; tenantName: string; - manifest?: VirtualAccountManifest.Raw | null; - jwtId?: string | null; + manifest?: (VirtualAccountManifest.Raw | null | undefined) | null; + jwtId?: (string | null | undefined) | null; createdBySubject: Subject.Raw; createdAt: string; updatedAt: string; - lastAccessedAt?: string | null; - isExpired?: boolean | null; - jwts?: Jwt.Raw[] | null; + lastAccessedAt?: (string | null | undefined) | null; + isExpired?: (boolean | null | undefined) | null; + jwts?: (Jwt.Raw[] | null | undefined) | null; accountId: string; - metadata?: Record | null; - roleIds?: string[] | null; - rolesWithResource?: RoleWithResource.Raw[] | null; - createdBy?: string | null; - nextScheduledRotation?: string | null; + metadata?: (Record | null | undefined) | null; + roleIds?: (string[] | null | undefined) | null; + rolesWithResource?: (RoleWithResource.Raw[] | null | undefined) | null; + createdBy?: (string | null | undefined) | null; + nextScheduledRotation?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/VirtualAccountManifest.ts b/src/serialization/types/VirtualAccountManifest.ts index d86389c5..2d78d921 100644 --- a/src/serialization/types/VirtualAccountManifest.ts +++ b/src/serialization/types/VirtualAccountManifest.ts @@ -1,8 +1,8 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AutoRotate } from "./AutoRotate.js"; import { IdentityProviderMapping } from "./IdentityProviderMapping.js"; import { NotificationTarget } from "./NotificationTarget.js"; @@ -11,19 +11,25 @@ import { SecretStoreConfig } from "./SecretStoreConfig.js"; import { VirtualAccountManifestTokenType } from "./VirtualAccountManifestTokenType.js"; import { VirtualAccountOwnedBy } from "./VirtualAccountOwnedBy.js"; -export const VirtualAccountManifest: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "type": core.serialization.stringLiteral("virtual-account"), - "permissions": core.serialization.list(Permissions), - "expirationDate": core.serialization.property("expiration_date", core.serialization.string().optional()), - "autoRotate": core.serialization.property("auto_rotate", AutoRotate.optional()), - "notificationTarget": core.serialization.property("notification_target", NotificationTarget.optional()), - "secretStoreConfig": core.serialization.property("secret_store_config", SecretStoreConfig.optional()), - "ownedBy": VirtualAccountOwnedBy.optional(), - "tags": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - "identityProviderMapping": core.serialization.property("identity_provider_mapping", core.serialization.list(IdentityProviderMapping).optional()), - "tokenType": core.serialization.property("token_type", VirtualAccountManifestTokenType.optional()) - }); +export const VirtualAccountManifest: core.serialization.ObjectSchema< + serializers.VirtualAccountManifest.Raw, + TrueFoundry.VirtualAccountManifest +> = core.serialization.object({ + name: core.serialization.string(), + type: core.serialization.stringLiteral("virtual-account"), + permissions: core.serialization.list(Permissions), + expirationDate: core.serialization.property("expiration_date", core.serialization.string().optional()), + autoRotate: core.serialization.property("auto_rotate", AutoRotate.optional()), + notificationTarget: core.serialization.property("notification_target", NotificationTarget.optional()), + secretStoreConfig: core.serialization.property("secret_store_config", SecretStoreConfig.optional()), + ownedBy: VirtualAccountOwnedBy.optional(), + tags: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + identityProviderMapping: core.serialization.property( + "identity_provider_mapping", + core.serialization.list(IdentityProviderMapping).optional(), + ), + tokenType: core.serialization.property("token_type", VirtualAccountManifestTokenType.optional()), +}); export declare namespace VirtualAccountManifest { export interface Raw { diff --git a/src/serialization/types/VirtualAccountManifestTokenType.ts b/src/serialization/types/VirtualAccountManifestTokenType.ts index 95e18569..c568cfab 100644 --- a/src/serialization/types/VirtualAccountManifestTokenType.ts +++ b/src/serialization/types/VirtualAccountManifestTokenType.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const VirtualAccountManifestTokenType: core.serialization.Schema = core.serialization.enum_(["jwt", "opaque"]); +export const VirtualAccountManifestTokenType: core.serialization.Schema< + serializers.VirtualAccountManifestTokenType.Raw, + TrueFoundry.VirtualAccountManifestTokenType +> = core.serialization.enum_(["jwt", "opaque"]); export declare namespace VirtualAccountManifestTokenType { export type Raw = "jwt" | "opaque"; diff --git a/src/serialization/types/VirtualAccountOwnedBy.ts b/src/serialization/types/VirtualAccountOwnedBy.ts index 110f5b67..e7cf95ec 100644 --- a/src/serialization/types/VirtualAccountOwnedBy.ts +++ b/src/serialization/types/VirtualAccountOwnedBy.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const VirtualAccountOwnedBy: core.serialization.ObjectSchema = core.serialization.object({ - "account": core.serialization.string().optional(), - "team": core.serialization.string() - }); +export const VirtualAccountOwnedBy: core.serialization.ObjectSchema< + serializers.VirtualAccountOwnedBy.Raw, + TrueFoundry.VirtualAccountOwnedBy +> = core.serialization.object({ + account: core.serialization.string().optional(), + team: core.serialization.string(), +}); export declare namespace VirtualAccountOwnedBy { export interface Raw { diff --git a/src/serialization/types/VirtualMcpServerIntegration.ts b/src/serialization/types/VirtualMcpServerIntegration.ts index e0afa0ed..da48b534 100644 --- a/src/serialization/types/VirtualMcpServerIntegration.ts +++ b/src/serialization/types/VirtualMcpServerIntegration.ts @@ -1,17 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { VirtualMcpServerSource } from "./VirtualMcpServerSource.js"; -export const VirtualMcpServerIntegration: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/mcp-server/virtual"), - "name": core.serialization.string(), - "description": core.serialization.string(), - "servers": core.serialization.list(VirtualMcpServerSource), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const VirtualMcpServerIntegration: core.serialization.ObjectSchema< + serializers.VirtualMcpServerIntegration.Raw, + TrueFoundry.VirtualMcpServerIntegration +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/mcp-server/virtual"), + name: core.serialization.string(), + description: core.serialization.string(), + servers: core.serialization.list(VirtualMcpServerSource), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace VirtualMcpServerIntegration { export interface Raw { diff --git a/src/serialization/types/VirtualMcpServerManifest.ts b/src/serialization/types/VirtualMcpServerManifest.ts index 3b7a7317..dfb1975c 100644 --- a/src/serialization/types/VirtualMcpServerManifest.ts +++ b/src/serialization/types/VirtualMcpServerManifest.ts @@ -1,26 +1,31 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { McpServerSource } from "./McpServerSource.js"; import { OwnedBy } from "./OwnedBy.js"; -export const VirtualMcpServerManifest: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("mcp-server/virtual"), - "name": core.serialization.string(), - "description": core.serialization.string(), - "servers": core.serialization.list(McpServerSource), - "collaborators": core.serialization.list(Collaborator), - "ownedBy": OwnedBy.optional(), - "tags": core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional() - }); +export const VirtualMcpServerManifest: core.serialization.ObjectSchema< + serializers.VirtualMcpServerManifest.Raw, + TrueFoundry.VirtualMcpServerManifest +> = core.serialization.object({ + type: core.serialization.stringLiteral("mcp-server/virtual"), + name: core.serialization.string(), + displayName: core.serialization.property("display_name", core.serialization.string().optional()), + description: core.serialization.string(), + servers: core.serialization.list(McpServerSource), + collaborators: core.serialization.list(Collaborator), + ownedBy: OwnedBy.optional(), + tags: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), +}); export declare namespace VirtualMcpServerManifest { export interface Raw { type: "mcp-server/virtual"; name: string; + display_name?: string | null; description: string; servers: McpServerSource.Raw[]; collaborators: Collaborator.Raw[]; diff --git a/src/serialization/types/VirtualMcpServerSource.ts b/src/serialization/types/VirtualMcpServerSource.ts index c6aec526..69479345 100644 --- a/src/serialization/types/VirtualMcpServerSource.ts +++ b/src/serialization/types/VirtualMcpServerSource.ts @@ -1,15 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { McpServerHeaderOverrideAuth } from "./McpServerHeaderOverrideAuth.js"; -export const VirtualMcpServerSource: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "enabledTools": core.serialization.property("enabled_tools", core.serialization.list(core.serialization.string()).optional()), - "authData": core.serialization.property("auth_data", McpServerHeaderOverrideAuth.optional()) - }); +export const VirtualMcpServerSource: core.serialization.ObjectSchema< + serializers.VirtualMcpServerSource.Raw, + TrueFoundry.VirtualMcpServerSource +> = core.serialization.object({ + name: core.serialization.string(), + enabledTools: core.serialization.property( + "enabled_tools", + core.serialization.list(core.serialization.string()).optional(), + ), + authData: core.serialization.property("auth_data", McpServerHeaderOverrideAuth.optional()), +}); export declare namespace VirtualMcpServerSource { export interface Raw { diff --git a/src/serialization/types/VirtualModel.ts b/src/serialization/types/VirtualModel.ts index c5835b88..89e1440e 100644 --- a/src/serialization/types/VirtualModel.ts +++ b/src/serialization/types/VirtualModel.ts @@ -1,17 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { HeaderRoutingConfig } from "./HeaderRoutingConfig.js"; import { VirtualModelModelType } from "./VirtualModelModelType.js"; -export const VirtualModel: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "type": core.serialization.stringLiteral("integration/model/virtual"), - "modelTypes": core.serialization.property("model_types", core.serialization.list(VirtualModelModelType)), - "slug": core.serialization.string().optional(), - "routingConfig": core.serialization.property("routing_config", HeaderRoutingConfig) +export const VirtualModel: core.serialization.ObjectSchema = + core.serialization.object({ + name: core.serialization.string(), + type: core.serialization.stringLiteral("integration/model/virtual"), + modelTypes: core.serialization.property("model_types", core.serialization.list(VirtualModelModelType)), + slug: core.serialization.string().optional(), + routingConfig: core.serialization.property("routing_config", HeaderRoutingConfig), }); export declare namespace VirtualModel { diff --git a/src/serialization/types/VirtualModelModelType.ts b/src/serialization/types/VirtualModelModelType.ts index 9163b997..f972244e 100644 --- a/src/serialization/types/VirtualModelModelType.ts +++ b/src/serialization/types/VirtualModelModelType.ts @@ -1,11 +1,35 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const VirtualModelModelType: core.serialization.Schema = core.serialization.enum_(["chat", "completion", "embedding", "rerank", "moderation", "audio_transcription", "audio_translation", "text_to_speech", "image"]); +export const VirtualModelModelType: core.serialization.Schema< + serializers.VirtualModelModelType.Raw, + TrueFoundry.VirtualModelModelType +> = core.serialization.enum_([ + "chat", + "completion", + "embedding", + "rerank", + "moderation", + "audio_transcription", + "audio_translation", + "text_to_speech", + "image", + "responses", +]); export declare namespace VirtualModelModelType { - export type Raw = "chat" | "completion" | "embedding" | "rerank" | "moderation" | "audio_transcription" | "audio_translation" | "text_to_speech" | "image"; + export type Raw = + | "chat" + | "completion" + | "embedding" + | "rerank" + | "moderation" + | "audio_transcription" + | "audio_translation" + | "text_to_speech" + | "image" + | "responses"; } diff --git a/src/serialization/types/VirtualModelProviderAccount.ts b/src/serialization/types/VirtualModelProviderAccount.ts index 588ed271..bcfac043 100644 --- a/src/serialization/types/VirtualModelProviderAccount.ts +++ b/src/serialization/types/VirtualModelProviderAccount.ts @@ -1,19 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { OwnedBy } from "./OwnedBy.js"; import { VirtualModel } from "./VirtualModel.js"; -export const VirtualModelProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "name": core.serialization.string(), - "type": core.serialization.stringLiteral("provider-account/virtual-model"), - "integrations": core.serialization.list(VirtualModel), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional() - }); +export const VirtualModelProviderAccount: core.serialization.ObjectSchema< + serializers.VirtualModelProviderAccount.Raw, + TrueFoundry.VirtualModelProviderAccount +> = core.serialization.object({ + name: core.serialization.string(), + type: core.serialization.stringLiteral("provider-account/virtual-model"), + integrations: core.serialization.list(VirtualModel), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), +}); export declare namespace VirtualModelProviderAccount { export interface Raw { diff --git a/src/serialization/types/Volume.ts b/src/serialization/types/Volume.ts index 08c9e2cc..652855cc 100644 --- a/src/serialization/types/Volume.ts +++ b/src/serialization/types/Volume.ts @@ -1,17 +1,18 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { VolumeBrowser } from "./VolumeBrowser.js"; import { VolumeConfig } from "./VolumeConfig.js"; -export const Volume: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("volume"), - "name": core.serialization.string(), - "config": VolumeConfig, - "volumeBrowser": core.serialization.property("volume_browser", VolumeBrowser.optional()), - "workspaceFqn": core.serialization.property("workspace_fqn", core.serialization.string().optional()) +export const Volume: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("volume"), + name: core.serialization.string(), + config: VolumeConfig, + volumeBrowser: core.serialization.property("volume_browser", VolumeBrowser.optional()), + workspaceFqn: core.serialization.property("workspace_fqn", core.serialization.string().optional()), }); export declare namespace Volume { diff --git a/src/serialization/types/VolumeBrowser.ts b/src/serialization/types/VolumeBrowser.ts index 394c70da..c2cfa99a 100644 --- a/src/serialization/types/VolumeBrowser.ts +++ b/src/serialization/types/VolumeBrowser.ts @@ -1,15 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Endpoint } from "./Endpoint.js"; -export const VolumeBrowser: core.serialization.ObjectSchema = core.serialization.object({ - "username": core.serialization.string().optional(), - "passwordSecretFqn": core.serialization.property("password_secret_fqn", core.serialization.string().optional()), - "endpoint": Endpoint, - "serviceAccount": core.serialization.property("service_account", core.serialization.string().optional()) +export const VolumeBrowser: core.serialization.ObjectSchema = + core.serialization.object({ + username: core.serialization.string().optional(), + passwordSecretFqn: core.serialization.property("password_secret_fqn", core.serialization.string().optional()), + endpoint: Endpoint, + serviceAccount: core.serialization.property("service_account", core.serialization.string().optional()), }); export declare namespace VolumeBrowser { diff --git a/src/serialization/types/VolumeConfig.ts b/src/serialization/types/VolumeConfig.ts index b7e8c0d5..112cc384 100644 --- a/src/serialization/types/VolumeConfig.ts +++ b/src/serialization/types/VolumeConfig.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { DynamicVolumeConfig } from "./DynamicVolumeConfig.js"; import { StaticVolumeConfig } from "./StaticVolumeConfig.js"; -export const VolumeConfig: core.serialization.Schema = core.serialization.undiscriminatedUnion([DynamicVolumeConfig, StaticVolumeConfig]); +export const VolumeConfig: core.serialization.Schema = + core.serialization.undiscriminatedUnion([DynamicVolumeConfig, StaticVolumeConfig]); export declare namespace VolumeConfig { export type Raw = DynamicVolumeConfig.Raw | StaticVolumeConfig.Raw; diff --git a/src/serialization/types/VolumeMount.ts b/src/serialization/types/VolumeMount.ts index a6ad7667..c8f05aae 100644 --- a/src/serialization/types/VolumeMount.ts +++ b/src/serialization/types/VolumeMount.ts @@ -1,14 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const VolumeMount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("volume"), - "mountPath": core.serialization.property("mount_path", core.serialization.string()), - "subPath": core.serialization.property("sub_path", core.serialization.string().optional()), - "volumeFqn": core.serialization.property("volume_fqn", core.serialization.string()) +export const VolumeMount: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("volume"), + mountPath: core.serialization.property("mount_path", core.serialization.string()), + subPath: core.serialization.property("sub_path", core.serialization.string().optional()), + volumeFqn: core.serialization.property("volume_fqn", core.serialization.string()), }); export declare namespace VolumeMount { diff --git a/src/serialization/types/WaferApiKeyAuth.ts b/src/serialization/types/WaferApiKeyAuth.ts index 2253c906..4de04cec 100644 --- a/src/serialization/types/WaferApiKeyAuth.ts +++ b/src/serialization/types/WaferApiKeyAuth.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const WaferApiKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) - }); +export const WaferApiKeyAuth: core.serialization.ObjectSchema< + serializers.WaferApiKeyAuth.Raw, + TrueFoundry.WaferApiKeyAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), +}); export declare namespace WaferApiKeyAuth { export interface Raw { diff --git a/src/serialization/types/WaferIntegrations.ts b/src/serialization/types/WaferIntegrations.ts index 37158cc5..4a57059b 100644 --- a/src/serialization/types/WaferIntegrations.ts +++ b/src/serialization/types/WaferIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { WaferModel } from "./WaferModel.js"; -export const WaferIntegrations: core.serialization.ObjectSchema = WaferModel; +export const WaferIntegrations: core.serialization.ObjectSchema< + serializers.WaferIntegrations.Raw, + TrueFoundry.WaferIntegrations +> = WaferModel; export declare namespace WaferIntegrations { export type Raw = WaferModel.Raw; diff --git a/src/serialization/types/WaferModel.ts b/src/serialization/types/WaferModel.ts index 5c7856bc..f743bdbd 100644 --- a/src/serialization/types/WaferModel.ts +++ b/src/serialization/types/WaferModel.ts @@ -1,18 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const WaferModel: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/model/wafer"), - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) +export const WaferModel: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("integration/model/wafer"), + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace WaferModel { diff --git a/src/serialization/types/WaferProviderAccount.ts b/src/serialization/types/WaferProviderAccount.ts index c0edb3dc..b93c767f 100644 --- a/src/serialization/types/WaferProviderAccount.ts +++ b/src/serialization/types/WaferProviderAccount.ts @@ -1,24 +1,27 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { OwnedBy } from "./OwnedBy.js"; import { WaferApiKeyAuth } from "./WaferApiKeyAuth.js"; import { WaferIntegrations } from "./WaferIntegrations.js"; -export const WaferProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/wafer"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", WaferApiKeyAuth), - "baseUrl": core.serialization.property("base_url", core.serialization.string().optional()), - "zeroDataRetention": core.serialization.property("zero_data_retention", core.serialization.boolean().optional()), - "integrations": core.serialization.list(WaferIntegrations).optional(), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const WaferProviderAccount: core.serialization.ObjectSchema< + serializers.WaferProviderAccount.Raw, + TrueFoundry.WaferProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/wafer"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", WaferApiKeyAuth), + baseUrl: core.serialization.property("base_url", core.serialization.string().optional()), + zeroDataRetention: core.serialization.property("zero_data_retention", core.serialization.boolean().optional()), + integrations: core.serialization.list(WaferIntegrations).optional(), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace WaferProviderAccount { export interface Raw { diff --git a/src/serialization/types/WebhookBasicAuth.ts b/src/serialization/types/WebhookBasicAuth.ts index 9af63285..6849a286 100644 --- a/src/serialization/types/WebhookBasicAuth.ts +++ b/src/serialization/types/WebhookBasicAuth.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const WebhookBasicAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("webhook-basic"), - "username": core.serialization.string(), - "password": core.serialization.string() - }); +export const WebhookBasicAuth: core.serialization.ObjectSchema< + serializers.WebhookBasicAuth.Raw, + TrueFoundry.WebhookBasicAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("webhook-basic"), + username: core.serialization.string(), + password: core.serialization.string(), +}); export declare namespace WebhookBasicAuth { export interface Raw { diff --git a/src/serialization/types/WebhookBearerAuth.ts b/src/serialization/types/WebhookBearerAuth.ts index 01e68b2c..522047bc 100644 --- a/src/serialization/types/WebhookBearerAuth.ts +++ b/src/serialization/types/WebhookBearerAuth.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const WebhookBearerAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("webhook-bearer"), - "token": core.serialization.string(), - "prefix": core.serialization.string() - }); +export const WebhookBearerAuth: core.serialization.ObjectSchema< + serializers.WebhookBearerAuth.Raw, + TrueFoundry.WebhookBearerAuth +> = core.serialization.object({ + type: core.serialization.stringLiteral("webhook-bearer"), + token: core.serialization.string(), + prefix: core.serialization.string(), +}); export declare namespace WebhookBearerAuth { export interface Raw { diff --git a/src/serialization/types/WebhookIntegration.ts b/src/serialization/types/WebhookIntegration.ts index 899e4984..a03b86dd 100644 --- a/src/serialization/types/WebhookIntegration.ts +++ b/src/serialization/types/WebhookIntegration.ts @@ -1,17 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { WebhookIntegrationAuthData } from "./WebhookIntegrationAuthData.js"; -export const WebhookIntegration: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/gateway-request-logger/webhook"), - "name": core.serialization.string(), - "webhookUrl": core.serialization.property("webhook_url", core.serialization.string()), - "authData": core.serialization.property("auth_data", WebhookIntegrationAuthData.optional()), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) - }); +export const WebhookIntegration: core.serialization.ObjectSchema< + serializers.WebhookIntegration.Raw, + TrueFoundry.WebhookIntegration +> = core.serialization.object({ + type: core.serialization.stringLiteral("integration/gateway-request-logger/webhook"), + name: core.serialization.string(), + webhookUrl: core.serialization.property("webhook_url", core.serialization.string()), + authData: core.serialization.property("auth_data", WebhookIntegrationAuthData.optional()), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), +}); export declare namespace WebhookIntegration { export interface Raw { diff --git a/src/serialization/types/WebhookIntegrationAuthData.ts b/src/serialization/types/WebhookIntegrationAuthData.ts index 2beb11fd..1921ff97 100644 --- a/src/serialization/types/WebhookIntegrationAuthData.ts +++ b/src/serialization/types/WebhookIntegrationAuthData.ts @@ -1,12 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { WebhookBasicAuth } from "./WebhookBasicAuth.js"; import { WebhookBearerAuth } from "./WebhookBearerAuth.js"; -export const WebhookIntegrationAuthData: core.serialization.Schema = core.serialization.undiscriminatedUnion([WebhookBasicAuth, WebhookBearerAuth]); +export const WebhookIntegrationAuthData: core.serialization.Schema< + serializers.WebhookIntegrationAuthData.Raw, + TrueFoundry.WebhookIntegrationAuthData +> = core.serialization.undiscriminatedUnion([WebhookBasicAuth, WebhookBearerAuth]); export declare namespace WebhookIntegrationAuthData { export type Raw = WebhookBasicAuth.Raw | WebhookBearerAuth.Raw; diff --git a/src/serialization/types/WebhookIntegrations.ts b/src/serialization/types/WebhookIntegrations.ts index 535a2605..fc9c32cb 100644 --- a/src/serialization/types/WebhookIntegrations.ts +++ b/src/serialization/types/WebhookIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { WebhookIntegration } from "./WebhookIntegration.js"; -export const WebhookIntegrations: core.serialization.ObjectSchema = WebhookIntegration; +export const WebhookIntegrations: core.serialization.ObjectSchema< + serializers.WebhookIntegrations.Raw, + TrueFoundry.WebhookIntegrations +> = WebhookIntegration; export declare namespace WebhookIntegrations { export type Raw = WebhookIntegration.Raw; diff --git a/src/serialization/types/WebhookProviderAccount.ts b/src/serialization/types/WebhookProviderAccount.ts index 5801dfe4..b32f9704 100644 --- a/src/serialization/types/WebhookProviderAccount.ts +++ b/src/serialization/types/WebhookProviderAccount.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { OwnedBy } from "./OwnedBy.js"; import { WebhookIntegrations } from "./WebhookIntegrations.js"; -export const WebhookProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/webhook"), - "name": core.serialization.string(), - "integrations": core.serialization.list(WebhookIntegrations), - "ownedBy": OwnedBy.optional() - }); +export const WebhookProviderAccount: core.serialization.ObjectSchema< + serializers.WebhookProviderAccount.Raw, + TrueFoundry.WebhookProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/webhook"), + name: core.serialization.string(), + integrations: core.serialization.list(WebhookIntegrations), + ownedBy: OwnedBy.optional(), +}); export declare namespace WebhookProviderAccount { export interface Raw { diff --git a/src/serialization/types/WeightBasedLoadBalancing.ts b/src/serialization/types/WeightBasedLoadBalancing.ts index 08903802..fefdc8a5 100644 --- a/src/serialization/types/WeightBasedLoadBalancing.ts +++ b/src/serialization/types/WeightBasedLoadBalancing.ts @@ -1,16 +1,19 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { LoadBalanceTarget } from "./LoadBalanceTarget.js"; import { StickyRouting } from "./StickyRouting.js"; -export const WeightBasedLoadBalancing: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("weight-based-routing"), - "loadBalanceTargets": core.serialization.property("load_balance_targets", core.serialization.list(LoadBalanceTarget)), - "stickyRouting": core.serialization.property("sticky_routing", StickyRouting.optional()) - }); +export const WeightBasedLoadBalancing: core.serialization.ObjectSchema< + serializers.WeightBasedLoadBalancing.Raw, + TrueFoundry.WeightBasedLoadBalancing +> = core.serialization.object({ + type: core.serialization.stringLiteral("weight-based-routing"), + loadBalanceTargets: core.serialization.property("load_balance_targets", core.serialization.list(LoadBalanceTarget)), + stickyRouting: core.serialization.property("sticky_routing", StickyRouting.optional()), +}); export declare namespace WeightBasedLoadBalancing { export interface Raw { diff --git a/src/serialization/types/WeightBasedLoadBalancingRule.ts b/src/serialization/types/WeightBasedLoadBalancingRule.ts index 419aaeba..c44ebb62 100644 --- a/src/serialization/types/WeightBasedLoadBalancingRule.ts +++ b/src/serialization/types/WeightBasedLoadBalancingRule.ts @@ -1,15 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { LoadBalancingWhen } from "./LoadBalancingWhen.js"; import { WeightBasedLoadBalancing } from "./WeightBasedLoadBalancing.js"; -export const WeightBasedLoadBalancingRule: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string(), - "when": LoadBalancingWhen - }).extend(WeightBasedLoadBalancing); +export const WeightBasedLoadBalancingRule: core.serialization.ObjectSchema< + serializers.WeightBasedLoadBalancingRule.Raw, + TrueFoundry.WeightBasedLoadBalancingRule +> = core.serialization + .object({ + id: core.serialization.string(), + when: LoadBalancingWhen, + }) + .extend(WeightBasedLoadBalancing); export declare namespace WeightBasedLoadBalancingRule { export interface Raw extends WeightBasedLoadBalancing.Raw { diff --git a/src/serialization/types/WorkbenchImage.ts b/src/serialization/types/WorkbenchImage.ts index f07cd0a0..a10b0163 100644 --- a/src/serialization/types/WorkbenchImage.ts +++ b/src/serialization/types/WorkbenchImage.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const WorkbenchImage: core.serialization.ObjectSchema = core.serialization.object({ - "imageUri": core.serialization.property("image_uri", core.serialization.string()), - "buildScript": core.serialization.property("build_script", core.serialization.string().optional()), - "dockerRegistry": core.serialization.property("docker_registry", core.serialization.string().optional()) - }); +export const WorkbenchImage: core.serialization.ObjectSchema< + serializers.WorkbenchImage.Raw, + TrueFoundry.WorkbenchImage +> = core.serialization.object({ + imageUri: core.serialization.property("image_uri", core.serialization.string()), + buildScript: core.serialization.property("build_script", core.serialization.string().optional()), + dockerRegistry: core.serialization.property("docker_registry", core.serialization.string().optional()), +}); export declare namespace WorkbenchImage { export interface Raw { diff --git a/src/serialization/types/WorkerConfig.ts b/src/serialization/types/WorkerConfig.ts index 724d43bf..a0a02d82 100644 --- a/src/serialization/types/WorkerConfig.ts +++ b/src/serialization/types/WorkerConfig.ts @@ -1,15 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { WorkerConfigInputConfig } from "./WorkerConfigInputConfig.js"; import { WorkerConfigOutputConfig } from "./WorkerConfigOutputConfig.js"; -export const WorkerConfig: core.serialization.ObjectSchema = core.serialization.object({ - "inputConfig": core.serialization.property("input_config", WorkerConfigInputConfig), - "outputConfig": core.serialization.property("output_config", WorkerConfigOutputConfig.optional()), - "numConcurrentWorkers": core.serialization.property("num_concurrent_workers", core.serialization.number()) +export const WorkerConfig: core.serialization.ObjectSchema = + core.serialization.object({ + inputConfig: core.serialization.property("input_config", WorkerConfigInputConfig), + outputConfig: core.serialization.property("output_config", WorkerConfigOutputConfig.optional()), + numConcurrentWorkers: core.serialization.property("num_concurrent_workers", core.serialization.number()), }); export declare namespace WorkerConfig { diff --git a/src/serialization/types/WorkerConfigInputConfig.ts b/src/serialization/types/WorkerConfigInputConfig.ts index 2dcc70dd..77a420cc 100644 --- a/src/serialization/types/WorkerConfigInputConfig.ts +++ b/src/serialization/types/WorkerConfigInputConfig.ts @@ -1,14 +1,17 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AmqpInputConfig } from "./AmqpInputConfig.js"; import { KafkaInputConfig } from "./KafkaInputConfig.js"; import { NatsInputConfig } from "./NatsInputConfig.js"; import { SqsInputConfig } from "./SqsInputConfig.js"; -export const WorkerConfigInputConfig: core.serialization.Schema = core.serialization.undiscriminatedUnion([SqsInputConfig, NatsInputConfig, KafkaInputConfig, AmqpInputConfig]); +export const WorkerConfigInputConfig: core.serialization.Schema< + serializers.WorkerConfigInputConfig.Raw, + TrueFoundry.WorkerConfigInputConfig +> = core.serialization.undiscriminatedUnion([SqsInputConfig, NatsInputConfig, KafkaInputConfig, AmqpInputConfig]); export declare namespace WorkerConfigInputConfig { export type Raw = SqsInputConfig.Raw | NatsInputConfig.Raw | KafkaInputConfig.Raw | AmqpInputConfig.Raw; diff --git a/src/serialization/types/WorkerConfigOutputConfig.ts b/src/serialization/types/WorkerConfigOutputConfig.ts index ae5faa08..9248f95b 100644 --- a/src/serialization/types/WorkerConfigOutputConfig.ts +++ b/src/serialization/types/WorkerConfigOutputConfig.ts @@ -1,16 +1,30 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { AmqpOutputConfig } from "./AmqpOutputConfig.js"; import { CoreNatsOutputConfig } from "./CoreNatsOutputConfig.js"; import { KafkaOutputConfig } from "./KafkaOutputConfig.js"; import { NatsOutputConfig } from "./NatsOutputConfig.js"; import { SqsOutputConfig } from "./SqsOutputConfig.js"; -export const WorkerConfigOutputConfig: core.serialization.Schema = core.serialization.undiscriminatedUnion([SqsOutputConfig, NatsOutputConfig, CoreNatsOutputConfig, KafkaOutputConfig, AmqpOutputConfig]); +export const WorkerConfigOutputConfig: core.serialization.Schema< + serializers.WorkerConfigOutputConfig.Raw, + TrueFoundry.WorkerConfigOutputConfig +> = core.serialization.undiscriminatedUnion([ + SqsOutputConfig, + NatsOutputConfig, + CoreNatsOutputConfig, + KafkaOutputConfig, + AmqpOutputConfig, +]); export declare namespace WorkerConfigOutputConfig { - export type Raw = SqsOutputConfig.Raw | NatsOutputConfig.Raw | CoreNatsOutputConfig.Raw | KafkaOutputConfig.Raw | AmqpOutputConfig.Raw; + export type Raw = + | SqsOutputConfig.Raw + | NatsOutputConfig.Raw + | CoreNatsOutputConfig.Raw + | KafkaOutputConfig.Raw + | AmqpOutputConfig.Raw; } diff --git a/src/serialization/types/Workflow.ts b/src/serialization/types/Workflow.ts index bf6c9ecc..08e48a84 100644 --- a/src/serialization/types/Workflow.ts +++ b/src/serialization/types/Workflow.ts @@ -1,19 +1,23 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { WorkflowAlert } from "./WorkflowAlert.js"; import { WorkflowFlyteEntitiesItem } from "./WorkflowFlyteEntitiesItem.js"; import { WorkflowSource } from "./WorkflowSource.js"; -export const Workflow: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("workflow"), - "name": core.serialization.string(), - "source": WorkflowSource, - "workflowFilePath": core.serialization.property("workflow_file_path", core.serialization.string()), - "flyteEntities": core.serialization.property("flyte_entities", core.serialization.list(WorkflowFlyteEntitiesItem).optional()), - "alerts": core.serialization.list(WorkflowAlert).optional() +export const Workflow: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("workflow"), + name: core.serialization.string(), + source: WorkflowSource, + workflowFilePath: core.serialization.property("workflow_file_path", core.serialization.string()), + flyteEntities: core.serialization.property( + "flyte_entities", + core.serialization.list(WorkflowFlyteEntitiesItem).optional(), + ), + alerts: core.serialization.list(WorkflowAlert).optional(), }); export declare namespace Workflow { diff --git a/src/serialization/types/WorkflowAlert.ts b/src/serialization/types/WorkflowAlert.ts index 351a939d..f4849031 100644 --- a/src/serialization/types/WorkflowAlert.ts +++ b/src/serialization/types/WorkflowAlert.ts @@ -1,14 +1,15 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { NotificationTarget } from "./NotificationTarget.js"; -export const WorkflowAlert: core.serialization.ObjectSchema = core.serialization.object({ - "notificationTarget": core.serialization.property("notification_target", NotificationTarget.optional()), - "onCompletion": core.serialization.property("on_completion", core.serialization.boolean().optional()), - "onFailure": core.serialization.property("on_failure", core.serialization.boolean().optional()) +export const WorkflowAlert: core.serialization.ObjectSchema = + core.serialization.object({ + notificationTarget: core.serialization.property("notification_target", NotificationTarget.optional()), + onCompletion: core.serialization.property("on_completion", core.serialization.boolean().optional()), + onFailure: core.serialization.property("on_failure", core.serialization.boolean().optional()), }); export declare namespace WorkflowAlert { diff --git a/src/serialization/types/WorkflowFlyteEntitiesItem.ts b/src/serialization/types/WorkflowFlyteEntitiesItem.ts index dc3b4629..9ac6d4ee 100644 --- a/src/serialization/types/WorkflowFlyteEntitiesItem.ts +++ b/src/serialization/types/WorkflowFlyteEntitiesItem.ts @@ -1,13 +1,16 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { FlyteLaunchPlan } from "./FlyteLaunchPlan.js"; import { FlyteTask } from "./FlyteTask.js"; import { FlyteWorkflow } from "./FlyteWorkflow.js"; -export const WorkflowFlyteEntitiesItem: core.serialization.Schema = core.serialization.undiscriminatedUnion([FlyteTask, FlyteWorkflow, FlyteLaunchPlan]); +export const WorkflowFlyteEntitiesItem: core.serialization.Schema< + serializers.WorkflowFlyteEntitiesItem.Raw, + TrueFoundry.WorkflowFlyteEntitiesItem +> = core.serialization.undiscriminatedUnion([FlyteTask, FlyteWorkflow, FlyteLaunchPlan]); export declare namespace WorkflowFlyteEntitiesItem { export type Raw = FlyteTask.Raw | FlyteWorkflow.Raw | FlyteLaunchPlan.Raw; diff --git a/src/serialization/types/WorkflowSource.ts b/src/serialization/types/WorkflowSource.ts index 99c26684..1c45caa6 100644 --- a/src/serialization/types/WorkflowSource.ts +++ b/src/serialization/types/WorkflowSource.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { LocalSource } from "./LocalSource.js"; import { RemoteSource } from "./RemoteSource.js"; -export const WorkflowSource: core.serialization.Schema = core.serialization.undiscriminatedUnion([LocalSource, RemoteSource]); +export const WorkflowSource: core.serialization.Schema = + core.serialization.undiscriminatedUnion([LocalSource, RemoteSource]); export declare namespace WorkflowSource { export type Raw = LocalSource.Raw | RemoteSource.Raw; diff --git a/src/serialization/types/Workspace.ts b/src/serialization/types/Workspace.ts index 278c3fd2..f51de48d 100644 --- a/src/serialization/types/Workspace.ts +++ b/src/serialization/types/Workspace.ts @@ -1,24 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Subject } from "./Subject.js"; import { WorkspaceManifest } from "./WorkspaceManifest.js"; -export const Workspace: core.serialization.ObjectSchema = core.serialization.object({ - "id": core.serialization.string(), - "fqn": core.serialization.string(), - "tenantName": core.serialization.string(), - "clusterId": core.serialization.string(), - "createdBySubject": Subject, - "createdAt": core.serialization.date(), - "updatedAt": core.serialization.date(), - "environmentId": core.serialization.string().optional(), - "manifest": WorkspaceManifest, - "accountId": core.serialization.string(), - "isSystemWs": core.serialization.boolean().optional(), - "createdBy": core.serialization.string().optional() +export const Workspace: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string(), + fqn: core.serialization.string(), + tenantName: core.serialization.string(), + clusterId: core.serialization.string(), + createdBySubject: Subject, + createdAt: core.serialization.date(), + updatedAt: core.serialization.date(), + environmentId: core.serialization.string().optionalNullable(), + manifest: WorkspaceManifest, + accountId: core.serialization.string(), + isSystemWs: core.serialization.boolean().optionalNullable(), + createdBy: core.serialization.string().optionalNullable(), }); export declare namespace Workspace { @@ -30,10 +31,10 @@ export declare namespace Workspace { createdBySubject: Subject.Raw; createdAt: string; updatedAt: string; - environmentId?: string | null; + environmentId?: (string | null | undefined) | null; manifest: WorkspaceManifest.Raw; accountId: string; - isSystemWs?: boolean | null; - createdBy?: string | null; + isSystemWs?: (boolean | null | undefined) | null; + createdBy?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/WorkspaceManifest.ts b/src/serialization/types/WorkspaceManifest.ts index eec70df5..e0e9ef00 100644 --- a/src/serialization/types/WorkspaceManifest.ts +++ b/src/serialization/types/WorkspaceManifest.ts @@ -1,23 +1,26 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { OwnedBy } from "./OwnedBy.js"; import { Permissions } from "./Permissions.js"; -export const WorkspaceManifest: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("workspace"), - "clusterFqn": core.serialization.property("cluster_fqn", core.serialization.string()), - "name": core.serialization.string(), - "environmentName": core.serialization.property("environment_name", core.serialization.string().optional()), - "labels": core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), - "annotations": core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), - "collaborators": core.serialization.list(Collaborator).optional(), - "permissions": core.serialization.list(Permissions).optional(), - "ownedBy": OwnedBy.optional() - }); +export const WorkspaceManifest: core.serialization.ObjectSchema< + serializers.WorkspaceManifest.Raw, + TrueFoundry.WorkspaceManifest +> = core.serialization.object({ + type: core.serialization.stringLiteral("workspace"), + clusterFqn: core.serialization.property("cluster_fqn", core.serialization.string()), + name: core.serialization.string(), + environmentName: core.serialization.property("environment_name", core.serialization.string().optional()), + labels: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), + annotations: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), + collaborators: core.serialization.list(Collaborator).optional(), + permissions: core.serialization.list(Permissions).optional(), + ownedBy: OwnedBy.optional(), +}); export declare namespace WorkspaceManifest { export interface Raw { diff --git a/src/serialization/types/XaiIntegrations.ts b/src/serialization/types/XaiIntegrations.ts index 83e0813d..44e83ff0 100644 --- a/src/serialization/types/XaiIntegrations.ts +++ b/src/serialization/types/XaiIntegrations.ts @@ -1,11 +1,14 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; -import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as TrueFoundry from "../../api/index.js"; +import type * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; import { XaiModel } from "./XaiModel.js"; -export const XaiIntegrations: core.serialization.ObjectSchema = XaiModel; +export const XaiIntegrations: core.serialization.ObjectSchema< + serializers.XaiIntegrations.Raw, + TrueFoundry.XaiIntegrations +> = XaiModel; export declare namespace XaiIntegrations { export type Raw = XaiModel.Raw; diff --git a/src/serialization/types/XaiKeyAuth.ts b/src/serialization/types/XaiKeyAuth.ts index 4ca5232e..0e7f2bc5 100644 --- a/src/serialization/types/XaiKeyAuth.ts +++ b/src/serialization/types/XaiKeyAuth.ts @@ -1,12 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const XaiKeyAuth: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("api-key"), - "apiKey": core.serialization.property("api_key", core.serialization.string()) +export const XaiKeyAuth: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("api-key"), + apiKey: core.serialization.property("api_key", core.serialization.string()), }); export declare namespace XaiKeyAuth { diff --git a/src/serialization/types/XaiModel.ts b/src/serialization/types/XaiModel.ts index 61de8c0a..065b3879 100644 --- a/src/serialization/types/XaiModel.ts +++ b/src/serialization/types/XaiModel.ts @@ -1,18 +1,22 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { ModelCostMetric } from "./ModelCostMetric.js"; import { ModelType } from "./ModelType.js"; -export const XaiModel: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("integration/model/xai"), - "name": core.serialization.string(), - "modelId": core.serialization.property("model_id", core.serialization.string()), - "modelTypes": core.serialization.property("model_types", core.serialization.list(ModelType)), - "cost": ModelCostMetric.optional(), - "authorizedSubjects": core.serialization.property("authorized_subjects", core.serialization.list(core.serialization.string()).optional()) +export const XaiModel: core.serialization.ObjectSchema = + core.serialization.object({ + type: core.serialization.stringLiteral("integration/model/xai"), + name: core.serialization.string(), + modelId: core.serialization.property("model_id", core.serialization.string()), + modelTypes: core.serialization.property("model_types", core.serialization.list(ModelType)), + cost: ModelCostMetric.optional(), + authorizedSubjects: core.serialization.property( + "authorized_subjects", + core.serialization.list(core.serialization.string()).optional(), + ), }); export declare namespace XaiModel { diff --git a/src/serialization/types/XaiProviderAccount.ts b/src/serialization/types/XaiProviderAccount.ts index 01905940..bb4f4fba 100644 --- a/src/serialization/types/XaiProviderAccount.ts +++ b/src/serialization/types/XaiProviderAccount.ts @@ -1,22 +1,25 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { Collaborator } from "./Collaborator.js"; import { OwnedBy } from "./OwnedBy.js"; import { XaiIntegrations } from "./XaiIntegrations.js"; import { XaiKeyAuth } from "./XaiKeyAuth.js"; -export const XaiProviderAccount: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("provider-account/xai"), - "name": core.serialization.string(), - "authData": core.serialization.property("auth_data", XaiKeyAuth), - "integrations": core.serialization.list(XaiIntegrations).optional(), - "collaborators": core.serialization.list(Collaborator).optional(), - "ownedBy": OwnedBy.optional(), - "discountPercent": core.serialization.property("discount_percent", core.serialization.number().optional()) - }); +export const XaiProviderAccount: core.serialization.ObjectSchema< + serializers.XaiProviderAccount.Raw, + TrueFoundry.XaiProviderAccount +> = core.serialization.object({ + type: core.serialization.stringLiteral("provider-account/xai"), + name: core.serialization.string(), + authData: core.serialization.property("auth_data", XaiKeyAuth), + integrations: core.serialization.list(XaiIntegrations).optional(), + collaborators: core.serialization.list(Collaborator).optional(), + ownedBy: OwnedBy.optional(), + discountPercent: core.serialization.property("discount_percent", core.serialization.number().optional()), +}); export declare namespace XaiProviderAccount { export interface Raw { diff --git a/src/serialization/types/XgBoostFramework.ts b/src/serialization/types/XgBoostFramework.ts index dd9ed27e..e2a543bf 100644 --- a/src/serialization/types/XgBoostFramework.ts +++ b/src/serialization/types/XgBoostFramework.ts @@ -1,17 +1,20 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; import { XgBoostModelSchema } from "./XgBoostModelSchema.js"; import { XgBoostSerializationFormat } from "./XgBoostSerializationFormat.js"; -export const XgBoostFramework: core.serialization.ObjectSchema = core.serialization.object({ - "type": core.serialization.stringLiteral("xgboost"), - "serializationFormat": core.serialization.property("serialization_format", XgBoostSerializationFormat.optional()), - "modelFilepath": core.serialization.property("model_filepath", core.serialization.string().optional()), - "modelSchema": core.serialization.property("model_schema", XgBoostModelSchema.optional()) - }); +export const XgBoostFramework: core.serialization.ObjectSchema< + serializers.XgBoostFramework.Raw, + TrueFoundry.XgBoostFramework +> = core.serialization.object({ + type: core.serialization.stringLiteral("xgboost"), + serializationFormat: core.serialization.property("serialization_format", XgBoostSerializationFormat.optional()), + modelFilepath: core.serialization.property("model_filepath", core.serialization.string().optional()), + modelSchema: core.serialization.property("model_schema", XgBoostModelSchema.optional()), +}); export declare namespace XgBoostFramework { export interface Raw { diff --git a/src/serialization/types/XgBoostModelSchema.ts b/src/serialization/types/XgBoostModelSchema.ts index 3a90b4e6..eca62fc2 100644 --- a/src/serialization/types/XgBoostModelSchema.ts +++ b/src/serialization/types/XgBoostModelSchema.ts @@ -1,14 +1,21 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const XgBoostModelSchema: core.serialization.ObjectSchema = core.serialization.object({ - "inferMethodName": core.serialization.property("infer_method_name", core.serialization.stringLiteral("predict")), - "inputs": core.serialization.list(core.serialization.record(core.serialization.string(), core.serialization.unknown())), - "outputs": core.serialization.list(core.serialization.record(core.serialization.string(), core.serialization.unknown())) - }); +export const XgBoostModelSchema: core.serialization.ObjectSchema< + serializers.XgBoostModelSchema.Raw, + TrueFoundry.XgBoostModelSchema +> = core.serialization.object({ + inferMethodName: core.serialization.property("infer_method_name", core.serialization.stringLiteral("predict")), + inputs: core.serialization.list( + core.serialization.record(core.serialization.string(), core.serialization.unknown()), + ), + outputs: core.serialization.list( + core.serialization.record(core.serialization.string(), core.serialization.unknown()), + ), +}); export declare namespace XgBoostModelSchema { export interface Raw { diff --git a/src/serialization/types/XgBoostSerializationFormat.ts b/src/serialization/types/XgBoostSerializationFormat.ts index c5074f4c..7db0b247 100644 --- a/src/serialization/types/XgBoostSerializationFormat.ts +++ b/src/serialization/types/XgBoostSerializationFormat.ts @@ -1,10 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -import * as TrueFoundry from "../../api/index.js"; +import type * as TrueFoundry from "../../api/index.js"; import * as core from "../../core/index.js"; -import * as serializers from "../index.js"; +import type * as serializers from "../index.js"; -export const XgBoostSerializationFormat: core.serialization.Schema = core.serialization.enum_(["cloudpickle", "joblib", "pickle", "json"]); +export const XgBoostSerializationFormat: core.serialization.Schema< + serializers.XgBoostSerializationFormat.Raw, + TrueFoundry.XgBoostSerializationFormat +> = core.serialization.enum_(["cloudpickle", "joblib", "pickle", "json"]); export declare namespace XgBoostSerializationFormat { export type Raw = "cloudpickle" | "joblib" | "pickle" | "json"; diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index 0f496fdc..4835c03e 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -3,12 +3,20 @@ export * from "./A2AFramework.js"; export * from "./Account.js"; export * from "./AccountInfo.js"; export * from "./ActivateUserResponse.js"; +export * from "./AddOnComponentSource.js"; export * from "./AddonComponent.js"; export * from "./AddonComponentName.js"; -export * from "./AddOnComponentSource.js"; export * from "./AddonComponentStatus.js"; export * from "./Agent.js"; +export * from "./AgentChannel.js"; +export * from "./AgentChannelAgent.js"; +export * from "./AgentChannelConfig.js"; +export * from "./AgentChannelManifest.js"; +export * from "./AgentChannelSlackAuth.js"; +export * from "./AgentChannelSlackBotTokenAuth.js"; +export * from "./AgentChannelSlackConfig.js"; export * from "./AgentFramework.js"; +export * from "./AgentIdentity.js"; export * from "./AgentIdentityAutoRotate.js"; export * from "./AgentIdentityConfig.js"; export * from "./AgentIdentityManifest.js"; @@ -36,6 +44,7 @@ export * from "./AktoGuardrailConfigConfig.js"; export * from "./AktoTokenAuth.js"; export * from "./Alert.js"; export * from "./AlertConfig.js"; +export * from "./AlertConfigEntity.js"; export * from "./AlertConfigResource.js"; export * from "./AlertConfigResourceType.js"; export * from "./AlertSeverity.js"; @@ -178,8 +187,13 @@ export * from "./BlobStorageReference.js"; export * from "./BlueGreen.js"; export * from "./BudgetAlert.js"; export * from "./BudgetConfig.js"; +export * from "./BudgetEntityUsage.js"; export * from "./BudgetLimitUnit.js"; export * from "./BudgetRule.js"; +export * from "./BudgetUsageEntry.js"; +export * from "./BudgetUsageEntryMode.js"; +export * from "./BudgetUsageEntryType.js"; +export * from "./BudgetUsageResponse.js"; export * from "./BudgetV2Alert.js"; export * from "./BudgetV2AppliesTo.js"; export * from "./BudgetV2AppliesToAggregate.js"; @@ -204,7 +218,10 @@ export * from "./BuildBuildSource.js"; export * from "./BuildBuildSpec.js"; export * from "./BuildInfo.js"; export * from "./BuildSecret.js"; -export * from "./BuildStatus.js"; +export * from "./CalypsoAiApiKeyAuth.js"; +export * from "./CalypsoAiGuardrailConfig.js"; +export * from "./CalypsoAiGuardrailConfigConfig.js"; +export * from "./CalypsoAiGuardrailConfigOperation.js"; export * from "./Canary.js"; export * from "./CanaryStep.js"; export * from "./CartesiaApiKeyAuth.js"; @@ -224,6 +241,10 @@ export * from "./ChatPromptManifestCacheConfig.js"; export * from "./ChatPromptManifestMcpServersItem.js"; export * from "./ChatPromptManifestResponseFormat.js"; export * from "./ChatPromptManifestRoutingConfig.js"; +export * from "./CiscoAiDefenseGuardrailConfig.js"; +export * from "./CiscoAiDefenseGuardrailConfigConfig.js"; +export * from "./CiscoAiDefenseGuardrailConfigConfigRegion.js"; +export * from "./CiscoAiDefenseKeyAuth.js"; export * from "./ClouderaIntegrations.js"; export * from "./ClouderaModel.js"; export * from "./ClouderaProviderAccount.js"; @@ -246,6 +267,11 @@ export * from "./CohereModel.js"; export * from "./CohereProviderAccount.js"; export * from "./Collaborator.js"; export * from "./CommonToolsSettings.js"; +export * from "./ComplexityBasedLoadBalanceTarget.js"; +export * from "./ComplexityBasedLoadBalanceTargetTier.js"; +export * from "./ComplexityBasedLoadBalancing.js"; +export * from "./ComplexityBasedLoadBalancingClassificationStrategy.js"; +export * from "./ComplexityStickyRouting.js"; export * from "./Config.js"; export * from "./ContainerTaskConfig.js"; export * from "./ContainerTaskConfigImage.js"; @@ -319,6 +345,7 @@ export * from "./DeleteVirtualAccountResponse.js"; export * from "./DeleteWorkspaceResponse.js"; export * from "./Deployment.js"; export * from "./DeploymentBuild.js"; +export * from "./DeploymentBuildStatus.js"; export * from "./DeploymentManifest.js"; export * from "./DeploymentStatus.js"; export * from "./DeploymentStatusValue.js"; @@ -354,6 +381,7 @@ export * from "./EventChartCategory.js"; export * from "./EventInvolvedObject.js"; export * from "./ExactMatchCacheConfig.js"; export * from "./ExternalBlobStorageSource.js"; +export * from "./ExternalIdentityProvider.js"; export * from "./FastAiFramework.js"; export * from "./FiddlerGuardrailConfig.js"; export * from "./FiddlerGuardrailConfigConfig.js"; @@ -374,11 +402,15 @@ export * from "./FlyteWorkflowTemplate.js"; export * from "./ForwardAction.js"; export * from "./Function.js"; export * from "./FunctionSchema.js"; +export * from "./GatewayBudget.js"; +export * from "./GatewayBudgetManifest.js"; export * from "./GatewayConfig.js"; export * from "./GatewayConfiguration.js"; export * from "./GatewayDataAccessConfig.js"; export * from "./GatewayDataCreatedByFilter.js"; +export * from "./GatewayDataCreatedByFilterOperator.js"; export * from "./GatewayDataMetadataFilter.js"; +export * from "./GatewayDataMetadataFilterOperator.js"; export * from "./GatewayDataRoutingConfig.js"; export * from "./GatewayDataRoutingConfigDestination.js"; export * from "./GatewayDataRoutingConfigDestinationCondition.js"; @@ -390,9 +422,8 @@ export * from "./GatewayDataRoutingConfigDestinationMetadataCondition.js"; export * from "./GatewayDataRoutingConfigDestinationStorage.js"; export * from "./GatewayDataRoutingConfigDestinationStorageStorage.js"; export * from "./GatewayDataType.js"; +export * from "./GatewayInstallation.js"; export * from "./GatewayLoggingConfig.js"; -export * from "./GatewayLoggingRule.js"; -export * from "./GatewayLoggingWhen.js"; export * from "./GatewayMetadataConfig.js"; export * from "./GatewayMetadataRule.js"; export * from "./GatewayMetadataWhen.js"; @@ -406,6 +437,7 @@ export * from "./GcpApiKeyAuth.js"; export * from "./GcpGcr.js"; export * from "./GcpGcs.js"; export * from "./GcpGkeIntegration.js"; +export * from "./GcpGkeIntegrationLocation.js"; export * from "./GcpGsm.js"; export * from "./GcpIntegrations.js"; export * from "./GcpKeyFileAuth.js"; @@ -415,6 +447,7 @@ export * from "./GcpRegion.js"; export * from "./GcpTpu.js"; export * from "./GeminiModel.js"; export * from "./GenericSecretStoreIntegration.js"; +export * from "./GetAgentIdentityTokenResponse.js"; export * from "./GetAgentResponse.js"; export * from "./GetAgentSkillResponse.js"; export * from "./GetAgentSkillVersionResponse.js"; @@ -489,9 +522,9 @@ export * from "./GroqModel.js"; export * from "./GroqProviderAccount.js"; export * from "./GuardrailConfigGroup.js"; export * from "./GuardrailConfigIntegrations.js"; +export * from "./GuardrailSettings.js"; export * from "./Guardrails.js"; export * from "./GuardrailsConfig.js"; -export * from "./GuardrailSettings.js"; export * from "./GuardrailsRule.js"; export * from "./GuardrailsWhen.js"; export * from "./H2OFramework.js"; @@ -508,13 +541,15 @@ export * from "./HealthProbe.js"; export * from "./Helm.js"; export * from "./HelmRepo.js"; export * from "./HelmSource.js"; +export * from "./HeuristicClassificationStrategy.js"; +export * from "./HeuristicFallbackStrategy.js"; export * from "./HostedA2AAgent.js"; export * from "./HttpError.js"; export * from "./HttpErrorCode.js"; export * from "./HttpProbe.js"; export * from "./HuggingfaceArtifactSource.js"; export * from "./IChange.js"; -export * from "./IChangeOperation.js"; +export * from "./IChangeType.js"; export * from "./IdentityProviderBackedIdentity.js"; export * from "./IdentityProviderMapping.js"; export * from "./Image.js"; @@ -527,6 +562,7 @@ export * from "./InfraProviderAccount.js"; export * from "./IngressControllerConfig.js"; export * from "./InlineSpecSource.js"; export * from "./InlineSpecSourceOpenapiSpec.js"; +export * from "./InNotIn.js"; export * from "./InNotInOperator.js"; export * from "./InNotInOperatorCondition.js"; export * from "./InputOutputBasedCostMetricValue.js"; @@ -539,17 +575,17 @@ export * from "./InternalListArtifactVersionsResponseDataItem.js"; export * from "./InternalModelVersion.js"; export * from "./InviteUserResponse.js"; export * from "./IsClusterConnectedResponse.js"; +export * from "./JFrogIntegrations.js"; export * from "./JfrogArtifactsRegistry.js"; export * from "./JfrogBasicAuth.js"; -export * from "./JFrogIntegrations.js"; export * from "./JfrogProviderAccount.js"; export * from "./Job.js"; export * from "./JobAlert.js"; export * from "./JobImage.js"; export * from "./JobMountsItem.js"; export * from "./JobRun.js"; -export * from "./JobRunsSortBy.js"; export * from "./JobRunStatus.js"; +export * from "./JobRunsSortBy.js"; export * from "./JobTrigger.js"; export * from "./JobTriggerInput.js"; export * from "./JobTriggerInputCommand.js"; @@ -583,6 +619,7 @@ export * from "./ListApplicationDeploymentsResponse.js"; export * from "./ListApplicationsResponse.js"; export * from "./ListArtifactsResponse.js"; export * from "./ListArtifactVersionsResponse.js"; +export * from "./ListBudgetsResponse.js"; export * from "./ListClusterAddonsResponse.js"; export * from "./ListClustersResponse.js"; export * from "./ListDataDirectoriesResponse.js"; @@ -605,6 +642,8 @@ export * from "./ListTeamsResponse.js"; export * from "./ListUsersResponse.js"; export * from "./ListVirtualAccountResponse.js"; export * from "./ListWorkspacesResponse.js"; +export * from "./LlmClassificationStrategy.js"; +export * from "./LlmClassificationStrategyFallbackStrategy.js"; export * from "./LoadBalanceTarget.js"; export * from "./LoadBalancingConfig.js"; export * from "./LoadBalancingRule.js"; @@ -618,12 +657,17 @@ export * from "./LoggingMode.js"; export * from "./LoggingModeAlways.js"; export * from "./LoggingModeHeaderControlled.js"; export * from "./LoggingModeNever.js"; +export * from "./LoggingWhen.js"; export * from "./LogsResponse.js"; export * from "./LogsSearchFilterType.js"; export * from "./LogsSearchOperatorType.js"; export * from "./LogsSortingDirection.js"; export * from "./Manual.js"; +export * from "./McpServer.js"; export * from "./McpServerAuth.js"; +export * from "./McpServerAuthStatusInfo.js"; +export * from "./McpServerAuthStatusInfoMethod.js"; +export * from "./McpServerAuthStatusInfoStatus.js"; export * from "./McpServerEnvAuth.js"; export * from "./McpServerEnvAuthAuthLevel.js"; export * from "./McpServerHeaderAuth.js"; @@ -638,6 +682,8 @@ export * from "./McpServerOAuth2GrantType.js"; export * from "./McpServerOAuth2JwtSource.js"; export * from "./McpServerOAuth2Provider.js"; export * from "./McpServerOAuth2ProviderAuth0Settings.js"; +export * from "./McpServerOAuth2ProviderOktaIdJagSettings.js"; +export * from "./McpServerOAuth2ProviderOktaSettings.js"; export * from "./McpServerPassthrough.js"; export * from "./McpServerProviderAccount.js"; export * from "./McpServerSource.js"; @@ -688,6 +734,10 @@ export * from "./Nodepool.js"; export * from "./NodepoolSelector.js"; export * from "./NodeSelector.js"; export * from "./NodeSelectorCapacityType.js"; +export * from "./NomaSecurityApiKeyAuth.js"; +export * from "./NomaSecurityGuardrailConfig.js"; +export * from "./NomaSecurityGuardrailConfigConfig.js"; +export * from "./NomaSecurityGuardrailConfigOperation.js"; export * from "./NomicIntegrations.js"; export * from "./NomicKeyAuth.js"; export * from "./NomicModel.js"; @@ -715,16 +765,16 @@ export * from "./OpaBearerAuth.js"; export * from "./OpaGuardrailConfig.js"; export * from "./OpaGuardrailConfigConfig.js"; export * from "./OpaHeaderAuth.js"; -export * from "./OpenaiApiKeyAuth.js"; export * from "./OpenAiIntegrations.js"; export * from "./OpenAiModel.js"; export * from "./OpenAiModerationsGuardrailConfig.js"; export * from "./OpenAiModerationsGuardrailConfigConfig.js"; -export * from "./OpenaiProviderAccount.js"; export * from "./OpenApimcpServerManifest.js"; export * from "./OpenApimcpToolSetting.js"; export * from "./OpenApimcpToolSettingMethod.js"; export * from "./OpenApiSpecSource.js"; +export * from "./OpenaiApiKeyAuth.js"; +export * from "./OpenaiProviderAccount.js"; export * from "./OpenRouterApiKeyAuth.js"; export * from "./OpenRouterIntegrations.js"; export * from "./OpenRouterModel.js"; @@ -777,10 +827,13 @@ export * from "./PatronusPiiCriteria.js"; export * from "./PatronusPiiEvaluator.js"; export * from "./PatronusToxicityCriteria.js"; export * from "./PatronusToxicityEvaluator.js"; +export * from "./PeriodUsage.js"; export * from "./PerMillionCharactersCostMetric.js"; export * from "./PerMillionCharactersCostMetricValue.js"; export * from "./PerMinuteOfAudioCostMetric.js"; export * from "./PerMinuteOfAudioCostMetricValue.js"; +export * from "./PermissionSetV2.js"; +export * from "./PermissionSetV2ResourceType.js"; export * from "./Permissions.js"; export * from "./PerplexityAiKeyAuth.js"; export * from "./PerplexityAiModel.js"; @@ -792,6 +845,7 @@ export * from "./PerThousandEmbeddingTokensCostMetric.js"; export * from "./PerThousandTokensCostMetric.js"; export * from "./Pip.js"; export * from "./Poetry.js"; +export * from "./Policy.js"; export * from "./PolicyActions.js"; export * from "./PolicyEntityTypes.js"; export * from "./PolicyFilters.js"; @@ -800,6 +854,7 @@ export * from "./PolicyManifestMode.js"; export * from "./PolicyManifestOperation.js"; export * from "./PolicyMutationOperation.js"; export * from "./PolicyValidationOperation.js"; +export * from "./PolicyVersion.js"; export * from "./Port.js"; export * from "./PortAppProtocol.js"; export * from "./PortAuth.js"; @@ -815,16 +870,21 @@ export * from "./PrometheusAlertRule.js"; export * from "./Prompt.js"; export * from "./PromptSource.js"; export * from "./PromptVersion.js"; +export * from "./ProviderAccount.js"; +export * from "./ProviderAccountProvider.js"; export * from "./ProviderAccounts.js"; +export * from "./ProviderIntegration.js"; +export * from "./ProviderIntegrationType.js"; export * from "./PublicCostMetric.js"; export * from "./PySparkTaskConfig.js"; +export * from "./PySparkTaskConfigImage.js"; +export * from "./PyTorchFramework.js"; export * from "./PythonBuild.js"; export * from "./PythonBuildCommand.js"; export * from "./PythonBuildPythonDependencies.js"; export * from "./PythonTaskConfig.js"; export * from "./PythonTaskConfigImage.js"; export * from "./PythonTaskConfigMountsItem.js"; -export * from "./PyTorchFramework.js"; export * from "./QuayArtifactsRegistry.js"; export * from "./QuayBasicAuth.js"; export * from "./QuayIntegrations.js"; @@ -835,6 +895,7 @@ export * from "./RateLimitRule.js"; export * from "./RateLimitUnit.js"; export * from "./RateLimitWhen.js"; export * from "./Recommendation.js"; +export * from "./Redaction.js"; export * from "./RefusalContentPart.js"; export * from "./RegexConstraint.js"; export * from "./RegexGuardrailConfig.js"; @@ -848,18 +909,20 @@ export * from "./RemoteSpecSource.js"; export * from "./Resources.js"; export * from "./ResourcesDevicesItem.js"; export * from "./ResourcesNode.js"; -export * from "./ResourceType.js"; export * from "./ResponseFormatJsonObject.js"; export * from "./ResponseFormatJsonSchema.js"; export * from "./ResponseFormatJsonSchemaJsonSchema.js"; export * from "./ResponseFormatText.js"; export * from "./RetryConfig.js"; export * from "./RevokeAllPersonalAccessTokenResponse.js"; +export * from "./Role.js"; +export * from "./RoleBinding.js"; export * from "./RoleBindingManifest.js"; export * from "./RoleBindingPermission.js"; export * from "./RoleBindingSubject.js"; export * from "./RoleBindingSubjectType.js"; export * from "./RoleManifest.js"; +export * from "./RoleResourceType.js"; export * from "./RoleWithResource.js"; export * from "./RoleWithResourceResourceType.js"; export * from "./Rolling.js"; @@ -908,10 +971,12 @@ export * from "./Session.js"; export * from "./SessionAccount.js"; export * from "./SessionActor.js"; export * from "./SessionTeam.js"; +export * from "./Settings.js"; export * from "./SignedUrl.js"; export * from "./SklearnFramework.js"; export * from "./SklearnModelSchema.js"; export * from "./SklearnSerializationFormat.js"; +export * from "./SlaCutoff.js"; export * from "./SlackBot.js"; export * from "./SlackBotAuth.js"; export * from "./SlackBotIntegration.js"; @@ -920,7 +985,6 @@ export * from "./SlackProviderAccount.js"; export * from "./SlackWebhook.js"; export * from "./SlackWebhookAuth.js"; export * from "./SlackWebhookIntegration.js"; -export * from "./SlaCutoff.js"; export * from "./SmallestAiApiKeyAuth.js"; export * from "./SmallestAiModel.js"; export * from "./SmallestAiProviderAccount.js"; @@ -959,6 +1023,7 @@ export * from "./SparkJobPythonEntrypoint.js"; export * from "./SparkJobPythonNotebookEntrypoint.js"; export * from "./SparkJobScalaEntrypoint.js"; export * from "./SparkJobScalaNotebookEntrypoint.js"; +export * from "./SparkJobTrigger.js"; export * from "./SparkJobTriggerInput.js"; export * from "./SqlSanitizerGuardrailConfig.js"; export * from "./SqlSanitizerGuardrailConfigConfig.js"; @@ -970,6 +1035,8 @@ export * from "./SqsQueueMetricConfigAuth.js"; export * from "./SshServer.js"; export * from "./SshServerConfig.js"; export * from "./StageArtifactResponse.js"; +export * from "./StaticFallbackStrategy.js"; +export * from "./StaticFallbackStrategyDefaultTier.js"; export * from "./StaticVolumeConfig.js"; export * from "./StatsModelsFramework.js"; export * from "./StdioMcpServerManifest.js"; @@ -983,6 +1050,7 @@ export * from "./SubjectClause.js"; export * from "./SubjectConditionGroup.js"; export * from "./SubjectConditionGroupOperator.js"; export * from "./SubjectPermission.js"; +export * from "./SubjectSubjectType.js"; export * from "./SubjectType.js"; export * from "./SyncTokenInSecretStoreInfo.js"; export * from "./SyncVirtualAccountTokenResponse.js"; @@ -993,6 +1061,7 @@ export * from "./TargetConditionGroup.js"; export * from "./TaskDockerFileBuild.js"; export * from "./TaskPySparkBuild.js"; export * from "./TaskPythonBuild.js"; +export * from "./TaskSparkImage.js"; export * from "./Team.js"; export * from "./TeamBudgetConfig.js"; export * from "./TeamBudgetConfigMode.js"; @@ -1027,6 +1096,7 @@ export * from "./ToolMessage.js"; export * from "./ToolMessageContent.js"; export * from "./ToolSchema.js"; export * from "./TraceSpan.js"; +export * from "./TracingProject.js"; export * from "./TracingProjectControlPlaneManagedStorage.js"; export * from "./TracingProjectCustomerManagedStorage.js"; export * from "./TracingProjectManifest.js"; @@ -1043,30 +1113,41 @@ export * from "./TrueFoundryAgentConfig.js"; export * from "./TrueFoundryAgentContextManagementConfig.js"; export * from "./TrueFoundryAgentDynamicSubAgentsConfig.js"; export * from "./TrueFoundryAgentGenerativeUiConfig.js"; +export * from "./TrueFoundryAgentGitSourceSkill.js"; export * from "./TrueFoundryAgentLargeToolResponseConfig.js"; export * from "./TrueFoundryAgentManifest.js"; export * from "./TrueFoundryAgentMcpServer.js"; +export * from "./TrueFoundryAgentMcpServerInline.js"; +export * from "./TrueFoundryAgentMcpServerRegistry.js"; export * from "./TrueFoundryAgentModel.js"; export * from "./TrueFoundryAgentModelParams.js"; export * from "./TrueFoundryAgentResponseFormat.js"; +export * from "./TrueFoundryAgentSandboxAuthData.js"; +export * from "./TrueFoundryAgentSandboxAuthInject.js"; +export * from "./TrueFoundryAgentSandboxAuthInjectMatch.js"; +export * from "./TrueFoundryAgentSandboxBasicAuthData.js"; export * from "./TrueFoundryAgentSandboxConfig.js"; +export * from "./TrueFoundryAgentSandboxGitAuthInject.js"; +export * from "./TrueFoundryAgentSandboxNetworkPolicy.js"; export * from "./TrueFoundryAgentSkill.js"; +export * from "./TrueFoundryAgentTrueFoundrySkill.js"; export * from "./TrueFoundryAgentUserMessage.js"; export * from "./TrueFoundryAgentVariable.js"; export * from "./TrueFoundryApplyRequestManifest.js"; export * from "./TrueFoundryApplyResponse.js"; export * from "./TrueFoundryApplyResponseAction.js"; +export * from "./TrueFoundryApplyResponseData.js"; export * from "./TrueFoundryApplyResponseExistingManifest.js"; export * from "./TrueFoundryArtifactSource.js"; -export * from "./TruefoundryBackedIdentity.js"; export * from "./TrueFoundryDbssm.js"; export * from "./TrueFoundryDeleteRequestManifest.js"; export * from "./TrueFoundryDeleteResponse.js"; -export * from "./TruefoundryFlyteTaskTemplate.js"; export * from "./TrueFoundryIntegrations.js"; export * from "./TrueFoundryInteractiveLogin.js"; export * from "./TrueFoundryManagedSource.js"; export * from "./TrueFoundryProviderAccount.js"; +export * from "./TruefoundryBackedIdentity.js"; +export * from "./TruefoundryFlyteTaskTemplate.js"; export * from "./TtlIntegrations.js"; export * from "./TtlProviderAccount.js"; export * from "./TtlRegistry.js"; diff --git a/tests/custom.test.ts b/tests/custom.test.ts index 69270923..7f5e031c 100644 --- a/tests/custom.test.ts +++ b/tests/custom.test.ts @@ -1,14 +1,13 @@ - /** -* This is a custom test file, if you wish to add more tests -* to your SDK. -* Be sure to mark this file in `.fernignore`. -* -* If you include example requests/responses in your fern definition, -* you will have tests automatically generated for you. -*/ + * This is a custom test file, if you wish to add more tests + * to your SDK. + * Be sure to mark this file in `.fernignore`. + * + * If you include example requests/responses in your fern definition, + * you will have tests automatically generated for you. + */ describe("test", () => { it("default", () => { expect(true).toBe(true); }); -}); \ No newline at end of file +}); diff --git a/tests/setup.ts b/tests/setup.ts index e2a8edf5..a5651f81 100644 --- a/tests/setup.ts +++ b/tests/setup.ts @@ -1,4 +1,3 @@ - import { expect } from "vitest"; interface CustomMatchers { @@ -79,4 +78,3 @@ expect.extend({ } }, }); - diff --git a/tests/tsconfig.json b/tests/tsconfig.json index a5df58a9..ac39744d 100644 --- a/tests/tsconfig.json +++ b/tests/tsconfig.json @@ -3,8 +3,8 @@ "compilerOptions": { "outDir": null, "rootDir": "..", - "types": ["vitest/globals"] + "types": ["vitest/globals"] }, - "include": ["../src","../tests"], + "include": ["../src", "../tests"], "exclude": [] -} \ No newline at end of file +} diff --git a/tests/unit/fetcher/Fetcher.test.ts b/tests/unit/fetcher/Fetcher.test.ts index 4632efa6..6c176242 100644 --- a/tests/unit/fetcher/Fetcher.test.ts +++ b/tests/unit/fetcher/Fetcher.test.ts @@ -76,8 +76,6 @@ describe("Test fetcherImpl", () => { } }); - - it("should receive file as stream", async () => { const url = "https://httpbin.org/post/file"; const mockArgs: Fetcher.Args = { @@ -261,5 +259,4 @@ describe("Test fetcherImpl", () => { expect(body.bodyUsed).toBe(true); } }); - }); diff --git a/tests/unit/fetcher/createRequestUrl.test.ts b/tests/unit/fetcher/createRequestUrl.test.ts index 44ce7e9f..7787e553 100644 --- a/tests/unit/fetcher/createRequestUrl.test.ts +++ b/tests/unit/fetcher/createRequestUrl.test.ts @@ -162,8 +162,6 @@ describe("Test createRequestUrl", () => { }); it("should default to repeat format for arrays", () => { - expect(createRequestUrl(BASE_URL, { items: ["a", "b"] })).toBe( - "https://api.example.com?items=a&items=b" - ); + expect(createRequestUrl(BASE_URL, { items: ["a", "b"] })).toBe("https://api.example.com?items=a&items=b"); }); }); diff --git a/tests/unit/fetcher/getResponseBody.test.ts b/tests/unit/fetcher/getResponseBody.test.ts index 97b525c5..64ed7461 100644 --- a/tests/unit/fetcher/getResponseBody.test.ts +++ b/tests/unit/fetcher/getResponseBody.test.ts @@ -88,7 +88,6 @@ describe("Test getResponseBody", () => { } }); - it("should handle streaming response type", async () => { const encoder = new TextEncoder(); const testData = "test stream data"; @@ -121,5 +120,4 @@ describe("Test getResponseBody", () => { const descriptor = Object.getOwnPropertyDescriptor(result, "__fern_response_ref"); expect(descriptor?.enumerable).toBe(false); }); - }); diff --git a/tests/unit/fetcher/makePassthroughRequest.test.ts b/tests/unit/fetcher/makePassthroughRequest.test.ts index e7c7228e..07cb8467 100644 --- a/tests/unit/fetcher/makePassthroughRequest.test.ts +++ b/tests/unit/fetcher/makePassthroughRequest.test.ts @@ -1,5 +1,5 @@ +import type { Mock } from "vitest"; import { makePassthroughRequest } from "../../../src/core/fetcher/makePassthroughRequest"; -import { Mock } from "vitest"; describe("makePassthroughRequest", () => { let mockFetch: Mock; @@ -89,6 +89,7 @@ describe("makePassthroughRequest", () => { headers: { "X-Custom": "from-init", Authorization: "from-init" }, }, { + baseUrl: "https://api.example.com", headers: { "X-Custom": "from-sdk", "X-SDK-Only": "sdk-value", @@ -108,7 +109,7 @@ describe("makePassthroughRequest", () => { const headers = calledOptions.headers; // requestOptions.headers wins for Authorization (highest priority) - expect(headers["authorization"]).toBe("from-request-options"); + expect(headers.authorization).toBe("from-request-options"); // init.headers wins over SDK defaults for X-Custom expect(headers["x-custom"]).toBe("from-init"); // SDK-only header is preserved @@ -139,11 +140,7 @@ describe("makePassthroughRequest", () => { it("should handle Headers object in init", async () => { const initHeaders = new Headers(); initHeaders.set("X-From-Headers-Object", "value"); - await makePassthroughRequest( - "https://api.example.com", - { headers: initHeaders }, - { fetch: mockFetch }, - ); + await makePassthroughRequest("https://api.example.com", { headers: initHeaders }, { fetch: mockFetch }); const [, calledOptions] = mockFetch.mock.calls[0]; expect(calledOptions.headers["x-from-headers-object"]).toBe("value"); }); @@ -172,11 +169,12 @@ describe("makePassthroughRequest", () => { describe("auth headers", () => { it("should include auth headers when getAuthHeaders is provided", async () => { await makePassthroughRequest("https://api.example.com", undefined, { + baseUrl: "https://api.example.com", getAuthHeaders: async () => ({ Authorization: "Bearer my-token" }), fetch: mockFetch, }); const [, calledOptions] = mockFetch.mock.calls[0]; - expect(calledOptions.headers["authorization"]).toBe("Bearer my-token"); + expect(calledOptions.headers.authorization).toBe("Bearer my-token"); }); it("should work without auth headers", async () => { @@ -184,7 +182,7 @@ describe("makePassthroughRequest", () => { fetch: mockFetch, }); const [, calledOptions] = mockFetch.mock.calls[0]; - expect(calledOptions.headers["authorization"]).toBeUndefined(); + expect(calledOptions.headers.authorization).toBeUndefined(); }); it("should allow init headers to override auth headers", async () => { @@ -192,12 +190,89 @@ describe("makePassthroughRequest", () => { "https://api.example.com", { headers: { Authorization: "Bearer override" } }, { + baseUrl: "https://api.example.com", getAuthHeaders: async () => ({ Authorization: "Bearer sdk-auth" }), fetch: mockFetch, }, ); const [, calledOptions] = mockFetch.mock.calls[0]; - expect(calledOptions.headers["authorization"]).toBe("Bearer override"); + expect(calledOptions.headers.authorization).toBe("Bearer override"); + }); + }); + + describe("auth header origin scoping", () => { + it("should attach auth headers to relative paths resolved against baseUrl", async () => { + await makePassthroughRequest("/v1/users", undefined, { + baseUrl: "https://api.example.com", + getAuthHeaders: async () => ({ Authorization: "Bearer my-token" }), + fetch: mockFetch, + }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers.authorization).toBe("Bearer my-token"); + }); + + it("should attach auth headers to same-origin absolute URLs", async () => { + await makePassthroughRequest("https://api.example.com/v1/users", undefined, { + baseUrl: "https://api.example.com", + getAuthHeaders: async () => ({ Authorization: "Bearer my-token" }), + fetch: mockFetch, + }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers.authorization).toBe("Bearer my-token"); + }); + + it("should attach auth headers when the absolute URL matches the environment origin", async () => { + await makePassthroughRequest("https://env.example.com/v1/users", undefined, { + environment: "https://env.example.com", + getAuthHeaders: async () => ({ Authorization: "Bearer my-token" }), + fetch: mockFetch, + }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers.authorization).toBe("Bearer my-token"); + }); + + it("should NOT attach auth headers to a cross-origin absolute URL", async () => { + await makePassthroughRequest("https://evil.example.com/steal", undefined, { + baseUrl: "https://api.example.com", + getAuthHeaders: async () => ({ Authorization: "Bearer my-token" }), + fetch: mockFetch, + }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers.authorization).toBeUndefined(); + }); + + it("should NOT attach auth headers to a cross-origin URL differing only by port", async () => { + await makePassthroughRequest("https://api.example.com:9999/steal", undefined, { + baseUrl: "https://api.example.com", + getAuthHeaders: async () => ({ Authorization: "Bearer my-token" }), + fetch: mockFetch, + }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers.authorization).toBeUndefined(); + }); + + it("should NOT attach auth headers when no baseUrl or environment is configured", async () => { + await makePassthroughRequest("https://api.example.com/v1/users", undefined, { + getAuthHeaders: async () => ({ Authorization: "Bearer my-token" }), + fetch: mockFetch, + }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers.authorization).toBeUndefined(); + }); + + it("should still allow explicit init headers on cross-origin requests", async () => { + await makePassthroughRequest( + "https://evil.example.com/steal", + { headers: { "X-Custom": "keep-me" } }, + { + baseUrl: "https://api.example.com", + getAuthHeaders: async () => ({ Authorization: "Bearer my-token" }), + fetch: mockFetch, + }, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers.authorization).toBeUndefined(); + expect(calledOptions.headers["x-custom"]).toBe("keep-me"); }); }); @@ -301,19 +376,19 @@ describe("makePassthroughRequest", () => { describe("credentials", () => { it("should pass credentials include when set", async () => { - await makePassthroughRequest( - "https://api.example.com", - { credentials: "include" }, - { fetch: mockFetch }, - ); + await makePassthroughRequest("https://api.example.com", { credentials: "include" }, { fetch: mockFetch }); const [, calledOptions] = mockFetch.mock.calls[0]; expect(calledOptions.credentials).toBe("include"); }); it("should not pass credentials when not set to include", async () => { - await makePassthroughRequest("https://api.example.com", { credentials: "same-origin" }, { - fetch: mockFetch, - }); + await makePassthroughRequest( + "https://api.example.com", + { credentials: "same-origin" }, + { + fetch: mockFetch, + }, + ); const [, calledOptions] = mockFetch.mock.calls[0]; expect(calledOptions.credentials).toBeUndefined(); }); @@ -399,4 +474,31 @@ describe("makePassthroughRequest", () => { expect(calledOptions.headers["x-dynamic"]).toBe("dynamic-value"); }); }); + + describe("debug logging", () => { + it("should redact credentials in the logged request URL", async () => { + const mockLogger = { + debug: vi.fn(), + info: vi.fn(), + warn: vi.fn(), + error: vi.fn(), + }; + await makePassthroughRequest("https://user:password@api.example.com/v1/users?token=secret", undefined, { + fetch: mockFetch, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + const loggedUrls = mockLogger.debug.mock.calls.map(([, meta]) => (meta as { url: string }).url); + expect(loggedUrls.length).toBeGreaterThan(0); + for (const loggedUrl of loggedUrls) { + expect(loggedUrl).toBe("https://[REDACTED]@api.example.com/v1/users?token=[REDACTED]"); + expect(loggedUrl).not.toContain("password"); + expect(loggedUrl).not.toContain("secret"); + } + }); + }); }); diff --git a/tests/unit/fetcher/makeRequest.test.ts b/tests/unit/fetcher/makeRequest.test.ts index fd62395a..bde19455 100644 --- a/tests/unit/fetcher/makeRequest.test.ts +++ b/tests/unit/fetcher/makeRequest.test.ts @@ -1,9 +1,9 @@ +import type { Mock } from "vitest"; import { - makeRequest, isCacheNoStoreSupported, + makeRequest, resetCacheNoStoreSupported, } from "../../../src/core/fetcher/makeRequest"; -import { Mock } from "vitest"; describe("Test makeRequest", () => { const mockPostUrl = "https://httpbin.org/post"; diff --git a/tests/unit/fetcher/requestWithRetries.test.ts b/tests/unit/fetcher/requestWithRetries.test.ts index b8e08b9d..7c98c0ab 100644 --- a/tests/unit/fetcher/requestWithRetries.test.ts +++ b/tests/unit/fetcher/requestWithRetries.test.ts @@ -1,5 +1,5 @@ +import type { Mock, MockInstance } from "vitest"; import { requestWithRetries } from "../../../src/core/fetcher/requestWithRetries"; -import { Mock, MockInstance } from "vitest"; describe("requestWithRetries", () => { let mockFetch: Mock; @@ -13,20 +13,20 @@ describe("requestWithRetries", () => { Math.random = vi.fn(() => 0.5); vi.useFakeTimers({ - toFake: [ - "setTimeout", - "clearTimeout", - "setInterval", - "clearInterval", - "setImmediate", - "clearImmediate", - "Date", - "performance", - "requestAnimationFrame", - "cancelAnimationFrame", - "requestIdleCallback", - "cancelIdleCallback" - ] + toFake: [ + "setTimeout", + "clearTimeout", + "setInterval", + "clearInterval", + "setImmediate", + "clearImmediate", + "Date", + "performance", + "requestAnimationFrame", + "cancelAnimationFrame", + "requestIdleCallback", + "cancelIdleCallback", + ], }); }); diff --git a/tests/unit/url/QueryStringBuilder.test.ts b/tests/unit/url/QueryStringBuilder.test.ts index c26f6026..1afa2d22 100644 --- a/tests/unit/url/QueryStringBuilder.test.ts +++ b/tests/unit/url/QueryStringBuilder.test.ts @@ -97,10 +97,7 @@ describe("QueryStringBuilder", () => { describe("chaining", () => { it("chains multiple add() calls", () => { - const qs = queryBuilder() - .add("limit", 10) - .add("offset", 20) - .build(); + const qs = queryBuilder().add("limit", 10).add("offset", 20).build(); expect(qs).toBe("limit=10&offset=20"); }); @@ -126,16 +123,12 @@ describe("QueryStringBuilder", () => { describe("addMany()", () => { it("adds all params from a record", () => { - const qs = queryBuilder() - .addMany({ limit: 10, offset: 20, name: "test" }) - .build(); + const qs = queryBuilder().addMany({ limit: 10, offset: 20, name: "test" }).build(); expect(qs).toBe("limit=10&offset=20&name=test"); }); it("skips null and undefined values", () => { - const qs = queryBuilder() - .addMany({ a: "1", b: null, c: undefined, d: "4" }) - .build(); + const qs = queryBuilder().addMany({ a: "1", b: null, c: undefined, d: "4" }).build(); expect(qs).toBe("a=1&d=4"); }); @@ -146,10 +139,7 @@ describe("QueryStringBuilder", () => { it("works with comma-style override after addMany", () => { const params = { limit: 10, tags: ["a", "b"], active: true }; - const qs = queryBuilder() - .addMany(params) - .add("tags", params.tags, { style: "comma" }) - .build(); + const qs = queryBuilder().addMany(params).add("tags", params.tags, { style: "comma" }).build(); expect(qs).toBe("limit=10&tags=a,b&active=true"); }); @@ -163,42 +153,27 @@ describe("QueryStringBuilder", () => { describe("mergeAdditional()", () => { it("appends additional params", () => { - const qs = queryBuilder() - .add("limit", 10) - .mergeAdditional({ extra: "value" }) - .build(); + const qs = queryBuilder().add("limit", 10).mergeAdditional({ extra: "value" }).build(); expect(qs).toBe("limit=10&extra=value"); }); it("overrides existing keys (last-write-wins)", () => { - const qs = queryBuilder() - .add("limit", 10) - .mergeAdditional({ limit: 20 }) - .build(); + const qs = queryBuilder().add("limit", 10).mergeAdditional({ limit: 20 }).build(); expect(qs).toBe("limit=20"); }); it("handles undefined additional params", () => { - const qs = queryBuilder() - .add("limit", 10) - .mergeAdditional(undefined) - .build(); + const qs = queryBuilder().add("limit", 10).mergeAdditional(undefined).build(); expect(qs).toBe("limit=10"); }); it("skips undefined values in additional params", () => { - const qs = queryBuilder() - .add("limit", 10) - .mergeAdditional({ extra: undefined }) - .build(); + const qs = queryBuilder().add("limit", 10).mergeAdditional({ extra: undefined }).build(); expect(qs).toBe("limit=10"); }); it("skips null values in additional params", () => { - const qs = queryBuilder() - .add("limit", 10) - .mergeAdditional({ extra: null }) - .build(); + const qs = queryBuilder().add("limit", 10).mergeAdditional({ extra: null }).build(); expect(qs).toBe("limit=10"); }); @@ -245,7 +220,7 @@ describe("QueryStringBuilder", () => { excludeUser: "excludeUser", filter: "filter", tags: ["tags"], - optionalTags: undefined + optionalTags: undefined, }; const qs = queryBuilder() .addMany(params) diff --git a/tests/wire/agentSkillVersions.test.ts b/tests/wire/agentSkillVersions.test.ts index 1fabfbd7..a7a97033 100644 --- a/tests/wire/agentSkillVersions.test.ts +++ b/tests/wire/agentSkillVersions.test.ts @@ -5,186 +5,225 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("AgentSkillVersionsClient", () => { - test("list", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "created_at" : "2024-01-15T09:30:00Z" , "updated_at" : "2024-01-15T09:30:00Z" , "manifest" : { "name" : "name" , "metadata" : { "key" : "value" } , "ml_repo" : "ml_repo" , "type" : "agent-skill" , "source" : { "type" : "inline" , "skill_md" : "skill_md" } } , "id" : "id" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "ml_repo_id" : "ml_repo_id" , "agent_skill_id" : "agent_skill_id" , "usage_code_snippets" : [ { "display_name" : "display_name" , "language" : "language" , "code" : "code" } ] } ] , "pagination" : { "total" : 100 , "offset" : 0 , "limit" : 10 } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + manifest: { + name: "name", + metadata: { key: "value" }, + ml_repo: "ml_repo", + type: "agent-skill", + source: { type: "inline", skill_md: "skill_md" }, + }, + id: "id", + fqn: "fqn", + created_by_subject: { subjectId: "subjectId", subjectType: "user" }, + ml_repo_id: "ml_repo_id", + agent_skill_id: "agent_skill_id", + usage_code_snippets: [{ display_name: "display_name", language: "language", code: "code" }], + }, + ], + pagination: { total: 100, offset: 0, limit: 10 }, + }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/agent-skill-versions").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const expected = { - data: [{ - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - manifest: { - name: "name", - metadata: { - "key": "value" + .mockEndpoint() + .get("/api/svc/v1/agent-skill-versions") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + data: [ + { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + manifest: { + name: "name", + metadata: { + key: "value", + }, + mlRepo: "ml_repo", + type: "agent-skill", + source: { + type: "inline", + skillMd: "skill_md", + }, + }, + id: "id", + fqn: "fqn", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + mlRepoId: "ml_repo_id", + agentSkillId: "agent_skill_id", + usageCodeSnippets: [ + { + displayName: "display_name", + language: "language", + code: "code", + }, + ], }, - mlRepo: "ml_repo", - type: "agent-skill", - source: { - type: "inline", - skillMd: "skill_md" - } - }, - id: "id", - fqn: "fqn", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" + ], + pagination: { + total: 100, + offset: 0, + limit: 10, }, - mlRepoId: "ml_repo_id", - agentSkillId: "agent_skill_id", - usageCodeSnippets: [{ - displayName: "display_name", - language: "language", - code: "code" - }] - }], - pagination: { - total: 100, - offset: 0, - limit: 10 - } -}; - const page = await client.agentSkillVersions.list({ - limit: 10, - offset: 0, - fqn: "fqn", - agentSkillId: "agent_skill_id", - mlRepoId: "ml_repo_id", - name: "name", - version: 1 -}); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - + }; + const page = await client.agentSkillVersions.list({ + limit: 10, + offset: 0, + }); + + expect(expected.data).toEqual(page.data); }); - + test("get (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : { "created_at" : "2024-01-15T09:30:00Z" , "updated_at" : "2024-01-15T09:30:00Z" , "manifest" : { "name" : "name" , "metadata" : { "key" : "value" } , "ml_repo" : "ml_repo" , "version" : 1 , "type" : "agent-skill" , "source" : { "type" : "inline" , "skill_md" : "skill_md" } } , "id" : "id" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "ml_repo_id" : "ml_repo_id" , "agent_skill_id" : "agent_skill_id" , "usage_code_snippets" : [ { "display_name" : "display_name" , "language" : "language" , "code" : "code" } ] } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: { + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + manifest: { + name: "name", + metadata: { key: "value" }, + ml_repo: "ml_repo", + version: 1, + type: "agent-skill", + source: { type: "inline", skill_md: "skill_md" }, + }, + id: "id", + fqn: "fqn", + created_by_subject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + ml_repo_id: "ml_repo_id", + agent_skill_id: "agent_skill_id", + usage_code_snippets: [{ display_name: "display_name", language: "language", code: "code" }], + }, + }; + server .mockEndpoint() - .get("/api/svc/v1/agent-skill-versions/agent_skill_version_id").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.agentSkillVersions.get("agent_skill_version_id"); - expect(response).toEqual({ - data: { - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - manifest: { - name: "name", - metadata: { - "key": "value" + .get("/api/svc/v1/agent-skill-versions/agent_skill_version_id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentSkillVersions.get("agent_skill_version_id"); + expect(response).toEqual({ + data: { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + manifest: { + name: "name", + metadata: { + key: "value", + }, + mlRepo: "ml_repo", + version: 1, + type: "agent-skill", + source: { + type: "inline", + skillMd: "skill_md", + }, + }, + id: "id", + fqn: "fqn", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + mlRepoId: "ml_repo_id", + agentSkillId: "agent_skill_id", + usageCodeSnippets: [ + { + displayName: "display_name", + language: "language", + code: "code", + }, + ], }, - mlRepo: "ml_repo", - version: 1, - type: "agent-skill", - source: { - type: "inline", - skillMd: "skill_md" - } - }, - id: "id", - fqn: "fqn", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - mlRepoId: "ml_repo_id", - agentSkillId: "agent_skill_id", - usageCodeSnippets: [{ - displayName: "display_name", - language: "language", - code: "code" - }] - } -}); - - + }); }); - + test("get (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/agent-skill-versions/agent_skill_version_id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.agentSkillVersions.get("agent_skill_version_id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .get("/api/svc/v1/agent-skill-versions/agent_skill_version_id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentSkillVersions.get("agent_skill_version_id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("delete (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = {}; + server .mockEndpoint() - .delete("/api/svc/v1/agent-skill-versions/agent_skill_version_id").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.agentSkillVersions.delete("agent_skill_version_id"); - expect(response).toEqual({}); - - + .delete("/api/svc/v1/agent-skill-versions/agent_skill_version_id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentSkillVersions.delete("agent_skill_version_id"); + expect(response).toEqual({}); }); - + test("delete (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .delete("/api/svc/v1/agent-skill-versions/agent_skill_version_id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.agentSkillVersions.delete("agent_skill_version_id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .delete("/api/svc/v1/agent-skill-versions/agent_skill_version_id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agentSkillVersions.delete("agent_skill_version_id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - }); diff --git a/tests/wire/agentSkills.test.ts b/tests/wire/agentSkills.test.ts index b841a6fb..9838f35b 100644 --- a/tests/wire/agentSkills.test.ts +++ b/tests/wire/agentSkills.test.ts @@ -5,273 +5,362 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("AgentSkillsClient", () => { - test("get (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : { "id" : "id" , "ml_repo_id" : "ml_repo_id" , "type" : "agent-skill" , "name" : "name" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "created_at" : "2024-01-15T09:30:00Z" , "updated_at" : "2024-01-15T09:30:00Z" , "latest_version" : { "created_at" : "2024-01-15T09:30:00Z" , "updated_at" : "2024-01-15T09:30:00Z" , "manifest" : { "name" : "name" , "metadata" : { "key" : "value" } , "ml_repo" : "ml_repo" , "type" : "agent-skill" , "source" : { "type" : "inline" , "skill_md" : "skill_md" } } , "id" : "id" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "ml_repo_id" : "ml_repo_id" , "agent_skill_id" : "agent_skill_id" , "usage_code_snippets" : [ { "display_name" : "display_name" , "language" : "language" , "code" : "code" } ] } } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: { + id: "id", + ml_repo_id: "ml_repo_id", + type: "agent-skill", + name: "name", + fqn: "fqn", + created_by_subject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + latest_version: { + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + manifest: { + name: "name", + metadata: { key: "value" }, + ml_repo: "ml_repo", + type: "agent-skill", + source: { type: "inline", skill_md: "skill_md" }, + }, + id: "id", + fqn: "fqn", + created_by_subject: { subjectId: "subjectId", subjectType: "user" }, + ml_repo_id: "ml_repo_id", + agent_skill_id: "agent_skill_id", + usage_code_snippets: [{ display_name: "display_name", language: "language", code: "code" }], + }, + }, + }; + server .mockEndpoint() - .get("/api/svc/v1/agent-skills/agent_skill_id").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .get("/api/svc/v1/agent-skills/agent_skill_id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.agentSkills.get("agent_skill_id"); - expect(response).toEqual({ - data: { - id: "id", - mlRepoId: "ml_repo_id", - type: "agent-skill", - name: "name", - fqn: "fqn", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - latestVersion: { - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - manifest: { + const response = await client.agentSkills.get("agent_skill_id"); + expect(response).toEqual({ + data: { + id: "id", + mlRepoId: "ml_repo_id", + type: "agent-skill", name: "name", - metadata: { - "key": "value" + fqn: "fqn", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + latestVersion: { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + manifest: { + name: "name", + metadata: { + key: "value", + }, + mlRepo: "ml_repo", + type: "agent-skill", + source: { + type: "inline", + skillMd: "skill_md", + }, + }, + id: "id", + fqn: "fqn", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + mlRepoId: "ml_repo_id", + agentSkillId: "agent_skill_id", + usageCodeSnippets: [ + { + displayName: "display_name", + language: "language", + code: "code", + }, + ], }, - mlRepo: "ml_repo", - type: "agent-skill", - source: { - type: "inline", - skillMd: "skill_md" - } - }, - id: "id", - fqn: "fqn", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" }, - mlRepoId: "ml_repo_id", - agentSkillId: "agent_skill_id", - usageCodeSnippets: [{ - displayName: "display_name", - language: "language", - code: "code" - }] - } - } -}); - - + }); }); - + test("get (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/agent-skills/agent_skill_id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); + .get("/api/svc/v1/agent-skills/agent_skill_id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.agentSkills.get("agent_skill_id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + await expect(async () => { + return await client.agentSkills.get("agent_skill_id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("delete (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = {}; + server .mockEndpoint() - .delete("/api/svc/v1/agent-skills/agent_skill_id").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .delete("/api/svc/v1/agent-skills/agent_skill_id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.agentSkills.delete("agent_skill_id"); - expect(response).toEqual({}); - - + const response = await client.agentSkills.delete("agent_skill_id"); + expect(response).toEqual({}); }); - + test("delete (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .delete("/api/svc/v1/agent-skills/agent_skill_id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); + .delete("/api/svc/v1/agent-skills/agent_skill_id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.agentSkills.delete("agent_skill_id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + await expect(async () => { + return await client.agentSkills.delete("agent_skill_id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("list", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "id" : "id" , "ml_repo_id" : "ml_repo_id" , "type" : "agent-skill" , "name" : "name" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "created_at" : "2024-01-15T09:30:00Z" , "updated_at" : "2024-01-15T09:30:00Z" , "latest_version" : { "manifest" : { "name" : "name" , "metadata" : { "key" : "value" } , "ml_repo" : "ml_repo" , "type" : "agent-skill" , "source" : { "type" : "inline" , "skill_md" : "skill_md" } } , "id" : "id" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "ml_repo_id" : "ml_repo_id" , "agent_skill_id" : "agent_skill_id" } } ] , "pagination" : { "total" : 100 , "offset" : 0 , "limit" : 10 } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + id: "id", + ml_repo_id: "ml_repo_id", + type: "agent-skill", + name: "name", + fqn: "fqn", + created_by_subject: { subjectId: "subjectId", subjectType: "user" }, + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + latest_version: { + manifest: { + name: "name", + metadata: { key: "value" }, + ml_repo: "ml_repo", + type: "agent-skill", + source: { type: "inline", skill_md: "skill_md" }, + }, + id: "id", + fqn: "fqn", + created_by_subject: { subjectId: "subjectId", subjectType: "user" }, + ml_repo_id: "ml_repo_id", + agent_skill_id: "agent_skill_id", + }, + }, + ], + pagination: { total: 100, offset: 0, limit: 10 }, + }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/agent-skills").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .mockEndpoint() + .get("/api/svc/v1/agent-skills") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const expected = { - data: [{ - id: "id", - mlRepoId: "ml_repo_id", - type: "agent-skill", - name: "name", - fqn: "fqn", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" + const expected = { + data: [ + { + id: "id", + mlRepoId: "ml_repo_id", + type: "agent-skill", + name: "name", + fqn: "fqn", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + latestVersion: { + manifest: { + name: "name", + metadata: { + key: "value", + }, + mlRepo: "ml_repo", + type: "agent-skill", + source: { + type: "inline", + skillMd: "skill_md", + }, + }, + id: "id", + fqn: "fqn", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + mlRepoId: "ml_repo_id", + agentSkillId: "agent_skill_id", + }, + }, + ], + pagination: { + total: 100, + offset: 0, + limit: 10, + }, + }; + const page = await client.agentSkills.list({ + limit: 10, + offset: 0, + }); + + expect(expected.data).toEqual(page.data); + }); + + test("create_or_update", async () => { + const server = mockServerPool.createServer(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + name: "name", + metadata: { key: "value" }, + ml_repo: "ml_repo", + type: "agent-skill", + source: { type: "inline", skill_md: "skill_md" }, + }, + }; + const rawResponseBody = { + data: { + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + manifest: { + name: "name", + metadata: { key: "value" }, + ml_repo: "ml_repo", + version: 1, + type: "agent-skill", + source: { type: "inline", skill_md: "skill_md" }, + }, + id: "id", + fqn: "fqn", + created_by_subject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + ml_repo_id: "ml_repo_id", + agent_skill_id: "agent_skill_id", + usage_code_snippets: [{ display_name: "display_name", language: "language", code: "code" }], + }, + }; + + server + .mockEndpoint() + .put("/api/svc/v1/agent-skill-versions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agentSkills.createOrUpdate({ + manifest: { + name: "name", + metadata: { + key: "value", + }, + mlRepo: "ml_repo", + type: "agent-skill", + source: { + type: "inline", + skillMd: "skill_md", + }, }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - latestVersion: { + }); + expect(response).toEqual({ + data: { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), manifest: { name: "name", metadata: { - "key": "value" + key: "value", }, mlRepo: "ml_repo", + version: 1, type: "agent-skill", source: { type: "inline", - skillMd: "skill_md" - } + skillMd: "skill_md", + }, }, id: "id", fqn: "fqn", createdBySubject: { subjectId: "subjectId", - subjectType: "user" + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", }, mlRepoId: "ml_repo_id", - agentSkillId: "agent_skill_id" - } - }], - pagination: { - total: 100, - offset: 0, - limit: 10 - } -}; - const page = await client.agentSkills.list({ - limit: 10, - offset: 0, - fqn: "fqn", - mlRepoId: "ml_repo_id", - name: "name", - includeEmptyAgentSkills: true -}); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - - }); - - test("create_or_update", async () => { - const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "name" : "name" , "metadata" : { "key" : "value" } , "ml_repo" : "ml_repo" , "type" : "agent-skill" , "source" : { "type" : "inline" , "skill_md" : "skill_md" } } }; - const rawResponseBody = { "data" : { "created_at" : "2024-01-15T09:30:00Z" , "updated_at" : "2024-01-15T09:30:00Z" , "manifest" : { "name" : "name" , "metadata" : { "key" : "value" } , "ml_repo" : "ml_repo" , "version" : 1 , "type" : "agent-skill" , "source" : { "type" : "inline" , "skill_md" : "skill_md" } } , "id" : "id" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "ml_repo_id" : "ml_repo_id" , "agent_skill_id" : "agent_skill_id" , "usage_code_snippets" : [ { "display_name" : "display_name" , "language" : "language" , "code" : "code" } ] } }; - - server - .mockEndpoint() - .put("/api/svc/v1/agent-skill-versions").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.agentSkills.createOrUpdate({ - manifest: { - name: "name", - metadata: { - "key": "value" - }, - mlRepo: "ml_repo", - type: "agent-skill", - source: { - type: "inline", - skillMd: "skill_md" - } - } -}); - expect(response).toEqual({ - data: { - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - manifest: { - name: "name", - metadata: { - "key": "value" + agentSkillId: "agent_skill_id", + usageCodeSnippets: [ + { + displayName: "display_name", + language: "language", + code: "code", + }, + ], }, - mlRepo: "ml_repo", - version: 1, - type: "agent-skill", - source: { - type: "inline", - skillMd: "skill_md" - } - }, - id: "id", - fqn: "fqn", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - mlRepoId: "ml_repo_id", - agentSkillId: "agent_skill_id", - usageCodeSnippets: [{ - displayName: "display_name", - language: "language", - code: "code" - }] - } -}); - - + }); }); - }); diff --git a/tests/wire/agentVersions.test.ts b/tests/wire/agentVersions.test.ts index 1b69d829..651c977f 100644 --- a/tests/wire/agentVersions.test.ts +++ b/tests/wire/agentVersions.test.ts @@ -4,63 +4,76 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("AgentVersionsClient", () => { - test("list", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "agentId" : "agentId" , "fqn" : "fqn" , "manifest" : { "type" : "truefoundry-agent" , "name" : "name" , "description" : "description" , "model" : { "name" : "name" } , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } ] } , "version" : 1.1 , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" } } ] , "pagination" : { "total" : 100 , "offset" : 0 , "limit" : 10 } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + id: "jqfwg345gi25n5ju2yz5iz6m", + agentId: "agentId", + fqn: "fqn", + manifest: { + type: "truefoundry-agent", + name: "name", + description: "description", + model: { name: "name" }, + collaborators: [{ subject: "subject", role_id: "role_id" }], + }, + version: 1.1, + createdBySubject: { subjectId: "subjectId", subjectType: "user" }, + }, + ], + pagination: { total: 100, offset: 0, limit: 10 }, + }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/agent-versions").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .mockEndpoint() + .get("/api/svc/v1/agent-versions") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const expected = { - data: [{ - id: "jqfwg345gi25n5ju2yz5iz6m", - agentId: "agentId", - fqn: "fqn", - manifest: { - type: "truefoundry-agent", - name: "name", - description: "description", - model: { - name: "name" + const expected = { + data: [ + { + id: "jqfwg345gi25n5ju2yz5iz6m", + agentId: "agentId", + fqn: "fqn", + manifest: { + type: "truefoundry-agent", + name: "name", + description: "description", + model: { + name: "name", + }, + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + ], + }, + version: 1.1, + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, }, - collaborators: [{ - subject: "subject", - roleId: "role_id" - }] + ], + pagination: { + total: 100, + offset: 0, + limit: 10, }, - version: 1.1, - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" - } - }], - pagination: { - total: 100, - offset: 0, - limit: 10 - } -}; - const page = await client.agentVersions.list({ - limit: 10, - offset: 0, - id: "id" -}); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - + }; + const page = await client.agentVersions.list({ + limit: 10, + offset: 0, + }); + + expect(expected.data).toEqual(page.data); }); - }); diff --git a/tests/wire/agents.test.ts b/tests/wire/agents.test.ts index ffcc09bc..1f2ac8ca 100644 --- a/tests/wire/agents.test.ts +++ b/tests/wire/agents.test.ts @@ -5,545 +5,823 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("AgentsClient", () => { - test("list (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "name" : "name" , "fqn" : "fqn" , "tenantName" : "tenantName" , "accountId" : "accountId" , "latestVersion" : 1.1 , "type" : "type" , "latestVersionDetails" : { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "agentId" : "agentId" , "fqn" : "fqn" , "manifest" : { "type" : "truefoundry-agent" , "name" : "name" , "description" : "description" , "model" : { "name" : "name" } , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } ] } , "version" : 1.1 } , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "createdBy" : "createdBy" } ] , "pagination" : { "total" : 100 , "offset" : 0 , "limit" : 10 } }; - - server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/agents").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const expected = { - data: [{ - id: "jqfwg345gi25n5ju2yz5iz6m", - name: "name", - fqn: "fqn", - tenantName: "tenantName", - accountId: "accountId", - latestVersion: 1.1, - type: "type", - latestVersionDetails: { - id: "jqfwg345gi25n5ju2yz5iz6m", - agentId: "agentId", - fqn: "fqn", - manifest: { - type: "truefoundry-agent", + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + id: "jqfwg345gi25n5ju2yz5iz6m", name: "name", - description: "description", - model: { - name: "name" + fqn: "fqn", + tenantName: "tenantName", + accountId: "accountId", + latestVersion: 1.1, + type: "type", + latestVersionDetails: { + id: "jqfwg345gi25n5ju2yz5iz6m", + agentId: "agentId", + fqn: "fqn", + manifest: { + type: "truefoundry-agent", + name: "name", + description: "description", + model: { name: "name" }, + collaborators: [{ subject: "subject", role_id: "role_id" }], + }, + version: 1.1, }, - collaborators: [{ - subject: "subject", - roleId: "role_id" - }] + createdBySubject: { subjectId: "subjectId", subjectType: "user" }, + manifest: { key: "value" }, + agentIdentityId: "agentIdentityId", + createdBy: "createdBy", }, - version: 1.1 - }, - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" + ], + pagination: { total: 100, offset: 0, limit: 10 }, + }; + + server.mockEndpoint().get("/api/svc/v1/agents").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const expected = { + data: [ + { + id: "jqfwg345gi25n5ju2yz5iz6m", + name: "name", + fqn: "fqn", + tenantName: "tenantName", + accountId: "accountId", + latestVersion: 1.1, + type: "type", + latestVersionDetails: { + id: "jqfwg345gi25n5ju2yz5iz6m", + agentId: "agentId", + fqn: "fqn", + manifest: { + type: "truefoundry-agent", + name: "name", + description: "description", + model: { + name: "name", + }, + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + ], + }, + version: 1.1, + }, + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + manifest: { + key: "value", + }, + agentIdentityId: "agentIdentityId", + createdBy: "createdBy", + }, + ], + pagination: { + total: 100, + offset: 0, + limit: 10, }, - createdBy: "createdBy" - }], - pagination: { - total: 100, - offset: 0, - limit: 10 - } -}; - const page = await client.agents.list({ - limit: 10, - offset: 0, - name: "name", - namePrefix: "namePrefix", - type: "remote-agent", - attributes: ["attributes"] -}); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - + }; + const page = await client.agents.list({ + limit: 10, + offset: 0, + }); + + expect(expected.data).toEqual(page.data); }); - + test("list (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - - server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/agents").respondWith() - .statusCode(401).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.agents.list() - }).rejects.toThrow(TrueFoundry.UnauthorizedError); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + + server.mockEndpoint().get("/api/svc/v1/agents").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.agents.list(); + }).rejects.toThrow(TrueFoundry.UnauthorizedError); }); - + test("create_or_update (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "truefoundry-agent" , "name" : "name" , "description" : "description" , "model" : { "name" : "name" } , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } ] } }; - const rawResponseBody = { "data" : { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "agentId" : "agentId" , "fqn" : "fqn" , "manifest" : { "type" : "truefoundry-agent" , "name" : "name" , "description" : "description" , "tags" : { "key" : "value" } , "model" : { "name" : "name" } , "skills" : [ { "fqn" : "fqn" , "preload" : true } ] , "mcp_servers" : [ { "name" : "name" } ] , "instructions" : "instructions" , "messages" : [ { "role" : "user" , "content" : "content" } ] , "variables" : { "key" : { } } , "sample_inputs" : [ { } ] , "response_format" : { "type" : "text" } , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } ] , "ownedBy" : { "account" : "account" } } , "version" : 1.1 , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } } }; - - server - .mockEndpoint() - .put("/api/svc/v1/agents").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.agents.createOrUpdate({ - manifest: { - type: "truefoundry-agent", - name: "name", - description: "description", - model: { - name: "name" - }, - collaborators: [{ - subject: "subject", - roleId: "role_id" - }] - } -}); - expect(response).toEqual({ - data: { - id: "jqfwg345gi25n5ju2yz5iz6m", - agentId: "agentId", - fqn: "fqn", - manifest: { - type: "truefoundry-agent", - name: "name", - description: "description", - tags: { - "key": "value" + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + type: "truefoundry-agent", + name: "name", + description: "description", + model: { name: "name" }, + collaborators: [{ subject: "subject", role_id: "role_id" }], }, - model: { - name: "name" + }; + const rawResponseBody = { + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + agentId: "agentId", + fqn: "fqn", + manifest: { + type: "truefoundry-agent", + name: "name", + description: "description", + tags: { key: "value" }, + model: { name: "name" }, + skills: [{ type: "truefoundry-skills-registry", fqn: "fqn", preload: true }], + mcp_servers: [{ type: "truefoundry-mcp-registry", name: "name" }], + instructions: "instructions", + messages: [{ type: "user.message", content: "content" }], + variables: { key: {} }, + sample_inputs: [{}], + response_format: { type: "text" }, + collaborators: [{ subject: "subject", role_id: "role_id" }], + ownedBy: { account: "account" }, + }, + version: 1.1, + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, }, - skills: [{ - fqn: "fqn", - preload: true - }], - mcpServers: [{ - name: "name" - }], - instructions: "instructions", - messages: [{ - role: "user", - content: "content" - }], - variables: { - "key": {} + }; + + server + .mockEndpoint() + .put("/api/svc/v1/agents") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agents.createOrUpdate({ + manifest: { + type: "truefoundry-agent", + name: "name", + description: "description", + model: { + name: "name", + }, + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + ], }, - sampleInputs: [{}], - responseFormat: { - type: "text" + }); + expect(response).toEqual({ + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + agentId: "agentId", + fqn: "fqn", + manifest: { + type: "truefoundry-agent", + name: "name", + description: "description", + tags: { + key: "value", + }, + model: { + name: "name", + }, + skills: [ + { + type: "truefoundry-skills-registry", + fqn: "fqn", + preload: true, + }, + ], + mcpServers: [ + { + type: "truefoundry-mcp-registry", + name: "name", + }, + ], + instructions: "instructions", + messages: [ + { + type: "user.message", + content: "content", + }, + ], + variables: { + key: {}, + }, + sampleInputs: [{}], + responseFormat: { + type: "text", + }, + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + ], + ownedBy: { + account: "account", + }, + }, + version: 1.1, + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, }, - collaborators: [{ - subject: "subject", - roleId: "role_id" - }], - ownedBy: { - account: "account" - } - }, - version: 1.1, - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - } - } -}); - - + }); }); - + test("create_or_update (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "truefoundry-agent" , "name" : "name" , "description" : "description" , "model" : { "name" : "x" } , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } , { "subject" : "subject" , "role_id" : "role_id" } ] } }; - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + type: "truefoundry-agent", + name: "name", + description: "description", + model: { name: "x" }, + collaborators: [ + { subject: "subject", role_id: "role_id" }, + { subject: "subject", role_id: "role_id" }, + ], + }, + }; + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .put("/api/svc/v1/agents").jsonBody(rawRequestBody) - .respondWith() - .statusCode(400).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.agents.createOrUpdate({ - manifest: { - type: "truefoundry-agent", - name: "name", - description: "description", - model: { - name: "x" - }, - collaborators: [{ - subject: "subject", - roleId: "role_id" - }, { - subject: "subject", - roleId: "role_id" - }] - } -}) - }).rejects.toThrow(TrueFoundry.BadRequestError); + .put("/api/svc/v1/agents") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.createOrUpdate({ + manifest: { + type: "truefoundry-agent", + name: "name", + description: "description", + model: { + name: "x", + }, + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + { + subject: "subject", + roleId: "role_id", + }, + ], + }, + }); + }).rejects.toThrow(TrueFoundry.BadRequestError); }); - + test("create_or_update (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "truefoundry-agent" , "name" : "name" , "description" : "description" , "model" : { "name" : "x" } , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } , { "subject" : "subject" , "role_id" : "role_id" } ] } }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + type: "truefoundry-agent", + name: "name", + description: "description", + model: { name: "x" }, + collaborators: [ + { subject: "subject", role_id: "role_id" }, + { subject: "subject", role_id: "role_id" }, + ], + }, + }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .put("/api/svc/v1/agents").jsonBody(rawRequestBody) - .respondWith() - .statusCode(401).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.agents.createOrUpdate({ - manifest: { - type: "truefoundry-agent", - name: "name", - description: "description", - model: { - name: "x" - }, - collaborators: [{ - subject: "subject", - roleId: "role_id" - }, { - subject: "subject", - roleId: "role_id" - }] - } -}) - }).rejects.toThrow(TrueFoundry.UnauthorizedError); + .put("/api/svc/v1/agents") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.createOrUpdate({ + manifest: { + type: "truefoundry-agent", + name: "name", + description: "description", + model: { + name: "x", + }, + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + { + subject: "subject", + roleId: "role_id", + }, + ], + }, + }); + }).rejects.toThrow(TrueFoundry.UnauthorizedError); }); - + test("create_or_update (4)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "truefoundry-agent" , "name" : "name" , "description" : "description" , "model" : { "name" : "x" } , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } , { "subject" : "subject" , "role_id" : "role_id" } ] } }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + type: "truefoundry-agent", + name: "name", + description: "description", + model: { name: "x" }, + collaborators: [ + { subject: "subject", role_id: "role_id" }, + { subject: "subject", role_id: "role_id" }, + ], + }, + }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .put("/api/svc/v1/agents").jsonBody(rawRequestBody) - .respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.agents.createOrUpdate({ - manifest: { - type: "truefoundry-agent", - name: "name", - description: "description", - model: { - name: "x" - }, - collaborators: [{ - subject: "subject", - roleId: "role_id" - }, { - subject: "subject", - roleId: "role_id" - }] - } -}) - }).rejects.toThrow(TrueFoundry.ForbiddenError); + .put("/api/svc/v1/agents") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.createOrUpdate({ + manifest: { + type: "truefoundry-agent", + name: "name", + description: "description", + model: { + name: "x", + }, + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + { + subject: "subject", + roleId: "role_id", + }, + ], + }, + }); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("create_or_update (5)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "truefoundry-agent" , "name" : "name" , "description" : "description" , "model" : { "name" : "x" } , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } , { "subject" : "subject" , "role_id" : "role_id" } ] } }; - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + type: "truefoundry-agent", + name: "name", + description: "description", + model: { name: "x" }, + collaborators: [ + { subject: "subject", role_id: "role_id" }, + { subject: "subject", role_id: "role_id" }, + ], + }, + }; + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .put("/api/svc/v1/agents").jsonBody(rawRequestBody) - .respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.agents.createOrUpdate({ - manifest: { - type: "truefoundry-agent", - name: "name", - description: "description", - model: { - name: "x" - }, - collaborators: [{ - subject: "subject", - roleId: "role_id" - }, { - subject: "subject", - roleId: "role_id" - }] - } -}) - }).rejects.toThrow(TrueFoundry.NotFoundError); + .put("/api/svc/v1/agents") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.createOrUpdate({ + manifest: { + type: "truefoundry-agent", + name: "name", + description: "description", + model: { + name: "x", + }, + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + { + subject: "subject", + roleId: "role_id", + }, + ], + }, + }); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("create_or_update (6)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "truefoundry-agent" , "name" : "name" , "description" : "description" , "model" : { "name" : "x" } , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } , { "subject" : "subject" , "role_id" : "role_id" } ] } }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + type: "truefoundry-agent", + name: "name", + description: "description", + model: { name: "x" }, + collaborators: [ + { subject: "subject", role_id: "role_id" }, + { subject: "subject", role_id: "role_id" }, + ], + }, + }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .put("/api/svc/v1/agents").jsonBody(rawRequestBody) - .respondWith() - .statusCode(500).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.agents.createOrUpdate({ - manifest: { - type: "truefoundry-agent", - name: "name", - description: "description", - model: { - name: "x" - }, - collaborators: [{ - subject: "subject", - roleId: "role_id" - }, { - subject: "subject", - roleId: "role_id" - }] - } -}) - }).rejects.toThrow(TrueFoundry.InternalServerError); + .put("/api/svc/v1/agents") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.createOrUpdate({ + manifest: { + type: "truefoundry-agent", + name: "name", + description: "description", + model: { + name: "x", + }, + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + { + subject: "subject", + roleId: "role_id", + }, + ], + }, + }); + }).rejects.toThrow(TrueFoundry.InternalServerError); }); - + test("get (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "name" : "name" , "fqn" : "fqn" , "tenantName" : "tenantName" , "accountId" : "accountId" , "latestVersion" : 1.1 , "type" : "type" , "latestVersionDetails" : { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "agentId" : "agentId" , "fqn" : "fqn" , "manifest" : { "type" : "truefoundry-agent" , "name" : "name" , "description" : "description" , "model" : { "name" : "name" } , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } ] } , "version" : 1.1 , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" } } , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "createdBy" : "createdBy" } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + name: "name", + fqn: "fqn", + tenantName: "tenantName", + accountId: "accountId", + latestVersion: 1.1, + type: "type", + latestVersionDetails: { + id: "jqfwg345gi25n5ju2yz5iz6m", + agentId: "agentId", + fqn: "fqn", + manifest: { + type: "truefoundry-agent", + name: "name", + description: "description", + model: { name: "name" }, + collaborators: [{ subject: "subject", role_id: "role_id" }], + }, + version: 1.1, + createdBySubject: { subjectId: "subjectId", subjectType: "user" }, + }, + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + manifest: { key: "value" }, + agentIdentityId: "agentIdentityId", + createdBy: "createdBy", + }, + }; + server .mockEndpoint() - .get("/api/svc/v1/agents/jqfwg345gi25n5ju2yz5iz6m").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.agents.get("jqfwg345gi25n5ju2yz5iz6m"); - expect(response).toEqual({ - data: { - id: "jqfwg345gi25n5ju2yz5iz6m", - name: "name", - fqn: "fqn", - tenantName: "tenantName", - accountId: "accountId", - latestVersion: 1.1, - type: "type", - latestVersionDetails: { - id: "jqfwg345gi25n5ju2yz5iz6m", - agentId: "agentId", - fqn: "fqn", - manifest: { - type: "truefoundry-agent", + .get("/api/svc/v1/agents/jqfwg345gi25n5ju2yz5iz6m") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agents.get("jqfwg345gi25n5ju2yz5iz6m"); + expect(response).toEqual({ + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", name: "name", - description: "description", - model: { - name: "name" + fqn: "fqn", + tenantName: "tenantName", + accountId: "accountId", + latestVersion: 1.1, + type: "type", + latestVersionDetails: { + id: "jqfwg345gi25n5ju2yz5iz6m", + agentId: "agentId", + fqn: "fqn", + manifest: { + type: "truefoundry-agent", + name: "name", + description: "description", + model: { + name: "name", + }, + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + ], + }, + version: 1.1, + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, }, - collaborators: [{ - subject: "subject", - roleId: "role_id" - }] + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + manifest: { + key: "value", + }, + agentIdentityId: "agentIdentityId", + createdBy: "createdBy", }, - version: 1.1, - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" - } - }, - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - createdBy: "createdBy" - } -}); - - + }); }); - + test("get (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .get("/api/svc/v1/agents/id").respondWith() - .statusCode(401).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.agents.get("id") - }).rejects.toThrow(TrueFoundry.UnauthorizedError); + .get("/api/svc/v1/agents/id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.get("id"); + }).rejects.toThrow(TrueFoundry.UnauthorizedError); }); - + test("get (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/agents/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.agents.get("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .get("/api/svc/v1/agents/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.get("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("delete (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + server .mockEndpoint() - .delete("/api/svc/v1/agents/jqfwg345gi25n5ju2yz5iz6m").respondWith() - .statusCode(200).build(); - - - - const response = await client.agents.delete("jqfwg345gi25n5ju2yz5iz6m"); - expect(response).toEqual(undefined); - - + .delete("/api/svc/v1/agents/jqfwg345gi25n5ju2yz5iz6m") + .respondWith() + .statusCode(200) + .build(); + + const response = await client.agents.delete("jqfwg345gi25n5ju2yz5iz6m"); + expect(response).toEqual(undefined); }); - + test("delete (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .delete("/api/svc/v1/agents/id").respondWith() - .statusCode(401).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.agents.delete("id") - }).rejects.toThrow(TrueFoundry.UnauthorizedError); + .delete("/api/svc/v1/agents/id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.delete("id"); + }).rejects.toThrow(TrueFoundry.UnauthorizedError); }); - + test("delete (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .delete("/api/svc/v1/agents/id").respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.agents.delete("id") - }).rejects.toThrow(TrueFoundry.ForbiddenError); + .delete("/api/svc/v1/agents/id") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.delete("id"); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("delete (4)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .delete("/api/svc/v1/agents/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.agents.delete("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .delete("/api/svc/v1/agents/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.delete("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("delete (5)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + + server + .mockEndpoint() + .delete("/api/svc/v1/agents/id") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.delete("id"); + }).rejects.toThrow(TrueFoundry.InternalServerError); + }); + + test("getToken (1)", async () => { + const server = mockServerPool.createServer(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { token: "token" }; + server .mockEndpoint() - .delete("/api/svc/v1/agents/id").respondWith() - .statusCode(500).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.agents.delete("id") - }).rejects.toThrow(TrueFoundry.InternalServerError); + .get("/api/svc/v1/agents/jqfwg345gi25n5ju2yz5iz6m/token") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.agents.getToken("jqfwg345gi25n5ju2yz5iz6m"); + expect(response).toEqual({ + token: "token", + }); + }); + + test("getToken (2)", async () => { + const server = mockServerPool.createServer(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + + server + .mockEndpoint() + .get("/api/svc/v1/agents/id/token") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.getToken("id"); + }).rejects.toThrow(TrueFoundry.UnauthorizedError); + }); + + test("getToken (3)", async () => { + const server = mockServerPool.createServer(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + + server + .mockEndpoint() + .get("/api/svc/v1/agents/id/token") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.getToken("id"); + }).rejects.toThrow(TrueFoundry.ForbiddenError); + }); + + test("getToken (4)", async () => { + const server = mockServerPool.createServer(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/api/svc/v1/agents/id/token") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.getToken("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); + }); + + test("getToken (5)", async () => { + const server = mockServerPool.createServer(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + + server + .mockEndpoint() + .get("/api/svc/v1/agents/id/token") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.agents.getToken("id"); + }).rejects.toThrow(TrueFoundry.UnprocessableEntityError); }); - }); diff --git a/tests/wire/alerts.test.ts b/tests/wire/alerts.test.ts index 821a0e76..379af8f5 100644 --- a/tests/wire/alerts.test.ts +++ b/tests/wire/alerts.test.ts @@ -5,77 +5,65 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("AlertsClient", () => { - test("list (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : { "key" : [ { "name" : "name" , "timestamps" : [ "2024-01-15T09:30:00Z" ] , "startTime" : "2024-01-15T09:30:00Z" , "clusterId" : "clusterId" , "fingerprint" : "fingerprint" } ] } }; - - server - .mockEndpoint() - .get("/api/svc/v1/alerts").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - - - const response = await client.alerts.list({ - startTs: "startTs", - endTs: "endTs", - clusterId: "clusterId", - applicationId: "applicationId", - alertStatus: "firing" -}); - expect(response).toEqual({ - data: { - "key": [{ - name: "name", - timestamps: [new Date("2024-01-15T09:30:00.000Z")], - startTime: new Date("2024-01-15T09:30:00.000Z"), - clusterId: "clusterId", - fingerprint: "fingerprint" - }] - } -}); - - + const rawResponseBody = { + data: { + key: [ + { + name: "name", + timestamps: ["2024-01-15T09:30:00Z"], + startTime: "2024-01-15T09:30:00Z", + clusterId: "clusterId", + fingerprint: "fingerprint", + }, + ], + }, + }; + + server.mockEndpoint().get("/api/svc/v1/alerts").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.alerts.list(); + expect(response).toEqual({ + data: { + key: [ + { + name: "name", + timestamps: [new Date("2024-01-15T09:30:00.000Z")], + startTime: new Date("2024-01-15T09:30:00.000Z"), + clusterId: "clusterId", + fingerprint: "fingerprint", + }, + ], + }, + }); }); - + test("list (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - - server - .mockEndpoint() - .get("/api/svc/v1/alerts").respondWith() - .statusCode(400).jsonBody(rawResponseBody) - .build(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - - await expect(async () => { - return await client.alerts.list() - }).rejects.toThrow(TrueFoundry.BadRequestError); + const rawResponseBody = { key: "value" }; + + server.mockEndpoint().get("/api/svc/v1/alerts").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.alerts.list(); + }).rejects.toThrow(TrueFoundry.BadRequestError); }); - + test("list (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - - server - .mockEndpoint() - .get("/api/svc/v1/alerts").respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + + server.mockEndpoint().get("/api/svc/v1/alerts").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.alerts.list() - }).rejects.toThrow(TrueFoundry.ForbiddenError); + await expect(async () => { + return await client.alerts.list(); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - }); diff --git a/tests/wire/applicationVersions.test.ts b/tests/wire/applicationVersions.test.ts index 7acaaf8a..969c2ea6 100644 --- a/tests/wire/applicationVersions.test.ts +++ b/tests/wire/applicationVersions.test.ts @@ -5,317 +5,465 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("ApplicationVersionsClient", () => { - test("list (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "id" : "id" , "version" : 1.1 , "fqn" : "fqn" , "applicationId" : "applicationId" , "manifest" : { "name" : "name" , "image" : { "type" : "build" , "build_source" : { "type" : "remote" , "remote_uri" : "remote_uri" } , "build_spec" : { "type" : "dockerfile" , "dockerfile_path" : "dockerfile_path" , "build_context_path" : "build_context_path" } } , "ports" : [ { "port" : 1 , "protocol" : "TCP" , "expose" : true } ] , "type" : "service" , "replicas" : 1.1 } , "application" : { "lifecycleStage" : "active" } , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "deploymentBuilds" : [ { "name" : "name" , "status" : 20 } ] , "deploymentStatuses" : [ { } ] , "currentStatusId" : "currentStatusId" , "appliedRecommendations" : [ { "recommendationData" : { "key" : "value" } , "recommendationType" : "recommendationType" , "expiryTimestamp" : "2024-01-15T09:30:00Z" } ] , "createdBy" : "createdBy" } ] , "pagination" : { "total" : 100 , "offset" : 0 , "limit" : 10 } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + id: "id", + version: 1.1, + fqn: "fqn", + applicationId: "applicationId", + manifest: { + name: "name", + image: { + type: "build", + build_source: { type: "remote", remote_uri: "remote_uri" }, + build_spec: { + type: "dockerfile", + dockerfile_path: "dockerfile_path", + build_context_path: "build_context_path", + }, + }, + ports: [{ port: 1, protocol: "TCP", expose: true }], + type: "service", + replicas: 1.1, + }, + application: { lifecycleStage: "active" }, + createdBySubject: { subjectId: "subjectId", subjectType: "user" }, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + deploymentBuilds: [{ name: "name", status: 20 }], + deploymentStatuses: [{}], + currentStatusId: "currentStatusId", + appliedRecommendations: [ + { + recommendationData: { key: "value" }, + recommendationType: "recommendationType", + expiryTimestamp: "2024-01-15T09:30:00Z", + }, + ], + createdBy: "createdBy", + }, + ], + pagination: { total: 100, offset: 0, limit: 10 }, + }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/apps/id/deployments").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .mockEndpoint() + .get("/api/svc/v1/apps/id/deployments") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const expected = { - data: [{ - id: "id", - version: 1.1, - fqn: "fqn", - applicationId: "applicationId", - manifest: { - name: "name", - image: { - type: "build", - buildSource: { - type: "remote", - remoteUri: "remote_uri" + const expected = { + data: [ + { + id: "id", + version: 1.1, + fqn: "fqn", + applicationId: "applicationId", + manifest: { + name: "name", + image: { + type: "build", + buildSource: { + type: "remote", + remoteUri: "remote_uri", + }, + buildSpec: { + type: "dockerfile", + dockerfilePath: "dockerfile_path", + buildContextPath: "build_context_path", + }, + }, + ports: [ + { + port: 1, + protocol: "TCP", + expose: true, + }, + ], + type: "service", + replicas: 1.1, }, - buildSpec: { - type: "dockerfile", - dockerfilePath: "dockerfile_path", - buildContextPath: "build_context_path" - } + application: { + lifecycleStage: "active", + }, + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + deploymentBuilds: [ + { + name: "name", + status: 20, + }, + ], + deploymentStatuses: [{}], + currentStatusId: "currentStatusId", + appliedRecommendations: [ + { + recommendationData: { + key: "value", + }, + recommendationType: "recommendationType", + expiryTimestamp: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + createdBy: "createdBy", }, - ports: [{ - port: 1, - protocol: "TCP", - expose: true - }], - type: "service", - replicas: 1.1 - }, - application: { - lifecycleStage: "active" - }, - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" + ], + pagination: { + total: 100, + offset: 0, + limit: 10, }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - deploymentBuilds: [{ - name: "name", - status: 20 - }], - deploymentStatuses: [{}], - currentStatusId: "currentStatusId", - appliedRecommendations: [{ - recommendationData: { - "key": "value" - }, - recommendationType: "recommendationType", - expiryTimestamp: new Date("2024-01-15T09:30:00.000Z") - }], - createdBy: "createdBy" - }], - pagination: { - total: 100, - offset: 0, - limit: 10 - } -}; - const page = await client.applicationVersions.list("id", { - limit: 10, - offset: 0, - version: "1", - deploymentId: "deployment123" -}); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - + }; + const page = await client.applicationVersions.list("id", { + limit: 10, + offset: 0, + version: "1", + deploymentId: "deployment123", + }); + + expect(expected.data).toEqual(page.data); }); - + test("list (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/apps/id/deployments").respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); + .mockEndpoint() + .get("/api/svc/v1/apps/id/deployments") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.applicationVersions.list("id") - }).rejects.toThrow(TrueFoundry.ForbiddenError); + await expect(async () => { + return await client.applicationVersions.list("id"); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("list (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/apps/id/deployments").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); + .mockEndpoint() + .get("/api/svc/v1/apps/id/deployments") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.applicationVersions.list("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + await expect(async () => { + return await client.applicationVersions.list("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("get (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : { "id" : "id" , "version" : 1.1 , "fqn" : "fqn" , "applicationId" : "applicationId" , "manifest" : { "name" : "name" , "image" : { "type" : "build" , "build_source" : { "type" : "remote" , "remote_uri" : "remote_uri" } , "build_spec" : { "type" : "dockerfile" , "dockerfile_path" : "dockerfile_path" , "build_context_path" : "build_context_path" } } , "artifacts_download" : { "artifacts" : [ { "type" : "truefoundry-artifact" , "artifact_version_fqn" : "artifact_version_fqn" , "download_path_env_variable" : "download_path_env_variable" } ] } , "resources" : { "cpu_request" : 1.1 , "cpu_limit" : 1.1 , "memory_request" : 1 , "memory_limit" : 1 , "ephemeral_storage_request" : 1 , "ephemeral_storage_limit" : 1 } , "ports" : [ { "port" : 1 , "protocol" : "TCP" , "expose" : true } ] , "service_account" : "service_account" , "mounts" : [ { "type" : "secret" , "mount_path" : "mount_path" , "secret_fqn" : "secret_fqn" } ] , "labels" : { "key" : "value" } , "liveness_probe" : { "config" : { "type" : "http" , "path" : "path" , "port" : 1 } } , "readiness_probe" : { "config" : { "type" : "http" , "path" : "path" , "port" : 1 } } , "startup_probe" : { "config" : { "type" : "http" , "path" : "path" , "port" : 1 } } , "workspace_fqn" : "workspace_fqn" , "type" : "service" , "replicas" : 1.1 , "auto_shutdown" : { "wait_time" : 1 } , "allow_interception" : true , "rollout_strategy" : { "type" : "rolling_update" , "max_unavailable_percentage" : 1 , "max_surge_percentage" : 1 } } , "application" : { "id" : "id" , "fqn" : "fqn" , "name" : "name" , "type" : "async-service" , "lifecycleStage" : "active" , "workspaceId" : "workspaceId" , "activeVersion" : 1 , "applicationSetId" : "applicationSetId" } , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "deploymentBuilds" : [ { "name" : "name" , "status" : 20 } ] , "deploymentStatuses" : [ { } ] , "currentStatusId" : "currentStatusId" , "currentStatus" : { "id" : "id" , "deploymentId" : "deploymentId" , "status" : "INITIALIZED" , "state" : { "key" : "value" } , "transition" : "BUILDING" , "message" : "message" , "retryCount" : 1.1 , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" } , "appliedRecommendations" : [ { "recommendationData" : { "key" : "value" } , "recommendationType" : "recommendationType" , "expiryTimestamp" : "2024-01-15T09:30:00Z" } ] , "createdBy" : "createdBy" } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: { + id: "id", + version: 1.1, + fqn: "fqn", + applicationId: "applicationId", + manifest: { + name: "name", + image: { + type: "build", + build_source: { type: "remote", remote_uri: "remote_uri" }, + build_spec: { + type: "dockerfile", + dockerfile_path: "dockerfile_path", + build_context_path: "build_context_path", + }, + }, + artifacts_download: { + artifacts: [ + { + type: "truefoundry-artifact", + artifact_version_fqn: "artifact_version_fqn", + download_path_env_variable: "download_path_env_variable", + }, + ], + }, + resources: { + cpu_request: 1.1, + cpu_limit: 1.1, + memory_request: 1, + memory_limit: 1, + ephemeral_storage_request: 1, + ephemeral_storage_limit: 1, + }, + ports: [{ port: 1, protocol: "TCP", expose: true }], + service_account: "service_account", + mounts: [{ type: "secret", mount_path: "mount_path", secret_fqn: "secret_fqn" }], + labels: { key: "value" }, + liveness_probe: { config: { type: "http", path: "path", port: 1 } }, + readiness_probe: { config: { type: "http", path: "path", port: 1 } }, + startup_probe: { config: { type: "http", path: "path", port: 1 } }, + workspace_fqn: "workspace_fqn", + type: "service", + replicas: 1.1, + auto_shutdown: { wait_time: 1 }, + allow_interception: true, + rollout_strategy: { + type: "rolling_update", + max_unavailable_percentage: 1, + max_surge_percentage: 1, + }, + }, + application: { + id: "id", + fqn: "fqn", + name: "name", + type: "async-service", + lifecycleStage: "active", + workspaceId: "workspaceId", + activeVersion: 1, + applicationSetId: "applicationSetId", + }, + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + deploymentBuilds: [{ name: "name", status: 20 }], + deploymentStatuses: [{}], + currentStatusId: "currentStatusId", + currentStatus: { + id: "id", + deploymentId: "deploymentId", + status: "INITIALIZED", + state: { key: "value" }, + transition: "BUILDING", + message: "message", + retryCount: 1.1, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + }, + appliedRecommendations: [ + { + recommendationData: { key: "value" }, + recommendationType: "recommendationType", + expiryTimestamp: "2024-01-15T09:30:00Z", + }, + ], + createdBy: "createdBy", + }, + }; + server .mockEndpoint() - .get("/api/svc/v1/apps/id/deployments/deploymentId").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .get("/api/svc/v1/apps/id/deployments/deploymentId") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.applicationVersions.get("id", "deploymentId"); - expect(response).toEqual({ - data: { - id: "id", - version: 1.1, - fqn: "fqn", - applicationId: "applicationId", - manifest: { - name: "name", - image: { - type: "build", - buildSource: { - type: "remote", - remoteUri: "remote_uri" + const response = await client.applicationVersions.get("id", "deploymentId"); + expect(response).toEqual({ + data: { + id: "id", + version: 1.1, + fqn: "fqn", + applicationId: "applicationId", + manifest: { + name: "name", + image: { + type: "build", + buildSource: { + type: "remote", + remoteUri: "remote_uri", + }, + buildSpec: { + type: "dockerfile", + dockerfilePath: "dockerfile_path", + buildContextPath: "build_context_path", + }, + }, + artifactsDownload: { + artifacts: [ + { + type: "truefoundry-artifact", + artifactVersionFqn: "artifact_version_fqn", + downloadPathEnvVariable: "download_path_env_variable", + }, + ], + }, + resources: { + cpuRequest: 1.1, + cpuLimit: 1.1, + memoryRequest: 1, + memoryLimit: 1, + ephemeralStorageRequest: 1, + ephemeralStorageLimit: 1, + }, + ports: [ + { + port: 1, + protocol: "TCP", + expose: true, + }, + ], + serviceAccount: "service_account", + mounts: [ + { + type: "secret", + mountPath: "mount_path", + secretFqn: "secret_fqn", + }, + ], + labels: { + key: "value", + }, + livenessProbe: { + config: { + type: "http", + path: "path", + port: 1, + }, + }, + readinessProbe: { + config: { + type: "http", + path: "path", + port: 1, + }, + }, + startupProbe: { + config: { + type: "http", + path: "path", + port: 1, + }, + }, + workspaceFqn: "workspace_fqn", + type: "service", + replicas: 1.1, + autoShutdown: { + waitTime: 1, + }, + allowInterception: true, + rolloutStrategy: { + type: "rolling_update", + maxUnavailablePercentage: 1, + maxSurgePercentage: 1, + }, }, - buildSpec: { - type: "dockerfile", - dockerfilePath: "dockerfile_path", - buildContextPath: "build_context_path" - } - }, - artifactsDownload: { - artifacts: [{ - type: "truefoundry-artifact", - artifactVersionFqn: "artifact_version_fqn", - downloadPathEnvVariable: "download_path_env_variable" - }] - }, - resources: { - cpuRequest: 1.1, - cpuLimit: 1.1, - memoryRequest: 1, - memoryLimit: 1, - ephemeralStorageRequest: 1, - ephemeralStorageLimit: 1 - }, - ports: [{ - port: 1, - protocol: "TCP", - expose: true - }], - serviceAccount: "service_account", - mounts: [{ - type: "secret", - mountPath: "mount_path", - secretFqn: "secret_fqn" - }], - labels: { - "key": "value" - }, - livenessProbe: { - config: { - type: "http", - path: "path", - port: 1 - } - }, - readinessProbe: { - config: { - type: "http", - path: "path", - port: 1 - } - }, - startupProbe: { - config: { - type: "http", - path: "path", - port: 1 - } - }, - workspaceFqn: "workspace_fqn", - type: "service", - replicas: 1.1, - autoShutdown: { - waitTime: 1 - }, - allowInterception: true, - rolloutStrategy: { - type: "rolling_update", - maxUnavailablePercentage: 1, - maxSurgePercentage: 1 - } - }, - application: { - id: "id", - fqn: "fqn", - name: "name", - type: "async-service", - lifecycleStage: "active", - workspaceId: "workspaceId", - activeVersion: 1, - applicationSetId: "applicationSetId" - }, - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - deploymentBuilds: [{ - name: "name", - status: 20 - }], - deploymentStatuses: [{}], - currentStatusId: "currentStatusId", - currentStatus: { - id: "id", - deploymentId: "deploymentId", - status: "INITIALIZED", - state: { - "key": "value" - }, - transition: "BUILDING", - message: "message", - retryCount: 1.1, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z") - }, - appliedRecommendations: [{ - recommendationData: { - "key": "value" + application: { + id: "id", + fqn: "fqn", + name: "name", + type: "async-service", + lifecycleStage: "active", + workspaceId: "workspaceId", + activeVersion: 1, + applicationSetId: "applicationSetId", }, - recommendationType: "recommendationType", - expiryTimestamp: new Date("2024-01-15T09:30:00.000Z") - }], - createdBy: "createdBy" - } -}); - - + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + deploymentBuilds: [ + { + name: "name", + status: 20, + }, + ], + deploymentStatuses: [{}], + currentStatusId: "currentStatusId", + currentStatus: { + id: "id", + deploymentId: "deploymentId", + status: "INITIALIZED", + state: { + key: "value", + }, + transition: "BUILDING", + message: "message", + retryCount: 1.1, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + appliedRecommendations: [ + { + recommendationData: { + key: "value", + }, + recommendationType: "recommendationType", + expiryTimestamp: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + createdBy: "createdBy", + }, + }); }); - + test("get (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .get("/api/svc/v1/apps/id/deployments/deploymentId").respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); + .get("/api/svc/v1/apps/id/deployments/deploymentId") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.applicationVersions.get("id", "deploymentId") - }).rejects.toThrow(TrueFoundry.ForbiddenError); + await expect(async () => { + return await client.applicationVersions.get("id", "deploymentId"); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("get (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/apps/id/deployments/deploymentId").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); + .get("/api/svc/v1/apps/id/deployments/deploymentId") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.applicationVersions.get("id", "deploymentId") - }).rejects.toThrow(TrueFoundry.NotFoundError); + await expect(async () => { + return await client.applicationVersions.get("id", "deploymentId"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - }); diff --git a/tests/wire/applications.test.ts b/tests/wire/applications.test.ts index 5ac6366e..b6622ce3 100644 --- a/tests/wire/applications.test.ts +++ b/tests/wire/applications.test.ts @@ -5,1261 +5,1768 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("ApplicationsClient", () => { - test("list (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "id" : "id" , "fqn" : "fqn" , "name" : "name" , "type" : "async-service" , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "tenantName" : "tenantName" , "lifecycleStage" : "active" , "workspaceId" : "workspaceId" , "lastVersion" : 1 , "activeVersion" : 1 , "applicationSetId" : "applicationSetId" , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "recommendations" : [ { "recommendationData" : { "key" : "value" } , "recommendationType" : "recommendationType" , "expiryTimestamp" : "2024-01-15T09:30:00Z" } ] , "alerts" : [ { "name" : "name" , "timestamps" : [ "2024-01-15T09:30:00Z" ] , "startTime" : "2024-01-15T09:30:00Z" , "clusterId" : "clusterId" , "fingerprint" : "fingerprint" } ] , "alertsSummary" : { "key" : "value" } , "applicationDebugInfos" : [ { "applicationId" : "applicationId" , "debugInfo" : { "key" : "value" } } ] , "potentialProblems" : [ { "name" : "name" , "description" : "description" } ] , "autopilot" : { "key" : "value" } , "workspaceFqn" : "workspaceFqn" , "createdBy" : "createdBy" , "deployment" : { "manifest" : { "name" : "name" , "image" : { "type" : "build" , "build_source" : { "type" : "remote" , "remote_uri" : "remote_uri" } , "build_spec" : { "type" : "dockerfile" , "dockerfile_path" : "dockerfile_path" , "build_context_path" : "build_context_path" } } , "ports" : [ { "port" : 1 , "protocol" : "TCP" , "expose" : true } ] , "type" : "service" , "replicas" : 1.1 } , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "deploymentBuilds" : [ { "name" : "name" , "status" : 20 } ] } , "activeDeploymentId" : "activeDeploymentId" , "lastDeploymentId" : "lastDeploymentId" } ] , "pagination" : { "total" : 100 , "offset" : 0 , "limit" : 10 } }; - - server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/apps").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const expected = { - data: [{ - id: "id", - fqn: "fqn", - name: "name", - type: "async-service", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" - }, - tenantName: "tenantName", - lifecycleStage: "active", - workspaceId: "workspaceId", - lastVersion: 1, - activeVersion: 1, - applicationSetId: "applicationSetId", - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - recommendations: [{ - recommendationData: { - "key": "value" + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + id: "id", + fqn: "fqn", + name: "name", + type: "async-service", + createdBySubject: { subjectId: "subjectId", subjectType: "user" }, + tenantName: "tenantName", + lifecycleStage: "active", + workspaceId: "workspaceId", + lastVersion: 1, + activeVersion: 1, + applicationSetId: "applicationSetId", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + recommendations: [ + { + recommendationData: { key: "value" }, + recommendationType: "recommendationType", + expiryTimestamp: "2024-01-15T09:30:00Z", + }, + ], + alerts: [ + { + name: "name", + timestamps: ["2024-01-15T09:30:00Z"], + startTime: "2024-01-15T09:30:00Z", + clusterId: "clusterId", + fingerprint: "fingerprint", + }, + ], + alertsSummary: { key: "value" }, + applicationDebugInfos: [{ applicationId: "applicationId", debugInfo: { key: "value" } }], + potentialProblems: [{ name: "name", description: "description" }], + autopilot: { key: "value" }, + workspaceFqn: "workspaceFqn", + createdBy: "createdBy", + deployment: { + manifest: { + name: "name", + image: { + type: "build", + build_source: { type: "remote", remote_uri: "remote_uri" }, + build_spec: { + type: "dockerfile", + dockerfile_path: "dockerfile_path", + build_context_path: "build_context_path", + }, + }, + ports: [{ port: 1, protocol: "TCP", expose: true }], + type: "service", + replicas: 1.1, + }, + createdBySubject: { subjectId: "subjectId", subjectType: "user" }, + deploymentBuilds: [{ name: "name", status: 20 }], }, - recommendationType: "recommendationType", - expiryTimestamp: new Date("2024-01-15T09:30:00.000Z") - }], - alerts: [{ + activeDeploymentId: "activeDeploymentId", + lastDeploymentId: "lastDeploymentId", + }, + ], + pagination: { total: 100, offset: 0, limit: 10 }, + }; + + server.mockEndpoint().get("/api/svc/v1/apps").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const expected = { + data: [ + { + id: "id", + fqn: "fqn", name: "name", - timestamps: [new Date("2024-01-15T09:30:00.000Z")], - startTime: new Date("2024-01-15T09:30:00.000Z"), - clusterId: "clusterId", - fingerprint: "fingerprint" - }], - alertsSummary: { - "key": "value" + type: "async-service", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + tenantName: "tenantName", + lifecycleStage: "active", + workspaceId: "workspaceId", + lastVersion: 1, + activeVersion: 1, + applicationSetId: "applicationSetId", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + recommendations: [ + { + recommendationData: { + key: "value", + }, + recommendationType: "recommendationType", + expiryTimestamp: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + alerts: [ + { + name: "name", + timestamps: [new Date("2024-01-15T09:30:00.000Z")], + startTime: new Date("2024-01-15T09:30:00.000Z"), + clusterId: "clusterId", + fingerprint: "fingerprint", + }, + ], + alertsSummary: { + key: "value", + }, + applicationDebugInfos: [ + { + applicationId: "applicationId", + debugInfo: { + key: "value", + }, + }, + ], + potentialProblems: [ + { + name: "name", + description: "description", + }, + ], + autopilot: { + key: "value", + }, + workspaceFqn: "workspaceFqn", + createdBy: "createdBy", + deployment: { + manifest: { + name: "name", + image: { + type: "build", + buildSource: { + type: "remote", + remoteUri: "remote_uri", + }, + buildSpec: { + type: "dockerfile", + dockerfilePath: "dockerfile_path", + buildContextPath: "build_context_path", + }, + }, + ports: [ + { + port: 1, + protocol: "TCP", + expose: true, + }, + ], + type: "service", + replicas: 1.1, + }, + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + deploymentBuilds: [ + { + name: "name", + status: 20, + }, + ], + }, + activeDeploymentId: "activeDeploymentId", + lastDeploymentId: "lastDeploymentId", + }, + ], + pagination: { + total: 100, + offset: 0, + limit: 10, }, - applicationDebugInfos: [{ - applicationId: "applicationId", - debugInfo: { - "key": "value" - } - }], - potentialProblems: [{ + }; + const page = await client.applications.list({ + limit: 10, + offset: 0, + }); + + expect(expected.data).toEqual(page.data); + }); + + test("list (2)", async () => { + const server = mockServerPool.createServer(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server.mockEndpoint().get("/api/svc/v1/apps").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.applications.list(); + }).rejects.toThrow(TrueFoundry.BadRequestError); + }); + + test("create_or_update (1)", async () => { + const server = mockServerPool.createServer(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { manifest: { key: "value" } }; + const rawResponseBody = { + data: { + id: "id", + version: 1.1, + fqn: "fqn", + applicationId: "applicationId", + manifest: { + name: "name", + image: { + type: "build", + build_source: { type: "remote", remote_uri: "remote_uri" }, + build_spec: { + type: "dockerfile", + dockerfile_path: "dockerfile_path", + build_context_path: "build_context_path", + }, + }, + artifacts_download: { + artifacts: [ + { + type: "truefoundry-artifact", + artifact_version_fqn: "artifact_version_fqn", + download_path_env_variable: "download_path_env_variable", + }, + ], + }, + resources: { + cpu_request: 1.1, + cpu_limit: 1.1, + memory_request: 1, + memory_limit: 1, + ephemeral_storage_request: 1, + ephemeral_storage_limit: 1, + }, + ports: [{ port: 1, protocol: "TCP", expose: true }], + service_account: "service_account", + mounts: [{ type: "secret", mount_path: "mount_path", secret_fqn: "secret_fqn" }], + labels: { key: "value" }, + liveness_probe: { config: { type: "http", path: "path", port: 1 } }, + readiness_probe: { config: { type: "http", path: "path", port: 1 } }, + startup_probe: { config: { type: "http", path: "path", port: 1 } }, + workspace_fqn: "workspace_fqn", + type: "service", + replicas: 1.1, + auto_shutdown: { wait_time: 1 }, + allow_interception: true, + rollout_strategy: { + type: "rolling_update", + max_unavailable_percentage: 1, + max_surge_percentage: 1, + }, + }, + application: { + id: "id", + fqn: "fqn", name: "name", - description: "description" - }], - autopilot: { - "key": "value" + type: "async-service", + lifecycleStage: "active", + workspaceId: "workspaceId", + activeVersion: 1, + applicationSetId: "applicationSetId", + }, + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + deploymentBuilds: [{ name: "name", status: 20 }], + deploymentStatuses: [{}], + currentStatusId: "currentStatusId", + currentStatus: { + id: "id", + deploymentId: "deploymentId", + status: "INITIALIZED", + state: { key: "value" }, + transition: "BUILDING", + message: "message", + retryCount: 1.1, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + }, + appliedRecommendations: [ + { + recommendationData: { key: "value" }, + recommendationType: "recommendationType", + expiryTimestamp: "2024-01-15T09:30:00Z", + }, + ], + createdBy: "createdBy", }, - workspaceFqn: "workspaceFqn", - createdBy: "createdBy", - deployment: { + }; + + server + .mockEndpoint() + .put("/api/svc/v1/apps") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.applications.createOrUpdate({ + manifest: { + key: "value", + }, + }); + expect(response).toEqual({ + data: { + id: "id", + version: 1.1, + fqn: "fqn", + applicationId: "applicationId", manifest: { name: "name", image: { type: "build", buildSource: { type: "remote", - remoteUri: "remote_uri" + remoteUri: "remote_uri", }, buildSpec: { type: "dockerfile", dockerfilePath: "dockerfile_path", - buildContextPath: "build_context_path" - } + buildContextPath: "build_context_path", + }, + }, + artifactsDownload: { + artifacts: [ + { + type: "truefoundry-artifact", + artifactVersionFqn: "artifact_version_fqn", + downloadPathEnvVariable: "download_path_env_variable", + }, + ], + }, + resources: { + cpuRequest: 1.1, + cpuLimit: 1.1, + memoryRequest: 1, + memoryLimit: 1, + ephemeralStorageRequest: 1, + ephemeralStorageLimit: 1, }, - ports: [{ + ports: [ + { port: 1, protocol: "TCP", - expose: true - }], + expose: true, + }, + ], + serviceAccount: "service_account", + mounts: [ + { + type: "secret", + mountPath: "mount_path", + secretFqn: "secret_fqn", + }, + ], + labels: { + key: "value", + }, + livenessProbe: { + config: { + type: "http", + path: "path", + port: 1, + }, + }, + readinessProbe: { + config: { + type: "http", + path: "path", + port: 1, + }, + }, + startupProbe: { + config: { + type: "http", + path: "path", + port: 1, + }, + }, + workspaceFqn: "workspace_fqn", type: "service", - replicas: 1.1 + replicas: 1.1, + autoShutdown: { + waitTime: 1, + }, + allowInterception: true, + rolloutStrategy: { + type: "rolling_update", + maxUnavailablePercentage: 1, + maxSurgePercentage: 1, + }, + }, + application: { + id: "id", + fqn: "fqn", + name: "name", + type: "async-service", + lifecycleStage: "active", + workspaceId: "workspaceId", + activeVersion: 1, + applicationSetId: "applicationSetId", }, createdBySubject: { subjectId: "subjectId", - subjectType: "user" + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", }, - deploymentBuilds: [{ + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + deploymentBuilds: [ + { name: "name", - status: 20 - }] - }, - activeDeploymentId: "activeDeploymentId", - lastDeploymentId: "lastDeploymentId" - }], - pagination: { - total: 100, - offset: 0, - limit: 10 - } -}; - const page = await client.applications.list({ - limit: 10, - offset: 0, - applicationId: "applicationId", - workspaceId: "workspaceId", - applicationName: "applicationName", - fqn: "fqn", - workspaceFqn: "workspaceFqn", - applicationType: "async-service", - nameSearchQuery: "nameSearchQuery", - environmentId: "environmentId", - clusterId: "clusterId", - applicationSetId: "applicationSetId", - paused: true, - deviceTypeFilter: "cpu", - lastDeployedBySubjects: "lastDeployedBySubjects", - lifecycleStage: "active", - isRecommendationPresentAndVisible: true -}); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - - }); - - test("list (2)", async () => { - const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - - server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/apps").respondWith() - .statusCode(400).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.applications.list() - }).rejects.toThrow(TrueFoundry.BadRequestError); - }); - - test("create_or_update (1)", async () => { - const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "key" : "value" } }; - const rawResponseBody = { "data" : { "id" : "id" , "version" : 1.1 , "fqn" : "fqn" , "applicationId" : "applicationId" , "manifest" : { "name" : "name" , "image" : { "type" : "build" , "build_source" : { "type" : "remote" , "remote_uri" : "remote_uri" } , "build_spec" : { "type" : "dockerfile" , "dockerfile_path" : "dockerfile_path" , "build_context_path" : "build_context_path" } } , "artifacts_download" : { "artifacts" : [ { "type" : "truefoundry-artifact" , "artifact_version_fqn" : "artifact_version_fqn" , "download_path_env_variable" : "download_path_env_variable" } ] } , "resources" : { "cpu_request" : 1.1 , "cpu_limit" : 1.1 , "memory_request" : 1 , "memory_limit" : 1 , "ephemeral_storage_request" : 1 , "ephemeral_storage_limit" : 1 } , "ports" : [ { "port" : 1 , "protocol" : "TCP" , "expose" : true } ] , "service_account" : "service_account" , "mounts" : [ { "type" : "secret" , "mount_path" : "mount_path" , "secret_fqn" : "secret_fqn" } ] , "labels" : { "key" : "value" } , "liveness_probe" : { "config" : { "type" : "http" , "path" : "path" , "port" : 1 } } , "readiness_probe" : { "config" : { "type" : "http" , "path" : "path" , "port" : 1 } } , "startup_probe" : { "config" : { "type" : "http" , "path" : "path" , "port" : 1 } } , "workspace_fqn" : "workspace_fqn" , "type" : "service" , "replicas" : 1.1 , "auto_shutdown" : { "wait_time" : 1 } , "allow_interception" : true , "rollout_strategy" : { "type" : "rolling_update" , "max_unavailable_percentage" : 1 , "max_surge_percentage" : 1 } } , "application" : { "id" : "id" , "fqn" : "fqn" , "name" : "name" , "type" : "async-service" , "lifecycleStage" : "active" , "workspaceId" : "workspaceId" , "activeVersion" : 1 , "applicationSetId" : "applicationSetId" } , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "deploymentBuilds" : [ { "name" : "name" , "status" : 20 } ] , "deploymentStatuses" : [ { } ] , "currentStatusId" : "currentStatusId" , "currentStatus" : { "id" : "id" , "deploymentId" : "deploymentId" , "status" : "INITIALIZED" , "state" : { "key" : "value" } , "transition" : "BUILDING" , "message" : "message" , "retryCount" : 1.1 , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" } , "appliedRecommendations" : [ { "recommendationData" : { "key" : "value" } , "recommendationType" : "recommendationType" , "expiryTimestamp" : "2024-01-15T09:30:00Z" } ] , "createdBy" : "createdBy" } }; - - server - .mockEndpoint() - .put("/api/svc/v1/apps").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.applications.createOrUpdate({ - manifest: { - "key": "value" - } -}); - expect(response).toEqual({ - data: { - id: "id", - version: 1.1, - fqn: "fqn", - applicationId: "applicationId", - manifest: { - name: "name", - image: { - type: "build", - buildSource: { - type: "remote", - remoteUri: "remote_uri" + status: 20, + }, + ], + deploymentStatuses: [{}], + currentStatusId: "currentStatusId", + currentStatus: { + id: "id", + deploymentId: "deploymentId", + status: "INITIALIZED", + state: { + key: "value", + }, + transition: "BUILDING", + message: "message", + retryCount: 1.1, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, - buildSpec: { - type: "dockerfile", - dockerfilePath: "dockerfile_path", - buildContextPath: "build_context_path" - } - }, - artifactsDownload: { - artifacts: [{ - type: "truefoundry-artifact", - artifactVersionFqn: "artifact_version_fqn", - downloadPathEnvVariable: "download_path_env_variable" - }] - }, - resources: { - cpuRequest: 1.1, - cpuLimit: 1.1, - memoryRequest: 1, - memoryLimit: 1, - ephemeralStorageRequest: 1, - ephemeralStorageLimit: 1 - }, - ports: [{ - port: 1, - protocol: "TCP", - expose: true - }], - serviceAccount: "service_account", - mounts: [{ - type: "secret", - mountPath: "mount_path", - secretFqn: "secret_fqn" - }], - labels: { - "key": "value" - }, - livenessProbe: { - config: { - type: "http", - path: "path", - port: 1 - } - }, - readinessProbe: { - config: { - type: "http", - path: "path", - port: 1 - } - }, - startupProbe: { - config: { - type: "http", - path: "path", - port: 1 - } - }, - workspaceFqn: "workspace_fqn", - type: "service", - replicas: 1.1, - autoShutdown: { - waitTime: 1 - }, - allowInterception: true, - rolloutStrategy: { - type: "rolling_update", - maxUnavailablePercentage: 1, - maxSurgePercentage: 1 - } - }, - application: { - id: "id", - fqn: "fqn", - name: "name", - type: "async-service", - lifecycleStage: "active", - workspaceId: "workspaceId", - activeVersion: 1, - applicationSetId: "applicationSetId" - }, - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - deploymentBuilds: [{ - name: "name", - status: 20 - }], - deploymentStatuses: [{}], - currentStatusId: "currentStatusId", - currentStatus: { - id: "id", - deploymentId: "deploymentId", - status: "INITIALIZED", - state: { - "key": "value" + appliedRecommendations: [ + { + recommendationData: { + key: "value", + }, + recommendationType: "recommendationType", + expiryTimestamp: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + createdBy: "createdBy", }, - transition: "BUILDING", - message: "message", - retryCount: 1.1, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z") - }, - appliedRecommendations: [{ - recommendationData: { - "key": "value" - }, - recommendationType: "recommendationType", - expiryTimestamp: new Date("2024-01-15T09:30:00.000Z") - }], - createdBy: "createdBy" - } -}); - - + }); }); - + test("create_or_update (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "manifest" : { "key" : "value" } } }; - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { manifest: { manifest: { key: "value" } } }; + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .put("/api/svc/v1/apps").jsonBody(rawRequestBody) - .respondWith() - .statusCode(400).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.applications.createOrUpdate({ - manifest: { - "manifest": { - "key": "value" - } - } -}) - }).rejects.toThrow(TrueFoundry.BadRequestError); + .put("/api/svc/v1/apps") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.applications.createOrUpdate({ + manifest: { + manifest: { + key: "value", + }, + }, + }); + }).rejects.toThrow(TrueFoundry.BadRequestError); }); - + test("create_or_update (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "manifest" : { "key" : "value" } } }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { manifest: { manifest: { key: "value" } } }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .put("/api/svc/v1/apps").jsonBody(rawRequestBody) - .respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.applications.createOrUpdate({ - manifest: { - "manifest": { - "key": "value" - } - } -}) - }).rejects.toThrow(TrueFoundry.ForbiddenError); + .put("/api/svc/v1/apps") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.applications.createOrUpdate({ + manifest: { + manifest: { + key: "value", + }, + }, + }); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("create_or_update (4)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "manifest" : { "key" : "value" } } }; - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { manifest: { manifest: { key: "value" } } }; + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .put("/api/svc/v1/apps").jsonBody(rawRequestBody) - .respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.applications.createOrUpdate({ - manifest: { - "manifest": { - "key": "value" - } - } -}) - }).rejects.toThrow(TrueFoundry.NotFoundError); + .put("/api/svc/v1/apps") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.applications.createOrUpdate({ + manifest: { + manifest: { + key: "value", + }, + }, + }); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("create_or_update (5)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "manifest" : { "key" : "value" } } }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { manifest: { manifest: { key: "value" } } }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .put("/api/svc/v1/apps").jsonBody(rawRequestBody) - .respondWith() - .statusCode(409).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.applications.createOrUpdate({ - manifest: { - "manifest": { - "key": "value" - } - } -}) - }).rejects.toThrow(TrueFoundry.ConflictError); + .put("/api/svc/v1/apps") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.applications.createOrUpdate({ + manifest: { + manifest: { + key: "value", + }, + }, + }); + }).rejects.toThrow(TrueFoundry.ConflictError); }); - + test("get (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : { "id" : "id" , "fqn" : "fqn" , "name" : "name" , "type" : "async-service" , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "tenantName" : "tenantName" , "metadata" : { "paused" : true } , "lifecycleStage" : "active" , "workspaceId" : "workspaceId" , "lastVersion" : 1 , "activeVersion" : 1 , "applicationSetId" : "applicationSetId" , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "recommendations" : [ { "recommendationData" : { "key" : "value" } , "recommendationType" : "recommendationType" , "expiryTimestamp" : "2024-01-15T09:30:00Z" } ] , "alerts" : [ { "name" : "name" , "timestamps" : [ "2024-01-15T09:30:00Z" ] , "startTime" : "2024-01-15T09:30:00Z" , "clusterId" : "clusterId" , "fingerprint" : "fingerprint" } ] , "alertsSummary" : { "key" : "value" } , "applicationDebugInfos" : [ { "applicationId" : "applicationId" , "debugInfo" : { "key" : "value" } } ] , "potentialProblems" : [ { "name" : "name" , "description" : "description" } ] , "autopilot" : { "key" : "value" } , "workspaceFqn" : "workspaceFqn" , "createdBy" : "createdBy" , "deployment" : { "id" : "id" , "version" : 1.1 , "fqn" : "fqn" , "applicationId" : "applicationId" , "manifest" : { "name" : "name" , "image" : { "type" : "build" , "build_source" : { "type" : "remote" , "remote_uri" : "remote_uri" } , "build_spec" : { "type" : "dockerfile" , "dockerfile_path" : "dockerfile_path" , "build_context_path" : "build_context_path" } } , "ports" : [ { "port" : 1 , "protocol" : "TCP" , "expose" : true } ] , "type" : "service" , "replicas" : 1.1 } , "application" : { "lifecycleStage" : "active" } , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "deploymentBuilds" : [ { "name" : "name" , "status" : 20 } ] , "deploymentStatuses" : [ { } ] , "currentStatusId" : "currentStatusId" , "appliedRecommendations" : [ { "recommendationData" : { "key" : "value" } , "recommendationType" : "recommendationType" , "expiryTimestamp" : "2024-01-15T09:30:00Z" } ] , "createdBy" : "createdBy" } , "activeDeploymentId" : "activeDeploymentId" , "lastDeploymentId" : "lastDeploymentId" } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: { + id: "id", + fqn: "fqn", + name: "name", + type: "async-service", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + tenantName: "tenantName", + metadata: { paused: true }, + lifecycleStage: "active", + workspaceId: "workspaceId", + lastVersion: 1, + activeVersion: 1, + applicationSetId: "applicationSetId", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + recommendations: [ + { + recommendationData: { key: "value" }, + recommendationType: "recommendationType", + expiryTimestamp: "2024-01-15T09:30:00Z", + }, + ], + alerts: [ + { + name: "name", + timestamps: ["2024-01-15T09:30:00Z"], + startTime: "2024-01-15T09:30:00Z", + clusterId: "clusterId", + fingerprint: "fingerprint", + }, + ], + alertsSummary: { key: "value" }, + applicationDebugInfos: [{ applicationId: "applicationId", debugInfo: { key: "value" } }], + potentialProblems: [{ name: "name", description: "description" }], + autopilot: { key: "value" }, + workspaceFqn: "workspaceFqn", + createdBy: "createdBy", + deployment: { + id: "id", + version: 1.1, + fqn: "fqn", + applicationId: "applicationId", + manifest: { + name: "name", + image: { + type: "build", + build_source: { type: "remote", remote_uri: "remote_uri" }, + build_spec: { + type: "dockerfile", + dockerfile_path: "dockerfile_path", + build_context_path: "build_context_path", + }, + }, + ports: [{ port: 1, protocol: "TCP", expose: true }], + type: "service", + replicas: 1.1, + }, + application: { lifecycleStage: "active" }, + createdBySubject: { subjectId: "subjectId", subjectType: "user" }, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + deploymentBuilds: [{ name: "name", status: 20 }], + deploymentStatuses: [{}], + currentStatusId: "currentStatusId", + appliedRecommendations: [ + { + recommendationData: { key: "value" }, + recommendationType: "recommendationType", + expiryTimestamp: "2024-01-15T09:30:00Z", + }, + ], + createdBy: "createdBy", + }, + activeDeploymentId: "activeDeploymentId", + lastDeploymentId: "lastDeploymentId", + }, + }; + server .mockEndpoint() - .get("/api/svc/v1/apps/id").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.applications.get("id"); - expect(response).toEqual({ - data: { - id: "id", - fqn: "fqn", - name: "name", - type: "async-service", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - tenantName: "tenantName", - metadata: { - paused: true - }, - lifecycleStage: "active", - workspaceId: "workspaceId", - lastVersion: 1, - activeVersion: 1, - applicationSetId: "applicationSetId", - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - recommendations: [{ - recommendationData: { - "key": "value" - }, - recommendationType: "recommendationType", - expiryTimestamp: new Date("2024-01-15T09:30:00.000Z") - }], - alerts: [{ - name: "name", - timestamps: [new Date("2024-01-15T09:30:00.000Z")], - startTime: new Date("2024-01-15T09:30:00.000Z"), - clusterId: "clusterId", - fingerprint: "fingerprint" - }], - alertsSummary: { - "key": "value" - }, - applicationDebugInfos: [{ - applicationId: "applicationId", - debugInfo: { - "key": "value" - } - }], - potentialProblems: [{ - name: "name", - description: "description" - }], - autopilot: { - "key": "value" - }, - workspaceFqn: "workspaceFqn", - createdBy: "createdBy", - deployment: { - id: "id", - version: 1.1, - fqn: "fqn", - applicationId: "applicationId", - manifest: { + .get("/api/svc/v1/apps/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.applications.get("id"); + expect(response).toEqual({ + data: { + id: "id", + fqn: "fqn", name: "name", - image: { - type: "build", - buildSource: { - type: "remote", - remoteUri: "remote_uri" + type: "async-service", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + tenantName: "tenantName", + metadata: { + paused: true, + }, + lifecycleStage: "active", + workspaceId: "workspaceId", + lastVersion: 1, + activeVersion: 1, + applicationSetId: "applicationSetId", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + recommendations: [ + { + recommendationData: { + key: "value", + }, + recommendationType: "recommendationType", + expiryTimestamp: new Date("2024-01-15T09:30:00.000Z"), }, - buildSpec: { - type: "dockerfile", - dockerfilePath: "dockerfile_path", - buildContextPath: "build_context_path" - } + ], + alerts: [ + { + name: "name", + timestamps: [new Date("2024-01-15T09:30:00.000Z")], + startTime: new Date("2024-01-15T09:30:00.000Z"), + clusterId: "clusterId", + fingerprint: "fingerprint", + }, + ], + alertsSummary: { + key: "value", }, - ports: [{ - port: 1, - protocol: "TCP", - expose: true - }], - type: "service", - replicas: 1.1 - }, - application: { - lifecycleStage: "active" - }, - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - deploymentBuilds: [{ - name: "name", - status: 20 - }], - deploymentStatuses: [{}], - currentStatusId: "currentStatusId", - appliedRecommendations: [{ - recommendationData: { - "key": "value" + applicationDebugInfos: [ + { + applicationId: "applicationId", + debugInfo: { + key: "value", + }, }, - recommendationType: "recommendationType", - expiryTimestamp: new Date("2024-01-15T09:30:00.000Z") - }], - createdBy: "createdBy" - }, - activeDeploymentId: "activeDeploymentId", - lastDeploymentId: "lastDeploymentId" - } -}); - - + ], + potentialProblems: [ + { + name: "name", + description: "description", + }, + ], + autopilot: { + key: "value", + }, + workspaceFqn: "workspaceFqn", + createdBy: "createdBy", + deployment: { + id: "id", + version: 1.1, + fqn: "fqn", + applicationId: "applicationId", + manifest: { + name: "name", + image: { + type: "build", + buildSource: { + type: "remote", + remoteUri: "remote_uri", + }, + buildSpec: { + type: "dockerfile", + dockerfilePath: "dockerfile_path", + buildContextPath: "build_context_path", + }, + }, + ports: [ + { + port: 1, + protocol: "TCP", + expose: true, + }, + ], + type: "service", + replicas: 1.1, + }, + application: { + lifecycleStage: "active", + }, + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + deploymentBuilds: [ + { + name: "name", + status: 20, + }, + ], + deploymentStatuses: [{}], + currentStatusId: "currentStatusId", + appliedRecommendations: [ + { + recommendationData: { + key: "value", + }, + recommendationType: "recommendationType", + expiryTimestamp: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + createdBy: "createdBy", + }, + activeDeploymentId: "activeDeploymentId", + lastDeploymentId: "lastDeploymentId", + }, + }); }); - + test("get (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .get("/api/svc/v1/apps/id").respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.applications.get("id") - }).rejects.toThrow(TrueFoundry.ForbiddenError); + .get("/api/svc/v1/apps/id") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.applications.get("id"); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("get (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/apps/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.applications.get("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .get("/api/svc/v1/apps/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.applications.get("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("delete (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server .mockEndpoint() - .delete("/api/svc/v1/apps/id").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.applications.delete("id"); - expect(response).toEqual({ - message: "message" -}); - - + .delete("/api/svc/v1/apps/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.applications.delete("id"); + expect(response).toEqual({ + message: "message", + }); }); - + test("delete (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .delete("/api/svc/v1/apps/id").respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.applications.delete("id") - }).rejects.toThrow(TrueFoundry.ForbiddenError); + .delete("/api/svc/v1/apps/id") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.applications.delete("id"); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("delete (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .delete("/api/svc/v1/apps/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.applications.delete("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .delete("/api/svc/v1/apps/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.applications.delete("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("redeploy (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : { "id" : "id" , "version" : 1.1 , "fqn" : "fqn" , "applicationId" : "applicationId" , "manifest" : { "name" : "name" , "image" : { "type" : "build" , "build_source" : { "type" : "remote" , "remote_uri" : "remote_uri" } , "build_spec" : { "type" : "dockerfile" , "dockerfile_path" : "dockerfile_path" , "build_context_path" : "build_context_path" } } , "artifacts_download" : { "artifacts" : [ { "type" : "truefoundry-artifact" , "artifact_version_fqn" : "artifact_version_fqn" , "download_path_env_variable" : "download_path_env_variable" } ] } , "resources" : { "cpu_request" : 1.1 , "cpu_limit" : 1.1 , "memory_request" : 1 , "memory_limit" : 1 , "ephemeral_storage_request" : 1 , "ephemeral_storage_limit" : 1 } , "ports" : [ { "port" : 1 , "protocol" : "TCP" , "expose" : true } ] , "service_account" : "service_account" , "mounts" : [ { "type" : "secret" , "mount_path" : "mount_path" , "secret_fqn" : "secret_fqn" } ] , "labels" : { "key" : "value" } , "liveness_probe" : { "config" : { "type" : "http" , "path" : "path" , "port" : 1 } } , "readiness_probe" : { "config" : { "type" : "http" , "path" : "path" , "port" : 1 } } , "startup_probe" : { "config" : { "type" : "http" , "path" : "path" , "port" : 1 } } , "workspace_fqn" : "workspace_fqn" , "type" : "service" , "replicas" : 1.1 , "auto_shutdown" : { "wait_time" : 1 } , "allow_interception" : true , "rollout_strategy" : { "type" : "rolling_update" , "max_unavailable_percentage" : 1 , "max_surge_percentage" : 1 } } , "application" : { "id" : "id" , "fqn" : "fqn" , "name" : "name" , "type" : "async-service" , "lifecycleStage" : "active" , "workspaceId" : "workspaceId" , "activeVersion" : 1 , "applicationSetId" : "applicationSetId" } , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "deploymentBuilds" : [ { "name" : "name" , "status" : 20 } ] , "deploymentStatuses" : [ { } ] , "currentStatusId" : "currentStatusId" , "currentStatus" : { "id" : "id" , "deploymentId" : "deploymentId" , "status" : "INITIALIZED" , "state" : { "key" : "value" } , "transition" : "BUILDING" , "message" : "message" , "retryCount" : 1.1 , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" } , "appliedRecommendations" : [ { "recommendationData" : { "key" : "value" } , "recommendationType" : "recommendationType" , "expiryTimestamp" : "2024-01-15T09:30:00Z" } ] , "createdBy" : "createdBy" } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: { + id: "id", + version: 1.1, + fqn: "fqn", + applicationId: "applicationId", + manifest: { + name: "name", + image: { + type: "build", + build_source: { type: "remote", remote_uri: "remote_uri" }, + build_spec: { + type: "dockerfile", + dockerfile_path: "dockerfile_path", + build_context_path: "build_context_path", + }, + }, + artifacts_download: { + artifacts: [ + { + type: "truefoundry-artifact", + artifact_version_fqn: "artifact_version_fqn", + download_path_env_variable: "download_path_env_variable", + }, + ], + }, + resources: { + cpu_request: 1.1, + cpu_limit: 1.1, + memory_request: 1, + memory_limit: 1, + ephemeral_storage_request: 1, + ephemeral_storage_limit: 1, + }, + ports: [{ port: 1, protocol: "TCP", expose: true }], + service_account: "service_account", + mounts: [{ type: "secret", mount_path: "mount_path", secret_fqn: "secret_fqn" }], + labels: { key: "value" }, + liveness_probe: { config: { type: "http", path: "path", port: 1 } }, + readiness_probe: { config: { type: "http", path: "path", port: 1 } }, + startup_probe: { config: { type: "http", path: "path", port: 1 } }, + workspace_fqn: "workspace_fqn", + type: "service", + replicas: 1.1, + auto_shutdown: { wait_time: 1 }, + allow_interception: true, + rollout_strategy: { + type: "rolling_update", + max_unavailable_percentage: 1, + max_surge_percentage: 1, + }, + }, + application: { + id: "id", + fqn: "fqn", + name: "name", + type: "async-service", + lifecycleStage: "active", + workspaceId: "workspaceId", + activeVersion: 1, + applicationSetId: "applicationSetId", + }, + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + deploymentBuilds: [{ name: "name", status: 20 }], + deploymentStatuses: [{}], + currentStatusId: "currentStatusId", + currentStatus: { + id: "id", + deploymentId: "deploymentId", + status: "INITIALIZED", + state: { key: "value" }, + transition: "BUILDING", + message: "message", + retryCount: 1.1, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + }, + appliedRecommendations: [ + { + recommendationData: { key: "value" }, + recommendationType: "recommendationType", + expiryTimestamp: "2024-01-15T09:30:00Z", + }, + ], + createdBy: "createdBy", + }, + }; + server .mockEndpoint() - .post("/api/svc/v1/apps/id/deployments/deploymentId/redeploy").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.applications.redeploy("id", "deploymentId"); - expect(response).toEqual({ - data: { - id: "id", - version: 1.1, - fqn: "fqn", - applicationId: "applicationId", - manifest: { - name: "name", - image: { - type: "build", - buildSource: { - type: "remote", - remoteUri: "remote_uri" + .post("/api/svc/v1/apps/id/deployments/deploymentId/redeploy") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.applications.redeploy("id", "deploymentId"); + expect(response).toEqual({ + data: { + id: "id", + version: 1.1, + fqn: "fqn", + applicationId: "applicationId", + manifest: { + name: "name", + image: { + type: "build", + buildSource: { + type: "remote", + remoteUri: "remote_uri", + }, + buildSpec: { + type: "dockerfile", + dockerfilePath: "dockerfile_path", + buildContextPath: "build_context_path", + }, + }, + artifactsDownload: { + artifacts: [ + { + type: "truefoundry-artifact", + artifactVersionFqn: "artifact_version_fqn", + downloadPathEnvVariable: "download_path_env_variable", + }, + ], + }, + resources: { + cpuRequest: 1.1, + cpuLimit: 1.1, + memoryRequest: 1, + memoryLimit: 1, + ephemeralStorageRequest: 1, + ephemeralStorageLimit: 1, + }, + ports: [ + { + port: 1, + protocol: "TCP", + expose: true, + }, + ], + serviceAccount: "service_account", + mounts: [ + { + type: "secret", + mountPath: "mount_path", + secretFqn: "secret_fqn", + }, + ], + labels: { + key: "value", + }, + livenessProbe: { + config: { + type: "http", + path: "path", + port: 1, + }, + }, + readinessProbe: { + config: { + type: "http", + path: "path", + port: 1, + }, + }, + startupProbe: { + config: { + type: "http", + path: "path", + port: 1, + }, + }, + workspaceFqn: "workspace_fqn", + type: "service", + replicas: 1.1, + autoShutdown: { + waitTime: 1, + }, + allowInterception: true, + rolloutStrategy: { + type: "rolling_update", + maxUnavailablePercentage: 1, + maxSurgePercentage: 1, + }, }, - buildSpec: { - type: "dockerfile", - dockerfilePath: "dockerfile_path", - buildContextPath: "build_context_path" - } - }, - artifactsDownload: { - artifacts: [{ - type: "truefoundry-artifact", - artifactVersionFqn: "artifact_version_fqn", - downloadPathEnvVariable: "download_path_env_variable" - }] - }, - resources: { - cpuRequest: 1.1, - cpuLimit: 1.1, - memoryRequest: 1, - memoryLimit: 1, - ephemeralStorageRequest: 1, - ephemeralStorageLimit: 1 - }, - ports: [{ - port: 1, - protocol: "TCP", - expose: true - }], - serviceAccount: "service_account", - mounts: [{ - type: "secret", - mountPath: "mount_path", - secretFqn: "secret_fqn" - }], - labels: { - "key": "value" - }, - livenessProbe: { - config: { - type: "http", - path: "path", - port: 1 - } - }, - readinessProbe: { - config: { - type: "http", - path: "path", - port: 1 - } - }, - startupProbe: { - config: { - type: "http", - path: "path", - port: 1 - } - }, - workspaceFqn: "workspace_fqn", - type: "service", - replicas: 1.1, - autoShutdown: { - waitTime: 1 - }, - allowInterception: true, - rolloutStrategy: { - type: "rolling_update", - maxUnavailablePercentage: 1, - maxSurgePercentage: 1 - } - }, - application: { - id: "id", - fqn: "fqn", - name: "name", - type: "async-service", - lifecycleStage: "active", - workspaceId: "workspaceId", - activeVersion: 1, - applicationSetId: "applicationSetId" - }, - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - deploymentBuilds: [{ - name: "name", - status: 20 - }], - deploymentStatuses: [{}], - currentStatusId: "currentStatusId", - currentStatus: { - id: "id", - deploymentId: "deploymentId", - status: "INITIALIZED", - state: { - "key": "value" - }, - transition: "BUILDING", - message: "message", - retryCount: 1.1, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z") - }, - appliedRecommendations: [{ - recommendationData: { - "key": "value" + application: { + id: "id", + fqn: "fqn", + name: "name", + type: "async-service", + lifecycleStage: "active", + workspaceId: "workspaceId", + activeVersion: 1, + applicationSetId: "applicationSetId", }, - recommendationType: "recommendationType", - expiryTimestamp: new Date("2024-01-15T09:30:00.000Z") - }], - createdBy: "createdBy" - } -}); - - + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + deploymentBuilds: [ + { + name: "name", + status: 20, + }, + ], + deploymentStatuses: [{}], + currentStatusId: "currentStatusId", + currentStatus: { + id: "id", + deploymentId: "deploymentId", + status: "INITIALIZED", + state: { + key: "value", + }, + transition: "BUILDING", + message: "message", + retryCount: 1.1, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + appliedRecommendations: [ + { + recommendationData: { + key: "value", + }, + recommendationType: "recommendationType", + expiryTimestamp: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + createdBy: "createdBy", + }, + }); }); - + test("redeploy (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .post("/api/svc/v1/apps/id/deployments/deploymentId/redeploy").respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.applications.redeploy("id", "deploymentId") - }).rejects.toThrow(TrueFoundry.ForbiddenError); + .post("/api/svc/v1/apps/id/deployments/deploymentId/redeploy") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.applications.redeploy("id", "deploymentId"); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("redeploy (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .post("/api/svc/v1/apps/id/deployments/deploymentId/redeploy").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.applications.redeploy("id", "deploymentId") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .post("/api/svc/v1/apps/id/deployments/deploymentId/redeploy") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.applications.redeploy("id", "deploymentId"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("scale_to_zero (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - - - server - .mockEndpoint() - .patch("/api/svc/v1/apps/id/scale-to-zero").respondWith() - .statusCode(200).build(); - - - - const response = await client.applications.scaleToZero("id"); - expect(response).toEqual(undefined); - - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().patch("/api/svc/v1/apps/id/scale-to-zero").respondWith().statusCode(200).build(); + + const response = await client.applications.scaleToZero("id"); + expect(response).toEqual(undefined); }); - + test("scale_to_zero (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .patch("/api/svc/v1/apps/id/scale-to-zero").respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.applications.scaleToZero("id") - }).rejects.toThrow(TrueFoundry.ForbiddenError); + .patch("/api/svc/v1/apps/id/scale-to-zero") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.applications.scaleToZero("id"); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("scale_to_zero (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .patch("/api/svc/v1/apps/id/scale-to-zero").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.applications.scaleToZero("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .patch("/api/svc/v1/apps/id/scale-to-zero") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.applications.scaleToZero("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("scale_to_zero (4)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .patch("/api/svc/v1/apps/id/scale-to-zero").respondWith() - .statusCode(405).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.applications.scaleToZero("id") - }).rejects.toThrow(TrueFoundry.MethodNotAllowedError); + .patch("/api/svc/v1/apps/id/scale-to-zero") + .respondWith() + .statusCode(405) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.applications.scaleToZero("id"); + }).rejects.toThrow(TrueFoundry.MethodNotAllowedError); }); - + test("scale_to_zero (5)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .patch("/api/svc/v1/apps/id/scale-to-zero").respondWith() - .statusCode(501).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.applications.scaleToZero("id") - }).rejects.toThrow(TrueFoundry.NotImplementedError); + .patch("/api/svc/v1/apps/id/scale-to-zero") + .respondWith() + .statusCode(501) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.applications.scaleToZero("id"); + }).rejects.toThrow(TrueFoundry.NotImplementedError); }); - + test("scale_to_original (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "id" : "id" , "version" : 1.1 , "fqn" : "fqn" , "applicationId" : "applicationId" , "manifest" : { "name" : "name" , "image" : { "type" : "build" , "docker_registry" : "docker_registry" , "build_source" : { "type" : "remote" , "remote_uri" : "remote_uri" } , "build_spec" : { "type" : "dockerfile" , "dockerfile_path" : "dockerfile_path" , "build_context_path" : "build_context_path" } } , "artifacts_download" : { "cache_volume" : { "storage_class" : "storage_class" , "cache_size" : 1 } , "artifacts" : [ { "type" : "truefoundry-artifact" , "artifact_version_fqn" : "artifact_version_fqn" , "download_path_env_variable" : "download_path_env_variable" } ] } , "resources" : { "cpu_request" : 1.1 , "cpu_limit" : 1.1 , "memory_request" : 1 , "memory_limit" : 1 , "ephemeral_storage_request" : 1 , "ephemeral_storage_limit" : 1 , "shared_memory_size" : 1 , "node" : { "type" : "node_selector" } , "devices" : [ { "type" : "nvidia_gpu" , "count" : 1 } ] } , "env" : { "key" : "value" } , "ports" : [ { "port" : 1 , "protocol" : "TCP" , "expose" : true } ] , "service_account" : "service_account" , "mounts" : [ { "type" : "secret" , "mount_path" : "mount_path" , "secret_fqn" : "secret_fqn" } ] , "labels" : { "key" : "value" } , "kustomize" : { "patch" : { "key" : "value" } , "additions" : [ { "key" : "value" } ] } , "liveness_probe" : { "config" : { "type" : "http" , "path" : "path" , "port" : 1 } , "initial_delay_seconds" : 1 , "period_seconds" : 1 , "timeout_seconds" : 1 , "success_threshold" : 1 , "failure_threshold" : 1 } , "readiness_probe" : { "config" : { "type" : "http" , "path" : "path" , "port" : 1 } , "initial_delay_seconds" : 1 , "period_seconds" : 1 , "timeout_seconds" : 1 , "success_threshold" : 1 , "failure_threshold" : 1 } , "startup_probe" : { "config" : { "type" : "http" , "path" : "path" , "port" : 1 } , "initial_delay_seconds" : 1 , "period_seconds" : 1 , "timeout_seconds" : 1 , "success_threshold" : 1 , "failure_threshold" : 1 } , "workspace_fqn" : "workspace_fqn" , "type" : "service" , "replicas" : 1.1 , "auto_shutdown" : { "wait_time" : 1 } , "allow_interception" : true , "rollout_strategy" : { "type" : "rolling_update" , "max_unavailable_percentage" : 1 , "max_surge_percentage" : 1 } } , "application" : { "id" : "id" , "fqn" : "fqn" , "name" : "name" , "type" : "async-service" , "metadata" : { "paused" : true } , "lifecycleStage" : "active" , "workspaceId" : "workspaceId" , "activeVersion" : 1 , "applicationSetId" : "applicationSetId" } , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "deploymentBuilds" : [ { "name" : "name" , "status" : 20 } ] , "deploymentStatuses" : [ { "id" : "id" , "deploymentId" : "deploymentId" , "status" : "INITIALIZED" , "state" : { "key" : "value" } , "transition" : "BUILDING" , "message" : "message" , "retryCount" : 1.1 , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" } ] , "currentStatusId" : "currentStatusId" , "currentStatus" : { "id" : "id" , "deploymentId" : "deploymentId" , "status" : "INITIALIZED" , "state" : { "key" : "value" } , "transition" : "BUILDING" , "message" : "message" , "retryCount" : 1.1 , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" } , "appliedRecommendations" : [ { "id" : "id" , "clusterId" : "clusterId" , "applicationId" : "applicationId" , "deploymentId" : "deploymentId" , "applicationVersion" : 1 , "recommendationData" : { "key" : "value" } , "recommendationType" : "recommendationType" , "appliedDeploymentId" : "appliedDeploymentId" , "expiryTimestamp" : "2024-01-15T09:30:00Z" , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" } ] , "createdBy" : "createdBy" }; - - server - .mockEndpoint() - .patch("/api/svc/v1/apps/id/scale-to-original").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.applications.scaleToOriginal("id"); - expect(response).toEqual({ - id: "id", - version: 1.1, - fqn: "fqn", - applicationId: "applicationId", - manifest: { - name: "name", - image: { - type: "build", - dockerRegistry: "docker_registry", - buildSource: { - type: "remote", - remoteUri: "remote_uri" - }, - buildSpec: { - type: "dockerfile", - dockerfilePath: "dockerfile_path", - buildContextPath: "build_context_path" - } - }, - artifactsDownload: { - cacheVolume: { - storageClass: "storage_class", - cacheSize: 1 + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + id: "id", + version: 1.1, + fqn: "fqn", + applicationId: "applicationId", + manifest: { + name: "name", + image: { + type: "build", + docker_registry: "docker_registry", + build_source: { type: "remote", remote_uri: "remote_uri" }, + build_spec: { + type: "dockerfile", + dockerfile_path: "dockerfile_path", + build_context_path: "build_context_path", + }, + }, + artifacts_download: { + cache_volume: { storage_class: "storage_class", cache_size: 1 }, + artifacts: [ + { + type: "truefoundry-artifact", + artifact_version_fqn: "artifact_version_fqn", + download_path_env_variable: "download_path_env_variable", + }, + ], + }, + resources: { + cpu_request: 1.1, + cpu_limit: 1.1, + memory_request: 1, + memory_limit: 1, + ephemeral_storage_request: 1, + ephemeral_storage_limit: 1, + shared_memory_size: 1, + node: { type: "node_selector" }, + devices: [{ type: "nvidia_gpu", count: 1 }], + }, + env: { key: "value" }, + ports: [{ port: 1, protocol: "TCP", expose: true }], + service_account: "service_account", + mounts: [{ type: "secret", mount_path: "mount_path", secret_fqn: "secret_fqn" }], + labels: { key: "value" }, + kustomize: { patch: { key: "value" }, additions: [{ key: "value" }] }, + liveness_probe: { + config: { type: "http", path: "path", port: 1 }, + initial_delay_seconds: 1, + period_seconds: 1, + timeout_seconds: 1, + success_threshold: 1, + failure_threshold: 1, + }, + readiness_probe: { + config: { type: "http", path: "path", port: 1 }, + initial_delay_seconds: 1, + period_seconds: 1, + timeout_seconds: 1, + success_threshold: 1, + failure_threshold: 1, + }, + startup_probe: { + config: { type: "http", path: "path", port: 1 }, + initial_delay_seconds: 1, + period_seconds: 1, + timeout_seconds: 1, + success_threshold: 1, + failure_threshold: 1, + }, + workspace_fqn: "workspace_fqn", + type: "service", + replicas: 1.1, + auto_shutdown: { wait_time: 1 }, + allow_interception: true, + rollout_strategy: { type: "rolling_update", max_unavailable_percentage: 1, max_surge_percentage: 1 }, }, - artifacts: [{ - type: "truefoundry-artifact", - artifactVersionFqn: "artifact_version_fqn", - downloadPathEnvVariable: "download_path_env_variable" - }] - }, - resources: { - cpuRequest: 1.1, - cpuLimit: 1.1, - memoryRequest: 1, - memoryLimit: 1, - ephemeralStorageRequest: 1, - ephemeralStorageLimit: 1, - sharedMemorySize: 1, - node: { - type: "node_selector" + application: { + id: "id", + fqn: "fqn", + name: "name", + type: "async-service", + metadata: { paused: true }, + lifecycleStage: "active", + workspaceId: "workspaceId", + activeVersion: 1, + applicationSetId: "applicationSetId", }, - devices: [{ - type: "nvidia_gpu", - count: 1 - }] - }, - env: { - "key": "value" - }, - ports: [{ - port: 1, - protocol: "TCP", - expose: true - }], - serviceAccount: "service_account", - mounts: [{ - type: "secret", - mountPath: "mount_path", - secretFqn: "secret_fqn" - }], - labels: { - "key": "value" - }, - kustomize: { - patch: { - "key": "value" + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", }, - additions: [{ - "key": "value" - }] - }, - livenessProbe: { - config: { - type: "http", - path: "path", - port: 1 + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + deploymentBuilds: [{ name: "name", status: 20 }], + deploymentStatuses: [ + { + id: "id", + deploymentId: "deploymentId", + status: "INITIALIZED", + state: { key: "value" }, + transition: "BUILDING", + message: "message", + retryCount: 1.1, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + }, + ], + currentStatusId: "currentStatusId", + currentStatus: { + id: "id", + deploymentId: "deploymentId", + status: "INITIALIZED", + state: { key: "value" }, + transition: "BUILDING", + message: "message", + retryCount: 1.1, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", }, - initialDelaySeconds: 1, - periodSeconds: 1, - timeoutSeconds: 1, - successThreshold: 1, - failureThreshold: 1 - }, - readinessProbe: { - config: { - type: "http", - path: "path", - port: 1 + appliedRecommendations: [ + { + id: "id", + clusterId: "clusterId", + applicationId: "applicationId", + deploymentId: "deploymentId", + applicationVersion: 1, + recommendationData: { key: "value" }, + recommendationType: "recommendationType", + appliedDeploymentId: "appliedDeploymentId", + expiryTimestamp: "2024-01-15T09:30:00Z", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + }, + ], + createdBy: "createdBy", + }; + + server + .mockEndpoint() + .patch("/api/svc/v1/apps/id/scale-to-original") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.applications.scaleToOriginal("id"); + expect(response).toEqual({ + id: "id", + version: 1.1, + fqn: "fqn", + applicationId: "applicationId", + manifest: { + name: "name", + image: { + type: "build", + dockerRegistry: "docker_registry", + buildSource: { + type: "remote", + remoteUri: "remote_uri", + }, + buildSpec: { + type: "dockerfile", + dockerfilePath: "dockerfile_path", + buildContextPath: "build_context_path", + }, + }, + artifactsDownload: { + cacheVolume: { + storageClass: "storage_class", + cacheSize: 1, + }, + artifacts: [ + { + type: "truefoundry-artifact", + artifactVersionFqn: "artifact_version_fqn", + downloadPathEnvVariable: "download_path_env_variable", + }, + ], + }, + resources: { + cpuRequest: 1.1, + cpuLimit: 1.1, + memoryRequest: 1, + memoryLimit: 1, + ephemeralStorageRequest: 1, + ephemeralStorageLimit: 1, + sharedMemorySize: 1, + node: { + type: "node_selector", + }, + devices: [ + { + type: "nvidia_gpu", + count: 1, + }, + ], + }, + env: { + key: "value", + }, + ports: [ + { + port: 1, + protocol: "TCP", + expose: true, + }, + ], + serviceAccount: "service_account", + mounts: [ + { + type: "secret", + mountPath: "mount_path", + secretFqn: "secret_fqn", + }, + ], + labels: { + key: "value", + }, + kustomize: { + patch: { + key: "value", + }, + additions: [ + { + key: "value", + }, + ], + }, + livenessProbe: { + config: { + type: "http", + path: "path", + port: 1, + }, + initialDelaySeconds: 1, + periodSeconds: 1, + timeoutSeconds: 1, + successThreshold: 1, + failureThreshold: 1, + }, + readinessProbe: { + config: { + type: "http", + path: "path", + port: 1, + }, + initialDelaySeconds: 1, + periodSeconds: 1, + timeoutSeconds: 1, + successThreshold: 1, + failureThreshold: 1, + }, + startupProbe: { + config: { + type: "http", + path: "path", + port: 1, + }, + initialDelaySeconds: 1, + periodSeconds: 1, + timeoutSeconds: 1, + successThreshold: 1, + failureThreshold: 1, + }, + workspaceFqn: "workspace_fqn", + type: "service", + replicas: 1.1, + autoShutdown: { + waitTime: 1, + }, + allowInterception: true, + rolloutStrategy: { + type: "rolling_update", + maxUnavailablePercentage: 1, + maxSurgePercentage: 1, + }, }, - initialDelaySeconds: 1, - periodSeconds: 1, - timeoutSeconds: 1, - successThreshold: 1, - failureThreshold: 1 - }, - startupProbe: { - config: { - type: "http", - path: "path", - port: 1 + application: { + id: "id", + fqn: "fqn", + name: "name", + type: "async-service", + metadata: { + paused: true, + }, + lifecycleStage: "active", + workspaceId: "workspaceId", + activeVersion: 1, + applicationSetId: "applicationSetId", }, - initialDelaySeconds: 1, - periodSeconds: 1, - timeoutSeconds: 1, - successThreshold: 1, - failureThreshold: 1 - }, - workspaceFqn: "workspace_fqn", - type: "service", - replicas: 1.1, - autoShutdown: { - waitTime: 1 - }, - allowInterception: true, - rolloutStrategy: { - type: "rolling_update", - maxUnavailablePercentage: 1, - maxSurgePercentage: 1 - } - }, - application: { - id: "id", - fqn: "fqn", - name: "name", - type: "async-service", - metadata: { - paused: true - }, - lifecycleStage: "active", - workspaceId: "workspaceId", - activeVersion: 1, - applicationSetId: "applicationSetId" - }, - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - deploymentBuilds: [{ - name: "name", - status: 20 - }], - deploymentStatuses: [{ - id: "id", - deploymentId: "deploymentId", - status: "INITIALIZED", - state: { - "key": "value" + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", }, - transition: "BUILDING", - message: "message", - retryCount: 1.1, createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z") - }], - currentStatusId: "currentStatusId", - currentStatus: { - id: "id", - deploymentId: "deploymentId", - status: "INITIALIZED", - state: { - "key": "value" - }, - transition: "BUILDING", - message: "message", - retryCount: 1.1, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z") - }, - appliedRecommendations: [{ - id: "id", - clusterId: "clusterId", - applicationId: "applicationId", - deploymentId: "deploymentId", - applicationVersion: 1, - recommendationData: { - "key": "value" + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + deploymentBuilds: [ + { + name: "name", + status: 20, + }, + ], + deploymentStatuses: [ + { + id: "id", + deploymentId: "deploymentId", + status: "INITIALIZED", + state: { + key: "value", + }, + transition: "BUILDING", + message: "message", + retryCount: 1.1, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + currentStatusId: "currentStatusId", + currentStatus: { + id: "id", + deploymentId: "deploymentId", + status: "INITIALIZED", + state: { + key: "value", + }, + transition: "BUILDING", + message: "message", + retryCount: 1.1, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, - recommendationType: "recommendationType", - appliedDeploymentId: "appliedDeploymentId", - expiryTimestamp: new Date("2024-01-15T09:30:00.000Z"), - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z") - }], - createdBy: "createdBy" -}); - - + appliedRecommendations: [ + { + id: "id", + clusterId: "clusterId", + applicationId: "applicationId", + deploymentId: "deploymentId", + applicationVersion: 1, + recommendationData: { + key: "value", + }, + recommendationType: "recommendationType", + appliedDeploymentId: "appliedDeploymentId", + expiryTimestamp: new Date("2024-01-15T09:30:00.000Z"), + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + createdBy: "createdBy", + }); }); - + test("scale_to_original (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .patch("/api/svc/v1/apps/id/scale-to-original").respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.applications.scaleToOriginal("id") - }).rejects.toThrow(TrueFoundry.ForbiddenError); + .patch("/api/svc/v1/apps/id/scale-to-original") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.applications.scaleToOriginal("id"); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("scale_to_original (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .patch("/api/svc/v1/apps/id/scale-to-original").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.applications.scaleToOriginal("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .patch("/api/svc/v1/apps/id/scale-to-original") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.applications.scaleToOriginal("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("scale_to_original (4)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .patch("/api/svc/v1/apps/id/scale-to-original").respondWith() - .statusCode(501).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.applications.scaleToOriginal("id") - }).rejects.toThrow(TrueFoundry.NotImplementedError); + .patch("/api/svc/v1/apps/id/scale-to-original") + .respondWith() + .statusCode(501) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.applications.scaleToOriginal("id"); + }).rejects.toThrow(TrueFoundry.NotImplementedError); }); - + test("cancel_deployment (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server .mockEndpoint() - .post("/api/svc/v1/apps/id/deployments/deploymentId/cancel").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.applications.cancelDeployment("id", "deploymentId"); - expect(response).toEqual({ - message: "message" -}); - - + .post("/api/svc/v1/apps/id/deployments/deploymentId/cancel") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.applications.cancelDeployment("id", "deploymentId"); + expect(response).toEqual({ + message: "message", + }); }); - + test("cancel_deployment (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .post("/api/svc/v1/apps/id/deployments/deploymentId/cancel").respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.applications.cancelDeployment("id", "deploymentId") - }).rejects.toThrow(TrueFoundry.ForbiddenError); + .post("/api/svc/v1/apps/id/deployments/deploymentId/cancel") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.applications.cancelDeployment("id", "deploymentId"); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("cancel_deployment (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .post("/api/svc/v1/apps/id/deployments/deploymentId/cancel").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.applications.cancelDeployment("id", "deploymentId") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .post("/api/svc/v1/apps/id/deployments/deploymentId/cancel") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.applications.cancelDeployment("id", "deploymentId"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("cancel_deployment (4)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .post("/api/svc/v1/apps/id/deployments/deploymentId/cancel").respondWith() - .statusCode(409).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.applications.cancelDeployment("id", "deploymentId") - }).rejects.toThrow(TrueFoundry.ConflictError); + .post("/api/svc/v1/apps/id/deployments/deploymentId/cancel") + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.applications.cancelDeployment("id", "deploymentId"); + }).rejects.toThrow(TrueFoundry.ConflictError); }); - }); diff --git a/tests/wire/artifactVersions.test.ts b/tests/wire/artifactVersions.test.ts index c1b3eaf4..e62ddb58 100644 --- a/tests/wire/artifactVersions.test.ts +++ b/tests/wire/artifactVersions.test.ts @@ -5,379 +5,434 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("ArtifactVersionsClient", () => { - test("list", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "created_at" : "2024-01-15T09:30:00Z" , "updated_at" : "2024-01-15T09:30:00Z" , "manifest" : { "metadata" : { "key" : "value" } , "type" : "artifact-version" , "source" : { "type" : "truefoundry" } , "step" : 1 } , "id" : "jqfwg345gi25n5ju2yz5iz6m" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "ml_repo_id" : "ml_repo_id" , "usage_code_snippet" : "usage_code_snippet" , "tags" : [ "tags" ] , "artifact_id" : "artifact_id" } ] , "pagination" : { "total" : 100 , "offset" : 0 , "limit" : 10 } }; - - server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/artifact-versions").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const expected = { - data: [{ - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - manifest: { - metadata: { - "key": "value" + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + manifest: { + metadata: { key: "value" }, + type: "artifact-version", + source: { type: "truefoundry" }, + step: 1, + }, + id: "jqfwg345gi25n5ju2yz5iz6m", + fqn: "fqn", + created_by_subject: { subjectId: "subjectId", subjectType: "user" }, + ml_repo_id: "ml_repo_id", + usage_code_snippet: "usage_code_snippet", + tags: ["tags"], + artifact_id: "artifact_id", }, - type: "artifact-version", - source: { - type: "truefoundry" + ], + pagination: { total: 100, offset: 0, limit: 10 }, + }; + + server + .mockEndpoint() + .get("/api/svc/v1/artifact-versions") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + data: [ + { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + manifest: { + metadata: { + key: "value", + }, + type: "artifact-version", + source: { + type: "truefoundry", + }, + step: 1, + }, + id: "jqfwg345gi25n5ju2yz5iz6m", + fqn: "fqn", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + mlRepoId: "ml_repo_id", + usageCodeSnippet: "usage_code_snippet", + tags: ["tags"], + artifactId: "artifact_id", }, - step: 1 + ], + pagination: { + total: 100, + offset: 0, + limit: 10, }, - id: "jqfwg345gi25n5ju2yz5iz6m", - fqn: "fqn", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" - }, - mlRepoId: "ml_repo_id", - usageCodeSnippet: "usage_code_snippet", - tags: ["tags"], - artifactId: "artifact_id" - }], - pagination: { - total: 100, - offset: 0, - limit: 10 - } -}; - const page = await client.artifactVersions.list({ - limit: 10, - offset: 0, - tag: "tag", - fqn: "fqn", - artifactId: "artifact_id", - mlRepoId: "ml_repo_id", - name: "name", - version: 1, - runIds: ["run_ids"], - runSteps: [1.1], - includeInternalMetadata: true -}); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - + }; + const page = await client.artifactVersions.list({ + limit: 10, + offset: 0, + }); + + expect(expected.data).toEqual(page.data); }); - + test("apply_tags", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "artifact_version_id" : "artifact_version_id" , "tags" : [ "tags" ] }; - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { artifact_version_id: "artifact_version_id", tags: ["tags"] }; + const rawResponseBody = {}; + server .mockEndpoint() - .put("/api/svc/v1/artifact-versions/tags").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.artifactVersions.applyTags({ - artifactVersionId: "artifact_version_id", - tags: ["tags"] -}); - expect(response).toEqual({}); - - + .put("/api/svc/v1/artifact-versions/tags") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.artifactVersions.applyTags({ + artifactVersionId: "artifact_version_id", + tags: ["tags"], + }); + expect(response).toEqual({}); }); - + test("get_signed_urls", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "id" : "id" , "paths" : [ "paths" ] , "operation" : "READ" }; - const rawResponseBody = { "data" : [ { "path" : "path" , "signed_url" : "signed_url" } ] }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { id: "id", paths: ["paths"], operation: "READ" }; + const rawResponseBody = { data: [{ path: "path", signed_url: "signed_url" }] }; + server .mockEndpoint() - .post("/api/svc/v1/artifact-versions/signed-urls").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.artifactVersions.getSignedUrls({ - id: "id", - paths: ["paths"], - operation: "READ" -}); - expect(response).toEqual({ - data: [{ - path: "path", - signedUrl: "signed_url" - }] -}); - - + .post("/api/svc/v1/artifact-versions/signed-urls") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.artifactVersions.getSignedUrls({ + id: "id", + paths: ["paths"], + operation: "READ", + }); + expect(response).toEqual({ + data: [ + { + path: "path", + signedUrl: "signed_url", + }, + ], + }); }); - + test("create_multi_part_upload", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "id" : "id" , "path" : "path" , "num_parts" : 1.1 }; - const rawResponseBody = { "data" : { "storage_provider" : "S3_COMPATIBLE" , "part_signed_urls" : [ { "path" : "path" , "signed_url" : "signed_url" } ] , "finalize_signed_url" : { "path" : "path" , "signed_url" : "signed_url" } , "s3_compatible_upload_id" : "s3_compatible_upload_id" , "azure_blob_block_ids" : [ "azure_blob_block_ids" ] } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { id: "id", path: "path", num_parts: 1.1 }; + const rawResponseBody = { + data: { + storage_provider: "S3_COMPATIBLE", + part_signed_urls: [{ path: "path", signed_url: "signed_url" }], + finalize_signed_url: { path: "path", signed_url: "signed_url" }, + s3_compatible_upload_id: "s3_compatible_upload_id", + azure_blob_block_ids: ["azure_blob_block_ids"], + }, + }; + server .mockEndpoint() - .post("/api/svc/v1/artifact-versions/signed-urls/multipart").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.artifactVersions.createMultiPartUpload({ - id: "id", - path: "path", - numParts: 1.1 -}); - expect(response).toEqual({ - data: { - storageProvider: "S3_COMPATIBLE", - partSignedUrls: [{ - path: "path", - signedUrl: "signed_url" - }], - finalizeSignedUrl: { + .post("/api/svc/v1/artifact-versions/signed-urls/multipart") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.artifactVersions.createMultiPartUpload({ + id: "id", path: "path", - signedUrl: "signed_url" - }, - s3CompatibleUploadId: "s3_compatible_upload_id", - azureBlobBlockIds: ["azure_blob_block_ids"] - } -}); - - + numParts: 1.1, + }); + expect(response).toEqual({ + data: { + storageProvider: "S3_COMPATIBLE", + partSignedUrls: [ + { + path: "path", + signedUrl: "signed_url", + }, + ], + finalizeSignedUrl: { + path: "path", + signedUrl: "signed_url", + }, + s3CompatibleUploadId: "s3_compatible_upload_id", + azureBlobBlockIds: ["azure_blob_block_ids"], + }, + }); }); - + test("list_files", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "id" : "id" }; - const rawResponseBody = { "data" : [ { "path" : "path" , "is_dir" : true , "file_size" : 1.1 , "signed_url" : "signed_url" , "last_modified" : "2024-01-15T09:30:00Z" } ] , "pagination" : { "limit" : 10 , "nextPageToken" : "nextPageToken" , "previousPageToken" : "previousPageToken" } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { id: "id" }; + const rawResponseBody = { + data: [ + { + path: "path", + is_dir: true, + file_size: 1.1, + signed_url: "signed_url", + last_modified: "2024-01-15T09:30:00Z", + }, + ], + pagination: { limit: 10, nextPageToken: "nextPageToken", previousPageToken: "previousPageToken" }, + }; + server .mockEndpoint({ once: false }) - .post("/api/svc/v1/artifact-versions/files").jsonBody(rawRequestBody, { ignoredFields: [ "pageToken" ] }) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const expected = { - data: [{ - path: "path", - isDir: true, - fileSize: 1.1, - signedUrl: "signed_url", - lastModified: new Date("2024-01-15T09:30:00.000Z") - }], - pagination: { - limit: 10, - nextPageToken: "nextPageToken", - previousPageToken: "previousPageToken" - } -}; - const page = await client.artifactVersions.listFiles({ - id: "id" -}); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - + .post("/api/svc/v1/artifact-versions/files") + .jsonBody(rawRequestBody, { ignoredFields: ["pageToken"] }) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + data: [ + { + path: "path", + isDir: true, + fileSize: 1.1, + signedUrl: "signed_url", + lastModified: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + pagination: { + limit: 10, + nextPageToken: "nextPageToken", + previousPageToken: "previousPageToken", + }, + }; + const page = await client.artifactVersions.listFiles({ + id: "id", + }); + + expect(expected.data).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.data).toEqual(nextPage.data); }); - + test("stage", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "metadata" : { "key" : "value" } , "type" : "artifact-version" , "source" : { "type" : "truefoundry" } , "step" : 1 } }; - const rawResponseBody = { "id" : "id" , "storage_root" : "storage_root" , "artifact_id" : "artifact_id" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + metadata: { key: "value" }, + type: "artifact-version", + source: { type: "truefoundry" }, + step: 1, + }, + }; + const rawResponseBody = { id: "id", storage_root: "storage_root", artifact_id: "artifact_id" }; + server .mockEndpoint() - .post("/api/svc/v1/artifact-versions/stage").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.artifactVersions.stage({ - manifest: { - metadata: { - "key": "value" - }, - type: "artifact-version", - source: { - type: "truefoundry" - }, - step: 1 - } -}); - expect(response).toEqual({ - id: "id", - storageRoot: "storage_root", - artifactId: "artifact_id" -}); - - + .post("/api/svc/v1/artifact-versions/stage") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.artifactVersions.stage({ + manifest: { + metadata: { + key: "value", + }, + type: "artifact-version", + source: { + type: "truefoundry", + }, + step: 1, + }, + }); + expect(response).toEqual({ + id: "id", + storageRoot: "storage_root", + artifactId: "artifact_id", + }); }); - + test("mark_stage_failure", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "id" : "id" }; - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { id: "id" }; + const rawResponseBody = {}; + server .mockEndpoint() - .post("/api/svc/v1/artifact-versions/mark-stage-failure").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.artifactVersions.markStageFailure({ - id: "id" -}); - expect(response).toEqual({}); - - + .post("/api/svc/v1/artifact-versions/mark-stage-failure") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.artifactVersions.markStageFailure({ + id: "id", + }); + expect(response).toEqual({}); }); - + test("get (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : { "created_at" : "2024-01-15T09:30:00Z" , "updated_at" : "2024-01-15T09:30:00Z" , "manifest" : { "name" : "name" , "metadata" : { "key" : "value" } , "ml_repo" : "ml_repo" , "version" : 1 , "type" : "artifact-version" , "description" : "description" , "version_alias" : "version_alias" , "source" : { "type" : "truefoundry" } , "step" : 1 , "run_id" : "run_id" } , "id" : "jqfwg345gi25n5ju2yz5iz6m" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "ml_repo_id" : "ml_repo_id" , "usage_code_snippet" : "usage_code_snippet" , "tags" : [ "tags" ] , "artifact_id" : "artifact_id" } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: { + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + manifest: { + name: "name", + metadata: { key: "value" }, + ml_repo: "ml_repo", + version: 1, + type: "artifact-version", + description: "description", + version_alias: "version_alias", + source: { type: "truefoundry" }, + step: 1, + run_id: "run_id", + }, + id: "jqfwg345gi25n5ju2yz5iz6m", + fqn: "fqn", + created_by_subject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + ml_repo_id: "ml_repo_id", + usage_code_snippet: "usage_code_snippet", + tags: ["tags"], + artifact_id: "artifact_id", + }, + }; + server .mockEndpoint() - .get("/api/svc/v1/artifact-versions/id").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.artifactVersions.get("id"); - expect(response).toEqual({ - data: { - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - manifest: { - name: "name", - metadata: { - "key": "value" - }, - mlRepo: "ml_repo", - version: 1, - type: "artifact-version", - description: "description", - versionAlias: "version_alias", - source: { - type: "truefoundry" + .get("/api/svc/v1/artifact-versions/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.artifactVersions.get("id"); + expect(response).toEqual({ + data: { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + manifest: { + name: "name", + metadata: { + key: "value", + }, + mlRepo: "ml_repo", + version: 1, + type: "artifact-version", + description: "description", + versionAlias: "version_alias", + source: { + type: "truefoundry", + }, + step: 1, + runId: "run_id", + }, + id: "jqfwg345gi25n5ju2yz5iz6m", + fqn: "fqn", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + mlRepoId: "ml_repo_id", + usageCodeSnippet: "usage_code_snippet", + tags: ["tags"], + artifactId: "artifact_id", }, - step: 1, - runId: "run_id" - }, - id: "jqfwg345gi25n5ju2yz5iz6m", - fqn: "fqn", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - mlRepoId: "ml_repo_id", - usageCodeSnippet: "usage_code_snippet", - tags: ["tags"], - artifactId: "artifact_id" - } -}); - - + }); }); - + test("get (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/artifact-versions/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.artifactVersions.get("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .get("/api/svc/v1/artifact-versions/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.artifactVersions.get("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("delete (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = {}; + server .mockEndpoint() - .delete("/api/svc/v1/artifact-versions/id").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.artifactVersions.delete("id"); - expect(response).toEqual({}); - - + .delete("/api/svc/v1/artifact-versions/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.artifactVersions.delete("id"); + expect(response).toEqual({}); }); - + test("delete (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .delete("/api/svc/v1/artifact-versions/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.artifactVersions.delete("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .delete("/api/svc/v1/artifact-versions/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.artifactVersions.delete("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - }); diff --git a/tests/wire/artifacts.test.ts b/tests/wire/artifacts.test.ts index b20738e0..e2199e95 100644 --- a/tests/wire/artifacts.test.ts +++ b/tests/wire/artifacts.test.ts @@ -5,267 +5,356 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("ArtifactsClient", () => { - test("get (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "ml_repo_id" : "ml_repo_id" , "type" : "artifact" , "name" : "name" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "created_at" : "2024-01-15T09:30:00Z" , "updated_at" : "2024-01-15T09:30:00Z" , "latest_version" : { "created_at" : "2024-01-15T09:30:00Z" , "updated_at" : "2024-01-15T09:30:00Z" , "manifest" : { "metadata" : { "key" : "value" } , "type" : "artifact-version" , "source" : { "type" : "truefoundry" } , "step" : 1 } , "id" : "jqfwg345gi25n5ju2yz5iz6m" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "ml_repo_id" : "ml_repo_id" , "usage_code_snippet" : "usage_code_snippet" , "tags" : [ "tags" ] , "artifact_id" : "artifact_id" } , "run_steps" : [ 1.1 ] } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + ml_repo_id: "ml_repo_id", + type: "artifact", + name: "name", + fqn: "fqn", + created_by_subject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + latest_version: { + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + manifest: { + metadata: { key: "value" }, + type: "artifact-version", + source: { type: "truefoundry" }, + step: 1, + }, + id: "jqfwg345gi25n5ju2yz5iz6m", + fqn: "fqn", + created_by_subject: { subjectId: "subjectId", subjectType: "user" }, + ml_repo_id: "ml_repo_id", + usage_code_snippet: "usage_code_snippet", + tags: ["tags"], + artifact_id: "artifact_id", + }, + run_steps: [1.1], + }, + }; + server .mockEndpoint() - .get("/api/svc/v1/artifacts/jqfwg345gi25n5ju2yz5iz6m").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .get("/api/svc/v1/artifacts/jqfwg345gi25n5ju2yz5iz6m") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.artifacts.get("jqfwg345gi25n5ju2yz5iz6m"); - expect(response).toEqual({ - data: { - id: "jqfwg345gi25n5ju2yz5iz6m", - mlRepoId: "ml_repo_id", - type: "artifact", - name: "name", - fqn: "fqn", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - latestVersion: { - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - manifest: { - metadata: { - "key": "value" + const response = await client.artifacts.get("jqfwg345gi25n5ju2yz5iz6m"); + expect(response).toEqual({ + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + mlRepoId: "ml_repo_id", + type: "artifact", + name: "name", + fqn: "fqn", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", }, - type: "artifact-version", - source: { - type: "truefoundry" + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + latestVersion: { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + manifest: { + metadata: { + key: "value", + }, + type: "artifact-version", + source: { + type: "truefoundry", + }, + step: 1, + }, + id: "jqfwg345gi25n5ju2yz5iz6m", + fqn: "fqn", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + mlRepoId: "ml_repo_id", + usageCodeSnippet: "usage_code_snippet", + tags: ["tags"], + artifactId: "artifact_id", }, - step: 1 + runSteps: [1.1], }, - id: "jqfwg345gi25n5ju2yz5iz6m", - fqn: "fqn", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" - }, - mlRepoId: "ml_repo_id", - usageCodeSnippet: "usage_code_snippet", - tags: ["tags"], - artifactId: "artifact_id" - }, - runSteps: [1.1] - } -}); - - + }); }); - + test("get (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/artifacts/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); + .get("/api/svc/v1/artifacts/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.artifacts.get("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + await expect(async () => { + return await client.artifacts.get("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("delete (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = {}; + server .mockEndpoint() - .delete("/api/svc/v1/artifacts/jqfwg345gi25n5ju2yz5iz6m").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .delete("/api/svc/v1/artifacts/jqfwg345gi25n5ju2yz5iz6m") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.artifacts.delete("jqfwg345gi25n5ju2yz5iz6m"); - expect(response).toEqual({}); - - + const response = await client.artifacts.delete("jqfwg345gi25n5ju2yz5iz6m"); + expect(response).toEqual({}); }); - + test("delete (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .delete("/api/svc/v1/artifacts/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); + .delete("/api/svc/v1/artifacts/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.artifacts.delete("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + await expect(async () => { + return await client.artifacts.delete("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("list", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "ml_repo_id" : "ml_repo_id" , "type" : "artifact" , "name" : "name" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "created_at" : "2024-01-15T09:30:00Z" , "updated_at" : "2024-01-15T09:30:00Z" , "latest_version" : { "manifest" : { "metadata" : { "key" : "value" } , "type" : "artifact-version" , "source" : { "type" : "truefoundry" } , "step" : 1 } , "id" : "jqfwg345gi25n5ju2yz5iz6m" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "ml_repo_id" : "ml_repo_id" , "artifact_id" : "artifact_id" } , "run_steps" : [ 1.1 ] } ] , "pagination" : { "total" : 100 , "offset" : 0 , "limit" : 10 } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + id: "jqfwg345gi25n5ju2yz5iz6m", + ml_repo_id: "ml_repo_id", + type: "artifact", + name: "name", + fqn: "fqn", + created_by_subject: { subjectId: "subjectId", subjectType: "user" }, + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + latest_version: { + manifest: { + metadata: { key: "value" }, + type: "artifact-version", + source: { type: "truefoundry" }, + step: 1, + }, + id: "jqfwg345gi25n5ju2yz5iz6m", + fqn: "fqn", + created_by_subject: { subjectId: "subjectId", subjectType: "user" }, + ml_repo_id: "ml_repo_id", + artifact_id: "artifact_id", + }, + run_steps: [1.1], + }, + ], + pagination: { total: 100, offset: 0, limit: 10 }, + }; + + server + .mockEndpoint() + .get("/api/svc/v1/artifacts") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + data: [ + { + id: "jqfwg345gi25n5ju2yz5iz6m", + mlRepoId: "ml_repo_id", + type: "artifact", + name: "name", + fqn: "fqn", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + latestVersion: { + manifest: { + metadata: { + key: "value", + }, + type: "artifact-version", + source: { + type: "truefoundry", + }, + step: 1, + }, + id: "jqfwg345gi25n5ju2yz5iz6m", + fqn: "fqn", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + mlRepoId: "ml_repo_id", + artifactId: "artifact_id", + }, + runSteps: [1.1], + }, + ], + pagination: { + total: 100, + offset: 0, + limit: 10, + }, + }; + const page = await client.artifacts.list({ + limit: 10, + offset: 0, + }); + + expect(expected.data).toEqual(page.data); + }); + + test("create_or_update", async () => { + const server = mockServerPool.createServer(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + metadata: { key: "value" }, + type: "artifact-version", + source: { type: "truefoundry" }, + step: 1, + }, + }; + const rawResponseBody = { + data: { + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + manifest: { + name: "name", + metadata: { key: "value" }, + ml_repo: "ml_repo", + version: 1, + type: "artifact-version", + description: "description", + version_alias: "version_alias", + source: { type: "truefoundry" }, + step: 1, + run_id: "run_id", + }, + id: "jqfwg345gi25n5ju2yz5iz6m", + fqn: "fqn", + created_by_subject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + ml_repo_id: "ml_repo_id", + usage_code_snippet: "usage_code_snippet", + tags: ["tags"], + artifact_id: "artifact_id", + }, + }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/artifacts").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .mockEndpoint() + .put("/api/svc/v1/artifact-versions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const expected = { - data: [{ - id: "jqfwg345gi25n5ju2yz5iz6m", - mlRepoId: "ml_repo_id", - type: "artifact", - name: "name", - fqn: "fqn", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" + const response = await client.artifacts.createOrUpdate({ + manifest: { + metadata: { + key: "value", + }, + type: "artifact-version", + source: { + type: "truefoundry", + }, + step: 1, }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - latestVersion: { + }); + expect(response).toEqual({ + data: { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), manifest: { + name: "name", metadata: { - "key": "value" + key: "value", }, + mlRepo: "ml_repo", + version: 1, type: "artifact-version", + description: "description", + versionAlias: "version_alias", source: { - type: "truefoundry" + type: "truefoundry", }, - step: 1 + step: 1, + runId: "run_id", }, id: "jqfwg345gi25n5ju2yz5iz6m", fqn: "fqn", createdBySubject: { subjectId: "subjectId", - subjectType: "user" + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", }, mlRepoId: "ml_repo_id", - artifactId: "artifact_id" + usageCodeSnippet: "usage_code_snippet", + tags: ["tags"], + artifactId: "artifact_id", }, - runSteps: [1.1] - }], - pagination: { - total: 100, - offset: 0, - limit: 10 - } -}; - const page = await client.artifacts.list({ - limit: 10, - offset: 0, - fqn: "fqn", - mlRepoId: "ml_repo_id", - name: "name", - runId: "run_id", - includeEmptyArtifacts: true -}); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - - }); - - test("create_or_update", async () => { - const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "metadata" : { "key" : "value" } , "type" : "artifact-version" , "source" : { "type" : "truefoundry" } , "step" : 1 } }; - const rawResponseBody = { "data" : { "created_at" : "2024-01-15T09:30:00Z" , "updated_at" : "2024-01-15T09:30:00Z" , "manifest" : { "name" : "name" , "metadata" : { "key" : "value" } , "ml_repo" : "ml_repo" , "version" : 1 , "type" : "artifact-version" , "description" : "description" , "version_alias" : "version_alias" , "source" : { "type" : "truefoundry" } , "step" : 1 , "run_id" : "run_id" } , "id" : "jqfwg345gi25n5ju2yz5iz6m" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "ml_repo_id" : "ml_repo_id" , "usage_code_snippet" : "usage_code_snippet" , "tags" : [ "tags" ] , "artifact_id" : "artifact_id" } }; - - server - .mockEndpoint() - .put("/api/svc/v1/artifact-versions").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.artifacts.createOrUpdate({ - manifest: { - metadata: { - "key": "value" - }, - type: "artifact-version", - source: { - type: "truefoundry" - }, - step: 1 - } -}); - expect(response).toEqual({ - data: { - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - manifest: { - name: "name", - metadata: { - "key": "value" - }, - mlRepo: "ml_repo", - version: 1, - type: "artifact-version", - description: "description", - versionAlias: "version_alias", - source: { - type: "truefoundry" - }, - step: 1, - runId: "run_id" - }, - id: "jqfwg345gi25n5ju2yz5iz6m", - fqn: "fqn", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - mlRepoId: "ml_repo_id", - usageCodeSnippet: "usage_code_snippet", - tags: ["tags"], - artifactId: "artifact_id" - } -}); - - + }); }); - }); diff --git a/tests/wire/clusters.test.ts b/tests/wire/clusters.test.ts index 981ca6e0..59c1026a 100644 --- a/tests/wire/clusters.test.ts +++ b/tests/wire/clusters.test.ts @@ -5,566 +5,748 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("ClustersClient", () => { - test("list (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "fqn" : "fqn" , "manifest" : { "type" : "cluster" , "name" : "name" , "cluster_type" : "aws-eks" , "environment_names" : [ "environment_names" ] , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } ] } , "tenantName" : "tenantName" , "accountId" : "accountId" , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "createdBy" : "createdBy" } ] , "pagination" : { "total" : 100 , "offset" : 0 , "limit" : 10 } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + id: "jqfwg345gi25n5ju2yz5iz6m", + fqn: "fqn", + manifest: { + type: "cluster", + name: "name", + cluster_type: "aws-eks", + environment_names: ["environment_names"], + collaborators: [{ subject: "subject", role_id: "role_id" }], + }, + tenantName: "tenantName", + accountId: "accountId", + createdBySubject: { subjectId: "subjectId", subjectType: "user" }, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + createdBy: "createdBy", + }, + ], + pagination: { total: 100, offset: 0, limit: 10 }, + }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/clusters").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const expected = { - data: [{ - id: "jqfwg345gi25n5ju2yz5iz6m", - fqn: "fqn", - manifest: { - type: "cluster", - name: "name", - clusterType: "aws-eks", - environmentNames: ["environment_names"], - collaborators: [{ - subject: "subject", - roleId: "role_id" - }] - }, - tenantName: "tenantName", - accountId: "accountId", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" + .mockEndpoint() + .get("/api/svc/v1/clusters") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + data: [ + { + id: "jqfwg345gi25n5ju2yz5iz6m", + fqn: "fqn", + manifest: { + type: "cluster", + name: "name", + clusterType: "aws-eks", + environmentNames: ["environment_names"], + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + ], + }, + tenantName: "tenantName", + accountId: "accountId", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + createdBy: "createdBy", + }, + ], + pagination: { + total: 100, + offset: 0, + limit: 10, }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - createdBy: "createdBy" - }], - pagination: { - total: 100, - offset: 0, - limit: 10 - } -}; - const page = await client.clusters.list({ - limit: 10, - offset: 0, - attributes: ["attributes"] -}); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - + }; + const page = await client.clusters.list({ + limit: 10, + offset: 0, + }); + + expect(expected.data).toEqual(page.data); }); - + test("list (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/clusters").respondWith() - .statusCode(401).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.clusters.list() - }).rejects.toThrow(TrueFoundry.UnauthorizedError); + .mockEndpoint() + .get("/api/svc/v1/clusters") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.clusters.list(); + }).rejects.toThrow(TrueFoundry.UnauthorizedError); }); - + test("create_or_update (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "cluster" , "name" : "name" , "cluster_type" : "aws-eks" , "environment_names" : [ "environment_names" ] , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } ] } }; - const rawResponseBody = { "data" : { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "fqn" : "fqn" , "manifest" : { "type" : "cluster" , "name" : "name" , "cluster_type" : "aws-eks" , "environment_names" : [ "environment_names" ] , "base_domains" : [ "base_domains" ] , "default_registry_fqn" : "default_registry_fqn" , "spark_config" : { "ui_base_domain" : "ui_base_domain" } , "ingress_controller_config" : { "ingress_class_name" : "ingress_class_name" } , "cluster_integration_fqn" : "cluster_integration_fqn" , "workflow_storage_integration_fqn" : "workflow_storage_integration_fqn" , "supported_nodepools" : [ { "name" : "name" } ] , "node_label_keys" : { "nodepool_selector_label" : "nodepool_selector_label" } , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } ] , "ownedBy" : { "account" : "account" } } , "tenantName" : "tenantName" , "accountId" : "accountId" , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "createdBy" : "createdBy" } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + type: "cluster", + name: "name", + cluster_type: "aws-eks", + environment_names: ["environment_names"], + collaborators: [{ subject: "subject", role_id: "role_id" }], + }, + }; + const rawResponseBody = { + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + fqn: "fqn", + manifest: { + type: "cluster", + name: "name", + cluster_type: "aws-eks", + environment_names: ["environment_names"], + base_domains: ["base_domains"], + default_registry_fqn: "default_registry_fqn", + spark_config: { ui_base_domain: "ui_base_domain" }, + ingress_controller_config: { ingress_class_name: "ingress_class_name" }, + cluster_integration_fqn: "cluster_integration_fqn", + workflow_storage_integration_fqn: "workflow_storage_integration_fqn", + supported_nodepools: [{ name: "name" }], + node_label_keys: { nodepool_selector_label: "nodepool_selector_label" }, + collaborators: [{ subject: "subject", role_id: "role_id" }], + ownedBy: { account: "account" }, + }, + tenantName: "tenantName", + accountId: "accountId", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + createdBy: "createdBy", + }, + }; + server .mockEndpoint() - .put("/api/svc/v1/clusters").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.clusters.createOrUpdate({ - manifest: { - type: "cluster", - name: "name", - clusterType: "aws-eks", - environmentNames: ["environment_names"], - collaborators: [{ - subject: "subject", - roleId: "role_id" - }] - } -}); - expect(response).toEqual({ - data: { - id: "jqfwg345gi25n5ju2yz5iz6m", - fqn: "fqn", - manifest: { - type: "cluster", - name: "name", - clusterType: "aws-eks", - environmentNames: ["environment_names"], - baseDomains: ["base_domains"], - defaultRegistryFqn: "default_registry_fqn", - sparkConfig: { - uiBaseDomain: "ui_base_domain" - }, - ingressControllerConfig: { - ingressClassName: "ingress_class_name" + .put("/api/svc/v1/clusters") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.clusters.createOrUpdate({ + manifest: { + type: "cluster", + name: "name", + clusterType: "aws-eks", + environmentNames: ["environment_names"], + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + ], }, - clusterIntegrationFqn: "cluster_integration_fqn", - workflowStorageIntegrationFqn: "workflow_storage_integration_fqn", - supportedNodepools: [{ - name: "name" - }], - nodeLabelKeys: { - nodepoolSelectorLabel: "nodepool_selector_label" + }); + expect(response).toEqual({ + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + fqn: "fqn", + manifest: { + type: "cluster", + name: "name", + clusterType: "aws-eks", + environmentNames: ["environment_names"], + baseDomains: ["base_domains"], + defaultRegistryFqn: "default_registry_fqn", + sparkConfig: { + uiBaseDomain: "ui_base_domain", + }, + ingressControllerConfig: { + ingressClassName: "ingress_class_name", + }, + clusterIntegrationFqn: "cluster_integration_fqn", + workflowStorageIntegrationFqn: "workflow_storage_integration_fqn", + supportedNodepools: [ + { + name: "name", + }, + ], + nodeLabelKeys: { + nodepoolSelectorLabel: "nodepool_selector_label", + }, + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + ], + ownedBy: { + account: "account", + }, + }, + tenantName: "tenantName", + accountId: "accountId", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + createdBy: "createdBy", }, - collaborators: [{ - subject: "subject", - roleId: "role_id" - }], - ownedBy: { - account: "account" - } - }, - tenantName: "tenantName", - accountId: "accountId", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - createdBy: "createdBy" - } -}); - - + }); }); - + test("create_or_update (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "cluster" , "name" : "name" , "cluster_type" : "aws-eks" , "environment_names" : [ "environment_names" , "environment_names" ] , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } , { "subject" : "subject" , "role_id" : "role_id" } ] } }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + type: "cluster", + name: "name", + cluster_type: "aws-eks", + environment_names: ["environment_names", "environment_names"], + collaborators: [ + { subject: "subject", role_id: "role_id" }, + { subject: "subject", role_id: "role_id" }, + ], + }, + }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .put("/api/svc/v1/clusters").jsonBody(rawRequestBody) - .respondWith() - .statusCode(401).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.clusters.createOrUpdate({ - manifest: { - type: "cluster", - name: "name", - clusterType: "aws-eks", - environmentNames: ["environment_names", "environment_names"], - collaborators: [{ - subject: "subject", - roleId: "role_id" - }, { - subject: "subject", - roleId: "role_id" - }] - } -}) - }).rejects.toThrow(TrueFoundry.UnauthorizedError); + .put("/api/svc/v1/clusters") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.clusters.createOrUpdate({ + manifest: { + type: "cluster", + name: "name", + clusterType: "aws-eks", + environmentNames: ["environment_names", "environment_names"], + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + { + subject: "subject", + roleId: "role_id", + }, + ], + }, + }); + }).rejects.toThrow(TrueFoundry.UnauthorizedError); }); - + test("create_or_update (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "cluster" , "name" : "name" , "cluster_type" : "aws-eks" , "environment_names" : [ "environment_names" , "environment_names" ] , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } , { "subject" : "subject" , "role_id" : "role_id" } ] } }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + type: "cluster", + name: "name", + cluster_type: "aws-eks", + environment_names: ["environment_names", "environment_names"], + collaborators: [ + { subject: "subject", role_id: "role_id" }, + { subject: "subject", role_id: "role_id" }, + ], + }, + }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .put("/api/svc/v1/clusters").jsonBody(rawRequestBody) - .respondWith() - .statusCode(409).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.clusters.createOrUpdate({ - manifest: { - type: "cluster", - name: "name", - clusterType: "aws-eks", - environmentNames: ["environment_names", "environment_names"], - collaborators: [{ - subject: "subject", - roleId: "role_id" - }, { - subject: "subject", - roleId: "role_id" - }] - } -}) - }).rejects.toThrow(TrueFoundry.ConflictError); + .put("/api/svc/v1/clusters") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.clusters.createOrUpdate({ + manifest: { + type: "cluster", + name: "name", + clusterType: "aws-eks", + environmentNames: ["environment_names", "environment_names"], + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + { + subject: "subject", + roleId: "role_id", + }, + ], + }, + }); + }).rejects.toThrow(TrueFoundry.ConflictError); }); - + test("create_or_update (4)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "cluster" , "name" : "name" , "cluster_type" : "aws-eks" , "environment_names" : [ "environment_names" , "environment_names" ] , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } , { "subject" : "subject" , "role_id" : "role_id" } ] } }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + type: "cluster", + name: "name", + cluster_type: "aws-eks", + environment_names: ["environment_names", "environment_names"], + collaborators: [ + { subject: "subject", role_id: "role_id" }, + { subject: "subject", role_id: "role_id" }, + ], + }, + }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .put("/api/svc/v1/clusters").jsonBody(rawRequestBody) - .respondWith() - .statusCode(422).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.clusters.createOrUpdate({ - manifest: { - type: "cluster", - name: "name", - clusterType: "aws-eks", - environmentNames: ["environment_names", "environment_names"], - collaborators: [{ - subject: "subject", - roleId: "role_id" - }, { - subject: "subject", - roleId: "role_id" - }] - } -}) - }).rejects.toThrow(TrueFoundry.UnprocessableEntityError); + .put("/api/svc/v1/clusters") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.clusters.createOrUpdate({ + manifest: { + type: "cluster", + name: "name", + clusterType: "aws-eks", + environmentNames: ["environment_names", "environment_names"], + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + { + subject: "subject", + roleId: "role_id", + }, + ], + }, + }); + }).rejects.toThrow(TrueFoundry.UnprocessableEntityError); }); - + test("get (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "fqn" : "fqn" , "manifest" : { "type" : "cluster" , "name" : "name" , "cluster_type" : "aws-eks" , "environment_names" : [ "environment_names" ] , "base_domains" : [ "base_domains" ] , "default_registry_fqn" : "default_registry_fqn" , "spark_config" : { "ui_base_domain" : "ui_base_domain" } , "ingress_controller_config" : { "ingress_class_name" : "ingress_class_name" } , "cluster_integration_fqn" : "cluster_integration_fqn" , "workflow_storage_integration_fqn" : "workflow_storage_integration_fqn" , "supported_nodepools" : [ { "name" : "name" } ] , "node_label_keys" : { "nodepool_selector_label" : "nodepool_selector_label" } , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } ] , "ownedBy" : { "account" : "account" } } , "tenantName" : "tenantName" , "accountId" : "accountId" , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "createdBy" : "createdBy" } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + fqn: "fqn", + manifest: { + type: "cluster", + name: "name", + cluster_type: "aws-eks", + environment_names: ["environment_names"], + base_domains: ["base_domains"], + default_registry_fqn: "default_registry_fqn", + spark_config: { ui_base_domain: "ui_base_domain" }, + ingress_controller_config: { ingress_class_name: "ingress_class_name" }, + cluster_integration_fqn: "cluster_integration_fqn", + workflow_storage_integration_fqn: "workflow_storage_integration_fqn", + supported_nodepools: [{ name: "name" }], + node_label_keys: { nodepool_selector_label: "nodepool_selector_label" }, + collaborators: [{ subject: "subject", role_id: "role_id" }], + ownedBy: { account: "account" }, + }, + tenantName: "tenantName", + accountId: "accountId", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + createdBy: "createdBy", + }, + }; + server .mockEndpoint() - .get("/api/svc/v1/clusters/id").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.clusters.get("id"); - expect(response).toEqual({ - data: { - id: "jqfwg345gi25n5ju2yz5iz6m", - fqn: "fqn", - manifest: { - type: "cluster", - name: "name", - clusterType: "aws-eks", - environmentNames: ["environment_names"], - baseDomains: ["base_domains"], - defaultRegistryFqn: "default_registry_fqn", - sparkConfig: { - uiBaseDomain: "ui_base_domain" - }, - ingressControllerConfig: { - ingressClassName: "ingress_class_name" - }, - clusterIntegrationFqn: "cluster_integration_fqn", - workflowStorageIntegrationFqn: "workflow_storage_integration_fqn", - supportedNodepools: [{ - name: "name" - }], - nodeLabelKeys: { - nodepoolSelectorLabel: "nodepool_selector_label" + .get("/api/svc/v1/clusters/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.clusters.get("id"); + expect(response).toEqual({ + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + fqn: "fqn", + manifest: { + type: "cluster", + name: "name", + clusterType: "aws-eks", + environmentNames: ["environment_names"], + baseDomains: ["base_domains"], + defaultRegistryFqn: "default_registry_fqn", + sparkConfig: { + uiBaseDomain: "ui_base_domain", + }, + ingressControllerConfig: { + ingressClassName: "ingress_class_name", + }, + clusterIntegrationFqn: "cluster_integration_fqn", + workflowStorageIntegrationFqn: "workflow_storage_integration_fqn", + supportedNodepools: [ + { + name: "name", + }, + ], + nodeLabelKeys: { + nodepoolSelectorLabel: "nodepool_selector_label", + }, + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + ], + ownedBy: { + account: "account", + }, + }, + tenantName: "tenantName", + accountId: "accountId", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + createdBy: "createdBy", }, - collaborators: [{ - subject: "subject", - roleId: "role_id" - }], - ownedBy: { - account: "account" - } - }, - tenantName: "tenantName", - accountId: "accountId", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - createdBy: "createdBy" - } -}); - - + }); }); - + test("get (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .get("/api/svc/v1/clusters/id").respondWith() - .statusCode(401).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.clusters.get("id") - }).rejects.toThrow(TrueFoundry.UnauthorizedError); + .get("/api/svc/v1/clusters/id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.clusters.get("id"); + }).rejects.toThrow(TrueFoundry.UnauthorizedError); }); - + test("get (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/clusters/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.clusters.get("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .get("/api/svc/v1/clusters/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.clusters.get("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("delete (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server .mockEndpoint() - .delete("/api/svc/v1/clusters/id").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.clusters.delete("id"); - expect(response).toEqual({ - message: "message" -}); - - + .delete("/api/svc/v1/clusters/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.clusters.delete("id"); + expect(response).toEqual({ + message: "message", + }); }); - + test("delete (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .delete("/api/svc/v1/clusters/id").respondWith() - .statusCode(401).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.clusters.delete("id") - }).rejects.toThrow(TrueFoundry.UnauthorizedError); + .delete("/api/svc/v1/clusters/id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.clusters.delete("id"); + }).rejects.toThrow(TrueFoundry.UnauthorizedError); }); - + test("delete (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .delete("/api/svc/v1/clusters/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.clusters.delete("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .delete("/api/svc/v1/clusters/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.clusters.delete("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("get_addons (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "name" : "ARGOCD" , "appName" : "appName" , "namespace" : "namespace" , "applicationId" : "applicationId" , "description" : "description" , "path" : "path" , "addonFolder" : "addonFolder" , "installed" : true , "status" : { "installed" : true } , "version" : "version" , "manifest" : { "key" : "value" } , "installationSource" : "installationSource" , "unsupportedClusterTypes" : [ "aws-eks" ] , "required" : true , "knownCRDs" : [ "knownCRDs" ] , "source" : { "repo_url" : "repo_url" , "chart" : "chart" } , "labels" : [ "labels" ] , "recommendations" : [ { "recommendationData" : { "key" : "value" } , "recommendationType" : "recommendationType" , "expiryTimestamp" : "2024-01-15T09:30:00Z" } ] , "workspaceId" : "workspaceId" , "metadata" : { "key" : "value" } } ] , "pagination" : { "total" : 100 , "offset" : 0 , "limit" : 10 } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + name: "ARGOCD", + appName: "appName", + namespace: "namespace", + applicationId: "applicationId", + description: "description", + path: "path", + addonFolder: "addonFolder", + installed: true, + status: { installed: true }, + version: "version", + manifest: { key: "value" }, + installationSource: "installationSource", + unsupportedClusterTypes: ["aws-eks"], + required: true, + knownCRDs: ["knownCRDs"], + source: { repo_url: "repo_url", chart: "chart" }, + labels: ["labels"], + recommendations: [ + { + recommendationData: { key: "value" }, + recommendationType: "recommendationType", + expiryTimestamp: "2024-01-15T09:30:00Z", + }, + ], + workspaceId: "workspaceId", + metadata: { key: "value" }, + }, + ], + pagination: { total: 100, offset: 0, limit: 10 }, + }; + server .mockEndpoint() - .get("/api/svc/v1/clusters/id/get-addons").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.clusters.getAddons("id", { - limit: 10, - offset: 0, - attributes: ["attributes"] -}); - expect(response).toEqual({ - data: [{ - name: "ARGOCD", - appName: "appName", - namespace: "namespace", - applicationId: "applicationId", - description: "description", - path: "path", - addonFolder: "addonFolder", - installed: true, - status: { - installed: true - }, - version: "version", - manifest: { - "key": "value" - }, - installationSource: "installationSource", - unsupportedClusterTypes: ["aws-eks"], - required: true, - knownCrDs: ["knownCRDs"], - source: { - repoUrl: "repo_url", - chart: "chart" - }, - labels: ["labels"], - recommendations: [{ - recommendationData: { - "key": "value" + .get("/api/svc/v1/clusters/id/get-addons") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.clusters.getAddons("id", { + limit: 10, + offset: 0, + }); + expect(response).toEqual({ + data: [ + { + name: "ARGOCD", + appName: "appName", + namespace: "namespace", + applicationId: "applicationId", + description: "description", + path: "path", + addonFolder: "addonFolder", + installed: true, + status: { + installed: true, }, - recommendationType: "recommendationType", - expiryTimestamp: new Date("2024-01-15T09:30:00.000Z") - }], - workspaceId: "workspaceId", - metadata: { - "key": "value" - } - }], - pagination: { - total: 100, - offset: 0, - limit: 10 - } -}); - - + version: "version", + manifest: { + key: "value", + }, + installationSource: "installationSource", + unsupportedClusterTypes: ["aws-eks"], + required: true, + knownCrDs: ["knownCRDs"], + source: { + repoUrl: "repo_url", + chart: "chart", + }, + labels: ["labels"], + recommendations: [ + { + recommendationData: { + key: "value", + }, + recommendationType: "recommendationType", + expiryTimestamp: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + workspaceId: "workspaceId", + metadata: { + key: "value", + }, + }, + ], + pagination: { + total: 100, + offset: 0, + limit: 10, + }, + }); }); - + test("get_addons (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .get("/api/svc/v1/clusters/id/get-addons").respondWith() - .statusCode(401).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.clusters.getAddons("id") - }).rejects.toThrow(TrueFoundry.UnauthorizedError); + .get("/api/svc/v1/clusters/id/get-addons") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.clusters.getAddons("id"); + }).rejects.toThrow(TrueFoundry.UnauthorizedError); }); - + test("get_addons (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/clusters/id/get-addons").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.clusters.getAddons("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .get("/api/svc/v1/clusters/id/get-addons") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.clusters.getAddons("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("is_connected (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "isConnected" : true }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { isConnected: true }; + server .mockEndpoint() - .get("/api/svc/v1/clusters/id/is-connected").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.clusters.isConnected("id"); - expect(response).toEqual({ - isConnected: true -}); - - + .get("/api/svc/v1/clusters/id/is-connected") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.clusters.isConnected("id"); + expect(response).toEqual({ + isConnected: true, + }); }); - + test("is_connected (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .get("/api/svc/v1/clusters/id/is-connected").respondWith() - .statusCode(401).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.clusters.isConnected("id") - }).rejects.toThrow(TrueFoundry.UnauthorizedError); + .get("/api/svc/v1/clusters/id/is-connected") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.clusters.isConnected("id"); + }).rejects.toThrow(TrueFoundry.UnauthorizedError); }); - }); diff --git a/tests/wire/dataDirectories.test.ts b/tests/wire/dataDirectories.test.ts index 1ab4e356..7cb40d16 100644 --- a/tests/wire/dataDirectories.test.ts +++ b/tests/wire/dataDirectories.test.ts @@ -5,375 +5,459 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("DataDirectoriesClient", () => { - test("list", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "id" : "id" , "ml_repo_id" : "ml_repo_id" , "name" : "name" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "created_at" : "2024-01-15T09:30:00Z" , "updated_at" : "2024-01-15T09:30:00Z" , "manifest" : { "type" : "data-dir" , "name" : "name" , "ml_repo" : "ml_repo" , "metadata" : { "key" : "value" } , "source" : { "type" : "truefoundry" } } , "usage_code_snippet" : "usage_code_snippet" } ] , "pagination" : { "total" : 100 , "offset" : 0 , "limit" : 10 } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + id: "id", + ml_repo_id: "ml_repo_id", + name: "name", + fqn: "fqn", + created_by_subject: { subjectId: "subjectId", subjectType: "user" }, + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + manifest: { + type: "data-dir", + name: "name", + ml_repo: "ml_repo", + metadata: { key: "value" }, + source: { type: "truefoundry" }, + }, + usage_code_snippet: "usage_code_snippet", + }, + ], + pagination: { total: 100, offset: 0, limit: 10 }, + }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/data-directories").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const expected = { - data: [{ - id: "id", - mlRepoId: "ml_repo_id", - name: "name", - fqn: "fqn", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" + .mockEndpoint() + .get("/api/svc/v1/data-directories") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + data: [ + { + id: "id", + mlRepoId: "ml_repo_id", + name: "name", + fqn: "fqn", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + manifest: { + type: "data-dir", + name: "name", + mlRepo: "ml_repo", + metadata: { + key: "value", + }, + source: { + type: "truefoundry", + }, + }, + usageCodeSnippet: "usage_code_snippet", + }, + ], + pagination: { + total: 100, + offset: 0, + limit: 10, }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }; + const page = await client.dataDirectories.list({ + limit: 10, + offset: 0, + }); + + expect(expected.data).toEqual(page.data); + }); + + test("create_or_update", async () => { + const server = mockServerPool.createServer(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + type: "data-dir", + name: "name", + ml_repo: "ml_repo", + metadata: { key: "value" }, + source: { type: "truefoundry" }, + }, + }; + const rawResponseBody = { + data: { + id: "id", + ml_repo_id: "ml_repo_id", + name: "name", + fqn: "fqn", + created_by_subject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + manifest: { + type: "data-dir", + name: "name", + ml_repo: "ml_repo", + description: "description", + metadata: { key: "value" }, + source: { type: "truefoundry" }, + }, + usage_code_snippet: "usage_code_snippet", + }, + }; + + server + .mockEndpoint() + .put("/api/svc/v1/data-directories") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.dataDirectories.createOrUpdate({ manifest: { type: "data-dir", name: "name", mlRepo: "ml_repo", metadata: { - "key": "value" + key: "value", }, source: { - type: "truefoundry" - } + type: "truefoundry", + }, }, - usageCodeSnippet: "usage_code_snippet" - }], - pagination: { - total: 100, - offset: 0, - limit: 10 - } -}; - const page = await client.dataDirectories.list({ - limit: 10, - offset: 0, - fqn: "fqn", - mlRepoId: "ml_repo_id", - name: "name" -}); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - - }); - - test("create_or_update", async () => { - const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "data-dir" , "name" : "name" , "ml_repo" : "ml_repo" , "metadata" : { "key" : "value" } , "source" : { "type" : "truefoundry" } } }; - const rawResponseBody = { "data" : { "id" : "id" , "ml_repo_id" : "ml_repo_id" , "name" : "name" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "created_at" : "2024-01-15T09:30:00Z" , "updated_at" : "2024-01-15T09:30:00Z" , "manifest" : { "type" : "data-dir" , "name" : "name" , "ml_repo" : "ml_repo" , "description" : "description" , "metadata" : { "key" : "value" } , "source" : { "type" : "truefoundry" } } , "usage_code_snippet" : "usage_code_snippet" } }; - - server - .mockEndpoint() - .put("/api/svc/v1/data-directories").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.dataDirectories.createOrUpdate({ - manifest: { - type: "data-dir", - name: "name", - mlRepo: "ml_repo", - metadata: { - "key": "value" - }, - source: { - type: "truefoundry" - } - } -}); - expect(response).toEqual({ - data: { - id: "id", - mlRepoId: "ml_repo_id", - name: "name", - fqn: "fqn", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - manifest: { - type: "data-dir", - name: "name", - mlRepo: "ml_repo", - description: "description", - metadata: { - "key": "value" + }); + expect(response).toEqual({ + data: { + id: "id", + mlRepoId: "ml_repo_id", + name: "name", + fqn: "fqn", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + manifest: { + type: "data-dir", + name: "name", + mlRepo: "ml_repo", + description: "description", + metadata: { + key: "value", + }, + source: { + type: "truefoundry", + }, + }, + usageCodeSnippet: "usage_code_snippet", }, - source: { - type: "truefoundry" - } - }, - usageCodeSnippet: "usage_code_snippet" - } -}); - - + }); }); - + test("list_files", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "id" : "id" }; - const rawResponseBody = { "data" : [ { "path" : "path" , "is_dir" : true , "file_size" : 1.1 , "signed_url" : "signed_url" , "last_modified" : "2024-01-15T09:30:00Z" } ] , "pagination" : { "limit" : 10 , "nextPageToken" : "nextPageToken" , "previousPageToken" : "previousPageToken" } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { id: "id" }; + const rawResponseBody = { + data: [ + { + path: "path", + is_dir: true, + file_size: 1.1, + signed_url: "signed_url", + last_modified: "2024-01-15T09:30:00Z", + }, + ], + pagination: { limit: 10, nextPageToken: "nextPageToken", previousPageToken: "previousPageToken" }, + }; + server .mockEndpoint({ once: false }) - .post("/api/svc/v1/data-directories/files").jsonBody(rawRequestBody, { ignoredFields: [ "pageToken" ] }) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const expected = { - data: [{ - path: "path", - isDir: true, - fileSize: 1.1, - signedUrl: "signed_url", - lastModified: new Date("2024-01-15T09:30:00.000Z") - }], - pagination: { - limit: 10, - nextPageToken: "nextPageToken", - previousPageToken: "previousPageToken" - } -}; - const page = await client.dataDirectories.listFiles({ - id: "id" -}); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - + .post("/api/svc/v1/data-directories/files") + .jsonBody(rawRequestBody, { ignoredFields: ["pageToken"] }) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + data: [ + { + path: "path", + isDir: true, + fileSize: 1.1, + signedUrl: "signed_url", + lastModified: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + pagination: { + limit: 10, + nextPageToken: "nextPageToken", + previousPageToken: "previousPageToken", + }, + }; + const page = await client.dataDirectories.listFiles({ + id: "id", + }); + + expect(expected.data).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.data).toEqual(nextPage.data); }); - + test("delete_files", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "id" : "id" , "paths" : [ "paths" ] }; - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { id: "id", paths: ["paths"] }; + const rawResponseBody = {}; + server .mockEndpoint() - .delete("/api/svc/v1/data-directories/files").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.dataDirectories.deleteFiles({ - id: "id", - paths: ["paths"] -}); - expect(response).toEqual({}); - - + .delete("/api/svc/v1/data-directories/files") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.dataDirectories.deleteFiles({ + id: "id", + paths: ["paths"], + }); + expect(response).toEqual({}); }); - + test("create_multipart_upload", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "id" : "id" , "path" : "path" , "num_parts" : 1.1 }; - const rawResponseBody = { "data" : { "storage_provider" : "S3_COMPATIBLE" , "part_signed_urls" : [ { "path" : "path" , "signed_url" : "signed_url" } ] , "finalize_signed_url" : { "path" : "path" , "signed_url" : "signed_url" } , "s3_compatible_upload_id" : "s3_compatible_upload_id" , "azure_blob_block_ids" : [ "azure_blob_block_ids" ] } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { id: "id", path: "path", num_parts: 1.1 }; + const rawResponseBody = { + data: { + storage_provider: "S3_COMPATIBLE", + part_signed_urls: [{ path: "path", signed_url: "signed_url" }], + finalize_signed_url: { path: "path", signed_url: "signed_url" }, + s3_compatible_upload_id: "s3_compatible_upload_id", + azure_blob_block_ids: ["azure_blob_block_ids"], + }, + }; + server .mockEndpoint() - .post("/api/svc/v1/data-directories/signed-urls/multipart").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.dataDirectories.createMultipartUpload({ - id: "id", - path: "path", - numParts: 1.1 -}); - expect(response).toEqual({ - data: { - storageProvider: "S3_COMPATIBLE", - partSignedUrls: [{ - path: "path", - signedUrl: "signed_url" - }], - finalizeSignedUrl: { + .post("/api/svc/v1/data-directories/signed-urls/multipart") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.dataDirectories.createMultipartUpload({ + id: "id", path: "path", - signedUrl: "signed_url" - }, - s3CompatibleUploadId: "s3_compatible_upload_id", - azureBlobBlockIds: ["azure_blob_block_ids"] - } -}); - - + numParts: 1.1, + }); + expect(response).toEqual({ + data: { + storageProvider: "S3_COMPATIBLE", + partSignedUrls: [ + { + path: "path", + signedUrl: "signed_url", + }, + ], + finalizeSignedUrl: { + path: "path", + signedUrl: "signed_url", + }, + s3CompatibleUploadId: "s3_compatible_upload_id", + azureBlobBlockIds: ["azure_blob_block_ids"], + }, + }); }); - + test("get_signed_urls", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "id" : "id" , "paths" : [ "paths" ] , "operation" : "READ" }; - const rawResponseBody = { "data" : [ { "path" : "path" , "signed_url" : "signed_url" } ] }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { id: "id", paths: ["paths"], operation: "READ" }; + const rawResponseBody = { data: [{ path: "path", signed_url: "signed_url" }] }; + server .mockEndpoint() - .post("/api/svc/v1/data-directories/signed-urls").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.dataDirectories.getSignedUrls({ - id: "id", - paths: ["paths"], - operation: "READ" -}); - expect(response).toEqual({ - data: [{ - path: "path", - signedUrl: "signed_url" - }] -}); - - + .post("/api/svc/v1/data-directories/signed-urls") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.dataDirectories.getSignedUrls({ + id: "id", + paths: ["paths"], + operation: "READ", + }); + expect(response).toEqual({ + data: [ + { + path: "path", + signedUrl: "signed_url", + }, + ], + }); }); - + test("get (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : { "id" : "id" , "ml_repo_id" : "ml_repo_id" , "name" : "name" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "created_at" : "2024-01-15T09:30:00Z" , "updated_at" : "2024-01-15T09:30:00Z" , "manifest" : { "type" : "data-dir" , "name" : "name" , "ml_repo" : "ml_repo" , "description" : "description" , "metadata" : { "key" : "value" } , "source" : { "type" : "truefoundry" } } , "usage_code_snippet" : "usage_code_snippet" } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: { + id: "id", + ml_repo_id: "ml_repo_id", + name: "name", + fqn: "fqn", + created_by_subject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + manifest: { + type: "data-dir", + name: "name", + ml_repo: "ml_repo", + description: "description", + metadata: { key: "value" }, + source: { type: "truefoundry" }, + }, + usage_code_snippet: "usage_code_snippet", + }, + }; + server .mockEndpoint() - .get("/api/svc/v1/data-directories/id").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.dataDirectories.get("id"); - expect(response).toEqual({ - data: { - id: "id", - mlRepoId: "ml_repo_id", - name: "name", - fqn: "fqn", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - manifest: { - type: "data-dir", - name: "name", - mlRepo: "ml_repo", - description: "description", - metadata: { - "key": "value" + .get("/api/svc/v1/data-directories/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.dataDirectories.get("id"); + expect(response).toEqual({ + data: { + id: "id", + mlRepoId: "ml_repo_id", + name: "name", + fqn: "fqn", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + manifest: { + type: "data-dir", + name: "name", + mlRepo: "ml_repo", + description: "description", + metadata: { + key: "value", + }, + source: { + type: "truefoundry", + }, + }, + usageCodeSnippet: "usage_code_snippet", }, - source: { - type: "truefoundry" - } - }, - usageCodeSnippet: "usage_code_snippet" - } -}); - - + }); }); - + test("get (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/data-directories/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.dataDirectories.get("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .get("/api/svc/v1/data-directories/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.dataDirectories.get("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("delete (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = {}; + server .mockEndpoint() - .delete("/api/svc/v1/data-directories/id").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.dataDirectories.delete("id", { - deleteContents: true -}); - expect(response).toEqual({}); - - + .delete("/api/svc/v1/data-directories/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.dataDirectories.delete("id"); + expect(response).toEqual({}); }); - + test("delete (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .delete("/api/svc/v1/data-directories/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.dataDirectories.delete("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .delete("/api/svc/v1/data-directories/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.dataDirectories.delete("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - }); diff --git a/tests/wire/environments.test.ts b/tests/wire/environments.test.ts index b4ae1839..aa3b1f36 100644 --- a/tests/wire/environments.test.ts +++ b/tests/wire/environments.test.ts @@ -5,254 +5,314 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("EnvironmentsClient", () => { - test("list", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "id" : "id" , "priority" : 1.1 , "color" : { } , "tenantName" : "tenantName" , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "isProduction" : true , "optimizeFor" : "COST" , "manifest" : { "type" : "environment" , "name" : "name" , "color" : { } , "isProduction" : true , "optimizeFor" : "COST" } , "createdBy" : "createdBy" } ] , "pagination" : { "total" : 100 , "offset" : 0 , "limit" : 10 } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + id: "id", + priority: 1.1, + color: {}, + tenantName: "tenantName", + createdBySubject: { subjectId: "subjectId", subjectType: "user" }, + isProduction: true, + optimizeFor: "COST", + manifest: { type: "environment", name: "name", color: {}, isProduction: true, optimizeFor: "COST" }, + createdBy: "createdBy", + }, + ], + pagination: { total: 100, offset: 0, limit: 10 }, + }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/environments").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .mockEndpoint() + .get("/api/svc/v1/environments") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const expected = { - data: [{ - id: "id", - priority: 1.1, - color: {}, - tenantName: "tenantName", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" + const expected = { + data: [ + { + id: "id", + priority: 1.1, + color: {}, + tenantName: "tenantName", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + isProduction: true, + optimizeFor: "COST", + manifest: { + type: "environment", + name: "name", + color: {}, + isProduction: true, + optimizeFor: "COST", + }, + createdBy: "createdBy", + }, + ], + pagination: { + total: 100, + offset: 0, + limit: 10, }, - isProduction: true, - optimizeFor: "COST", + }; + const page = await client.environments.list({ + limit: 10, + offset: 0, + }); + + expect(expected.data).toEqual(page.data); + }); + + test("create_or_update (1)", async () => { + const server = mockServerPool.createServer(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { type: "environment", name: "name", color: {}, isProduction: true, optimizeFor: "COST" }, + }; + const rawResponseBody = { + data: { + id: "id", + priority: 1.1, + color: { + colorHex: "colorHex", + backgroundColorHex: "backgroundColorHex", + color: "color", + backgroundColor: "backgroundColor", + }, + tenantName: "tenantName", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + isProduction: true, + optimizeFor: "COST", + manifest: { type: "environment", name: "name", color: {}, isProduction: true, optimizeFor: "COST" }, + createdBy: "createdBy", + }, + }; + + server + .mockEndpoint() + .put("/api/svc/v1/environments") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.environments.createOrUpdate({ manifest: { type: "environment", name: "name", color: {}, isProduction: true, - optimizeFor: "COST" + optimizeFor: "COST", }, - createdBy: "createdBy" - }], - pagination: { - total: 100, - offset: 0, - limit: 10 - } -}; - const page = await client.environments.list({ - limit: 10, - offset: 0 -}); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - + }); + expect(response).toEqual({ + data: { + id: "id", + priority: 1.1, + color: { + colorHex: "colorHex", + backgroundColorHex: "backgroundColorHex", + color: "color", + backgroundColor: "backgroundColor", + }, + tenantName: "tenantName", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + isProduction: true, + optimizeFor: "COST", + manifest: { + type: "environment", + name: "name", + color: {}, + isProduction: true, + optimizeFor: "COST", + }, + createdBy: "createdBy", + }, + }); }); - - test("create_or_update (1)", async () => { - const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "environment" , "name" : "name" , "color" : { } , "isProduction" : true , "optimizeFor" : "COST" } }; - const rawResponseBody = { "data" : { "id" : "id" , "priority" : 1.1 , "color" : { "colorHex" : "colorHex" , "backgroundColorHex" : "backgroundColorHex" , "color" : "color" , "backgroundColor" : "backgroundColor" } , "tenantName" : "tenantName" , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "isProduction" : true , "optimizeFor" : "COST" , "manifest" : { "type" : "environment" , "name" : "name" , "color" : { } , "isProduction" : true , "optimizeFor" : "COST" } , "createdBy" : "createdBy" } }; - - server - .mockEndpoint() - .put("/api/svc/v1/environments").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - const response = await client.environments.createOrUpdate({ - manifest: { - type: "environment", - name: "name", - color: {}, - isProduction: true, - optimizeFor: "COST" - } -}); - expect(response).toEqual({ - data: { - id: "id", - priority: 1.1, - color: { - colorHex: "colorHex", - backgroundColorHex: "backgroundColorHex", - color: "color", - backgroundColor: "backgroundColor" - }, - tenantName: "tenantName", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - isProduction: true, - optimizeFor: "COST", - manifest: { - type: "environment", - name: "name", - color: {}, - isProduction: true, - optimizeFor: "COST" - }, - createdBy: "createdBy" - } -}); - - - }); - test("create_or_update (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "environment" , "name" : "name" , "color" : { } , "isProduction" : true , "optimizeFor" : "COST" } }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { type: "environment", name: "name", color: {}, isProduction: true, optimizeFor: "COST" }, + }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .put("/api/svc/v1/environments").jsonBody(rawRequestBody) - .respondWith() - .statusCode(422).jsonBody(rawResponseBody) - .build(); + .put("/api/svc/v1/environments") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.environments.createOrUpdate({ - manifest: { - type: "environment", - name: "name", - color: {}, - isProduction: true, - optimizeFor: "COST" - } -}) - }).rejects.toThrow(TrueFoundry.UnprocessableEntityError); + await expect(async () => { + return await client.environments.createOrUpdate({ + manifest: { + type: "environment", + name: "name", + color: {}, + isProduction: true, + optimizeFor: "COST", + }, + }); + }).rejects.toThrow(TrueFoundry.UnprocessableEntityError); }); - + test("get", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : { "id" : "id" , "priority" : 1.1 , "color" : { "colorHex" : "colorHex" , "backgroundColorHex" : "backgroundColorHex" , "color" : "color" , "backgroundColor" : "backgroundColor" } , "tenantName" : "tenantName" , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "isProduction" : true , "optimizeFor" : "COST" , "manifest" : { "type" : "environment" , "name" : "name" , "color" : { } , "isProduction" : true , "optimizeFor" : "COST" } , "createdBy" : "createdBy" } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: { + id: "id", + priority: 1.1, + color: { + colorHex: "colorHex", + backgroundColorHex: "backgroundColorHex", + color: "color", + backgroundColor: "backgroundColor", + }, + tenantName: "tenantName", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + isProduction: true, + optimizeFor: "COST", + manifest: { type: "environment", name: "name", color: {}, isProduction: true, optimizeFor: "COST" }, + createdBy: "createdBy", + }, + }; + server .mockEndpoint() - .get("/api/svc/v1/environments/jqfwg345gi25n5ju2yz5iz6m").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .get("/api/svc/v1/environments/jqfwg345gi25n5ju2yz5iz6m") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.environments.get("jqfwg345gi25n5ju2yz5iz6m"); - expect(response).toEqual({ - data: { - id: "id", - priority: 1.1, - color: { - colorHex: "colorHex", - backgroundColorHex: "backgroundColorHex", - color: "color", - backgroundColor: "backgroundColor" - }, - tenantName: "tenantName", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - isProduction: true, - optimizeFor: "COST", - manifest: { - type: "environment", - name: "name", - color: {}, - isProduction: true, - optimizeFor: "COST" - }, - createdBy: "createdBy" - } -}); - - + const response = await client.environments.get("jqfwg345gi25n5ju2yz5iz6m"); + expect(response).toEqual({ + data: { + id: "id", + priority: 1.1, + color: { + colorHex: "colorHex", + backgroundColorHex: "backgroundColorHex", + color: "color", + backgroundColor: "backgroundColor", + }, + tenantName: "tenantName", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + isProduction: true, + optimizeFor: "COST", + manifest: { + type: "environment", + name: "name", + color: {}, + isProduction: true, + optimizeFor: "COST", + }, + createdBy: "createdBy", + }, + }); }); - + test("delete (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawResponseBody = true; - + server .mockEndpoint() - .delete("/api/svc/v1/environments/jqfwg345gi25n5ju2yz5iz6m").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .delete("/api/svc/v1/environments/jqfwg345gi25n5ju2yz5iz6m") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.environments.delete("jqfwg345gi25n5ju2yz5iz6m"); - expect(response).toEqual(true); - - + const response = await client.environments.delete("jqfwg345gi25n5ju2yz5iz6m"); + expect(response).toEqual(true); }); - + test("delete (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .delete("/api/svc/v1/environments/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); + .delete("/api/svc/v1/environments/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.environments.delete("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + await expect(async () => { + return await client.environments.delete("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("delete (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .delete("/api/svc/v1/environments/id").respondWith() - .statusCode(409).jsonBody(rawResponseBody) - .build(); + .delete("/api/svc/v1/environments/id") + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.environments.delete("id") - }).rejects.toThrow(TrueFoundry.ConflictError); + await expect(async () => { + return await client.environments.delete("id"); + }).rejects.toThrow(TrueFoundry.ConflictError); }); - }); diff --git a/tests/wire/events.test.ts b/tests/wire/events.test.ts index 4c6677d6..548bf2e2 100644 --- a/tests/wire/events.test.ts +++ b/tests/wire/events.test.ts @@ -5,104 +5,89 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("EventsClient", () => { - test("get (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "name" : "name" , "firstTimestamp" : "firstTimestamp" , "lastTimestamp" : "lastTimestamp" , "involvedObject" : { "kind" : "kind" , "name" : "name" } , "type" : "type" , "count" : 1 , "reason" : "reason" , "message" : "message" , "namespace" : "namespace" , "chart" : { "category" : "ContainerTerminated" } } ] }; - - server - .mockEndpoint() - .get("/api/svc/v1/events").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.events.get({ - startTs: "startTs", - endTs: "endTs", - applicationId: "applicationId", - applicationFqn: "applicationFqn", - podNames: ["podNames"], - jobRunName: "jobRunName" -}); - expect(response).toEqual({ - data: [{ - name: "name", - firstTimestamp: "firstTimestamp", - lastTimestamp: "lastTimestamp", - involvedObject: { - kind: "kind", - name: "name" - }, - type: "type", - count: 1, - reason: "reason", - message: "message", - namespace: "namespace", - chart: { - category: "ContainerTerminated" - } - }] -}); - - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + name: "name", + firstTimestamp: "firstTimestamp", + lastTimestamp: "lastTimestamp", + involvedObject: { kind: "kind", name: "name" }, + type: "type", + count: 1, + reason: "reason", + message: "message", + namespace: "namespace", + chart: { category: "ContainerTerminated" }, + }, + ], + }; + + server.mockEndpoint().get("/api/svc/v1/events").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.events.get(); + expect(response).toEqual({ + data: [ + { + name: "name", + firstTimestamp: "firstTimestamp", + lastTimestamp: "lastTimestamp", + involvedObject: { + kind: "kind", + name: "name", + }, + type: "type", + count: 1, + reason: "reason", + message: "message", + namespace: "namespace", + chart: { + category: "ContainerTerminated", + }, + }, + ], + }); }); - + test("get (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - - server - .mockEndpoint() - .get("/api/svc/v1/events").respondWith() - .statusCode(400).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.events.get() - }).rejects.toThrow(TrueFoundry.BadRequestError); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server.mockEndpoint().get("/api/svc/v1/events").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.events.get(); + }).rejects.toThrow(TrueFoundry.BadRequestError); }); - + test("get (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - - server - .mockEndpoint() - .get("/api/svc/v1/events").respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.events.get() - }).rejects.toThrow(TrueFoundry.ForbiddenError); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + + server.mockEndpoint().get("/api/svc/v1/events").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.events.get(); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("get (4)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - - server - .mockEndpoint() - .get("/api/svc/v1/events").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.events.get() - }).rejects.toThrow(TrueFoundry.NotFoundError); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server.mockEndpoint().get("/api/svc/v1/events").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); + + await expect(async () => { + return await client.events.get(); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - }); diff --git a/tests/wire/gatewayBudgets.test.ts b/tests/wire/gatewayBudgets.test.ts new file mode 100644 index 00000000..7386b019 --- /dev/null +++ b/tests/wire/gatewayBudgets.test.ts @@ -0,0 +1,569 @@ +// This file was auto-generated by Fern from our API Definition. + +import * as TrueFoundry from "../../src/api/index"; +import { TrueFoundryClient } from "../../src/Client"; +import { mockServerPool } from "../mock-server/MockServerPool"; + +describe("GatewayBudgetsClient", () => { + test("list", async () => { + const server = mockServerPool.createServer(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + id: "id", + tenantName: "tenantName", + name: "name", + type: "type", + manifest: { + type: "tenant-budget-config", + name: "name", + limits: {}, + applies_to: { type: "aggregate" }, + mode: "enforce", + }, + createdBySubject: { subjectId: "subjectId", subjectType: "user" }, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + }, + ], + }; + + server + .mockEndpoint() + .get("/api/svc/v1/llm-gateway/budgets") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.gatewayBudgets.list(); + expect(response).toEqual({ + data: [ + { + id: "id", + tenantName: "tenantName", + name: "name", + type: "type", + manifest: { + type: "tenant-budget-config", + name: "name", + limits: {}, + appliesTo: { + type: "aggregate", + }, + mode: "enforce", + }, + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + }); + }); + + test("create_or_update (1)", async () => { + const server = mockServerPool.createServer(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + type: "tenant-budget-config", + name: "name", + limits: {}, + applies_to: { type: "aggregate" }, + mode: "enforce", + }, + }; + const rawResponseBody = { + id: "id", + tenantName: "tenantName", + name: "name", + type: "type", + manifest: { + type: "tenant-budget-config", + name: "name", + when: { metadata: { key: {} } }, + limits: { + cost_per_day: 1.1, + cost_per_week: 1.1, + cost_per_month: 1.1, + cost_per_quarter: 1.1, + cost_per_lifetime: 1.1, + }, + applies_to: { type: "aggregate" }, + mode: "enforce", + alerts: { + thresholds: [1.1], + notification_target: [ + { type: "email", notification_channel: "notification_channel", to_emails: ["to_emails"] }, + ], + }, + }, + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + }; + + server + .mockEndpoint() + .put("/api/svc/v1/llm-gateway/budgets") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.gatewayBudgets.createOrUpdate({ + manifest: { + type: "tenant-budget-config", + name: "name", + limits: {}, + appliesTo: { + type: "aggregate", + }, + mode: "enforce", + }, + }); + expect(response).toEqual({ + id: "id", + tenantName: "tenantName", + name: "name", + type: "type", + manifest: { + type: "tenant-budget-config", + name: "name", + when: { + metadata: { + key: {}, + }, + }, + limits: { + costPerDay: 1.1, + costPerWeek: 1.1, + costPerMonth: 1.1, + costPerQuarter: 1.1, + costPerLifetime: 1.1, + }, + appliesTo: { + type: "aggregate", + }, + mode: "enforce", + alerts: { + thresholds: [1.1], + notificationTarget: [ + { + type: "email", + notificationChannel: "notification_channel", + toEmails: ["to_emails"], + }, + ], + }, + }, + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }); + }); + + test("create_or_update (2)", async () => { + const server = mockServerPool.createServer(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + type: "tenant-budget-config", + name: "name", + limits: {}, + applies_to: { type: "aggregate" }, + mode: "enforce", + }, + }; + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .put("/api/svc/v1/llm-gateway/budgets") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.gatewayBudgets.createOrUpdate({ + manifest: { + type: "tenant-budget-config", + name: "name", + limits: {}, + appliesTo: { + type: "aggregate", + }, + mode: "enforce", + }, + }); + }).rejects.toThrow(TrueFoundry.BadRequestError); + }); + + test("get_my_usage", async () => { + const server = mockServerPool.createServer(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + matched: [ + { + name: "name", + type: "tenant-budget-config", + team_name: "team_name", + applies_to: "applies_to", + mode: "enforce", + entities: [ + { + entity: "{user:alice@co.com}", + periods: { key: { limit: 1.1, used: 1.1, percentage: 1.1, start: 1.1, end: 1.1 } }, + }, + ], + }, + ], + }; + + server + .mockEndpoint() + .get("/api/svc/v1/llm-gateway/budgets/my-usage") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.gatewayBudgets.getMyUsage(); + expect(response).toEqual({ + matched: [ + { + name: "name", + type: "tenant-budget-config", + teamName: "team_name", + appliesTo: "applies_to", + mode: "enforce", + entities: [ + { + entity: "{user:alice@co.com}", + periods: { + key: { + limit: 1.1, + used: 1.1, + percentage: 1.1, + start: 1.1, + end: 1.1, + }, + }, + }, + ], + }, + ], + }); + }); + + test("simulate", async () => { + const server = mockServerPool.createServer(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { + matched: [ + { + name: "name", + type: "tenant-budget-config", + team_name: "team_name", + applies_to: "applies_to", + mode: "enforce", + entities: [ + { + entity: "{user:alice@co.com}", + periods: { key: { limit: 1.1, used: 1.1, percentage: 1.1, start: 1.1, end: 1.1 } }, + }, + ], + }, + ], + }; + + server + .mockEndpoint() + .post("/api/svc/v1/llm-gateway/budgets/simulate") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.gatewayBudgets.simulate(); + expect(response).toEqual({ + matched: [ + { + name: "name", + type: "tenant-budget-config", + teamName: "team_name", + appliesTo: "applies_to", + mode: "enforce", + entities: [ + { + entity: "{user:alice@co.com}", + periods: { + key: { + limit: 1.1, + used: 1.1, + percentage: 1.1, + start: 1.1, + end: 1.1, + }, + }, + }, + ], + }, + ], + }); + }); + + test("get (1)", async () => { + const server = mockServerPool.createServer(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + id: "id", + tenantName: "tenantName", + name: "name", + type: "type", + manifest: { + type: "tenant-budget-config", + name: "name", + when: { metadata: { key: {} } }, + limits: { + cost_per_day: 1.1, + cost_per_week: 1.1, + cost_per_month: 1.1, + cost_per_quarter: 1.1, + cost_per_lifetime: 1.1, + }, + applies_to: { type: "aggregate" }, + mode: "enforce", + alerts: { + thresholds: [1.1], + notification_target: [ + { type: "email", notification_channel: "notification_channel", to_emails: ["to_emails"] }, + ], + }, + }, + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + }; + + server + .mockEndpoint() + .get("/api/svc/v1/llm-gateway/budgets/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.gatewayBudgets.get("id"); + expect(response).toEqual({ + id: "id", + tenantName: "tenantName", + name: "name", + type: "type", + manifest: { + type: "tenant-budget-config", + name: "name", + when: { + metadata: { + key: {}, + }, + }, + limits: { + costPerDay: 1.1, + costPerWeek: 1.1, + costPerMonth: 1.1, + costPerQuarter: 1.1, + costPerLifetime: 1.1, + }, + appliesTo: { + type: "aggregate", + }, + mode: "enforce", + alerts: { + thresholds: [1.1], + notificationTarget: [ + { + type: "email", + notificationChannel: "notification_channel", + toEmails: ["to_emails"], + }, + ], + }, + }, + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }); + }); + + test("get (2)", async () => { + const server = mockServerPool.createServer(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/api/svc/v1/llm-gateway/budgets/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.gatewayBudgets.get("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); + }); + + test("delete (1)", async () => { + const server = mockServerPool.createServer(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().delete("/api/svc/v1/llm-gateway/budgets/id").respondWith().statusCode(200).build(); + + const response = await client.gatewayBudgets.delete("id"); + expect(response).toEqual(undefined); + }); + + test("delete (2)", async () => { + const server = mockServerPool.createServer(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .delete("/api/svc/v1/llm-gateway/budgets/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.gatewayBudgets.delete("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); + }); + + test("get_leaderboard (1)", async () => { + const server = mockServerPool.createServer(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + matched: [ + { + name: "name", + type: "tenant-budget-config", + team_name: "team_name", + applies_to: "applies_to", + mode: "enforce", + entities: [ + { + entity: "{user:alice@co.com}", + periods: { key: { limit: 1.1, used: 1.1, percentage: 1.1, start: 1.1, end: 1.1 } }, + }, + ], + }, + ], + }; + + server + .mockEndpoint() + .get("/api/svc/v1/llm-gateway/budgets/id/leaderboard") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.gatewayBudgets.getLeaderboard("id", { + limit: 50, + }); + expect(response).toEqual({ + matched: [ + { + name: "name", + type: "tenant-budget-config", + teamName: "team_name", + appliesTo: "applies_to", + mode: "enforce", + entities: [ + { + entity: "{user:alice@co.com}", + periods: { + key: { + limit: 1.1, + used: 1.1, + percentage: 1.1, + start: 1.1, + end: 1.1, + }, + }, + }, + ], + }, + ], + }); + }); + + test("get_leaderboard (2)", async () => { + const server = mockServerPool.createServer(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/api/svc/v1/llm-gateway/budgets/id/leaderboard") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.gatewayBudgets.getLeaderboard("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); + }); +}); diff --git a/tests/wire/internal.test.ts b/tests/wire/internal.test.ts index d8a9d486..d6fd9027 100644 --- a/tests/wire/internal.test.ts +++ b/tests/wire/internal.test.ts @@ -5,69 +5,67 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("InternalClient", () => { - test("get_id_from_fqn (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/fqn/type").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .get("/api/svc/v1/fqn/type") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.internal.getIdFromFqn("type", { - fqn: "fqn" -}); - expect(response).toEqual({ - "key": "value" -}); - - + const response = await client.internal.getIdFromFqn("type", { + fqn: "fqn", + }); + expect(response).toEqual({ + key: "value", + }); }); - + test("get_id_from_fqn (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/fqn/type").respondWith() - .statusCode(400).jsonBody(rawResponseBody) - .build(); + .get("/api/svc/v1/fqn/type") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.internal.getIdFromFqn("type", { - fqn: "fqn" -}) - }).rejects.toThrow(TrueFoundry.BadRequestError); + await expect(async () => { + return await client.internal.getIdFromFqn("type", { + fqn: "fqn", + }); + }).rejects.toThrow(TrueFoundry.BadRequestError); }); - + test("get_id_from_fqn (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/fqn/type").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); + .get("/api/svc/v1/fqn/type") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.internal.getIdFromFqn("type", { - fqn: "fqn" -}) - }).rejects.toThrow(TrueFoundry.NotFoundError); + await expect(async () => { + return await client.internal.getIdFromFqn("type", { + fqn: "fqn", + }); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - }); diff --git a/tests/wire/internal/aiGateway.test.ts b/tests/wire/internal/aiGateway.test.ts index 43239cea..802969a4 100644 --- a/tests/wire/internal/aiGateway.test.ts +++ b/tests/wire/internal/aiGateway.test.ts @@ -5,78 +5,82 @@ import { TrueFoundryClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; describe("AiGatewayClient", () => { - test("get_gateway_config", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "id" : "id" , "tenantName" : "tenantName" , "type" : "type" , "manifest" : { } , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + id: "id", + tenantName: "tenantName", + type: "type", + manifest: {}, + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + }; + server .mockEndpoint() - .get("/api/svc/v1/llm-gateway/config/gateway-rate-limiting-config").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .get("/api/svc/v1/llm-gateway/config/gateway-rate-limiting-config") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.internal.aiGateway.getGatewayConfig("gateway-rate-limiting-config"); - expect(response).toEqual({ - id: "id", - tenantName: "tenantName", - type: "type", - manifest: {}, - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z") -}); - - + const response = await client.internal.aiGateway.getGatewayConfig("gateway-rate-limiting-config"); + expect(response).toEqual({ + id: "id", + tenantName: "tenantName", + type: "type", + manifest: {}, + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }); }); - + test("getBudgetUsage (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - - - server - .mockEndpoint() - .get("/api/svc/v1/llm-gateway/config/budget/usage").respondWith() - .statusCode(200).build(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + server.mockEndpoint().get("/api/svc/v1/llm-gateway/config/budget/usage").respondWith().statusCode(200).build(); - - - const response = await client.internal.aiGateway.getBudgetUsage(); - expect(response).toEqual(undefined); - - + const response = await client.internal.aiGateway.getBudgetUsage(); + expect(response).toEqual(undefined); }); - + test("getBudgetUsage (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/llm-gateway/config/budget/usage").respondWith() - .statusCode(400).jsonBody(rawResponseBody) - .build(); + .get("/api/svc/v1/llm-gateway/config/budget/usage") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.internal.aiGateway.getBudgetUsage() - }).rejects.toThrow(TrueFoundry.BadRequestError); + await expect(async () => { + return await client.internal.aiGateway.getBudgetUsage(); + }).rejects.toThrow(TrueFoundry.BadRequestError); }); - }); diff --git a/tests/wire/internal/applications.test.ts b/tests/wire/internal/applications.test.ts index 18dd2398..6a3feb34 100644 --- a/tests/wire/internal/applications.test.ts +++ b/tests/wire/internal/applications.test.ts @@ -5,104 +5,90 @@ import { TrueFoundryClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; describe("ApplicationsClient", () => { - test("promote_rollout (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - - - server - .mockEndpoint() - .post("/api/svc/v1/x/apps/id/rollout/promote").respondWith() - .statusCode(200).build(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - - - const response = await client.internal.applications.promoteRollout("id", { - full: true -}); - expect(response).toEqual(undefined); - - + server.mockEndpoint().post("/api/svc/v1/x/apps/id/rollout/promote").respondWith().statusCode(200).build(); + + const response = await client.internal.applications.promoteRollout("id"); + expect(response).toEqual(undefined); }); - + test("promote_rollout (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .post("/api/svc/v1/x/apps/id/rollout/promote").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.internal.applications.promoteRollout("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .post("/api/svc/v1/x/apps/id/rollout/promote") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.internal.applications.promoteRollout("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("promote_rollout (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .post("/api/svc/v1/x/apps/id/rollout/promote").respondWith() - .statusCode(405).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.internal.applications.promoteRollout("id") - }).rejects.toThrow(TrueFoundry.MethodNotAllowedError); + .post("/api/svc/v1/x/apps/id/rollout/promote") + .respondWith() + .statusCode(405) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.internal.applications.promoteRollout("id"); + }).rejects.toThrow(TrueFoundry.MethodNotAllowedError); }); - + test("get_pod_template_hash_to_deployment_version (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : 1.1 }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: 1.1 }; + server .mockEndpoint() - .get("/api/svc/v1/x/apps/id/pod-template-hash-deployment-version-map").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.internal.applications.getPodTemplateHashToDeploymentVersion("id", { - podTemplateHashes: "podTemplateHashes" -}); - expect(response).toEqual({ - "key": 1.1 -}); - - + .get("/api/svc/v1/x/apps/id/pod-template-hash-deployment-version-map") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.internal.applications.getPodTemplateHashToDeploymentVersion("id"); + expect(response).toEqual({ + key: 1.1, + }); }); - + test("get_pod_template_hash_to_deployment_version (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/x/apps/id/pod-template-hash-deployment-version-map").respondWith() - .statusCode(400).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.internal.applications.getPodTemplateHashToDeploymentVersion("id") - }).rejects.toThrow(TrueFoundry.BadRequestError); + .get("/api/svc/v1/x/apps/id/pod-template-hash-deployment-version-map") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.internal.applications.getPodTemplateHashToDeploymentVersion("id"); + }).rejects.toThrow(TrueFoundry.BadRequestError); }); - }); diff --git a/tests/wire/internal/artifactVersions.test.ts b/tests/wire/internal/artifactVersions.test.ts index 75c44b5e..15d94c64 100644 --- a/tests/wire/internal/artifactVersions.test.ts +++ b/tests/wire/internal/artifactVersions.test.ts @@ -4,83 +4,91 @@ import { TrueFoundryClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; describe("ArtifactVersionsClient", () => { - test("list", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "created_at" : "2024-01-15T09:30:00Z" , "updated_at" : "2024-01-15T09:30:00Z" , "manifest" : { "metadata" : { "key" : "value" } , "type" : "artifact-version" , "source" : { "type" : "truefoundry" } , "step" : 1 } , "id" : "jqfwg345gi25n5ju2yz5iz6m" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "ml_repo_id" : "ml_repo_id" , "usage_code_snippet" : "usage_code_snippet" , "tags" : [ "tags" ] , "artifact_id" : "artifact_id" , "artifact_size" : 1.1 , "artifact_fqn" : "artifact_fqn" , "artifact_metadata" : { "key" : "value" } , "internal_metadata" : { "key" : "value" } } ] , "pagination" : { "total" : 100 , "offset" : 0 , "limit" : 10 } }; - - server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/x/artifact-versions").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - - - const expected = { - data: [{ - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - manifest: { - metadata: { - "key": "value" + const rawResponseBody = { + data: [ + { + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + manifest: { + metadata: { key: "value" }, + type: "artifact-version", + source: { type: "truefoundry" }, + step: 1, + }, + id: "jqfwg345gi25n5ju2yz5iz6m", + fqn: "fqn", + created_by_subject: { subjectId: "subjectId", subjectType: "user" }, + ml_repo_id: "ml_repo_id", + usage_code_snippet: "usage_code_snippet", + tags: ["tags"], + artifact_id: "artifact_id", + artifact_size: 1.1, + artifact_fqn: "artifact_fqn", + artifact_metadata: { key: "value" }, + internal_metadata: { key: "value" }, }, - type: "artifact-version", - source: { - type: "truefoundry" + ], + pagination: { total: 100, offset: 0, limit: 10 }, + }; + + server + .mockEndpoint() + .get("/api/svc/v1/x/artifact-versions") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + data: [ + { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + manifest: { + metadata: { + key: "value", + }, + type: "artifact-version", + source: { + type: "truefoundry", + }, + step: 1, + }, + id: "jqfwg345gi25n5ju2yz5iz6m", + fqn: "fqn", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + mlRepoId: "ml_repo_id", + usageCodeSnippet: "usage_code_snippet", + tags: ["tags"], + artifactId: "artifact_id", + artifactSize: 1.1, + artifactFqn: "artifact_fqn", + artifactMetadata: { + key: "value", + }, + internalMetadata: { + key: "value", + }, }, - step: 1 + ], + pagination: { + total: 100, + offset: 0, + limit: 10, }, - id: "jqfwg345gi25n5ju2yz5iz6m", - fqn: "fqn", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" - }, - mlRepoId: "ml_repo_id", - usageCodeSnippet: "usage_code_snippet", - tags: ["tags"], - artifactId: "artifact_id", - artifactSize: 1.1, - artifactFqn: "artifact_fqn", - artifactMetadata: { - "key": "value" - }, - internalMetadata: { - "key": "value" - } - }], - pagination: { - total: 100, - offset: 0, - limit: 10 - } -}; - const page = await client.internal.artifactVersions.list({ - limit: 10, - offset: 0, - tag: "tag", - fqn: "fqn", - artifactId: "artifact_id", - mlRepoId: "ml_repo_id", - name: "name", - version: 1, - runIds: ["run_ids"], - runSteps: [1.1], - includeInternalMetadata: true, - includeModelVersions: true, - artifactTypes: ["artifact_types"] -}); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - + }; + const page = await client.internal.artifactVersions.list({ + limit: 10, + offset: 0, + }); + + expect(expected.data).toEqual(page.data); }); - }); diff --git a/tests/wire/internal/buildLogs.test.ts b/tests/wire/internal/buildLogs.test.ts index e9dd445c..6993805e 100644 --- a/tests/wire/internal/buildLogs.test.ts +++ b/tests/wire/internal/buildLogs.test.ts @@ -5,58 +5,64 @@ import { TrueFoundryClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; describe("BuildLogsClient", () => { - test("get (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "logs" : [ { "job_name" : "job_name" , "log" : "log" , "stream" : "stdout" , "time" : "1635467890123456789" , "containerName" : "containerName" } ] }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + logs: [ + { + job_name: "job_name", + log: "log", + stream: "stdout", + time: "1635467890123456789", + containerName: "containerName", + }, + ], + }; + server .mockEndpoint() - .get("/api/svc/v1/x/build-logs/pipelineRunName").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.internal.buildLogs.get("pipelineRunName", { - startTs: "1635467890123456789", - endTs: "1635467891123456789", - limit: "limit", - direction: "direction", - filterQuery: "{\"matchString\":\"error\",\"type\":\"substring\",\"operator\":\"equal\"}", - numLogsToIgnore: 1.1 -}); - expect(response).toEqual({ - logs: [{ - jobName: "job_name", - log: "log", - stream: "stdout", - time: "1635467890123456789", - containerName: "containerName" - }] -}); - - + .get("/api/svc/v1/x/build-logs/pipelineRunName") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.internal.buildLogs.get("pipelineRunName", { + startTs: "1635467890123456789", + endTs: "1635467891123456789", + filterQuery: '{"matchString":"error","type":"substring","operator":"equal"}', + }); + expect(response).toEqual({ + logs: [ + { + jobName: "job_name", + log: "log", + stream: "stdout", + time: "1635467890123456789", + containerName: "containerName", + }, + ], + }); }); - + test("get (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/x/build-logs/pipelineRunName").respondWith() - .statusCode(400).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.internal.buildLogs.get("pipelineRunName") - }).rejects.toThrow(TrueFoundry.BadRequestError); + .get("/api/svc/v1/x/build-logs/pipelineRunName") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.internal.buildLogs.get("pipelineRunName"); + }).rejects.toThrow(TrueFoundry.BadRequestError); }); - }); diff --git a/tests/wire/internal/clusters.test.ts b/tests/wire/internal/clusters.test.ts index f170d342..c602df02 100644 --- a/tests/wire/internal/clusters.test.ts +++ b/tests/wire/internal/clusters.test.ts @@ -5,47 +5,44 @@ import { TrueFoundryClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; describe("ClustersClient", () => { - test("get_autoprovisioning_state (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "state" : { "key" : "value" } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { state: { key: "value" } }; + server .mockEndpoint() - .get("/api/svc/v1/x/clusters/id/autoprovisioning-state").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.internal.clusters.getAutoprovisioningState("id"); - expect(response).toEqual({ - state: { - "key": "value" - } -}); - - + .get("/api/svc/v1/x/clusters/id/autoprovisioning-state") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.internal.clusters.getAutoprovisioningState("id"); + expect(response).toEqual({ + state: { + key: "value", + }, + }); }); - + test("get_autoprovisioning_state (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .get("/api/svc/v1/x/clusters/id/autoprovisioning-state").respondWith() - .statusCode(401).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.internal.clusters.getAutoprovisioningState("id") - }).rejects.toThrow(TrueFoundry.UnauthorizedError); + .get("/api/svc/v1/x/clusters/id/autoprovisioning-state") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.internal.clusters.getAutoprovisioningState("id"); + }).rejects.toThrow(TrueFoundry.UnauthorizedError); }); - }); diff --git a/tests/wire/internal/deployments.test.ts b/tests/wire/internal/deployments.test.ts index 70921b5c..bb768f1b 100644 --- a/tests/wire/internal/deployments.test.ts +++ b/tests/wire/internal/deployments.test.ts @@ -5,204 +5,231 @@ import { TrueFoundryClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; describe("DeploymentsClient", () => { - test("get_deployment_statuses (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = [ { "id" : "id" , "deploymentId" : "deploymentId" , "status" : "INITIALIZED" , "state" : { "key" : "value" } , "transition" : "BUILDING" , "message" : "message" , "retryCount" : 1.1 , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" } ]; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = [ + { + id: "id", + deploymentId: "deploymentId", + status: "INITIALIZED", + state: { key: "value" }, + transition: "BUILDING", + message: "message", + retryCount: 1.1, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + }, + ]; + server .mockEndpoint() - .get("/api/svc/v1/x/apps/id/deployments/deploymentId/statuses").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.internal.deployments.getDeploymentStatuses("id", "deploymentId"); - expect(response).toEqual([{ - id: "id", - deploymentId: "deploymentId", - status: "INITIALIZED", - state: { - "key": "value" - }, - transition: "BUILDING", - message: "message", - retryCount: 1.1, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z") - }]); - - + .get("/api/svc/v1/x/apps/id/deployments/deploymentId/statuses") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.internal.deployments.getDeploymentStatuses("id", "deploymentId"); + expect(response).toEqual([ + { + id: "id", + deploymentId: "deploymentId", + status: "INITIALIZED", + state: { + key: "value", + }, + transition: "BUILDING", + message: "message", + retryCount: 1.1, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ]); }); - + test("get_deployment_statuses (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/x/apps/id/deployments/deploymentId/statuses").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.internal.deployments.getDeploymentStatuses("id", "deploymentId") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .get("/api/svc/v1/x/apps/id/deployments/deploymentId/statuses") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.internal.deployments.getDeploymentStatuses("id", "deploymentId"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("get_builds (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = [ { "id" : "id" , "deploymentId" : "deploymentId" , "componentName" : "componentName" , "build" : { "name" : "name" , "status" : 20 } , "buildId" : "buildId" , "imageUri" : "imageUri" , "name" : "name" , "status" : "STARTED" , "getLogsUrl" : "getLogsUrl" , "tailLogsUrl" : "tailLogsUrl" , "logsStartTs" : "logsStartTs" , "metadata" : { "key" : "value" } , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" } ]; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = [ + { + id: "id", + deploymentId: "deploymentId", + componentName: "componentName", + build: { name: "name", status: 20 }, + buildId: "buildId", + imageUri: "imageUri", + name: "name", + status: "STARTED", + getLogsUrl: "getLogsUrl", + tailLogsUrl: "tailLogsUrl", + logsStartTs: "logsStartTs", + metadata: { key: "value" }, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + }, + ]; + server .mockEndpoint() - .get("/api/svc/v1/x/apps/id/deployments/deploymentId/builds").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.internal.deployments.getBuilds("id", "deploymentId"); - expect(response).toEqual([{ - id: "id", - deploymentId: "deploymentId", - componentName: "componentName", - build: { - name: "name", - status: 20 - }, - buildId: "buildId", - imageUri: "imageUri", - name: "name", - status: "STARTED", - getLogsUrl: "getLogsUrl", - tailLogsUrl: "tailLogsUrl", - logsStartTs: "logsStartTs", - metadata: { - "key": "value" - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z") - }]); - - + .get("/api/svc/v1/x/apps/id/deployments/deploymentId/builds") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.internal.deployments.getBuilds("id", "deploymentId"); + expect(response).toEqual([ + { + id: "id", + deploymentId: "deploymentId", + componentName: "componentName", + build: { + name: "name", + status: 20, + }, + buildId: "buildId", + imageUri: "imageUri", + name: "name", + status: "STARTED", + getLogsUrl: "getLogsUrl", + tailLogsUrl: "tailLogsUrl", + logsStartTs: "logsStartTs", + metadata: { + key: "value", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ]); }); - + test("get_builds (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/x/apps/id/deployments/deploymentId/builds").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.internal.deployments.getBuilds("id", "deploymentId") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .get("/api/svc/v1/x/apps/id/deployments/deploymentId/builds") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.internal.deployments.getBuilds("id", "deploymentId"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("get_code_upload_url", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "serviceName" : "serviceName" , "workspaceFqn" : "workspaceFqn" }; - const rawResponseBody = { "uri" : "uri" , "url" : "url" , "headers" : { "key" : "value" } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { serviceName: "serviceName", workspaceFqn: "workspaceFqn" }; + const rawResponseBody = { uri: "uri", url: "url", headers: { key: "value" } }; + server .mockEndpoint() - .post("/api/svc/v1/deployment/code-upload-url").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.internal.deployments.getCodeUploadUrl({ - serviceName: "serviceName", - workspaceFqn: "workspaceFqn" -}); - expect(response).toEqual({ - uri: "uri", - url: "url", - headers: { - "key": "value" - } -}); - - + .post("/api/svc/v1/deployment/code-upload-url") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.internal.deployments.getCodeUploadUrl({ + serviceName: "serviceName", + workspaceFqn: "workspaceFqn", + }); + expect(response).toEqual({ + uri: "uri", + url: "url", + headers: { + key: "value", + }, + }); }); - + test("get_suggested_endpoint (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "host" : "host" , "path" : "path" , "gateway" : { "uid" : "uid" , "name" : "name" , "hosts" : [ "hosts" ] , "isTieBreaker" : true , "selector" : { "key" : "value" } } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + host: "host", + path: "path", + gateway: { uid: "uid", name: "name", hosts: ["hosts"], isTieBreaker: true, selector: { key: "value" } }, + }; + server .mockEndpoint() - .get("/api/svc/v1/deployment/deployment-endpoint").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.internal.deployments.getSuggestedEndpoint({ - applicationType: "async-service", - applicationName: "applicationName", - workspaceId: "workspaceId", - baseDomain: "baseDomain", - port: "port", - preferWildcard: true -}); - expect(response).toEqual({ - host: "host", - path: "path", - gateway: { - uid: "uid", - name: "name", - hosts: ["hosts"], - isTieBreaker: true, - selector: { - "key": "value" - } - } -}); - - + .get("/api/svc/v1/deployment/deployment-endpoint") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.internal.deployments.getSuggestedEndpoint({ + applicationType: "async-service", + applicationName: "applicationName", + workspaceId: "workspaceId", + }); + expect(response).toEqual({ + host: "host", + path: "path", + gateway: { + uid: "uid", + name: "name", + hosts: ["hosts"], + isTieBreaker: true, + selector: { + key: "value", + }, + }, + }); }); - + test("get_suggested_endpoint (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/deployment/deployment-endpoint").respondWith() - .statusCode(400).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.internal.deployments.getSuggestedEndpoint({ - applicationType: "async-service", - applicationName: "applicationName", - workspaceId: "workspaceId" -}) - }).rejects.toThrow(TrueFoundry.BadRequestError); + .get("/api/svc/v1/deployment/deployment-endpoint") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.internal.deployments.getSuggestedEndpoint({ + applicationType: "async-service", + applicationName: "applicationName", + workspaceId: "workspaceId", + }); + }).rejects.toThrow(TrueFoundry.BadRequestError); }); - }); diff --git a/tests/wire/internal/dockerRegistries.test.ts b/tests/wire/internal/dockerRegistries.test.ts index 919ec94e..c1663590 100644 --- a/tests/wire/internal/dockerRegistries.test.ts +++ b/tests/wire/internal/dockerRegistries.test.ts @@ -5,83 +5,75 @@ import { TrueFoundryClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; describe("DockerRegistriesClient", () => { - test("create_repository (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "fqn" : "fqn" , "applicationName" : "applicationName" , "workspaceFqn" : "workspaceFqn" }; - const rawResponseBody = { "repoName" : "repoName" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { fqn: "fqn", applicationName: "applicationName", workspaceFqn: "workspaceFqn" }; + const rawResponseBody = { repoName: "repoName" }; + server .mockEndpoint() - .post("/api/svc/v1/docker-registry/create-repo").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .post("/api/svc/v1/docker-registry/create-repo") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.internal.dockerRegistries.createRepository({ - fqn: "fqn", - applicationName: "applicationName", - workspaceFqn: "workspaceFqn" -}); - expect(response).toEqual({ - repoName: "repoName" -}); - - + const response = await client.internal.dockerRegistries.createRepository({ + fqn: "fqn", + applicationName: "applicationName", + workspaceFqn: "workspaceFqn", + }); + expect(response).toEqual({ + repoName: "repoName", + }); }); - + test("create_repository (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "fqn" : "fqn" , "applicationName" : "applicationName" , "workspaceFqn" : "workspaceFqn" }; - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { fqn: "fqn", applicationName: "applicationName", workspaceFqn: "workspaceFqn" }; + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .post("/api/svc/v1/docker-registry/create-repo").jsonBody(rawRequestBody) - .respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); + .post("/api/svc/v1/docker-registry/create-repo") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.internal.dockerRegistries.createRepository({ - fqn: "fqn", - applicationName: "applicationName", - workspaceFqn: "workspaceFqn" -}) - }).rejects.toThrow(TrueFoundry.NotFoundError); + await expect(async () => { + return await client.internal.dockerRegistries.createRepository({ + fqn: "fqn", + applicationName: "applicationName", + workspaceFqn: "workspaceFqn", + }); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("get_credentials", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "fqn" : "fqn" , "registryUrl" : "registryUrl" , "username" : "username" , "password" : "password" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { fqn: "fqn", registryUrl: "registryUrl", username: "username", password: "password" }; + server .mockEndpoint() - .get("/api/svc/v1/docker-registry/creds").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .get("/api/svc/v1/docker-registry/creds") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.internal.dockerRegistries.getCredentials({ - fqn: "fqn", - clusterId: "clusterId" -}); - expect(response).toEqual({ - fqn: "fqn", - registryUrl: "registryUrl", - username: "username", - password: "password" -}); - - + const response = await client.internal.dockerRegistries.getCredentials(); + expect(response).toEqual({ + fqn: "fqn", + registryUrl: "registryUrl", + username: "username", + password: "password", + }); }); - }); diff --git a/tests/wire/internal/metrics.test.ts b/tests/wire/internal/metrics.test.ts index 26ad7a8d..f9850e87 100644 --- a/tests/wire/internal/metrics.test.ts +++ b/tests/wire/internal/metrics.test.ts @@ -5,103 +5,105 @@ import { TrueFoundryClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; describe("MetricsClient", () => { - test("get_charts (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "step" : "30s" , "graphs" : [ { "name" : "name" , "description" : "description" , "chart" : "chart" , "chartType" : "line" , "params" : "params" } ] }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + step: "30s", + graphs: [{ name: "name", description: "description", chart: "chart", chartType: "line", params: "params" }], + }; + server .mockEndpoint() - .get("/api/svc/v1/metrics/workspaceId/charts").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.internal.metrics.getCharts("workspaceId", { - applicationId: "applicationId", - startTs: "startTs", - endTs: "endTs", - filterEntity: "application", - filterQuery: "{\"pod\":\"my-app-abc123-xyz\"}" -}); - expect(response).toEqual({ - step: "30s", - graphs: [{ - name: "name", - description: "description", - chart: "chart", - chartType: "line", - params: "params" - }] -}); - - + .get("/api/svc/v1/metrics/workspaceId/charts") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.internal.metrics.getCharts("workspaceId", { + applicationId: "applicationId", + filterEntity: "application", + filterQuery: '{"pod":"my-app-abc123-xyz"}', + }); + expect(response).toEqual({ + step: "30s", + graphs: [ + { + name: "name", + description: "description", + chart: "chart", + chartType: "line", + params: "params", + }, + ], + }); }); - + test("get_charts (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/metrics/workspaceId/charts").respondWith() - .statusCode(400).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.internal.metrics.getCharts("workspaceId", { - applicationId: "applicationId", - filterEntity: "application" -}) - }).rejects.toThrow(TrueFoundry.BadRequestError); + .get("/api/svc/v1/metrics/workspaceId/charts") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.internal.metrics.getCharts("workspaceId", { + applicationId: "applicationId", + filterEntity: "application", + }); + }).rejects.toThrow(TrueFoundry.BadRequestError); }); - + test("get_charts (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/metrics/workspaceId/charts").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.internal.metrics.getCharts("workspaceId", { - applicationId: "applicationId", - filterEntity: "application" -}) - }).rejects.toThrow(TrueFoundry.NotFoundError); + .get("/api/svc/v1/metrics/workspaceId/charts") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.internal.metrics.getCharts("workspaceId", { + applicationId: "applicationId", + filterEntity: "application", + }); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("get_charts (4)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/metrics/workspaceId/charts").respondWith() - .statusCode(405).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.internal.metrics.getCharts("workspaceId", { - applicationId: "applicationId", - filterEntity: "application" -}) - }).rejects.toThrow(TrueFoundry.MethodNotAllowedError); + .get("/api/svc/v1/metrics/workspaceId/charts") + .respondWith() + .statusCode(405) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.internal.metrics.getCharts("workspaceId", { + applicationId: "applicationId", + filterEntity: "application", + }); + }).rejects.toThrow(TrueFoundry.MethodNotAllowedError); }); - }); diff --git a/tests/wire/internal/users.test.ts b/tests/wire/internal/users.test.ts index 2a32aa9e..ad108a3d 100644 --- a/tests/wire/internal/users.test.ts +++ b/tests/wire/internal/users.test.ts @@ -4,114 +4,183 @@ import { TrueFoundryClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; describe("UsersClient", () => { - test("get_info", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "userName" : "userName" , "subjectSlug" : "subjectSlug" , "subjectControllerName" : "subjectControllerName" , "subjectPatName" : "subjectPatName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" , "email" : "email" , "subjectType" : "user" , "tenantName" : "tenantName" , "roles" : [ "roles" ] , "teams" : [ { "name" : "name" , "id" : "jqfwg345gi25n5ju2yz5iz6m" } ] , "accounts" : [ { "name" : "name" , "id" : "jqfwg345gi25n5ju2yz5iz6m" } ] , "metadata" : { "sub" : "sub" , "imageURL" : "imageURL" , "pictureDownloadPath" : "pictureDownloadPath" , "displayName" : "displayName" , "userObject" : { "key" : "value" } , "inviteAccepted" : true , "registeredInIdp" : true , "preference" : { "key" : "value" } , "groups" : [ "groups" ] , "tenantRoleManagedBy" : "manual" , "ssoName" : "ssoName" , "scimUserObject" : { "key" : "value" } , "createdByScim" : true } , "createdAt" : "2024-01-15T09:30:00Z" , "isBillingEnabled" : true , "actor" : { "organization" : "org_abc123" } , "serviceAccountMetadata" : { "key" : "value" } , "account" : { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "tenantName" : "tenantName" , "fqn" : "fqn" , "manifest" : { "key" : "value" } , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "isEditable" : true } , "rootAccount" : { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "tenantName" : "tenantName" , "fqn" : "fqn" , "manifest" : { "key" : "value" } , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "isEditable" : true } , "effectiveUserId" : "effectiveUserId" }; - - server - .mockEndpoint() - .get("/api/svc/v1/x/users/info").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - - - const response = await client.internal.users.getInfo(); - expect(response).toEqual({ - id: "jqfwg345gi25n5ju2yz5iz6m", - userName: "userName", - subjectSlug: "subjectSlug", - subjectControllerName: "subjectControllerName", - subjectPatName: "subjectPatName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug", - email: "email", - subjectType: "user", - tenantName: "tenantName", - roles: ["roles"], - teams: [{ - name: "name", - id: "jqfwg345gi25n5ju2yz5iz6m" - }], - accounts: [{ - name: "name", - id: "jqfwg345gi25n5ju2yz5iz6m" - }], - metadata: { - sub: "sub", - imageUrl: "imageURL", - pictureDownloadPath: "pictureDownloadPath", - displayName: "displayName", - userObject: { - "key": "value" - }, - inviteAccepted: true, - registeredInIdp: true, - preference: { - "key": "value" - }, - groups: ["groups"], - tenantRoleManagedBy: "manual", - ssoName: "ssoName", - scimUserObject: { - "key": "value" - }, - createdByScim: true - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - isBillingEnabled: true, - actor: { - organization: "org_abc123" - }, - serviceAccountMetadata: { - "key": "value" - }, - account: { - id: "jqfwg345gi25n5ju2yz5iz6m", - tenantName: "tenantName", - fqn: "fqn", - manifest: { - "key": "value" - }, - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", + const rawResponseBody = { + id: "jqfwg345gi25n5ju2yz5iz6m", + userName: "userName", subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - isEditable: true - }, - rootAccount: { - id: "jqfwg345gi25n5ju2yz5iz6m", - tenantName: "tenantName", - fqn: "fqn", - manifest: { - "key": "value" - }, - createdBySubject: { - subjectId: "subjectId", + subjectPatName: "subjectPatName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + email: "email", subjectType: "user", + tenantName: "tenantName", + roles: ["roles"], + teams: [{ name: "name", id: "jqfwg345gi25n5ju2yz5iz6m" }], + accounts: [{ name: "name", id: "jqfwg345gi25n5ju2yz5iz6m" }], + metadata: { + sub: "sub", + imageURL: "imageURL", + pictureDownloadPath: "pictureDownloadPath", + displayName: "displayName", + userObject: { key: "value" }, + inviteAccepted: true, + registeredInIdp: true, + preference: { key: "value" }, + groups: ["groups"], + tenantRoleManagedBy: "manual", + ssoName: "ssoName", + scimUserObject: { key: "value" }, + createdByScim: true, + }, + createdAt: "2024-01-15T09:30:00Z", + isBillingEnabled: true, + actor: { organization: "org_abc123" }, + serviceAccountMetadata: { key: "value" }, + account: { + id: "jqfwg345gi25n5ju2yz5iz6m", + tenantName: "tenantName", + fqn: "fqn", + manifest: { key: "value" }, + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + isEditable: true, + }, + rootAccount: { + id: "jqfwg345gi25n5ju2yz5iz6m", + tenantName: "tenantName", + fqn: "fqn", + manifest: { key: "value" }, + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + isEditable: true, + }, + effectiveUserId: "effectiveUserId", + }; + + server + .mockEndpoint() + .get("/api/svc/v1/x/users/info") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.internal.users.getInfo(); + expect(response).toEqual({ + id: "jqfwg345gi25n5ju2yz5iz6m", + userName: "userName", subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - isEditable: true - }, - effectiveUserId: "effectiveUserId" -}); - - + subjectPatName: "subjectPatName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + email: "email", + subjectType: "user", + tenantName: "tenantName", + roles: ["roles"], + teams: [ + { + name: "name", + id: "jqfwg345gi25n5ju2yz5iz6m", + }, + ], + accounts: [ + { + name: "name", + id: "jqfwg345gi25n5ju2yz5iz6m", + }, + ], + metadata: { + sub: "sub", + imageUrl: "imageURL", + pictureDownloadPath: "pictureDownloadPath", + displayName: "displayName", + userObject: { + key: "value", + }, + inviteAccepted: true, + registeredInIdp: true, + preference: { + key: "value", + }, + groups: ["groups"], + tenantRoleManagedBy: "manual", + ssoName: "ssoName", + scimUserObject: { + key: "value", + }, + createdByScim: true, + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + isBillingEnabled: true, + actor: { + organization: "org_abc123", + }, + serviceAccountMetadata: { + key: "value", + }, + account: { + id: "jqfwg345gi25n5ju2yz5iz6m", + tenantName: "tenantName", + fqn: "fqn", + manifest: { + key: "value", + }, + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + isEditable: true, + }, + rootAccount: { + id: "jqfwg345gi25n5ju2yz5iz6m", + tenantName: "tenantName", + fqn: "fqn", + manifest: { + key: "value", + }, + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + isEditable: true, + }, + effectiveUserId: "effectiveUserId", + }); }); - }); diff --git a/tests/wire/internal/vcs.test.ts b/tests/wire/internal/vcs.test.ts index af830344..f1a2dc6a 100644 --- a/tests/wire/internal/vcs.test.ts +++ b/tests/wire/internal/vcs.test.ts @@ -4,56 +4,50 @@ import { TrueFoundryClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; describe("VcsClient", () => { - test("get_repository_details", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "repoURL" : "repoURL" }; - const rawResponseBody = { "exists" : true , "id" : "id" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { repoURL: "repoURL" }; + const rawResponseBody = { exists: true, id: "id" }; + server .mockEndpoint() - .post("/api/svc/v1/vcs/repository/details").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .post("/api/svc/v1/vcs/repository/details") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.internal.vcs.getRepositoryDetails({ - repoUrl: "repoURL" -}); - expect(response).toEqual({ - exists: true, - id: "id" -}); - - + const response = await client.internal.vcs.getRepositoryDetails({ + repoUrl: "repoURL", + }); + expect(response).toEqual({ + exists: true, + id: "id", + }); }); - + test("get_authenticated_url", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "repoURL" : "repoURL" }; - const rawResponseBody = { "authenticatedURL" : "authenticatedURL" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { repoURL: "repoURL" }; + const rawResponseBody = { authenticatedURL: "authenticatedURL" }; + server .mockEndpoint() - .post("/api/svc/v1/vcs/repository/authenticated-url").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .post("/api/svc/v1/vcs/repository/authenticated-url") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.internal.vcs.getAuthenticatedUrl({ - repoUrl: "repoURL" -}); - expect(response).toEqual({ - authenticatedUrl: "authenticatedURL" -}); - - + const response = await client.internal.vcs.getAuthenticatedUrl({ + repoUrl: "repoURL", + }); + expect(response).toEqual({ + authenticatedUrl: "authenticatedURL", + }); }); - }); diff --git a/tests/wire/internal/workflows.test.ts b/tests/wire/internal/workflows.test.ts index 94681e90..b15a0647 100644 --- a/tests/wire/internal/workflows.test.ts +++ b/tests/wire/internal/workflows.test.ts @@ -5,66 +5,64 @@ import { TrueFoundryClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; describe("WorkflowsClient", () => { - test("execute_workflow (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { }; - const rawResponseBody = { "executionName" : "executionName" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { executionName: "executionName" }; + server .mockEndpoint() - .post("/api/svc/v1/workflow/applicationId/executions").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .post("/api/svc/v1/workflow/applicationId/executions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.internal.workflows.executeWorkflow("applicationId"); - expect(response).toEqual({ - executionName: "executionName" -}); - - + const response = await client.internal.workflows.executeWorkflow("applicationId"); + expect(response).toEqual({ + executionName: "executionName", + }); }); - + test("execute_workflow (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { }; - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .post("/api/svc/v1/workflow/applicationId/executions").jsonBody(rawRequestBody) - .respondWith() - .statusCode(400).jsonBody(rawResponseBody) - .build(); + .post("/api/svc/v1/workflow/applicationId/executions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.internal.workflows.executeWorkflow("applicationId") - }).rejects.toThrow(TrueFoundry.BadRequestError); + await expect(async () => { + return await client.internal.workflows.executeWorkflow("applicationId"); + }).rejects.toThrow(TrueFoundry.BadRequestError); }); - + test("execute_workflow (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { }; - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .post("/api/svc/v1/workflow/applicationId/executions").jsonBody(rawRequestBody) - .respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); + .post("/api/svc/v1/workflow/applicationId/executions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.internal.workflows.executeWorkflow("applicationId") - }).rejects.toThrow(TrueFoundry.NotFoundError); + await expect(async () => { + return await client.internal.workflows.executeWorkflow("applicationId"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - }); diff --git a/tests/wire/jobs.test.ts b/tests/wire/jobs.test.ts index da200768..8f2a67bd 100644 --- a/tests/wire/jobs.test.ts +++ b/tests/wire/jobs.test.ts @@ -5,522 +5,602 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("JobsClient", () => { - test("list_runs (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "name" : "name" , "applicationName" : "applicationName" , "deploymentVersion" : "deploymentVersion" , "createdAt" : 1.1 , "endTime" : 1.1 , "duration" : 1 , "command" : "command" , "totalRetries" : 1 , "error" : "error" , "status" : "CREATED" , "triggeredBy" : "triggeredBy" , "triggeredBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "exitCode" : 1 , "sparkUi" : "sparkUi" , "applicationId" : "applicationId" , "deploymentId" : "deploymentId" , "tenantName" : "tenantName" } ] , "pagination" : { "total" : 100 , "offset" : 0 , "limit" : 10 } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + id: "jqfwg345gi25n5ju2yz5iz6m", + name: "name", + applicationName: "applicationName", + deploymentVersion: "deploymentVersion", + createdAt: 1.1, + endTime: 1.1, + duration: 1, + command: "command", + totalRetries: 1, + error: "error", + status: "CREATED", + triggeredBy: "triggeredBy", + triggeredBySubject: { subjectId: "subjectId", subjectType: "user" }, + exitCode: 1, + sparkUi: "sparkUi", + applicationId: "applicationId", + deploymentId: "deploymentId", + tenantName: "tenantName", + }, + ], + pagination: { total: 100, offset: 0, limit: 10 }, + }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/jobs/jobId/runs").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const expected = { - data: [{ - id: "jqfwg345gi25n5ju2yz5iz6m", - name: "name", - applicationName: "applicationName", - deploymentVersion: "deploymentVersion", - createdAt: 1.1, - endTime: 1.1, - duration: 1, - command: "command", - totalRetries: 1, - error: "error", - status: "CREATED", - triggeredBy: "triggeredBy", - triggeredBySubject: { - subjectId: "subjectId", - subjectType: "user" + .mockEndpoint() + .get("/api/svc/v1/jobs/jobId/runs") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + data: [ + { + id: "jqfwg345gi25n5ju2yz5iz6m", + name: "name", + applicationName: "applicationName", + deploymentVersion: "deploymentVersion", + createdAt: 1.1, + endTime: 1.1, + duration: 1, + command: "command", + totalRetries: 1, + error: "error", + status: "CREATED", + triggeredBy: "triggeredBy", + triggeredBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + exitCode: 1, + sparkUi: "sparkUi", + applicationId: "applicationId", + deploymentId: "deploymentId", + tenantName: "tenantName", + }, + ], + pagination: { + total: 100, + offset: 0, + limit: 10, }, - exitCode: 1, - sparkUi: "sparkUi", - applicationId: "applicationId", - deploymentId: "deploymentId", - tenantName: "tenantName" - }], - pagination: { - total: 100, - offset: 0, - limit: 10 - } -}; - const page = await client.jobs.listRuns("jobId", { - limit: 10, - offset: 0, - searchPrefix: "searchPrefix", - sortBy: "startTime", - order: "asc", - triggeredBy: ["triggeredBy"], - status: ["CREATED"], - versionNumbers: [1.1] -}); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - + }; + const page = await client.jobs.listRuns("jobId", { + limit: 10, + offset: 0, + }); + + expect(expected.data).toEqual(page.data); }); - + test("list_runs (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/jobs/jobId/runs").respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.jobs.listRuns("jobId") - }).rejects.toThrow(TrueFoundry.ForbiddenError); + .mockEndpoint() + .get("/api/svc/v1/jobs/jobId/runs") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.jobs.listRuns("jobId"); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("list_runs (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/jobs/jobId/runs").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.jobs.listRuns("jobId") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .mockEndpoint() + .get("/api/svc/v1/jobs/jobId/runs") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.jobs.listRuns("jobId"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("list_runs (4)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/jobs/jobId/runs").respondWith() - .statusCode(422).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.jobs.listRuns("jobId") - }).rejects.toThrow(TrueFoundry.UnprocessableEntityError); + .mockEndpoint() + .get("/api/svc/v1/jobs/jobId/runs") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.jobs.listRuns("jobId"); + }).rejects.toThrow(TrueFoundry.UnprocessableEntityError); }); - + test("get_run (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "name" : "name" , "applicationName" : "applicationName" , "deploymentVersion" : "deploymentVersion" , "createdAt" : 1.1 , "endTime" : 1.1 , "duration" : 1 , "command" : "command" , "totalRetries" : 1 , "error" : "error" , "status" : "CREATED" , "triggeredBy" : "triggeredBy" , "triggeredBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "exitCode" : 1 , "sparkUi" : "sparkUi" , "applicationId" : "applicationId" , "deploymentId" : "deploymentId" , "tenantName" : "tenantName" } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + name: "name", + applicationName: "applicationName", + deploymentVersion: "deploymentVersion", + createdAt: 1.1, + endTime: 1.1, + duration: 1, + command: "command", + totalRetries: 1, + error: "error", + status: "CREATED", + triggeredBy: "triggeredBy", + triggeredBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + exitCode: 1, + sparkUi: "sparkUi", + applicationId: "applicationId", + deploymentId: "deploymentId", + tenantName: "tenantName", + }, + }; + server .mockEndpoint() - .get("/api/svc/v1/jobs/jobId/runs/jobRunName").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.jobs.getRun("jobId", "jobRunName"); - expect(response).toEqual({ - data: { - id: "jqfwg345gi25n5ju2yz5iz6m", - name: "name", - applicationName: "applicationName", - deploymentVersion: "deploymentVersion", - createdAt: 1.1, - endTime: 1.1, - duration: 1, - command: "command", - totalRetries: 1, - error: "error", - status: "CREATED", - triggeredBy: "triggeredBy", - triggeredBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - exitCode: 1, - sparkUi: "sparkUi", - applicationId: "applicationId", - deploymentId: "deploymentId", - tenantName: "tenantName" - } -}); - - + .get("/api/svc/v1/jobs/jobId/runs/jobRunName") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.jobs.getRun("jobId", "jobRunName"); + expect(response).toEqual({ + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + name: "name", + applicationName: "applicationName", + deploymentVersion: "deploymentVersion", + createdAt: 1.1, + endTime: 1.1, + duration: 1, + command: "command", + totalRetries: 1, + error: "error", + status: "CREATED", + triggeredBy: "triggeredBy", + triggeredBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + exitCode: 1, + sparkUi: "sparkUi", + applicationId: "applicationId", + deploymentId: "deploymentId", + tenantName: "tenantName", + }, + }); }); - + test("get_run (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .get("/api/svc/v1/jobs/jobId/runs/jobRunName").respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.jobs.getRun("jobId", "jobRunName") - }).rejects.toThrow(TrueFoundry.ForbiddenError); + .get("/api/svc/v1/jobs/jobId/runs/jobRunName") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.jobs.getRun("jobId", "jobRunName"); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("get_run (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/jobs/jobId/runs/jobRunName").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.jobs.getRun("jobId", "jobRunName") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .get("/api/svc/v1/jobs/jobId/runs/jobRunName") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.jobs.getRun("jobId", "jobRunName"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("delete_run (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message" }; + server .mockEndpoint() - .delete("/api/svc/v1/jobs/jobId/runs/jobRunName").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.jobs.deleteRun("jobId", "jobRunName"); - expect(response).toEqual({ - message: "message" -}); - - + .delete("/api/svc/v1/jobs/jobId/runs/jobRunName") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.jobs.deleteRun("jobId", "jobRunName"); + expect(response).toEqual({ + message: "message", + }); }); - + test("delete_run (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .delete("/api/svc/v1/jobs/jobId/runs/jobRunName").respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.jobs.deleteRun("jobId", "jobRunName") - }).rejects.toThrow(TrueFoundry.ForbiddenError); + .delete("/api/svc/v1/jobs/jobId/runs/jobRunName") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.jobs.deleteRun("jobId", "jobRunName"); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("delete_run (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .delete("/api/svc/v1/jobs/jobId/runs/jobRunName").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.jobs.deleteRun("jobId", "jobRunName") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .delete("/api/svc/v1/jobs/jobId/runs/jobRunName") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.jobs.deleteRun("jobId", "jobRunName"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("delete_run (4)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .delete("/api/svc/v1/jobs/jobId/runs/jobRunName").respondWith() - .statusCode(409).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.jobs.deleteRun("jobId", "jobRunName") - }).rejects.toThrow(TrueFoundry.ConflictError); + .delete("/api/svc/v1/jobs/jobId/runs/jobRunName") + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.jobs.deleteRun("jobId", "jobRunName"); + }).rejects.toThrow(TrueFoundry.ConflictError); }); - + test("trigger (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { }; - const rawResponseBody = { "message" : "message" , "jobRunName" : "jobRunName" , "data" : { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "name" : "name" , "applicationName" : "applicationName" , "deploymentVersion" : "deploymentVersion" , "createdAt" : 1.1 , "endTime" : 1.1 , "duration" : 1 , "command" : "command" , "totalRetries" : 1 , "error" : "error" , "status" : "CREATED" , "triggeredBy" : "triggeredBy" , "triggeredBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "exitCode" : 1 , "sparkUi" : "sparkUi" , "applicationId" : "applicationId" , "deploymentId" : "deploymentId" , "tenantName" : "tenantName" } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { + message: "message", + jobRunName: "jobRunName", + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + name: "name", + applicationName: "applicationName", + deploymentVersion: "deploymentVersion", + createdAt: 1.1, + endTime: 1.1, + duration: 1, + command: "command", + totalRetries: 1, + error: "error", + status: "CREATED", + triggeredBy: "triggeredBy", + triggeredBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + exitCode: 1, + sparkUi: "sparkUi", + applicationId: "applicationId", + deploymentId: "deploymentId", + tenantName: "tenantName", + }, + }; + server .mockEndpoint() - .post("/api/svc/v1/jobs/trigger").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.jobs.trigger(); - expect(response).toEqual({ - message: "message", - jobRunName: "jobRunName", - data: { - id: "jqfwg345gi25n5ju2yz5iz6m", - name: "name", - applicationName: "applicationName", - deploymentVersion: "deploymentVersion", - createdAt: 1.1, - endTime: 1.1, - duration: 1, - command: "command", - totalRetries: 1, - error: "error", - status: "CREATED", - triggeredBy: "triggeredBy", - triggeredBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - exitCode: 1, - sparkUi: "sparkUi", - applicationId: "applicationId", - deploymentId: "deploymentId", - tenantName: "tenantName" - } -}); - - + .post("/api/svc/v1/jobs/trigger") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.jobs.trigger(); + expect(response).toEqual({ + message: "message", + jobRunName: "jobRunName", + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + name: "name", + applicationName: "applicationName", + deploymentVersion: "deploymentVersion", + createdAt: 1.1, + endTime: 1.1, + duration: 1, + command: "command", + totalRetries: 1, + error: "error", + status: "CREATED", + triggeredBy: "triggeredBy", + triggeredBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + exitCode: 1, + sparkUi: "sparkUi", + applicationId: "applicationId", + deploymentId: "deploymentId", + tenantName: "tenantName", + }, + }); }); - + test("trigger (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { }; - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .post("/api/svc/v1/jobs/trigger").jsonBody(rawRequestBody) - .respondWith() - .statusCode(400).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.jobs.trigger() - }).rejects.toThrow(TrueFoundry.BadRequestError); + .post("/api/svc/v1/jobs/trigger") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.jobs.trigger(); + }).rejects.toThrow(TrueFoundry.BadRequestError); }); - + test("trigger (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .post("/api/svc/v1/jobs/trigger").jsonBody(rawRequestBody) - .respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.jobs.trigger() - }).rejects.toThrow(TrueFoundry.ForbiddenError); + .post("/api/svc/v1/jobs/trigger") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.jobs.trigger(); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("trigger (4)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { }; - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .post("/api/svc/v1/jobs/trigger").jsonBody(rawRequestBody) - .respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.jobs.trigger() - }).rejects.toThrow(TrueFoundry.NotFoundError); + .post("/api/svc/v1/jobs/trigger") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.jobs.trigger(); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("trigger (5)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .post("/api/svc/v1/jobs/trigger").jsonBody(rawRequestBody) - .respondWith() - .statusCode(422).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.jobs.trigger() - }).rejects.toThrow(TrueFoundry.UnprocessableEntityError); + .post("/api/svc/v1/jobs/trigger") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.jobs.trigger(); + }).rejects.toThrow(TrueFoundry.UnprocessableEntityError); }); - + test("terminate (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "message" : "message" , "jobRunStatus" : "CREATED" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { message: "message", jobRunStatus: "CREATED" }; + server .mockEndpoint() - .post("/api/svc/v1/jobs/terminate").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.jobs.terminate({ - deploymentId: "deploymentId", - jobRunName: "jobRunName" -}); - expect(response).toEqual({ - message: "message", - jobRunStatus: "CREATED" -}); - - + .post("/api/svc/v1/jobs/terminate") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.jobs.terminate({ + deploymentId: "deploymentId", + jobRunName: "jobRunName", + }); + expect(response).toEqual({ + message: "message", + jobRunStatus: "CREATED", + }); }); - + test("terminate (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .post("/api/svc/v1/jobs/terminate").respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.jobs.terminate({ - deploymentId: "deploymentId", - jobRunName: "jobRunName" -}) - }).rejects.toThrow(TrueFoundry.ForbiddenError); + .post("/api/svc/v1/jobs/terminate") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.jobs.terminate({ + deploymentId: "deploymentId", + jobRunName: "jobRunName", + }); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("terminate (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .post("/api/svc/v1/jobs/terminate").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.jobs.terminate({ - deploymentId: "deploymentId", - jobRunName: "jobRunName" -}) - }).rejects.toThrow(TrueFoundry.NotFoundError); + .post("/api/svc/v1/jobs/terminate") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.jobs.terminate({ + deploymentId: "deploymentId", + jobRunName: "jobRunName", + }); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("terminate (4)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .post("/api/svc/v1/jobs/terminate").respondWith() - .statusCode(417).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.jobs.terminate({ - deploymentId: "deploymentId", - jobRunName: "jobRunName" -}) - }).rejects.toThrow(TrueFoundry.ExpectationFailedError); + .post("/api/svc/v1/jobs/terminate") + .respondWith() + .statusCode(417) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.jobs.terminate({ + deploymentId: "deploymentId", + jobRunName: "jobRunName", + }); + }).rejects.toThrow(TrueFoundry.ExpectationFailedError); }); - + test("terminate (5)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .post("/api/svc/v1/jobs/terminate").respondWith() - .statusCode(422).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.jobs.terminate({ - deploymentId: "deploymentId", - jobRunName: "jobRunName" -}) - }).rejects.toThrow(TrueFoundry.UnprocessableEntityError); + .post("/api/svc/v1/jobs/terminate") + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.jobs.terminate({ + deploymentId: "deploymentId", + jobRunName: "jobRunName", + }); + }).rejects.toThrow(TrueFoundry.UnprocessableEntityError); }); - }); diff --git a/tests/wire/logs.test.ts b/tests/wire/logs.test.ts index 1d2a8974..4aace9dd 100644 --- a/tests/wire/logs.test.ts +++ b/tests/wire/logs.test.ts @@ -5,69 +5,52 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("LogsClient", () => { - test("get (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "job_name" : "job_name" , "log" : "log" , "stream" : "stdout" , "time" : "1635467890123456789" , "containerName" : "containerName" } ] }; - - server - .mockEndpoint() - .get("/api/svc/v1/logs").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - - - const response = await client.logs.get({ - startTs: "1779262323000000000", - endTs: "1779348723000000000", - limit: 1, - direction: "asc", - numLogsToIgnore: 1, - applicationId: "applicationId", - applicationFqn: "applicationFqn", - deploymentId: "deploymentId", - jobRunName: "jobRunName", - podName: "podName", - containerName: "containerName", - podNames: ["podNames"], - podNamesRegex: "podNamesRegex", - searchFilters: "[{\"string\":\"error\",\"type\":\"substring\",\"operator\":\"equal\"}]", - searchString: "searchString", - searchType: "regex", - searchOperator: "equal" -}); - expect(response).toEqual({ - data: [{ - jobName: "job_name", - log: "log", - stream: "stdout", - time: "1635467890123456789", - containerName: "containerName" - }] -}); - - + const rawResponseBody = { + data: [ + { + job_name: "job_name", + log: "log", + stream: "stdout", + time: "1635467890123456789", + containerName: "containerName", + }, + ], + }; + + server.mockEndpoint().get("/api/svc/v1/logs").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const response = await client.logs.get({ + startTs: "1779262323000000000", + endTs: "1779348723000000000", + searchFilters: '[{"string":"error","type":"substring","operator":"equal"}]', + }); + expect(response).toEqual({ + data: [ + { + jobName: "job_name", + log: "log", + stream: "stdout", + time: "1635467890123456789", + containerName: "containerName", + }, + ], + }); }); - + test("get (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - - server - .mockEndpoint() - .get("/api/svc/v1/logs").respondWith() - .statusCode(400).jsonBody(rawResponseBody) - .build(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + + server.mockEndpoint().get("/api/svc/v1/logs").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.logs.get() - }).rejects.toThrow(TrueFoundry.BadRequestError); + await expect(async () => { + return await client.logs.get(); + }).rejects.toThrow(TrueFoundry.BadRequestError); }); - }); diff --git a/tests/wire/main.test.ts b/tests/wire/main.test.ts index dddcbf68..6692c3a6 100644 --- a/tests/wire/main.test.ts +++ b/tests/wire/main.test.ts @@ -4,85 +4,171 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("TrueFoundryClient", () => { - test("apply", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "ml-repo" , "name" : "name" , "storage_integration_fqn" : "storage_integration_fqn" , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } ] } }; - const rawResponseBody = { "existingManifest" : { "type" : "ml-repo" , "name" : "name" , "description" : "description" , "storage_integration_fqn" : "storage_integration_fqn" , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } ] , "ownedBy" : { "account" : "account" } } , "action" : "CREATE" , "data" : { "key" : "value" } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + type: "ml-repo", + name: "name", + storage_integration_fqn: "storage_integration_fqn", + collaborators: [{ subject: "subject", role_id: "role_id" }], + }, + }; + const rawResponseBody = { + existingManifest: { + type: "ml-repo", + name: "name", + description: "description", + storage_integration_fqn: "storage_integration_fqn", + collaborators: [{ subject: "subject", role_id: "role_id" }], + ownedBy: { account: "account" }, + }, + action: "CREATE", + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + fqn: "fqn", + provider: "aws", + manifest: { key: "value" }, + integrations: [ + { + id: "jqfwg345gi25n5ju2yz5iz6m", + name: "name", + fqn: "fqn", + type: "blob-storage", + providerAccountFqn: "providerAccountFqn", + tenantName: "tenantName", + createdBySubject: { subjectId: "subjectId", subjectType: "user" }, + }, + ], + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + accountId: "accountId", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + createdBy: "createdBy", + }, + }; + server .mockEndpoint() - .put("/api/svc/v1/apply").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .put("/api/svc/v1/apply") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.apply({ - manifest: { - type: "ml-repo", - name: "name", - storageIntegrationFqn: "storage_integration_fqn", - collaborators: [{ - subject: "subject", - roleId: "role_id" - }] - } -}); - expect(response).toEqual({ - existingManifest: { - type: "ml-repo", - name: "name", - description: "description", - storageIntegrationFqn: "storage_integration_fqn", - collaborators: [{ - subject: "subject", - roleId: "role_id" - }], - ownedBy: { - account: "account" - } - }, - action: "CREATE", - data: { - "key": "value" - } -}); - - + const response = await client.apply({ + manifest: { + type: "ml-repo", + name: "name", + storageIntegrationFqn: "storage_integration_fqn", + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + ], + }, + }); + expect(response).toEqual({ + existingManifest: { + type: "ml-repo", + name: "name", + description: "description", + storageIntegrationFqn: "storage_integration_fqn", + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + ], + ownedBy: { + account: "account", + }, + }, + action: "CREATE", + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + fqn: "fqn", + provider: "aws", + manifest: { + key: "value", + }, + integrations: [ + { + id: "jqfwg345gi25n5ju2yz5iz6m", + name: "name", + fqn: "fqn", + type: "blob-storage", + providerAccountFqn: "providerAccountFqn", + tenantName: "tenantName", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + }, + ], + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + accountId: "accountId", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + createdBy: "createdBy", + }, + }); }); - + test("delete", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "ml-repo" , "name" : "name" , "storage_integration_fqn" : "storage_integration_fqn" , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } ] } }; - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + type: "ml-repo", + name: "name", + storage_integration_fqn: "storage_integration_fqn", + collaborators: [{ subject: "subject", role_id: "role_id" }], + }, + }; + const rawResponseBody = {}; + server .mockEndpoint() - .post("/api/svc/v1/delete").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .post("/api/svc/v1/delete") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.delete({ - manifest: { - type: "ml-repo", - name: "name", - storageIntegrationFqn: "storage_integration_fqn", - collaborators: [{ - subject: "subject", - roleId: "role_id" - }] - } -}); - expect(response).toEqual({}); - - + const response = await client.delete({ + manifest: { + type: "ml-repo", + name: "name", + storageIntegrationFqn: "storage_integration_fqn", + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + ], + }, + }); + expect(response).toEqual({}); }); - }); diff --git a/tests/wire/mlRepos.test.ts b/tests/wire/mlRepos.test.ts index 635ce19c..20cbdb3b 100644 --- a/tests/wire/mlRepos.test.ts +++ b/tests/wire/mlRepos.test.ts @@ -5,369 +5,504 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("MlReposClient", () => { - test("get (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : { "tenant_name" : "truefoundry" , "manifest" : { "type" : "ml-repo" , "name" : "name" , "description" : "description" , "storage_integration_fqn" : "storage_integration_fqn" , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } ] , "ownedBy" : { "account" : "account" } } , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "created_at" : "2024-01-15T09:30:00Z" , "account_id" : "account_id" , "id" : "420" , "num_runs" : 10 , "artifact_type_counts" : { "key" : 1 } , "datasets_count" : 10 , "tracing_projects_count" : 1 } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: { + tenant_name: "truefoundry", + manifest: { + type: "ml-repo", + name: "name", + description: "description", + storage_integration_fqn: "storage_integration_fqn", + collaborators: [{ subject: "subject", role_id: "role_id" }], + ownedBy: { account: "account" }, + }, + created_by_subject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + created_at: "2024-01-15T09:30:00Z", + account_id: "account_id", + id: "420", + num_runs: 10, + artifact_type_counts: { key: 1 }, + datasets_count: 10, + tracing_projects_count: 1, + }, + }; + server .mockEndpoint() - .get("/api/svc/v1/ml-repos/id").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.mlRepos.get("id"); - expect(response).toEqual({ - data: { - tenantName: "truefoundry", - manifest: { - type: "ml-repo", - name: "name", - description: "description", - storageIntegrationFqn: "storage_integration_fqn", - collaborators: [{ - subject: "subject", - roleId: "role_id" - }], - ownedBy: { - account: "account" - } - }, - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - accountId: "account_id", - id: "420", - numRuns: 10, - artifactTypeCounts: { - "key": 1 - }, - datasetsCount: 10, - tracingProjectsCount: 1 - } -}); - - + .get("/api/svc/v1/ml-repos/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.mlRepos.get("id"); + expect(response).toEqual({ + data: { + tenantName: "truefoundry", + manifest: { + type: "ml-repo", + name: "name", + description: "description", + storageIntegrationFqn: "storage_integration_fqn", + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + ], + ownedBy: { + account: "account", + }, + }, + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + accountId: "account_id", + id: "420", + numRuns: 10, + artifactTypeCounts: { + key: 1, + }, + datasetsCount: 10, + tracingProjectsCount: 1, + }, + }); }); - + test("get (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/ml-repos/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.mlRepos.get("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .get("/api/svc/v1/ml-repos/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.mlRepos.get("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("delete (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = {}; + server .mockEndpoint() - .delete("/api/svc/v1/ml-repos/id").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.mlRepos.delete("id"); - expect(response).toEqual({}); - - + .delete("/api/svc/v1/ml-repos/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.mlRepos.delete("id"); + expect(response).toEqual({}); }); - + test("delete (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .delete("/api/svc/v1/ml-repos/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.mlRepos.delete("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .delete("/api/svc/v1/ml-repos/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.mlRepos.delete("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("list", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "tenant_name" : "truefoundry" , "manifest" : { "type" : "ml-repo" , "name" : "name" , "storage_integration_fqn" : "storage_integration_fqn" , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } ] } , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "created_at" : "2024-01-15T09:30:00Z" , "account_id" : "account_id" , "id" : "420" , "num_runs" : 10 , "datasets_count" : 10 , "tracing_projects_count" : 1 } ] , "pagination" : { "total" : 100 , "offset" : 0 , "limit" : 10 } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + tenant_name: "truefoundry", + manifest: { + type: "ml-repo", + name: "name", + storage_integration_fqn: "storage_integration_fqn", + collaborators: [{ subject: "subject", role_id: "role_id" }], + }, + created_by_subject: { subjectId: "subjectId", subjectType: "user" }, + created_at: "2024-01-15T09:30:00Z", + account_id: "account_id", + id: "420", + num_runs: 10, + datasets_count: 10, + tracing_projects_count: 1, + }, + ], + pagination: { total: 100, offset: 0, limit: 10 }, + }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/ml-repos").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const expected = { - data: [{ - tenantName: "truefoundry", + .mockEndpoint() + .get("/api/svc/v1/ml-repos") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + data: [ + { + tenantName: "truefoundry", + manifest: { + type: "ml-repo", + name: "name", + storageIntegrationFqn: "storage_integration_fqn", + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + ], + }, + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + accountId: "account_id", + id: "420", + numRuns: 10, + datasetsCount: 10, + tracingProjectsCount: 1, + }, + ], + pagination: { + total: 100, + offset: 0, + limit: 10, + }, + }; + const page = await client.mlRepos.list({ + limit: 10, + offset: 0, + }); + + expect(expected.data).toEqual(page.data); + }); + + test("create_or_update (1)", async () => { + const server = mockServerPool.createServer(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { manifest: { type: "ml-repo", name: "name", - storageIntegrationFqn: "storage_integration_fqn", - collaborators: [{ - subject: "subject", - roleId: "role_id" - }] + storage_integration_fqn: "storage_integration_fqn", + collaborators: [{ subject: "subject", role_id: "role_id" }], }, - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" + }; + const rawResponseBody = { + data: { + tenant_name: "truefoundry", + manifest: { + type: "ml-repo", + name: "name", + description: "description", + storage_integration_fqn: "storage_integration_fqn", + collaborators: [{ subject: "subject", role_id: "role_id" }], + ownedBy: { account: "account" }, + }, + created_by_subject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + created_at: "2024-01-15T09:30:00Z", + account_id: "account_id", + id: "420", + num_runs: 10, + artifact_type_counts: { key: 1 }, + datasets_count: 10, + tracing_projects_count: 1, }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - accountId: "account_id", - id: "420", - numRuns: 10, - datasetsCount: 10, - tracingProjectsCount: 1 - }], - pagination: { - total: 100, - offset: 0, - limit: 10 - } -}; - const page = await client.mlRepos.list({ - limit: 10, - offset: 0, - name: "name", - attributes: ["attributes"] -}); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - - }); - - test("create_or_update (1)", async () => { - const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "ml-repo" , "name" : "name" , "storage_integration_fqn" : "storage_integration_fqn" , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } ] } }; - const rawResponseBody = { "data" : { "tenant_name" : "truefoundry" , "manifest" : { "type" : "ml-repo" , "name" : "name" , "description" : "description" , "storage_integration_fqn" : "storage_integration_fqn" , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } ] , "ownedBy" : { "account" : "account" } } , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "created_at" : "2024-01-15T09:30:00Z" , "account_id" : "account_id" , "id" : "420" , "num_runs" : 10 , "artifact_type_counts" : { "key" : 1 } , "datasets_count" : 10 , "tracing_projects_count" : 1 } }; - + }; + server .mockEndpoint() - .put("/api/svc/v1/ml-repos").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.mlRepos.createOrUpdate({ - manifest: { - type: "ml-repo", - name: "name", - storageIntegrationFqn: "storage_integration_fqn", - collaborators: [{ - subject: "subject", - roleId: "role_id" - }] - } -}); - expect(response).toEqual({ - data: { - tenantName: "truefoundry", - manifest: { - type: "ml-repo", - name: "name", - description: "description", - storageIntegrationFqn: "storage_integration_fqn", - collaborators: [{ - subject: "subject", - roleId: "role_id" - }], - ownedBy: { - account: "account" - } - }, - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - accountId: "account_id", - id: "420", - numRuns: 10, - artifactTypeCounts: { - "key": 1 - }, - datasetsCount: 10, - tracingProjectsCount: 1 - } -}); - - + .put("/api/svc/v1/ml-repos") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.mlRepos.createOrUpdate({ + manifest: { + type: "ml-repo", + name: "name", + storageIntegrationFqn: "storage_integration_fqn", + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + ], + }, + }); + expect(response).toEqual({ + data: { + tenantName: "truefoundry", + manifest: { + type: "ml-repo", + name: "name", + description: "description", + storageIntegrationFqn: "storage_integration_fqn", + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + ], + ownedBy: { + account: "account", + }, + }, + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + accountId: "account_id", + id: "420", + numRuns: 10, + artifactTypeCounts: { + key: 1, + }, + datasetsCount: 10, + tracingProjectsCount: 1, + }, + }); }); - + test("create_or_update (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "ml-repo" , "name" : "name" , "storage_integration_fqn" : "storage_integration_fqn" , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } , { "subject" : "subject" , "role_id" : "role_id" } ] } }; - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + type: "ml-repo", + name: "name", + storage_integration_fqn: "storage_integration_fqn", + collaborators: [ + { subject: "subject", role_id: "role_id" }, + { subject: "subject", role_id: "role_id" }, + ], + }, + }; + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .put("/api/svc/v1/ml-repos").jsonBody(rawRequestBody) - .respondWith() - .statusCode(400).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.mlRepos.createOrUpdate({ - manifest: { - type: "ml-repo", - name: "name", - storageIntegrationFqn: "storage_integration_fqn", - collaborators: [{ - subject: "subject", - roleId: "role_id" - }, { - subject: "subject", - roleId: "role_id" - }] - } -}) - }).rejects.toThrow(TrueFoundry.BadRequestError); + .put("/api/svc/v1/ml-repos") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.mlRepos.createOrUpdate({ + manifest: { + type: "ml-repo", + name: "name", + storageIntegrationFqn: "storage_integration_fqn", + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + { + subject: "subject", + roleId: "role_id", + }, + ], + }, + }); + }).rejects.toThrow(TrueFoundry.BadRequestError); }); - + test("create_or_update (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "ml-repo" , "name" : "name" , "storage_integration_fqn" : "storage_integration_fqn" , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } , { "subject" : "subject" , "role_id" : "role_id" } ] } }; - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + type: "ml-repo", + name: "name", + storage_integration_fqn: "storage_integration_fqn", + collaborators: [ + { subject: "subject", role_id: "role_id" }, + { subject: "subject", role_id: "role_id" }, + ], + }, + }; + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .put("/api/svc/v1/ml-repos").jsonBody(rawRequestBody) - .respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.mlRepos.createOrUpdate({ - manifest: { - type: "ml-repo", - name: "name", - storageIntegrationFqn: "storage_integration_fqn", - collaborators: [{ - subject: "subject", - roleId: "role_id" - }, { - subject: "subject", - roleId: "role_id" - }] - } -}) - }).rejects.toThrow(TrueFoundry.NotFoundError); + .put("/api/svc/v1/ml-repos") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.mlRepos.createOrUpdate({ + manifest: { + type: "ml-repo", + name: "name", + storageIntegrationFqn: "storage_integration_fqn", + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + { + subject: "subject", + roleId: "role_id", + }, + ], + }, + }); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("create_or_update (4)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "ml-repo" , "name" : "name" , "storage_integration_fqn" : "storage_integration_fqn" , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } , { "subject" : "subject" , "role_id" : "role_id" } ] } }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + type: "ml-repo", + name: "name", + storage_integration_fqn: "storage_integration_fqn", + collaborators: [ + { subject: "subject", role_id: "role_id" }, + { subject: "subject", role_id: "role_id" }, + ], + }, + }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .put("/api/svc/v1/ml-repos").jsonBody(rawRequestBody) - .respondWith() - .statusCode(409).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.mlRepos.createOrUpdate({ - manifest: { - type: "ml-repo", - name: "name", - storageIntegrationFqn: "storage_integration_fqn", - collaborators: [{ - subject: "subject", - roleId: "role_id" - }, { - subject: "subject", - roleId: "role_id" - }] - } -}) - }).rejects.toThrow(TrueFoundry.ConflictError); + .put("/api/svc/v1/ml-repos") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.mlRepos.createOrUpdate({ + manifest: { + type: "ml-repo", + name: "name", + storageIntegrationFqn: "storage_integration_fqn", + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + { + subject: "subject", + roleId: "role_id", + }, + ], + }, + }); + }).rejects.toThrow(TrueFoundry.ConflictError); }); - + test("create_or_update (5)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "ml-repo" , "name" : "name" , "storage_integration_fqn" : "storage_integration_fqn" , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } , { "subject" : "subject" , "role_id" : "role_id" } ] } }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + type: "ml-repo", + name: "name", + storage_integration_fqn: "storage_integration_fqn", + collaborators: [ + { subject: "subject", role_id: "role_id" }, + { subject: "subject", role_id: "role_id" }, + ], + }, + }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .put("/api/svc/v1/ml-repos").jsonBody(rawRequestBody) - .respondWith() - .statusCode(422).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.mlRepos.createOrUpdate({ - manifest: { - type: "ml-repo", - name: "name", - storageIntegrationFqn: "storage_integration_fqn", - collaborators: [{ - subject: "subject", - roleId: "role_id" - }, { - subject: "subject", - roleId: "role_id" - }] - } -}) - }).rejects.toThrow(TrueFoundry.UnprocessableEntityError); + .put("/api/svc/v1/ml-repos") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.mlRepos.createOrUpdate({ + manifest: { + type: "ml-repo", + name: "name", + storageIntegrationFqn: "storage_integration_fqn", + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + { + subject: "subject", + roleId: "role_id", + }, + ], + }, + }); + }).rejects.toThrow(TrueFoundry.UnprocessableEntityError); }); - }); diff --git a/tests/wire/modelVersions.test.ts b/tests/wire/modelVersions.test.ts index 47043974..32c1ad25 100644 --- a/tests/wire/modelVersions.test.ts +++ b/tests/wire/modelVersions.test.ts @@ -5,220 +5,263 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("ModelVersionsClient", () => { - test("list", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "created_at" : "2024-01-15T09:30:00Z" , "updated_at" : "2024-01-15T09:30:00Z" , "manifest" : { "metadata" : { "key" : "value" } , "type" : "model-version" , "source" : { "type" : "truefoundry" } , "step" : 1 } , "id" : "id" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "ml_repo_id" : "ml_repo_id" , "usage_code_snippet" : "usage_code_snippet" , "tags" : [ "tags" ] , "model_id" : "model_id" , "metrics" : [ { "key" : "key" } ] , "deployable" : true } ] , "pagination" : { "total" : 100 , "offset" : 0 , "limit" : 10 } }; - - server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/model-versions").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const expected = { - data: [{ - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - manifest: { - metadata: { - "key": "value" + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + manifest: { + metadata: { key: "value" }, + type: "model-version", + source: { type: "truefoundry" }, + step: 1, + }, + id: "id", + fqn: "fqn", + created_by_subject: { subjectId: "subjectId", subjectType: "user" }, + ml_repo_id: "ml_repo_id", + usage_code_snippet: "usage_code_snippet", + tags: ["tags"], + model_id: "model_id", + metrics: [{ key: "key" }], + deployable: true, }, - type: "model-version", - source: { - type: "truefoundry" + ], + pagination: { total: 100, offset: 0, limit: 10 }, + }; + + server + .mockEndpoint() + .get("/api/svc/v1/model-versions") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + data: [ + { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + manifest: { + metadata: { + key: "value", + }, + type: "model-version", + source: { + type: "truefoundry", + }, + step: 1, + }, + id: "id", + fqn: "fqn", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + mlRepoId: "ml_repo_id", + usageCodeSnippet: "usage_code_snippet", + tags: ["tags"], + modelId: "model_id", + metrics: [ + { + key: "key", + }, + ], + deployable: true, }, - step: 1 - }, - id: "id", - fqn: "fqn", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" + ], + pagination: { + total: 100, + offset: 0, + limit: 10, }, - mlRepoId: "ml_repo_id", - usageCodeSnippet: "usage_code_snippet", - tags: ["tags"], - modelId: "model_id", - metrics: [{ - key: "key" - }], - deployable: true - }], - pagination: { - total: 100, - offset: 0, - limit: 10 - } -}; - const page = await client.modelVersions.list({ - limit: 10, - offset: 0, - tag: "tag", - fqn: "fqn", - modelId: "model_id", - mlRepoId: "ml_repo_id", - name: "name", - version: 1, - runIds: ["run_ids"], - runSteps: [1.1], - includeInternalMetadata: true -}); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - + }; + const page = await client.modelVersions.list({ + limit: 10, + offset: 0, + }); + + expect(expected.data).toEqual(page.data); }); - + test("apply_tags", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "model_version_id" : "model_version_id" , "tags" : [ "tags" ] }; - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { model_version_id: "model_version_id", tags: ["tags"] }; + const rawResponseBody = {}; + server .mockEndpoint() - .put("/api/svc/v1/model-versions/tags").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.modelVersions.applyTags({ - modelVersionId: "model_version_id", - tags: ["tags"] -}); - expect(response).toEqual({}); - - + .put("/api/svc/v1/model-versions/tags") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.modelVersions.applyTags({ + modelVersionId: "model_version_id", + tags: ["tags"], + }); + expect(response).toEqual({}); }); - + test("get (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : { "created_at" : "2024-01-15T09:30:00Z" , "updated_at" : "2024-01-15T09:30:00Z" , "manifest" : { "name" : "name" , "metadata" : { "key" : "value" } , "ml_repo" : "ml_repo" , "version" : 1 , "type" : "model-version" , "description" : "description" , "version_alias" : "version_alias" , "source" : { "type" : "truefoundry" } , "framework" : { "type" : "transformers" } , "step" : 1 , "run_id" : "run_id" } , "id" : "id" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "ml_repo_id" : "ml_repo_id" , "usage_code_snippet" : "usage_code_snippet" , "tags" : [ "tags" ] , "model_id" : "model_id" , "metrics" : [ { "key" : "key" } ] , "deployable" : true } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: { + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + manifest: { + name: "name", + metadata: { key: "value" }, + ml_repo: "ml_repo", + version: 1, + type: "model-version", + description: "description", + version_alias: "version_alias", + source: { type: "truefoundry" }, + framework: { type: "transformers" }, + step: 1, + run_id: "run_id", + }, + id: "id", + fqn: "fqn", + created_by_subject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + ml_repo_id: "ml_repo_id", + usage_code_snippet: "usage_code_snippet", + tags: ["tags"], + model_id: "model_id", + metrics: [{ key: "key" }], + deployable: true, + }, + }; + server .mockEndpoint() - .get("/api/svc/v1/model-versions/id").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.modelVersions.get("id"); - expect(response).toEqual({ - data: { - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - manifest: { - name: "name", - metadata: { - "key": "value" - }, - mlRepo: "ml_repo", - version: 1, - type: "model-version", - description: "description", - versionAlias: "version_alias", - source: { - type: "truefoundry" - }, - framework: { - type: "transformers" + .get("/api/svc/v1/model-versions/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.modelVersions.get("id"); + expect(response).toEqual({ + data: { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + manifest: { + name: "name", + metadata: { + key: "value", + }, + mlRepo: "ml_repo", + version: 1, + type: "model-version", + description: "description", + versionAlias: "version_alias", + source: { + type: "truefoundry", + }, + framework: { + type: "transformers", + }, + step: 1, + runId: "run_id", + }, + id: "id", + fqn: "fqn", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + mlRepoId: "ml_repo_id", + usageCodeSnippet: "usage_code_snippet", + tags: ["tags"], + modelId: "model_id", + metrics: [ + { + key: "key", + }, + ], + deployable: true, }, - step: 1, - runId: "run_id" - }, - id: "id", - fqn: "fqn", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - mlRepoId: "ml_repo_id", - usageCodeSnippet: "usage_code_snippet", - tags: ["tags"], - modelId: "model_id", - metrics: [{ - key: "key" - }], - deployable: true - } -}); - - + }); }); - + test("get (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/model-versions/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.modelVersions.get("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .get("/api/svc/v1/model-versions/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.modelVersions.get("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("delete (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = {}; + server .mockEndpoint() - .delete("/api/svc/v1/model-versions/id").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.modelVersions.delete("id"); - expect(response).toEqual({}); - - + .delete("/api/svc/v1/model-versions/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.modelVersions.delete("id"); + expect(response).toEqual({}); }); - + test("delete (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .delete("/api/svc/v1/model-versions/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.modelVersions.delete("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .delete("/api/svc/v1/model-versions/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.modelVersions.delete("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - }); diff --git a/tests/wire/models.test.ts b/tests/wire/models.test.ts index 92e7f6d4..786a3746 100644 --- a/tests/wire/models.test.ts +++ b/tests/wire/models.test.ts @@ -5,278 +5,365 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("ModelsClient", () => { - test("get (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : { "id" : "id" , "ml_repo_id" : "ml_repo_id" , "type" : "model" , "name" : "name" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "created_at" : "2024-01-15T09:30:00Z" , "updated_at" : "2024-01-15T09:30:00Z" , "latest_version" : { "created_at" : "2024-01-15T09:30:00Z" , "updated_at" : "2024-01-15T09:30:00Z" , "manifest" : { "metadata" : { "key" : "value" } , "type" : "model-version" , "source" : { "type" : "truefoundry" } , "step" : 1 } , "id" : "id" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "ml_repo_id" : "ml_repo_id" , "usage_code_snippet" : "usage_code_snippet" , "tags" : [ "tags" ] , "model_id" : "model_id" , "metrics" : [ { "key" : "key" } ] , "deployable" : true } , "run_steps" : [ 1.1 ] } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: { + id: "id", + ml_repo_id: "ml_repo_id", + type: "model", + name: "name", + fqn: "fqn", + created_by_subject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + latest_version: { + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + manifest: { + metadata: { key: "value" }, + type: "model-version", + source: { type: "truefoundry" }, + step: 1, + }, + id: "id", + fqn: "fqn", + created_by_subject: { subjectId: "subjectId", subjectType: "user" }, + ml_repo_id: "ml_repo_id", + usage_code_snippet: "usage_code_snippet", + tags: ["tags"], + model_id: "model_id", + metrics: [{ key: "key" }], + deployable: true, + }, + run_steps: [1.1], + }, + }; + server .mockEndpoint() - .get("/api/svc/v1/models/id").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .get("/api/svc/v1/models/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.models.get("id"); - expect(response).toEqual({ - data: { - id: "id", - mlRepoId: "ml_repo_id", - type: "model", - name: "name", - fqn: "fqn", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - latestVersion: { - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - manifest: { - metadata: { - "key": "value" + const response = await client.models.get("id"); + expect(response).toEqual({ + data: { + id: "id", + mlRepoId: "ml_repo_id", + type: "model", + name: "name", + fqn: "fqn", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", }, - type: "model-version", - source: { - type: "truefoundry" + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + latestVersion: { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + manifest: { + metadata: { + key: "value", + }, + type: "model-version", + source: { + type: "truefoundry", + }, + step: 1, + }, + id: "id", + fqn: "fqn", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + mlRepoId: "ml_repo_id", + usageCodeSnippet: "usage_code_snippet", + tags: ["tags"], + modelId: "model_id", + metrics: [ + { + key: "key", + }, + ], + deployable: true, }, - step: 1 - }, - id: "id", - fqn: "fqn", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" + runSteps: [1.1], }, - mlRepoId: "ml_repo_id", - usageCodeSnippet: "usage_code_snippet", - tags: ["tags"], - modelId: "model_id", - metrics: [{ - key: "key" - }], - deployable: true - }, - runSteps: [1.1] - } -}); - - + }); }); - + test("get (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/models/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); + .get("/api/svc/v1/models/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.models.get("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + await expect(async () => { + return await client.models.get("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("delete (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = {}; + server .mockEndpoint() - .delete("/api/svc/v1/models/id").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .delete("/api/svc/v1/models/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.models.delete("id"); - expect(response).toEqual({}); - - + const response = await client.models.delete("id"); + expect(response).toEqual({}); }); - + test("delete (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .delete("/api/svc/v1/models/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); + .delete("/api/svc/v1/models/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.models.delete("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + await expect(async () => { + return await client.models.delete("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("list", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "id" : "id" , "ml_repo_id" : "ml_repo_id" , "type" : "model" , "name" : "name" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "created_at" : "2024-01-15T09:30:00Z" , "updated_at" : "2024-01-15T09:30:00Z" , "latest_version" : { "manifest" : { "metadata" : { "key" : "value" } , "type" : "model-version" , "source" : { "type" : "truefoundry" } , "step" : 1 } , "id" : "id" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "ml_repo_id" : "ml_repo_id" , "model_id" : "model_id" } , "run_steps" : [ 1.1 ] } ] , "pagination" : { "total" : 100 , "offset" : 0 , "limit" : 10 } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + id: "id", + ml_repo_id: "ml_repo_id", + type: "model", + name: "name", + fqn: "fqn", + created_by_subject: { subjectId: "subjectId", subjectType: "user" }, + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + latest_version: { + manifest: { + metadata: { key: "value" }, + type: "model-version", + source: { type: "truefoundry" }, + step: 1, + }, + id: "id", + fqn: "fqn", + created_by_subject: { subjectId: "subjectId", subjectType: "user" }, + ml_repo_id: "ml_repo_id", + model_id: "model_id", + }, + run_steps: [1.1], + }, + ], + pagination: { total: 100, offset: 0, limit: 10 }, + }; + + server.mockEndpoint().get("/api/svc/v1/models").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const expected = { + data: [ + { + id: "id", + mlRepoId: "ml_repo_id", + type: "model", + name: "name", + fqn: "fqn", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + latestVersion: { + manifest: { + metadata: { + key: "value", + }, + type: "model-version", + source: { + type: "truefoundry", + }, + step: 1, + }, + id: "id", + fqn: "fqn", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + mlRepoId: "ml_repo_id", + modelId: "model_id", + }, + runSteps: [1.1], + }, + ], + pagination: { + total: 100, + offset: 0, + limit: 10, + }, + }; + const page = await client.models.list({ + limit: 10, + offset: 0, + }); + + expect(expected.data).toEqual(page.data); + }); + + test("create_or_update", async () => { + const server = mockServerPool.createServer(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { metadata: { key: "value" }, type: "model-version", source: { type: "truefoundry" }, step: 1 }, + }; + const rawResponseBody = { + data: { + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + manifest: { + name: "name", + metadata: { key: "value" }, + ml_repo: "ml_repo", + version: 1, + type: "model-version", + description: "description", + version_alias: "version_alias", + source: { type: "truefoundry" }, + framework: { type: "transformers" }, + step: 1, + run_id: "run_id", + }, + id: "id", + fqn: "fqn", + created_by_subject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + ml_repo_id: "ml_repo_id", + usage_code_snippet: "usage_code_snippet", + tags: ["tags"], + model_id: "model_id", + metrics: [{ key: "key" }], + deployable: true, + }, + }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/models").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .mockEndpoint() + .put("/api/svc/v1/model-versions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const expected = { - data: [{ - id: "id", - mlRepoId: "ml_repo_id", - type: "model", - name: "name", - fqn: "fqn", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" + const response = await client.models.createOrUpdate({ + manifest: { + metadata: { + key: "value", + }, + type: "model-version", + source: { + type: "truefoundry", + }, + step: 1, }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - latestVersion: { + }); + expect(response).toEqual({ + data: { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), manifest: { + name: "name", metadata: { - "key": "value" + key: "value", }, + mlRepo: "ml_repo", + version: 1, type: "model-version", + description: "description", + versionAlias: "version_alias", source: { - type: "truefoundry" + type: "truefoundry", }, - step: 1 + framework: { + type: "transformers", + }, + step: 1, + runId: "run_id", }, id: "id", fqn: "fqn", createdBySubject: { subjectId: "subjectId", - subjectType: "user" + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", }, mlRepoId: "ml_repo_id", - modelId: "model_id" - }, - runSteps: [1.1] - }], - pagination: { - total: 100, - offset: 0, - limit: 10 - } -}; - const page = await client.models.list({ - limit: 10, - offset: 0, - fqn: "fqn", - mlRepoId: "ml_repo_id", - name: "name", - runId: "run_id", - includeEmptyModels: true -}); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - - }); - - test("create_or_update", async () => { - const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "metadata" : { "key" : "value" } , "type" : "model-version" , "source" : { "type" : "truefoundry" } , "step" : 1 } }; - const rawResponseBody = { "data" : { "created_at" : "2024-01-15T09:30:00Z" , "updated_at" : "2024-01-15T09:30:00Z" , "manifest" : { "name" : "name" , "metadata" : { "key" : "value" } , "ml_repo" : "ml_repo" , "version" : 1 , "type" : "model-version" , "description" : "description" , "version_alias" : "version_alias" , "source" : { "type" : "truefoundry" } , "framework" : { "type" : "transformers" } , "step" : 1 , "run_id" : "run_id" } , "id" : "id" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "ml_repo_id" : "ml_repo_id" , "usage_code_snippet" : "usage_code_snippet" , "tags" : [ "tags" ] , "model_id" : "model_id" , "metrics" : [ { "key" : "key" } ] , "deployable" : true } }; - - server - .mockEndpoint() - .put("/api/svc/v1/model-versions").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.models.createOrUpdate({ - manifest: { - metadata: { - "key": "value" - }, - type: "model-version", - source: { - type: "truefoundry" - }, - step: 1 - } -}); - expect(response).toEqual({ - data: { - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - manifest: { - name: "name", - metadata: { - "key": "value" - }, - mlRepo: "ml_repo", - version: 1, - type: "model-version", - description: "description", - versionAlias: "version_alias", - source: { - type: "truefoundry" - }, - framework: { - type: "transformers" + usageCodeSnippet: "usage_code_snippet", + tags: ["tags"], + modelId: "model_id", + metrics: [ + { + key: "key", + }, + ], + deployable: true, }, - step: 1, - runId: "run_id" - }, - id: "id", - fqn: "fqn", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - mlRepoId: "ml_repo_id", - usageCodeSnippet: "usage_code_snippet", - tags: ["tags"], - modelId: "model_id", - metrics: [{ - key: "key" - }], - deployable: true - } -}); - - + }); }); - }); diff --git a/tests/wire/personalAccessTokens.test.ts b/tests/wire/personalAccessTokens.test.ts index 1663c85f..836cc2f3 100644 --- a/tests/wire/personalAccessTokens.test.ts +++ b/tests/wire/personalAccessTokens.test.ts @@ -5,353 +5,455 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("PersonalAccessTokensClient", () => { - test("list", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "type" : "type" , "tenantName" : "tenantName" , "manifest" : { "name" : "name" , "type" : "virtual-account" , "permissions" : [ { "resource_fqn" : "resource_fqn" , "resource_type" : "resource_type" , "role_id" : "role_id" } ] } , "jwtId" : "jwtId" , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "lastAccessedAt" : "2024-01-15T09:30:00Z" , "isExpired" : true , "jwts" : [ { "id" : "id" , "subjectType" : "subjectType" , "subjectId" : "subjectId" , "expiry" : "2024-01-15T09:30:00Z" , "tokenType" : "jwt" , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" } ] , "accountId" : "accountId" , "metadata" : { "key" : "value" } , "roleIds" : [ "roleIds" ] , "rolesWithResource" : [ { "roleId" : "roleId" , "resourceType" : "role" , "resourceId" : "resourceId" , "roleName" : "roleName" } ] , "createdBy" : "createdBy" , "nextScheduledRotation" : "nextScheduledRotation" } ] , "pagination" : { "total" : 100 , "offset" : 0 , "limit" : 10 } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + id: "jqfwg345gi25n5ju2yz5iz6m", + type: "type", + tenantName: "tenantName", + manifest: { + name: "name", + type: "virtual-account", + permissions: [ + { resource_fqn: "resource_fqn", resource_type: "resource_type", role_id: "role_id" }, + ], + }, + jwtId: "jwtId", + createdBySubject: { subjectId: "subjectId", subjectType: "user" }, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + lastAccessedAt: "2024-01-15T09:30:00Z", + isExpired: true, + jwts: [ + { + id: "id", + subjectType: "subjectType", + subjectId: "subjectId", + expiry: "2024-01-15T09:30:00Z", + tokenType: "jwt", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + }, + ], + accountId: "accountId", + metadata: { key: "value" }, + roleIds: ["roleIds"], + rolesWithResource: [ + { roleId: "roleId", resourceType: "role", resourceId: "resourceId", roleName: "roleName" }, + ], + createdBy: "createdBy", + nextScheduledRotation: "nextScheduledRotation", + }, + ], + pagination: { total: 100, offset: 0, limit: 10 }, + }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/personal-access-tokens").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const expected = { - data: [{ - id: "jqfwg345gi25n5ju2yz5iz6m", - type: "type", - tenantName: "tenantName", - manifest: { - name: "name", - type: "virtual-account", - permissions: [{ - resourceFqn: "resource_fqn", - resourceType: "resource_type", - roleId: "role_id" - }] - }, - jwtId: "jwtId", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - lastAccessedAt: new Date("2024-01-15T09:30:00.000Z"), - isExpired: true, - jwts: [{ - id: "id", - subjectType: "subjectType", - subjectId: "subjectId", - expiry: new Date("2024-01-15T09:30:00.000Z"), - tokenType: "jwt", + .mockEndpoint() + .get("/api/svc/v1/personal-access-tokens") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + data: [ + { + id: "jqfwg345gi25n5ju2yz5iz6m", + type: "type", + tenantName: "tenantName", + manifest: { + name: "name", + type: "virtual-account", + permissions: [ + { + resourceFqn: "resource_fqn", + resourceType: "resource_type", + roleId: "role_id", + }, + ], + }, + jwtId: "jwtId", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z") - }], - accountId: "accountId", - metadata: { - "key": "value" + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + lastAccessedAt: new Date("2024-01-15T09:30:00.000Z"), + isExpired: true, + jwts: [ + { + id: "id", + subjectType: "subjectType", + subjectId: "subjectId", + expiry: new Date("2024-01-15T09:30:00.000Z"), + tokenType: "jwt", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + accountId: "accountId", + metadata: { + key: "value", + }, + roleIds: ["roleIds"], + rolesWithResource: [ + { + roleId: "roleId", + resourceType: "role", + resourceId: "resourceId", + roleName: "roleName", + }, + ], + createdBy: "createdBy", + nextScheduledRotation: "nextScheduledRotation", + }, + ], + pagination: { + total: 100, + offset: 0, + limit: 10, }, - roleIds: ["roleIds"], - rolesWithResource: [{ - roleId: "roleId", - resourceType: "role", - resourceId: "resourceId", - roleName: "roleName" - }], - createdBy: "createdBy", - nextScheduledRotation: "nextScheduledRotation" - }], - pagination: { - total: 100, - offset: 0, - limit: 10 - } -}; - const page = await client.personalAccessTokens.list({ - limit: 10, - offset: 0, - nameSearchQuery: "ci-token" -}); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - + }; + const page = await client.personalAccessTokens.list({ + limit: 10, + offset: 0, + nameSearchQuery: "ci-token", + }); + + expect(expected.data).toEqual(page.data); }); - + test("create (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "name" : "my-ci-token" }; - const rawResponseBody = { "token" : "token" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "my-ci-token" }; + const rawResponseBody = { token: "token" }; + server .mockEndpoint() - .post("/api/svc/v1/personal-access-tokens").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.personalAccessTokens.create({ - name: "my-ci-token" -}); - expect(response).toEqual({ - token: "token" -}); - - + .post("/api/svc/v1/personal-access-tokens") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.personalAccessTokens.create({ + name: "my-ci-token", + }); + expect(response).toEqual({ + token: "token", + }); }); - + test("create (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "name" : "name" }; - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .post("/api/svc/v1/personal-access-tokens").jsonBody(rawRequestBody) - .respondWith() - .statusCode(400).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.personalAccessTokens.create({ - name: "name" -}) - }).rejects.toThrow(TrueFoundry.BadRequestError); + .post("/api/svc/v1/personal-access-tokens") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.personalAccessTokens.create({ + name: "name", + }); + }).rejects.toThrow(TrueFoundry.BadRequestError); }); - + test("create (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "name" : "name" }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { name: "name" }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .post("/api/svc/v1/personal-access-tokens").jsonBody(rawRequestBody) - .respondWith() - .statusCode(409).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.personalAccessTokens.create({ - name: "name" -}) - }).rejects.toThrow(TrueFoundry.ConflictError); + .post("/api/svc/v1/personal-access-tokens") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.personalAccessTokens.create({ + name: "name", + }); + }).rejects.toThrow(TrueFoundry.ConflictError); }); - + test("revokeAll (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "email" : "alice@example.com" }; - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { email: "alice@example.com" }; + const rawResponseBody = {}; + server .mockEndpoint() - .delete("/api/svc/v1/personal-access-tokens/revoke/all").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.personalAccessTokens.revokeAll({ - email: "alice@example.com" -}); - expect(response).toEqual({}); - - + .delete("/api/svc/v1/personal-access-tokens/revoke/all") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.personalAccessTokens.revokeAll({ + email: "alice@example.com", + }); + expect(response).toEqual({}); }); - + test("revokeAll (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "email" : "email" }; - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { email: "email" }; + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .delete("/api/svc/v1/personal-access-tokens/revoke/all").jsonBody(rawRequestBody) - .respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.personalAccessTokens.revokeAll({ - email: "email" -}) - }).rejects.toThrow(TrueFoundry.NotFoundError); + .delete("/api/svc/v1/personal-access-tokens/revoke/all") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.personalAccessTokens.revokeAll({ + email: "email", + }); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("delete (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = {}; + server .mockEndpoint() - .delete("/api/svc/v1/personal-access-tokens/jqfwg345gi25n5ju2yz5iz6m").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.personalAccessTokens.delete("jqfwg345gi25n5ju2yz5iz6m"); - expect(response).toEqual({}); - - + .delete("/api/svc/v1/personal-access-tokens/jqfwg345gi25n5ju2yz5iz6m") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.personalAccessTokens.delete("jqfwg345gi25n5ju2yz5iz6m"); + expect(response).toEqual({}); }); - + test("delete (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .delete("/api/svc/v1/personal-access-tokens/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.personalAccessTokens.delete("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .delete("/api/svc/v1/personal-access-tokens/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.personalAccessTokens.delete("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("get (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "type" : "type" , "tenantName" : "tenantName" , "manifest" : { "name" : "name" , "type" : "virtual-account" , "permissions" : [ { "resource_fqn" : "resource_fqn" , "resource_type" : "resource_type" , "role_id" : "role_id" } ] , "expiration_date" : "expiration_date" , "auto_rotate" : { "auto_rotate_interval" : 1 , "grace_period" : 1 } , "notification_target" : { "type" : "email" , "notification_channel" : "notification_channel" , "to_emails" : [ "to_emails" ] } , "secret_store_config" : { "integration_fqn" : "integration_fqn" , "secret_path" : "secret_path" } , "ownedBy" : { "team" : "team" } , "tags" : { "key" : "value" } , "identity_provider_mapping" : [ { "identity_provider" : "identity_provider" , "value" : "value" } ] , "token_type" : "jwt" } , "jwtId" : "jwtId" , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "lastAccessedAt" : "2024-01-15T09:30:00Z" , "isExpired" : true , "jwts" : [ { "id" : "id" , "subjectType" : "subjectType" , "subjectId" : "subjectId" , "expiry" : "2024-01-15T09:30:00Z" , "tokenType" : "jwt" , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" } ] , "accountId" : "accountId" , "metadata" : { "key" : "value" } , "roleIds" : [ "roleIds" ] , "rolesWithResource" : [ { "roleId" : "roleId" , "resourceType" : "role" , "resourceId" : "resourceId" , "roleName" : "roleName" } ] , "createdBy" : "createdBy" , "nextScheduledRotation" : "nextScheduledRotation" } , "token" : "token" , "created" : true }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + type: "type", + tenantName: "tenantName", + manifest: { + name: "name", + type: "virtual-account", + permissions: [{ resource_fqn: "resource_fqn", resource_type: "resource_type", role_id: "role_id" }], + expiration_date: "expiration_date", + auto_rotate: { auto_rotate_interval: 1, grace_period: 1 }, + notification_target: { + type: "email", + notification_channel: "notification_channel", + to_emails: ["to_emails"], + }, + secret_store_config: { integration_fqn: "integration_fqn", secret_path: "secret_path" }, + ownedBy: { team: "team" }, + tags: { key: "value" }, + identity_provider_mapping: [{ identity_provider: "identity_provider", value: "value" }], + token_type: "jwt", + }, + jwtId: "jwtId", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + lastAccessedAt: "2024-01-15T09:30:00Z", + isExpired: true, + jwts: [ + { + id: "id", + subjectType: "subjectType", + subjectId: "subjectId", + expiry: "2024-01-15T09:30:00Z", + tokenType: "jwt", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + }, + ], + accountId: "accountId", + metadata: { key: "value" }, + roleIds: ["roleIds"], + rolesWithResource: [ + { roleId: "roleId", resourceType: "role", resourceId: "resourceId", roleName: "roleName" }, + ], + createdBy: "createdBy", + nextScheduledRotation: "nextScheduledRotation", + }, + token: "token", + created: true, + }; + server .mockEndpoint() - .get("/api/svc/v1/personal-access-tokens/name").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.personalAccessTokens.get("name", { - teamName: "teamName" -}); - expect(response).toEqual({ - data: { - id: "jqfwg345gi25n5ju2yz5iz6m", - type: "type", - tenantName: "tenantName", - manifest: { - name: "name", - type: "virtual-account", - permissions: [{ - resourceFqn: "resource_fqn", - resourceType: "resource_type", - roleId: "role_id" - }], - expirationDate: "expiration_date", - autoRotate: { - autoRotateInterval: 1, - gracePeriod: 1 - }, - notificationTarget: { - type: "email", - notificationChannel: "notification_channel", - toEmails: ["to_emails"] - }, - secretStoreConfig: { - integrationFqn: "integration_fqn", - secretPath: "secret_path" - }, - ownedBy: { - team: "team" - }, - tags: { - "key": "value" - }, - identityProviderMapping: [{ - identityProvider: "identity_provider", - value: "value" - }], - tokenType: "jwt" - }, - jwtId: "jwtId", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - lastAccessedAt: new Date("2024-01-15T09:30:00.000Z"), - isExpired: true, - jwts: [{ - id: "id", - subjectType: "subjectType", - subjectId: "subjectId", - expiry: new Date("2024-01-15T09:30:00.000Z"), - tokenType: "jwt", + .get("/api/svc/v1/personal-access-tokens/name") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.personalAccessTokens.get("name"); + expect(response).toEqual({ + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + type: "type", + tenantName: "tenantName", + manifest: { + name: "name", + type: "virtual-account", + permissions: [ + { + resourceFqn: "resource_fqn", + resourceType: "resource_type", + roleId: "role_id", + }, + ], + expirationDate: "expiration_date", + autoRotate: { + autoRotateInterval: 1, + gracePeriod: 1, + }, + notificationTarget: { + type: "email", + notificationChannel: "notification_channel", + toEmails: ["to_emails"], + }, + secretStoreConfig: { + integrationFqn: "integration_fqn", + secretPath: "secret_path", + }, + ownedBy: { + team: "team", + }, + tags: { + key: "value", + }, + identityProviderMapping: [ + { + identityProvider: "identity_provider", + value: "value", + }, + ], + tokenType: "jwt", + }, + jwtId: "jwtId", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z") - }], - accountId: "accountId", - metadata: { - "key": "value" - }, - roleIds: ["roleIds"], - rolesWithResource: [{ - roleId: "roleId", - resourceType: "role", - resourceId: "resourceId", - roleName: "roleName" - }], - createdBy: "createdBy", - nextScheduledRotation: "nextScheduledRotation" - }, - token: "token", - created: true -}); - - + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + lastAccessedAt: new Date("2024-01-15T09:30:00.000Z"), + isExpired: true, + jwts: [ + { + id: "id", + subjectType: "subjectType", + subjectId: "subjectId", + expiry: new Date("2024-01-15T09:30:00.000Z"), + tokenType: "jwt", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + accountId: "accountId", + metadata: { + key: "value", + }, + roleIds: ["roleIds"], + rolesWithResource: [ + { + roleId: "roleId", + resourceType: "role", + resourceId: "resourceId", + roleName: "roleName", + }, + ], + createdBy: "createdBy", + nextScheduledRotation: "nextScheduledRotation", + }, + token: "token", + created: true, + }); }); - + test("get (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/personal-access-tokens/name").respondWith() - .statusCode(400).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.personalAccessTokens.get("name") - }).rejects.toThrow(TrueFoundry.BadRequestError); + .get("/api/svc/v1/personal-access-tokens/name") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.personalAccessTokens.get("name"); + }).rejects.toThrow(TrueFoundry.BadRequestError); }); - }); diff --git a/tests/wire/promptVersions.test.ts b/tests/wire/promptVersions.test.ts index 8eb1f123..15355447 100644 --- a/tests/wire/promptVersions.test.ts +++ b/tests/wire/promptVersions.test.ts @@ -5,257 +5,325 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("PromptVersionsClient", () => { - test("list", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "created_at" : "2024-01-15T09:30:00Z" , "updated_at" : "2024-01-15T09:30:00Z" , "manifest" : { "metadata" : { "key" : "value" } , "type" : "chat_prompt" , "messages" : [ { "role" : "system" , "content" : "content" } ] } , "id" : "id" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "ml_repo_id" : "ml_repo_id" , "usage_code_snippet" : "usage_code_snippet" , "usage_code_snippets" : [ { "display_name" : "display_name" , "language" : "language" , "code" : "code" } ] , "tags" : [ "tags" ] , "prompt_id" : "prompt_id" } ] , "pagination" : { "total" : 100 , "offset" : 0 , "limit" : 10 } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + manifest: { + metadata: { key: "value" }, + type: "chat_prompt", + messages: [{ role: "system", content: "content" }], + }, + id: "id", + fqn: "fqn", + created_by_subject: { subjectId: "subjectId", subjectType: "user" }, + ml_repo_id: "ml_repo_id", + usage_code_snippet: "usage_code_snippet", + usage_code_snippets: [{ display_name: "display_name", language: "language", code: "code" }], + tags: ["tags"], + prompt_id: "prompt_id", + }, + ], + pagination: { total: 100, offset: 0, limit: 10 }, + }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/prompt-versions").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .mockEndpoint() + .get("/api/svc/v1/prompt-versions") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const expected = { - data: [{ - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - manifest: { - metadata: { - "key": "value" + const expected = { + data: [ + { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + manifest: { + metadata: { + key: "value", + }, + type: "chat_prompt", + messages: [ + { + role: "system", + content: "content", + }, + ], + }, + id: "id", + fqn: "fqn", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + mlRepoId: "ml_repo_id", + usageCodeSnippet: "usage_code_snippet", + usageCodeSnippets: [ + { + displayName: "display_name", + language: "language", + code: "code", + }, + ], + tags: ["tags"], + promptId: "prompt_id", }, - type: "chat_prompt", - messages: [{ - role: "system", - content: "content" - }] - }, - id: "id", - fqn: "fqn", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" + ], + pagination: { + total: 100, + offset: 0, + limit: 10, }, - mlRepoId: "ml_repo_id", - usageCodeSnippet: "usage_code_snippet", - usageCodeSnippets: [{ - displayName: "display_name", - language: "language", - code: "code" - }], - tags: ["tags"], - promptId: "prompt_id" - }], - pagination: { - total: 100, - offset: 0, - limit: 10 - } -}; - const page = await client.promptVersions.list({ - limit: 10, - offset: 0, - tag: "tag", - fqn: "fqn", - promptId: "prompt_id", - mlRepoId: "ml_repo_id", - name: "name", - version: 1 -}); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - + }; + const page = await client.promptVersions.list({ + limit: 10, + offset: 0, + }); + + expect(expected.data).toEqual(page.data); }); - + test("apply_tags", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "prompt_version_id" : "prompt_version_id" , "tags" : [ "tags" ] }; - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { prompt_version_id: "prompt_version_id", tags: ["tags"] }; + const rawResponseBody = {}; + server .mockEndpoint() - .put("/api/svc/v1/prompt-versions/tags").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .put("/api/svc/v1/prompt-versions/tags") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.promptVersions.applyTags({ - promptVersionId: "prompt_version_id", - tags: ["tags"] -}); - expect(response).toEqual({}); - - + const response = await client.promptVersions.applyTags({ + promptVersionId: "prompt_version_id", + tags: ["tags"], + }); + expect(response).toEqual({}); }); - + test("get (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : { "created_at" : "2024-01-15T09:30:00Z" , "updated_at" : "2024-01-15T09:30:00Z" , "manifest" : { "name" : "name" , "metadata" : { "key" : "value" } , "ml_repo" : "ml_repo" , "version" : 1 , "type" : "chat_prompt" , "description" : "description" , "version_alias" : "version_alias" , "messages" : [ { "role" : "system" , "content" : "content" } ] , "model_configuration" : { "provider" : "provider" , "model" : "model" } , "tools" : [ { "type" : "function" , "function" : { "name" : "name" } } ] , "mcp_servers" : [ { "type" : "mcp-server-fqn" , "integration_fqn" : "integration_fqn" , "enable_all_tools" : true } ] , "response_format" : { "type" : "json_object" } , "routing_config" : { "type" : "weight-based-routing" , "load_balance_targets" : [ { "target" : "target" , "weight" : 1 } ] } , "cache_config" : { "type" : "semantic" , "similarity_threshold" : 1.1 , "ttl" : 1.1 } , "tool_call_to_mcp_mapping" : { "key" : { "mcp_server_integration_id" : "mcp_server_integration_id" , "tool_name" : "tool_name" } } , "logging_config" : { "enabled" : true } , "sub_agents" : [ { "name" : "name" } ] } , "id" : "id" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "ml_repo_id" : "ml_repo_id" , "usage_code_snippet" : "usage_code_snippet" , "usage_code_snippets" : [ { "display_name" : "display_name" , "language" : "language" , "code" : "code" } ] , "tags" : [ "tags" ] , "prompt_id" : "prompt_id" } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: { + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + manifest: { + name: "name", + metadata: { key: "value" }, + ml_repo: "ml_repo", + version: 1, + type: "chat_prompt", + description: "description", + version_alias: "version_alias", + messages: [{ role: "system", content: "content" }], + model_configuration: { provider: "provider", model: "model" }, + tools: [{ type: "function", function: { name: "name" } }], + mcp_servers: [ + { type: "mcp-server-fqn", integration_fqn: "integration_fqn", enable_all_tools: true }, + ], + response_format: { type: "json_object" }, + routing_config: { + type: "weight-based-routing", + load_balance_targets: [{ target: "target", weight: 1 }], + }, + cache_config: { type: "semantic", similarity_threshold: 1.1, ttl: 1.1 }, + tool_call_to_mcp_mapping: { + key: { mcp_server_integration_id: "mcp_server_integration_id", tool_name: "tool_name" }, + }, + logging_config: { enabled: true }, + sub_agents: [{ name: "name" }], + }, + id: "id", + fqn: "fqn", + created_by_subject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + ml_repo_id: "ml_repo_id", + usage_code_snippet: "usage_code_snippet", + usage_code_snippets: [{ display_name: "display_name", language: "language", code: "code" }], + tags: ["tags"], + prompt_id: "prompt_id", + }, + }; + server .mockEndpoint() - .get("/api/svc/v1/prompt-versions/id").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .get("/api/svc/v1/prompt-versions/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.promptVersions.get("id"); - expect(response).toEqual({ - data: { - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - manifest: { - name: "name", - metadata: { - "key": "value" - }, - mlRepo: "ml_repo", - version: 1, - type: "chat_prompt", - description: "description", - versionAlias: "version_alias", - messages: [{ - role: "system", - content: "content" - }], - modelConfiguration: { - provider: "provider", - model: "model" - }, - tools: [{ - type: "function", - "function": { - name: "name" - } - }], - mcpServers: [{ - type: "mcp-server-fqn", - integrationFqn: "integration_fqn", - enableAllTools: true - }], - responseFormat: { - type: "json_object" - }, - routingConfig: { - type: "weight-based-routing", - loadBalanceTargets: [{ - target: "target", - weight: 1 - }] - }, - cacheConfig: { - type: "semantic", - similarityThreshold: 1.1, - ttl: 1.1 - }, - toolCallToMcpMapping: { - "key": { - mcpServerIntegrationId: "mcp_server_integration_id", - toolName: "tool_name" - } - }, - loggingConfig: { - enabled: true + const response = await client.promptVersions.get("id"); + expect(response).toEqual({ + data: { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + manifest: { + name: "name", + metadata: { + key: "value", + }, + mlRepo: "ml_repo", + version: 1, + type: "chat_prompt", + description: "description", + versionAlias: "version_alias", + messages: [ + { + role: "system", + content: "content", + }, + ], + modelConfiguration: { + provider: "provider", + model: "model", + }, + tools: [ + { + type: "function", + function: { + name: "name", + }, + }, + ], + mcpServers: [ + { + type: "mcp-server-fqn", + integrationFqn: "integration_fqn", + enableAllTools: true, + }, + ], + responseFormat: { + type: "json_object", + }, + routingConfig: { + type: "weight-based-routing", + loadBalanceTargets: [ + { + target: "target", + weight: 1, + }, + ], + }, + cacheConfig: { + type: "semantic", + similarityThreshold: 1.1, + ttl: 1.1, + }, + toolCallToMcpMapping: { + key: { + mcpServerIntegrationId: "mcp_server_integration_id", + toolName: "tool_name", + }, + }, + loggingConfig: { + enabled: true, + }, + subAgents: [ + { + name: "name", + }, + ], + }, + id: "id", + fqn: "fqn", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + mlRepoId: "ml_repo_id", + usageCodeSnippet: "usage_code_snippet", + usageCodeSnippets: [ + { + displayName: "display_name", + language: "language", + code: "code", + }, + ], + tags: ["tags"], + promptId: "prompt_id", }, - subAgents: [{ - name: "name" - }] - }, - id: "id", - fqn: "fqn", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - mlRepoId: "ml_repo_id", - usageCodeSnippet: "usage_code_snippet", - usageCodeSnippets: [{ - displayName: "display_name", - language: "language", - code: "code" - }], - tags: ["tags"], - promptId: "prompt_id" - } -}); - - + }); }); - + test("get (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/prompt-versions/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); + .get("/api/svc/v1/prompt-versions/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.promptVersions.get("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + await expect(async () => { + return await client.promptVersions.get("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("delete (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = {}; + server .mockEndpoint() - .delete("/api/svc/v1/prompt-versions/id").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .delete("/api/svc/v1/prompt-versions/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.promptVersions.delete("id"); - expect(response).toEqual({}); - - + const response = await client.promptVersions.delete("id"); + expect(response).toEqual({}); }); - + test("delete (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .delete("/api/svc/v1/prompt-versions/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); + .delete("/api/svc/v1/prompt-versions/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.promptVersions.delete("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + await expect(async () => { + return await client.promptVersions.delete("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - }); diff --git a/tests/wire/prompts.test.ts b/tests/wire/prompts.test.ts index 4e02afea..64ba6e25 100644 --- a/tests/wire/prompts.test.ts +++ b/tests/wire/prompts.test.ts @@ -5,317 +5,440 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("PromptsClient", () => { - test("get (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : { "id" : "id" , "ml_repo_id" : "ml_repo_id" , "type" : "chat_prompt" , "name" : "name" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "created_at" : "2024-01-15T09:30:00Z" , "updated_at" : "2024-01-15T09:30:00Z" , "latest_version" : { "created_at" : "2024-01-15T09:30:00Z" , "updated_at" : "2024-01-15T09:30:00Z" , "manifest" : { "metadata" : { "key" : "value" } , "type" : "chat_prompt" , "messages" : [ { "role" : "system" , "content" : "content" } ] } , "id" : "id" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "ml_repo_id" : "ml_repo_id" , "usage_code_snippet" : "usage_code_snippet" , "usage_code_snippets" : [ { "display_name" : "display_name" , "language" : "language" , "code" : "code" } ] , "tags" : [ "tags" ] , "prompt_id" : "prompt_id" } , "run_steps" : [ 1.1 ] } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: { + id: "id", + ml_repo_id: "ml_repo_id", + type: "chat_prompt", + name: "name", + fqn: "fqn", + created_by_subject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + latest_version: { + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + manifest: { + metadata: { key: "value" }, + type: "chat_prompt", + messages: [{ role: "system", content: "content" }], + }, + id: "id", + fqn: "fqn", + created_by_subject: { subjectId: "subjectId", subjectType: "user" }, + ml_repo_id: "ml_repo_id", + usage_code_snippet: "usage_code_snippet", + usage_code_snippets: [{ display_name: "display_name", language: "language", code: "code" }], + tags: ["tags"], + prompt_id: "prompt_id", + }, + run_steps: [1.1], + }, + }; + server .mockEndpoint() - .get("/api/svc/v1/prompts/id").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .get("/api/svc/v1/prompts/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.prompts.get("id"); - expect(response).toEqual({ - data: { - id: "id", - mlRepoId: "ml_repo_id", - type: "chat_prompt", - name: "name", - fqn: "fqn", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - latestVersion: { - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - manifest: { - metadata: { - "key": "value" - }, + const response = await client.prompts.get("id"); + expect(response).toEqual({ + data: { + id: "id", + mlRepoId: "ml_repo_id", type: "chat_prompt", - messages: [{ - role: "system", - content: "content" - }] - }, - id: "id", - fqn: "fqn", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" + name: "name", + fqn: "fqn", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + latestVersion: { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + manifest: { + metadata: { + key: "value", + }, + type: "chat_prompt", + messages: [ + { + role: "system", + content: "content", + }, + ], + }, + id: "id", + fqn: "fqn", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + mlRepoId: "ml_repo_id", + usageCodeSnippet: "usage_code_snippet", + usageCodeSnippets: [ + { + displayName: "display_name", + language: "language", + code: "code", + }, + ], + tags: ["tags"], + promptId: "prompt_id", + }, + runSteps: [1.1], }, - mlRepoId: "ml_repo_id", - usageCodeSnippet: "usage_code_snippet", - usageCodeSnippets: [{ - displayName: "display_name", - language: "language", - code: "code" - }], - tags: ["tags"], - promptId: "prompt_id" - }, - runSteps: [1.1] - } -}); - - + }); }); - + test("get (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/prompts/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); + .get("/api/svc/v1/prompts/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.prompts.get("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + await expect(async () => { + return await client.prompts.get("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("delete (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = {}; + server .mockEndpoint() - .delete("/api/svc/v1/prompts/id").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .delete("/api/svc/v1/prompts/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.prompts.delete("id"); - expect(response).toEqual({}); - - + const response = await client.prompts.delete("id"); + expect(response).toEqual({}); }); - + test("delete (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .delete("/api/svc/v1/prompts/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); + .delete("/api/svc/v1/prompts/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.prompts.delete("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + await expect(async () => { + return await client.prompts.delete("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("list", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "id" : "id" , "ml_repo_id" : "ml_repo_id" , "type" : "chat_prompt" , "name" : "name" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "created_at" : "2024-01-15T09:30:00Z" , "updated_at" : "2024-01-15T09:30:00Z" , "latest_version" : { "manifest" : { "metadata" : { "key" : "value" } , "type" : "chat_prompt" , "messages" : [ { "role" : "system" , "content" : "content" } ] } , "id" : "id" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "ml_repo_id" : "ml_repo_id" , "prompt_id" : "prompt_id" } , "run_steps" : [ 1.1 ] } ] , "pagination" : { "total" : 100 , "offset" : 0 , "limit" : 10 } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + id: "id", + ml_repo_id: "ml_repo_id", + type: "chat_prompt", + name: "name", + fqn: "fqn", + created_by_subject: { subjectId: "subjectId", subjectType: "user" }, + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", + latest_version: { + manifest: { + metadata: { key: "value" }, + type: "chat_prompt", + messages: [{ role: "system", content: "content" }], + }, + id: "id", + fqn: "fqn", + created_by_subject: { subjectId: "subjectId", subjectType: "user" }, + ml_repo_id: "ml_repo_id", + prompt_id: "prompt_id", + }, + run_steps: [1.1], + }, + ], + pagination: { total: 100, offset: 0, limit: 10 }, + }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/prompts").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .mockEndpoint() + .get("/api/svc/v1/prompts") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const expected = { - data: [{ - id: "id", - mlRepoId: "ml_repo_id", - type: "chat_prompt", - name: "name", - fqn: "fqn", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" + const expected = { + data: [ + { + id: "id", + mlRepoId: "ml_repo_id", + type: "chat_prompt", + name: "name", + fqn: "fqn", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + latestVersion: { + manifest: { + metadata: { + key: "value", + }, + type: "chat_prompt", + messages: [ + { + role: "system", + content: "content", + }, + ], + }, + id: "id", + fqn: "fqn", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + mlRepoId: "ml_repo_id", + promptId: "prompt_id", + }, + runSteps: [1.1], + }, + ], + pagination: { + total: 100, + offset: 0, + limit: 10, }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - latestVersion: { + }; + const page = await client.prompts.list({ + limit: 10, + offset: 0, + }); + + expect(expected.data).toEqual(page.data); + }); + + test("create_or_update", async () => { + const server = mockServerPool.createServer(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + metadata: { key: "value" }, + type: "chat_prompt", + messages: [{ role: "system", content: "content" }], + }, + }; + const rawResponseBody = { + data: { + created_at: "2024-01-15T09:30:00Z", + updated_at: "2024-01-15T09:30:00Z", manifest: { - metadata: { - "key": "value" - }, + name: "name", + metadata: { key: "value" }, + ml_repo: "ml_repo", + version: 1, type: "chat_prompt", - messages: [{ - role: "system", - content: "content" - }] + description: "description", + version_alias: "version_alias", + messages: [{ role: "system", content: "content" }], + model_configuration: { provider: "provider", model: "model" }, + tools: [{ type: "function", function: { name: "name" } }], + mcp_servers: [ + { type: "mcp-server-fqn", integration_fqn: "integration_fqn", enable_all_tools: true }, + ], + response_format: { type: "json_object" }, + routing_config: { + type: "weight-based-routing", + load_balance_targets: [{ target: "target", weight: 1 }], + }, + cache_config: { type: "semantic", similarity_threshold: 1.1, ttl: 1.1 }, + tool_call_to_mcp_mapping: { + key: { mcp_server_integration_id: "mcp_server_integration_id", tool_name: "tool_name" }, + }, + logging_config: { enabled: true }, + sub_agents: [{ name: "name" }], }, id: "id", fqn: "fqn", - createdBySubject: { + created_by_subject: { subjectId: "subjectId", - subjectType: "user" + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", }, - mlRepoId: "ml_repo_id", - promptId: "prompt_id" + ml_repo_id: "ml_repo_id", + usage_code_snippet: "usage_code_snippet", + usage_code_snippets: [{ display_name: "display_name", language: "language", code: "code" }], + tags: ["tags"], + prompt_id: "prompt_id", }, - runSteps: [1.1] - }], - pagination: { - total: 100, - offset: 0, - limit: 10 - } -}; - const page = await client.prompts.list({ - limit: 10, - offset: 0, - fqn: "fqn", - mlRepoId: "ml_repo_id", - name: "name", - includeEmptyPrompts: true -}); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - - }); - - test("create_or_update", async () => { - const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "metadata" : { "key" : "value" } , "type" : "chat_prompt" , "messages" : [ { "role" : "system" , "content" : "content" } ] } }; - const rawResponseBody = { "data" : { "created_at" : "2024-01-15T09:30:00Z" , "updated_at" : "2024-01-15T09:30:00Z" , "manifest" : { "name" : "name" , "metadata" : { "key" : "value" } , "ml_repo" : "ml_repo" , "version" : 1 , "type" : "chat_prompt" , "description" : "description" , "version_alias" : "version_alias" , "messages" : [ { "role" : "system" , "content" : "content" } ] , "model_configuration" : { "provider" : "provider" , "model" : "model" } , "tools" : [ { "type" : "function" , "function" : { "name" : "name" } } ] , "mcp_servers" : [ { "type" : "mcp-server-fqn" , "integration_fqn" : "integration_fqn" , "enable_all_tools" : true } ] , "response_format" : { "type" : "json_object" } , "routing_config" : { "type" : "weight-based-routing" , "load_balance_targets" : [ { "target" : "target" , "weight" : 1 } ] } , "cache_config" : { "type" : "semantic" , "similarity_threshold" : 1.1 , "ttl" : 1.1 } , "tool_call_to_mcp_mapping" : { "key" : { "mcp_server_integration_id" : "mcp_server_integration_id" , "tool_name" : "tool_name" } } , "logging_config" : { "enabled" : true } , "sub_agents" : [ { "name" : "name" } ] } , "id" : "id" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "ml_repo_id" : "ml_repo_id" , "usage_code_snippet" : "usage_code_snippet" , "usage_code_snippets" : [ { "display_name" : "display_name" , "language" : "language" , "code" : "code" } ] , "tags" : [ "tags" ] , "prompt_id" : "prompt_id" } }; - + }; + server .mockEndpoint() - .put("/api/svc/v1/prompt-versions").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .put("/api/svc/v1/prompt-versions") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.prompts.createOrUpdate({ - manifest: { - metadata: { - "key": "value" - }, - type: "chat_prompt", - messages: [{ - role: "system", - content: "content" - }] - } -}); - expect(response).toEqual({ - data: { - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - manifest: { - name: "name", - metadata: { - "key": "value" - }, - mlRepo: "ml_repo", - version: 1, - type: "chat_prompt", - description: "description", - versionAlias: "version_alias", - messages: [{ - role: "system", - content: "content" - }], - modelConfiguration: { - provider: "provider", - model: "model" - }, - tools: [{ - type: "function", - "function": { - name: "name" - } - }], - mcpServers: [{ - type: "mcp-server-fqn", - integrationFqn: "integration_fqn", - enableAllTools: true - }], - responseFormat: { - type: "json_object" - }, - routingConfig: { - type: "weight-based-routing", - loadBalanceTargets: [{ - target: "target", - weight: 1 - }] - }, - cacheConfig: { - type: "semantic", - similarityThreshold: 1.1, - ttl: 1.1 - }, - toolCallToMcpMapping: { - "key": { - mcpServerIntegrationId: "mcp_server_integration_id", - toolName: "tool_name" - } + const response = await client.prompts.createOrUpdate({ + manifest: { + metadata: { + key: "value", + }, + type: "chat_prompt", + messages: [ + { + role: "system", + content: "content", + }, + ], }, - loggingConfig: { - enabled: true + }); + expect(response).toEqual({ + data: { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + manifest: { + name: "name", + metadata: { + key: "value", + }, + mlRepo: "ml_repo", + version: 1, + type: "chat_prompt", + description: "description", + versionAlias: "version_alias", + messages: [ + { + role: "system", + content: "content", + }, + ], + modelConfiguration: { + provider: "provider", + model: "model", + }, + tools: [ + { + type: "function", + function: { + name: "name", + }, + }, + ], + mcpServers: [ + { + type: "mcp-server-fqn", + integrationFqn: "integration_fqn", + enableAllTools: true, + }, + ], + responseFormat: { + type: "json_object", + }, + routingConfig: { + type: "weight-based-routing", + loadBalanceTargets: [ + { + target: "target", + weight: 1, + }, + ], + }, + cacheConfig: { + type: "semantic", + similarityThreshold: 1.1, + ttl: 1.1, + }, + toolCallToMcpMapping: { + key: { + mcpServerIntegrationId: "mcp_server_integration_id", + toolName: "tool_name", + }, + }, + loggingConfig: { + enabled: true, + }, + subAgents: [ + { + name: "name", + }, + ], + }, + id: "id", + fqn: "fqn", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + mlRepoId: "ml_repo_id", + usageCodeSnippet: "usage_code_snippet", + usageCodeSnippets: [ + { + displayName: "display_name", + language: "language", + code: "code", + }, + ], + tags: ["tags"], + promptId: "prompt_id", }, - subAgents: [{ - name: "name" - }] - }, - id: "id", - fqn: "fqn", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - mlRepoId: "ml_repo_id", - usageCodeSnippet: "usage_code_snippet", - usageCodeSnippets: [{ - displayName: "display_name", - language: "language", - code: "code" - }], - tags: ["tags"], - promptId: "prompt_id" - } -}); - - + }); }); - }); diff --git a/tests/wire/runs.test.ts b/tests/wire/runs.test.ts index a7c7724b..cbc328ca 100644 --- a/tests/wire/runs.test.ts +++ b/tests/wire/runs.test.ts @@ -5,507 +5,602 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("RunsClient", () => { - test("create", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "experiment_id" : "experiment_id" , "name" : "name" }; - const rawResponseBody = { "run" : { "info" : { "run_uuid" : "run_uuid" , "run_id" : "run_id" , "experiment_id" : "experiment_id" , "name" : "name" , "fqn" : "fqn" , "user_id" : "user_id" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "status" : "status" , "start_time" : 1.1 , "end_time" : 1.1 , "artifact_uri" : "artifact_uri" , "lifecycle_stage" : "lifecycle_stage" , "description" : "description" } , "data" : { "metrics" : [ { "key" : "key" } ] , "params" : [ { "key" : "key" , "value" : "value" } ] , "tags" : [ { "key" : "key" , "value" : "value" } ] } } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { experiment_id: "experiment_id", name: "name" }; + const rawResponseBody = { + run: { + info: { + run_uuid: "run_uuid", + run_id: "run_id", + experiment_id: "experiment_id", + name: "name", + fqn: "fqn", + user_id: "user_id", + created_by_subject: { subjectId: "subjectId", subjectType: "user" }, + status: "status", + start_time: 1.1, + end_time: 1.1, + artifact_uri: "artifact_uri", + lifecycle_stage: "lifecycle_stage", + description: "description", + }, + data: { + metrics: [{ key: "key" }], + params: [{ key: "key", value: "value" }], + tags: [{ key: "key", value: "value" }], + }, + }, + }; + server .mockEndpoint() - .post("/api/svc/v1/runs").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.runs.create({ - experimentId: "experiment_id", - name: "name" -}); - expect(response).toEqual({ - run: { - info: { - runUuid: "run_uuid", - runId: "run_id", + .post("/api/svc/v1/runs") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.runs.create({ experimentId: "experiment_id", name: "name", - fqn: "fqn", - userId: "user_id", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" + }); + expect(response).toEqual({ + run: { + info: { + runUuid: "run_uuid", + runId: "run_id", + experimentId: "experiment_id", + name: "name", + fqn: "fqn", + userId: "user_id", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + status: "status", + startTime: 1.1, + endTime: 1.1, + artifactUri: "artifact_uri", + lifecycleStage: "lifecycle_stage", + description: "description", + }, + data: { + metrics: [ + { + key: "key", + }, + ], + params: [ + { + key: "key", + value: "value", + }, + ], + tags: [ + { + key: "key", + value: "value", + }, + ], + }, }, - status: "status", - startTime: 1.1, - endTime: 1.1, - artifactUri: "artifact_uri", - lifecycleStage: "lifecycle_stage", - description: "description" - }, - data: { - metrics: [{ - key: "key" - }], - params: [{ - key: "key", - value: "value" - }], - tags: [{ - key: "key", - value: "value" - }] - } - } -}); - - + }); }); - + test("get (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "run" : { "info" : { "run_uuid" : "run_uuid" , "run_id" : "run_id" , "experiment_id" : "experiment_id" , "name" : "name" , "fqn" : "fqn" , "user_id" : "user_id" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "status" : "status" , "start_time" : 1.1 , "end_time" : 1.1 , "artifact_uri" : "artifact_uri" , "lifecycle_stage" : "lifecycle_stage" , "description" : "description" } , "data" : { "metrics" : [ { "key" : "key" } ] , "params" : [ { "key" : "key" , "value" : "value" } ] , "tags" : [ { "key" : "key" , "value" : "value" } ] } } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + run: { + info: { + run_uuid: "run_uuid", + run_id: "run_id", + experiment_id: "experiment_id", + name: "name", + fqn: "fqn", + user_id: "user_id", + created_by_subject: { subjectId: "subjectId", subjectType: "user" }, + status: "status", + start_time: 1.1, + end_time: 1.1, + artifact_uri: "artifact_uri", + lifecycle_stage: "lifecycle_stage", + description: "description", + }, + data: { + metrics: [{ key: "key" }], + params: [{ key: "key", value: "value" }], + tags: [{ key: "key", value: "value" }], + }, + }, + }; + server .mockEndpoint() - .get("/api/svc/v1/runs/id").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.runs.get("id"); - expect(response).toEqual({ - run: { - info: { - runUuid: "run_uuid", - runId: "run_id", - experimentId: "experiment_id", - name: "name", - fqn: "fqn", - userId: "user_id", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" + .get("/api/svc/v1/runs/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.runs.get("id"); + expect(response).toEqual({ + run: { + info: { + runUuid: "run_uuid", + runId: "run_id", + experimentId: "experiment_id", + name: "name", + fqn: "fqn", + userId: "user_id", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + status: "status", + startTime: 1.1, + endTime: 1.1, + artifactUri: "artifact_uri", + lifecycleStage: "lifecycle_stage", + description: "description", + }, + data: { + metrics: [ + { + key: "key", + }, + ], + params: [ + { + key: "key", + value: "value", + }, + ], + tags: [ + { + key: "key", + value: "value", + }, + ], + }, }, - status: "status", - startTime: 1.1, - endTime: 1.1, - artifactUri: "artifact_uri", - lifecycleStage: "lifecycle_stage", - description: "description" - }, - data: { - metrics: [{ - key: "key" - }], - params: [{ - key: "key", - value: "value" - }], - tags: [{ - key: "key", - value: "value" - }] - } - } -}); - - + }); }); - + test("get (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/runs/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.runs.get("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .get("/api/svc/v1/runs/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.runs.get("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("update (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { }; - const rawResponseBody = { "run_info" : { "run_uuid" : "run_uuid" , "run_id" : "run_id" , "experiment_id" : "experiment_id" , "name" : "name" , "fqn" : "fqn" , "user_id" : "user_id" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "status" : "status" , "start_time" : 1.1 , "end_time" : 1.1 , "artifact_uri" : "artifact_uri" , "lifecycle_stage" : "lifecycle_stage" , "description" : "description" } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { + run_info: { + run_uuid: "run_uuid", + run_id: "run_id", + experiment_id: "experiment_id", + name: "name", + fqn: "fqn", + user_id: "user_id", + created_by_subject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + status: "status", + start_time: 1.1, + end_time: 1.1, + artifact_uri: "artifact_uri", + lifecycle_stage: "lifecycle_stage", + description: "description", + }, + }; + server .mockEndpoint() - .put("/api/svc/v1/runs/id").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.runs.update("id"); - expect(response).toEqual({ - runInfo: { - runUuid: "run_uuid", - runId: "run_id", - experimentId: "experiment_id", - name: "name", - fqn: "fqn", - userId: "user_id", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - status: "status", - startTime: 1.1, - endTime: 1.1, - artifactUri: "artifact_uri", - lifecycleStage: "lifecycle_stage", - description: "description" - } -}); - - + .put("/api/svc/v1/runs/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.runs.update("id"); + expect(response).toEqual({ + runInfo: { + runUuid: "run_uuid", + runId: "run_id", + experimentId: "experiment_id", + name: "name", + fqn: "fqn", + userId: "user_id", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + status: "status", + startTime: 1.1, + endTime: 1.1, + artifactUri: "artifact_uri", + lifecycleStage: "lifecycle_stage", + description: "description", + }, + }); }); - + test("update (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { }; - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .put("/api/svc/v1/runs/id").jsonBody(rawRequestBody) - .respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.runs.update("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .put("/api/svc/v1/runs/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.runs.update("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("delete (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = {}; + server .mockEndpoint() - .delete("/api/svc/v1/runs/id").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.runs.delete("id"); - expect(response).toEqual({}); - - + .delete("/api/svc/v1/runs/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.runs.delete("id"); + expect(response).toEqual({}); }); - + test("delete (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .delete("/api/svc/v1/runs/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.runs.delete("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .delete("/api/svc/v1/runs/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.runs.delete("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("search", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { }; - const rawResponseBody = { "runs" : [ { "info" : { "run_uuid" : "run_uuid" , "run_id" : "run_id" , "experiment_id" : "experiment_id" , "name" : "name" , "fqn" : "fqn" , "created_by_subject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "status" : "status" } , "data" : { "metrics" : [ { "key" : "key" } ] , "params" : [ { "key" : "key" , "value" : "value" } ] , "tags" : [ { "key" : "key" , "value" : "value" } ] } } ] , "total" : 1.1 , "next_page_token" : "next_page_token" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { + runs: [ + { + info: { + run_uuid: "run_uuid", + run_id: "run_id", + experiment_id: "experiment_id", + name: "name", + fqn: "fqn", + created_by_subject: { subjectId: "subjectId", subjectType: "user" }, + status: "status", + }, + data: { + metrics: [{ key: "key" }], + params: [{ key: "key", value: "value" }], + tags: [{ key: "key", value: "value" }], + }, + }, + ], + total: 1.1, + next_page_token: "next_page_token", + }; + server .mockEndpoint({ once: false }) - .post("/api/svc/v1/runs/search").jsonBody(rawRequestBody, { ignoredFields: [ "page_token" ] }) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const expected = { - runs: [{ - info: { - runUuid: "run_uuid", - runId: "run_id", - experimentId: "experiment_id", - name: "name", - fqn: "fqn", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" + .post("/api/svc/v1/runs/search") + .jsonBody(rawRequestBody, { ignoredFields: ["page_token"] }) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + runs: [ + { + info: { + runUuid: "run_uuid", + runId: "run_id", + experimentId: "experiment_id", + name: "name", + fqn: "fqn", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + status: "status", + }, + data: { + metrics: [ + { + key: "key", + }, + ], + params: [ + { + key: "key", + value: "value", + }, + ], + tags: [ + { + key: "key", + value: "value", + }, + ], + }, }, - status: "status" - }, - data: { - metrics: [{ - key: "key" - }], - params: [{ - key: "key", - value: "value" - }], - tags: [{ - key: "key", - value: "value" - }] - } - }], - total: 1.1, - nextPageToken: "next_page_token" -}; - const page = await client.runs.search(); - - expect(expected.runs).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.runs).toEqual(nextPage.data); - - - + ], + total: 1.1, + nextPageToken: "next_page_token", + }; + const page = await client.runs.search(); + + expect(expected.runs).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.runs).toEqual(nextPage.data); }); - + test("get_metric_history (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "metrics" : [ { "key" : "key" , "value" : 1.1 , "timestamp" : 1.1 , "step" : 1.1 } ] }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { metrics: [{ key: "key", value: 1.1, timestamp: 1.1, step: 1.1 }] }; + server .mockEndpoint() - .get("/api/svc/v1/runs/id/metrics/history").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.runs.getMetricHistory("id", { - metricKey: "metric_key" -}); - expect(response).toEqual({ - metrics: [{ - key: "key", - value: 1.1, - timestamp: 1.1, - step: 1.1 - }] -}); - - + .get("/api/svc/v1/runs/id/metrics/history") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.runs.getMetricHistory("id", { + metricKey: "metric_key", + }); + expect(response).toEqual({ + metrics: [ + { + key: "key", + value: 1.1, + timestamp: 1.1, + step: 1.1, + }, + ], + }); }); - + test("get_metric_history (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/runs/id/metrics/history").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.runs.getMetricHistory("id", { - metricKey: "metric_key" -}) - }).rejects.toThrow(TrueFoundry.NotFoundError); + .get("/api/svc/v1/runs/id/metrics/history") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.runs.getMetricHistory("id", { + metricKey: "metric_key", + }); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("list_metric_history (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { }; - const rawResponseBody = { "metric_collections" : [ { "key" : "key" , "metrics" : [ { "key" : "key" } ] } ] }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { metric_collections: [{ key: "key", metrics: [{ key: "key" }] }] }; + server .mockEndpoint() - .post("/api/svc/v1/runs/id/metrics/list").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.runs.listMetricHistory("id"); - expect(response).toEqual({ - metricCollections: [{ - key: "key", - metrics: [{ - key: "key" - }] - }] -}); - - + .post("/api/svc/v1/runs/id/metrics/list") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.runs.listMetricHistory("id"); + expect(response).toEqual({ + metricCollections: [ + { + key: "key", + metrics: [ + { + key: "key", + }, + ], + }, + ], + }); }); - + test("list_metric_history (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { }; - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .post("/api/svc/v1/runs/id/metrics/list").jsonBody(rawRequestBody) - .respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.runs.listMetricHistory("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .post("/api/svc/v1/runs/id/metrics/list") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.runs.listMetricHistory("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("log_metric", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "key" : "key" , "value" : 1.1 , "timestamp" : 1.1 }; - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { key: "key", value: 1.1, timestamp: 1.1 }; + const rawResponseBody = {}; + server .mockEndpoint() - .post("/api/svc/v1/runs/id/metrics").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.runs.logMetric("id", { - key: "key", - value: 1.1, - timestamp: 1.1 -}); - expect(response).toEqual({}); - - + .post("/api/svc/v1/runs/id/metrics") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.runs.logMetric("id", { + key: "key", + value: 1.1, + timestamp: 1.1, + }); + expect(response).toEqual({}); }); - + test("log_parameter", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "key" : "key" , "value" : "value" }; - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { key: "key", value: "value" }; + const rawResponseBody = {}; + server .mockEndpoint() - .post("/api/svc/v1/runs/id/parameters").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.runs.logParameter("id", { - key: "key", - value: "value" -}); - expect(response).toEqual({}); - - + .post("/api/svc/v1/runs/id/parameters") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.runs.logParameter("id", { + key: "key", + value: "value", + }); + expect(response).toEqual({}); }); - + test("set_tag", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "key" : "key" , "value" : "value" }; - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { key: "key", value: "value" }; + const rawResponseBody = {}; + server .mockEndpoint() - .put("/api/svc/v1/runs/id/tags").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.runs.setTag("id", { - key: "key", - value: "value" -}); - expect(response).toEqual({}); - - + .put("/api/svc/v1/runs/id/tags") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.runs.setTag("id", { + key: "key", + value: "value", + }); + expect(response).toEqual({}); }); - + test("delete_tag", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "key" : "key" }; - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { key: "key" }; + const rawResponseBody = {}; + server .mockEndpoint() - .post("/api/svc/v1/runs/id/tags/delete").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.runs.deleteTag("id", { - key: "key" -}); - expect(response).toEqual({}); - - + .post("/api/svc/v1/runs/id/tags/delete") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.runs.deleteTag("id", { + key: "key", + }); + expect(response).toEqual({}); }); - + test("log_batch", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { }; - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = {}; + server .mockEndpoint() - .post("/api/svc/v1/runs/id/batch").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.runs.logBatch("id"); - expect(response).toEqual({}); - - + .post("/api/svc/v1/runs/id/batch") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.runs.logBatch("id"); + expect(response).toEqual({}); }); - }); diff --git a/tests/wire/secretGroups.test.ts b/tests/wire/secretGroups.test.ts index f7b725c3..d8c6f2e7 100644 --- a/tests/wire/secretGroups.test.ts +++ b/tests/wire/secretGroups.test.ts @@ -5,716 +5,940 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("SecretGroupsClient", () => { - test("list", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "id" : "id" , "fqn" : "fqn" , "tenantName" : "tenantName" , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "associatedSecrets" : [ { "id" : "id" , "fqn" : "fqn" , "name" : "name" , "secretGroupId" : "secretGroupId" } ] , "integrationId" : "integrationId" , "manifest" : { "key" : "value" } , "accountId" : "accountId" , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "createdBy" : "createdBy" } ] , "pagination" : { "total" : 100 , "offset" : 0 , "limit" : 10 } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + id: "id", + fqn: "fqn", + tenantName: "tenantName", + createdBySubject: { subjectId: "subjectId", subjectType: "user" }, + associatedSecrets: [{ id: "id", fqn: "fqn", name: "name", secretGroupId: "secretGroupId" }], + integrationId: "integrationId", + manifest: { key: "value" }, + accountId: "accountId", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + createdBy: "createdBy", + }, + ], + pagination: { total: 100, offset: 0, limit: 10 }, + }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/secret-groups").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const expected = { - data: [{ - id: "id", - fqn: "fqn", - tenantName: "tenantName", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" - }, - associatedSecrets: [{ + .mockEndpoint() + .get("/api/svc/v1/secret-groups") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + data: [ + { id: "id", fqn: "fqn", - name: "name", - secretGroupId: "secretGroupId" - }], - integrationId: "integrationId", - manifest: { - "key": "value" + tenantName: "tenantName", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + associatedSecrets: [ + { + id: "id", + fqn: "fqn", + name: "name", + secretGroupId: "secretGroupId", + }, + ], + integrationId: "integrationId", + manifest: { + key: "value", + }, + accountId: "accountId", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + createdBy: "createdBy", + }, + ], + pagination: { + total: 100, + offset: 0, + limit: 10, }, - accountId: "accountId", - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - createdBy: "createdBy" - }], - pagination: { - total: 100, - offset: 0, - limit: 10 - } -}; - const page = await client.secretGroups.list({ - limit: 10, - offset: 0, - fqn: "fqn", - search: "search", - attributes: ["attributes"] -}); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - + }; + const page = await client.secretGroups.list({ + limit: 10, + offset: 0, + }); + + expect(expected.data).toEqual(page.data); }); - + test("create (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "name" : "name" , "integrationId" : "integrationId" , "secrets" : [ { "key" : "key" , "value" : "value" } ] }; - const rawResponseBody = { "data" : { "id" : "id" , "fqn" : "fqn" , "tenantName" : "tenantName" , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "associatedSecrets" : [ { "id" : "id" , "fqn" : "fqn" , "name" : "name" , "secretGroupId" : "secretGroupId" } ] , "integrationId" : "integrationId" , "manifest" : { "key" : "value" } , "accountId" : "accountId" , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "createdBy" : "createdBy" } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + name: "name", + integrationId: "integrationId", + secrets: [{ key: "key", value: "value" }], + }; + const rawResponseBody = { + data: { + id: "id", + fqn: "fqn", + tenantName: "tenantName", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + associatedSecrets: [{ id: "id", fqn: "fqn", name: "name", secretGroupId: "secretGroupId" }], + integrationId: "integrationId", + manifest: { key: "value" }, + accountId: "accountId", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + createdBy: "createdBy", + }, + }; + server .mockEndpoint() - .post("/api/svc/v1/secret-groups").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.secretGroups.create({ - name: "name", - integrationId: "integrationId", - secrets: [{ - key: "key", - value: "value" - }] -}); - expect(response).toEqual({ - data: { - id: "id", - fqn: "fqn", - tenantName: "tenantName", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - associatedSecrets: [{ + .post("/api/svc/v1/secret-groups") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.secretGroups.create({ + name: "name", + integrationId: "integrationId", + secrets: [ + { + key: "key", + value: "value", + }, + ], + }); + expect(response).toEqual({ + data: { id: "id", fqn: "fqn", - name: "name", - secretGroupId: "secretGroupId" - }], - integrationId: "integrationId", - manifest: { - "key": "value" - }, - accountId: "accountId", - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - createdBy: "createdBy" - } -}); - - + tenantName: "tenantName", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + associatedSecrets: [ + { + id: "id", + fqn: "fqn", + name: "name", + secretGroupId: "secretGroupId", + }, + ], + integrationId: "integrationId", + manifest: { + key: "value", + }, + accountId: "accountId", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + createdBy: "createdBy", + }, + }); }); - + test("create (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "name" : "name" , "integrationId" : "integrationId" , "secrets" : [ { "key" : "key" , "value" : "value" } , { "key" : "key" , "value" : "value" } ] }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + name: "name", + integrationId: "integrationId", + secrets: [ + { key: "key", value: "value" }, + { key: "key", value: "value" }, + ], + }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .post("/api/svc/v1/secret-groups").jsonBody(rawRequestBody) - .respondWith() - .statusCode(422).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.secretGroups.create({ - name: "name", - integrationId: "integrationId", - secrets: [{ - key: "key", - value: "value" - }, { - key: "key", - value: "value" - }] -}) - }).rejects.toThrow(TrueFoundry.UnprocessableEntityError); + .post("/api/svc/v1/secret-groups") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.secretGroups.create({ + name: "name", + integrationId: "integrationId", + secrets: [ + { + key: "key", + value: "value", + }, + { + key: "key", + value: "value", + }, + ], + }); + }).rejects.toThrow(TrueFoundry.UnprocessableEntityError); }); - + test("create (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "name" : "name" , "integrationId" : "integrationId" , "secrets" : [ { "key" : "key" , "value" : "value" } , { "key" : "key" , "value" : "value" } ] }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + name: "name", + integrationId: "integrationId", + secrets: [ + { key: "key", value: "value" }, + { key: "key", value: "value" }, + ], + }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .post("/api/svc/v1/secret-groups").jsonBody(rawRequestBody) - .respondWith() - .statusCode(424).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.secretGroups.create({ - name: "name", - integrationId: "integrationId", - secrets: [{ - key: "key", - value: "value" - }, { - key: "key", - value: "value" - }] -}) - }).rejects.toThrow(TrueFoundry.FailedDependencyError); + .post("/api/svc/v1/secret-groups") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(424) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.secretGroups.create({ + name: "name", + integrationId: "integrationId", + secrets: [ + { + key: "key", + value: "value", + }, + { + key: "key", + value: "value", + }, + ], + }); + }).rejects.toThrow(TrueFoundry.FailedDependencyError); }); - + test("create_or_update (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "secret-group" , "name" : "name" , "integration_fqn" : "integration_fqn" , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } ] } }; - const rawResponseBody = { "data" : { "id" : "id" , "fqn" : "fqn" , "tenantName" : "tenantName" , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "associatedSecrets" : [ { "id" : "id" , "fqn" : "fqn" , "name" : "name" , "secretGroupId" : "secretGroupId" } ] , "integrationId" : "integrationId" , "manifest" : { "key" : "value" } , "accountId" : "accountId" , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "createdBy" : "createdBy" } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + type: "secret-group", + name: "name", + integration_fqn: "integration_fqn", + collaborators: [{ subject: "subject", role_id: "role_id" }], + }, + }; + const rawResponseBody = { + data: { + id: "id", + fqn: "fqn", + tenantName: "tenantName", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + associatedSecrets: [{ id: "id", fqn: "fqn", name: "name", secretGroupId: "secretGroupId" }], + integrationId: "integrationId", + manifest: { key: "value" }, + accountId: "accountId", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + createdBy: "createdBy", + }, + }; + server .mockEndpoint() - .put("/api/svc/v1/secret-groups").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.secretGroups.createOrUpdate({ - manifest: { - type: "secret-group", - name: "name", - integrationFqn: "integration_fqn", - collaborators: [{ - subject: "subject", - roleId: "role_id" - }] - } -}); - expect(response).toEqual({ - data: { - id: "id", - fqn: "fqn", - tenantName: "tenantName", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - associatedSecrets: [{ + .put("/api/svc/v1/secret-groups") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.secretGroups.createOrUpdate({ + manifest: { + type: "secret-group", + name: "name", + integrationFqn: "integration_fqn", + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + ], + }, + }); + expect(response).toEqual({ + data: { id: "id", fqn: "fqn", - name: "name", - secretGroupId: "secretGroupId" - }], - integrationId: "integrationId", - manifest: { - "key": "value" - }, - accountId: "accountId", - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - createdBy: "createdBy" - } -}); - - + tenantName: "tenantName", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + associatedSecrets: [ + { + id: "id", + fqn: "fqn", + name: "name", + secretGroupId: "secretGroupId", + }, + ], + integrationId: "integrationId", + manifest: { + key: "value", + }, + accountId: "accountId", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + createdBy: "createdBy", + }, + }); }); - + test("create_or_update (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "secret-group" , "name" : "name" , "integration_fqn" : "integration_fqn" , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } , { "subject" : "subject" , "role_id" : "role_id" } ] } }; - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + type: "secret-group", + name: "name", + integration_fqn: "integration_fqn", + collaborators: [ + { subject: "subject", role_id: "role_id" }, + { subject: "subject", role_id: "role_id" }, + ], + }, + }; + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .put("/api/svc/v1/secret-groups").jsonBody(rawRequestBody) - .respondWith() - .statusCode(400).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.secretGroups.createOrUpdate({ - manifest: { - type: "secret-group", - name: "name", - integrationFqn: "integration_fqn", - collaborators: [{ - subject: "subject", - roleId: "role_id" - }, { - subject: "subject", - roleId: "role_id" - }] - } -}) - }).rejects.toThrow(TrueFoundry.BadRequestError); + .put("/api/svc/v1/secret-groups") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.secretGroups.createOrUpdate({ + manifest: { + type: "secret-group", + name: "name", + integrationFqn: "integration_fqn", + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + { + subject: "subject", + roleId: "role_id", + }, + ], + }, + }); + }).rejects.toThrow(TrueFoundry.BadRequestError); }); - + test("create_or_update (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "secret-group" , "name" : "name" , "integration_fqn" : "integration_fqn" , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } , { "subject" : "subject" , "role_id" : "role_id" } ] } }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + type: "secret-group", + name: "name", + integration_fqn: "integration_fqn", + collaborators: [ + { subject: "subject", role_id: "role_id" }, + { subject: "subject", role_id: "role_id" }, + ], + }, + }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .put("/api/svc/v1/secret-groups").jsonBody(rawRequestBody) - .respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.secretGroups.createOrUpdate({ - manifest: { - type: "secret-group", - name: "name", - integrationFqn: "integration_fqn", - collaborators: [{ - subject: "subject", - roleId: "role_id" - }, { - subject: "subject", - roleId: "role_id" - }] - } -}) - }).rejects.toThrow(TrueFoundry.ForbiddenError); + .put("/api/svc/v1/secret-groups") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.secretGroups.createOrUpdate({ + manifest: { + type: "secret-group", + name: "name", + integrationFqn: "integration_fqn", + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + { + subject: "subject", + roleId: "role_id", + }, + ], + }, + }); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("create_or_update (4)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "secret-group" , "name" : "name" , "integration_fqn" : "integration_fqn" , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } , { "subject" : "subject" , "role_id" : "role_id" } ] } }; - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + type: "secret-group", + name: "name", + integration_fqn: "integration_fqn", + collaborators: [ + { subject: "subject", role_id: "role_id" }, + { subject: "subject", role_id: "role_id" }, + ], + }, + }; + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .put("/api/svc/v1/secret-groups").jsonBody(rawRequestBody) - .respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.secretGroups.createOrUpdate({ - manifest: { - type: "secret-group", - name: "name", - integrationFqn: "integration_fqn", - collaborators: [{ - subject: "subject", - roleId: "role_id" - }, { - subject: "subject", - roleId: "role_id" - }] - } -}) - }).rejects.toThrow(TrueFoundry.NotFoundError); + .put("/api/svc/v1/secret-groups") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.secretGroups.createOrUpdate({ + manifest: { + type: "secret-group", + name: "name", + integrationFqn: "integration_fqn", + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + { + subject: "subject", + roleId: "role_id", + }, + ], + }, + }); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("create_or_update (5)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "secret-group" , "name" : "name" , "integration_fqn" : "integration_fqn" , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } , { "subject" : "subject" , "role_id" : "role_id" } ] } }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + type: "secret-group", + name: "name", + integration_fqn: "integration_fqn", + collaborators: [ + { subject: "subject", role_id: "role_id" }, + { subject: "subject", role_id: "role_id" }, + ], + }, + }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .put("/api/svc/v1/secret-groups").jsonBody(rawRequestBody) - .respondWith() - .statusCode(409).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.secretGroups.createOrUpdate({ - manifest: { - type: "secret-group", - name: "name", - integrationFqn: "integration_fqn", - collaborators: [{ - subject: "subject", - roleId: "role_id" - }, { - subject: "subject", - roleId: "role_id" - }] - } -}) - }).rejects.toThrow(TrueFoundry.ConflictError); + .put("/api/svc/v1/secret-groups") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.secretGroups.createOrUpdate({ + manifest: { + type: "secret-group", + name: "name", + integrationFqn: "integration_fqn", + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + { + subject: "subject", + roleId: "role_id", + }, + ], + }, + }); + }).rejects.toThrow(TrueFoundry.ConflictError); }); - + test("create_or_update (6)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "secret-group" , "name" : "name" , "integration_fqn" : "integration_fqn" , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } , { "subject" : "subject" , "role_id" : "role_id" } ] } }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + type: "secret-group", + name: "name", + integration_fqn: "integration_fqn", + collaborators: [ + { subject: "subject", role_id: "role_id" }, + { subject: "subject", role_id: "role_id" }, + ], + }, + }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .put("/api/svc/v1/secret-groups").jsonBody(rawRequestBody) - .respondWith() - .statusCode(422).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.secretGroups.createOrUpdate({ - manifest: { - type: "secret-group", - name: "name", - integrationFqn: "integration_fqn", - collaborators: [{ - subject: "subject", - roleId: "role_id" - }, { - subject: "subject", - roleId: "role_id" - }] - } -}) - }).rejects.toThrow(TrueFoundry.UnprocessableEntityError); + .put("/api/svc/v1/secret-groups") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.secretGroups.createOrUpdate({ + manifest: { + type: "secret-group", + name: "name", + integrationFqn: "integration_fqn", + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + { + subject: "subject", + roleId: "role_id", + }, + ], + }, + }); + }).rejects.toThrow(TrueFoundry.UnprocessableEntityError); }); - + test("get (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : { "id" : "id" , "fqn" : "fqn" , "tenantName" : "tenantName" , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "associatedSecrets" : [ { "id" : "id" , "fqn" : "fqn" , "name" : "name" , "secretGroupId" : "secretGroupId" } ] , "integrationId" : "integrationId" , "manifest" : { "key" : "value" } , "accountId" : "accountId" , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "createdBy" : "createdBy" } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: { + id: "id", + fqn: "fqn", + tenantName: "tenantName", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + associatedSecrets: [{ id: "id", fqn: "fqn", name: "name", secretGroupId: "secretGroupId" }], + integrationId: "integrationId", + manifest: { key: "value" }, + accountId: "accountId", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + createdBy: "createdBy", + }, + }; + server .mockEndpoint() - .get("/api/svc/v1/secret-groups/id").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.secretGroups.get("id"); - expect(response).toEqual({ - data: { - id: "id", - fqn: "fqn", - tenantName: "tenantName", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - associatedSecrets: [{ + .get("/api/svc/v1/secret-groups/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.secretGroups.get("id"); + expect(response).toEqual({ + data: { id: "id", fqn: "fqn", - name: "name", - secretGroupId: "secretGroupId" - }], - integrationId: "integrationId", - manifest: { - "key": "value" - }, - accountId: "accountId", - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - createdBy: "createdBy" - } -}); - - + tenantName: "tenantName", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + associatedSecrets: [ + { + id: "id", + fqn: "fqn", + name: "name", + secretGroupId: "secretGroupId", + }, + ], + integrationId: "integrationId", + manifest: { + key: "value", + }, + accountId: "accountId", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + createdBy: "createdBy", + }, + }); }); - + test("get (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .get("/api/svc/v1/secret-groups/id").respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.secretGroups.get("id") - }).rejects.toThrow(TrueFoundry.ForbiddenError); + .get("/api/svc/v1/secret-groups/id") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.secretGroups.get("id"); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("get (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/secret-groups/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.secretGroups.get("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .get("/api/svc/v1/secret-groups/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.secretGroups.get("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("update (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "secrets" : [ { "key" : "key" } ] }; - const rawResponseBody = { "data" : { "id" : "id" , "fqn" : "fqn" , "tenantName" : "tenantName" , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "associatedSecrets" : [ { "id" : "id" , "fqn" : "fqn" , "name" : "name" , "secretGroupId" : "secretGroupId" } ] , "integrationId" : "integrationId" , "manifest" : { "key" : "value" } , "accountId" : "accountId" , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "createdBy" : "createdBy" } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { secrets: [{ key: "key" }] }; + const rawResponseBody = { + data: { + id: "id", + fqn: "fqn", + tenantName: "tenantName", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + associatedSecrets: [{ id: "id", fqn: "fqn", name: "name", secretGroupId: "secretGroupId" }], + integrationId: "integrationId", + manifest: { key: "value" }, + accountId: "accountId", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + createdBy: "createdBy", + }, + }; + server .mockEndpoint() - .put("/api/svc/v1/secret-groups/id").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.secretGroups.update("id", { - secrets: [{ - key: "key" - }] -}); - expect(response).toEqual({ - data: { - id: "id", - fqn: "fqn", - tenantName: "tenantName", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - associatedSecrets: [{ + .put("/api/svc/v1/secret-groups/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.secretGroups.update("id", { + secrets: [ + { + key: "key", + }, + ], + }); + expect(response).toEqual({ + data: { id: "id", fqn: "fqn", - name: "name", - secretGroupId: "secretGroupId" - }], - integrationId: "integrationId", - manifest: { - "key": "value" - }, - accountId: "accountId", - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - createdBy: "createdBy" - } -}); - - + tenantName: "tenantName", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + associatedSecrets: [ + { + id: "id", + fqn: "fqn", + name: "name", + secretGroupId: "secretGroupId", + }, + ], + integrationId: "integrationId", + manifest: { + key: "value", + }, + accountId: "accountId", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + createdBy: "createdBy", + }, + }); }); - + test("update (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "secrets" : [ { "key" : "key" } , { "key" : "key" } ] }; - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { secrets: [{ key: "key" }, { key: "key" }] }; + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .put("/api/svc/v1/secret-groups/id").jsonBody(rawRequestBody) - .respondWith() - .statusCode(400).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.secretGroups.update("id", { - secrets: [{ - key: "key" - }, { - key: "key" - }] -}) - }).rejects.toThrow(TrueFoundry.BadRequestError); + .put("/api/svc/v1/secret-groups/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.secretGroups.update("id", { + secrets: [ + { + key: "key", + }, + { + key: "key", + }, + ], + }); + }).rejects.toThrow(TrueFoundry.BadRequestError); }); - + test("update (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "secrets" : [ { "key" : "key" } , { "key" : "key" } ] }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { secrets: [{ key: "key" }, { key: "key" }] }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .put("/api/svc/v1/secret-groups/id").jsonBody(rawRequestBody) - .respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.secretGroups.update("id", { - secrets: [{ - key: "key" - }, { - key: "key" - }] -}) - }).rejects.toThrow(TrueFoundry.ForbiddenError); + .put("/api/svc/v1/secret-groups/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.secretGroups.update("id", { + secrets: [ + { + key: "key", + }, + { + key: "key", + }, + ], + }); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("update (4)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "secrets" : [ { "key" : "key" } , { "key" : "key" } ] }; - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { secrets: [{ key: "key" }, { key: "key" }] }; + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .put("/api/svc/v1/secret-groups/id").jsonBody(rawRequestBody) - .respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.secretGroups.update("id", { - secrets: [{ - key: "key" - }, { - key: "key" - }] -}) - }).rejects.toThrow(TrueFoundry.NotFoundError); + .put("/api/svc/v1/secret-groups/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.secretGroups.update("id", { + secrets: [ + { + key: "key", + }, + { + key: "key", + }, + ], + }); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("update (5)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "secrets" : [ { "key" : "key" } , { "key" : "key" } ] }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { secrets: [{ key: "key" }, { key: "key" }] }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .put("/api/svc/v1/secret-groups/id").jsonBody(rawRequestBody) - .respondWith() - .statusCode(422).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.secretGroups.update("id", { - secrets: [{ - key: "key" - }, { - key: "key" - }] -}) - }).rejects.toThrow(TrueFoundry.UnprocessableEntityError); + .put("/api/svc/v1/secret-groups/id") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.secretGroups.update("id", { + secrets: [ + { + key: "key", + }, + { + key: "key", + }, + ], + }); + }).rejects.toThrow(TrueFoundry.UnprocessableEntityError); }); - + test("delete (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = {}; + server .mockEndpoint() - .delete("/api/svc/v1/secret-groups/id").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.secretGroups.delete("id", { - forceDelete: true -}); - expect(response).toEqual({}); - - + .delete("/api/svc/v1/secret-groups/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.secretGroups.delete("id"); + expect(response).toEqual({}); }); - + test("delete (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .delete("/api/svc/v1/secret-groups/id").respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.secretGroups.delete("id") - }).rejects.toThrow(TrueFoundry.ForbiddenError); + .delete("/api/svc/v1/secret-groups/id") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.secretGroups.delete("id"); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("delete (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .delete("/api/svc/v1/secret-groups/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.secretGroups.delete("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .delete("/api/svc/v1/secret-groups/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.secretGroups.delete("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("delete (4)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .delete("/api/svc/v1/secret-groups/id").respondWith() - .statusCode(424).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.secretGroups.delete("id") - }).rejects.toThrow(TrueFoundry.FailedDependencyError); + .delete("/api/svc/v1/secret-groups/id") + .respondWith() + .statusCode(424) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.secretGroups.delete("id"); + }).rejects.toThrow(TrueFoundry.FailedDependencyError); }); - }); diff --git a/tests/wire/secrets.test.ts b/tests/wire/secrets.test.ts index 24a0f21f..538d364d 100644 --- a/tests/wire/secrets.test.ts +++ b/tests/wire/secrets.test.ts @@ -5,252 +5,293 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("SecretsClient", () => { - test("list (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { }; - const rawResponseBody = { "data" : [ { "id" : "id" , "fqn" : "fqn" , "name" : "name" , "secretGroupId" : "secretGroupId" , "value" : "value" , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "secretVersions" : [ { "id" : "id" , "fqn" : "fqn" } ] , "activeDeploymentsCount" : 1 , "createdBy" : "createdBy" } ] , "pagination" : { "total" : 100 , "offset" : 0 , "limit" : 10 } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { + data: [ + { + id: "id", + fqn: "fqn", + name: "name", + secretGroupId: "secretGroupId", + value: "value", + createdBySubject: { subjectId: "subjectId", subjectType: "user" }, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + secretVersions: [{ id: "id", fqn: "fqn" }], + activeDeploymentsCount: 1, + createdBy: "createdBy", + }, + ], + pagination: { total: 100, offset: 0, limit: 10 }, + }; + server .mockEndpoint({ once: false }) - .post("/api/svc/v1/secrets").jsonBody(rawRequestBody, { ignoredFields: [ "offset" ] }) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const expected = { - data: [{ - id: "id", - fqn: "fqn", - name: "name", - secretGroupId: "secretGroupId", - value: "value", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - secretVersions: [{ + .post("/api/svc/v1/secrets") + .jsonBody(rawRequestBody, { ignoredFields: ["offset"] }) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + data: [ + { id: "id", - fqn: "fqn" - }], - activeDeploymentsCount: 1, - createdBy: "createdBy" - }], - pagination: { - total: 100, - offset: 0, - limit: 10 - } -}; - const page = await client.secrets.list(); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - + fqn: "fqn", + name: "name", + secretGroupId: "secretGroupId", + value: "value", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + secretVersions: [ + { + id: "id", + fqn: "fqn", + }, + ], + activeDeploymentsCount: 1, + createdBy: "createdBy", + }, + ], + pagination: { + total: 100, + offset: 0, + limit: 10, + }, + }; + const page = await client.secrets.list(); + + expect(expected.data).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.data).toEqual(nextPage.data); }); - + test("list (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { statusCode: 1, message: "message" }; + server - .mockEndpoint({ once: false }) - .post("/api/svc/v1/secrets").jsonBody(rawRequestBody, { ignoredFields: [ "offset" ] }) - .respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.secrets.list() - }).rejects.toThrow(TrueFoundry.ForbiddenError); + .mockEndpoint() + .post("/api/svc/v1/secrets") + .jsonBody(rawRequestBody, { ignoredFields: ["offset"] }) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.secrets.list(); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("list (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { }; - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = {}; + const rawResponseBody = { key: "value" }; + server - .mockEndpoint({ once: false }) - .post("/api/svc/v1/secrets").jsonBody(rawRequestBody, { ignoredFields: [ "offset" ] }) - .respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.secrets.list() - }).rejects.toThrow(TrueFoundry.NotFoundError); + .mockEndpoint() + .post("/api/svc/v1/secrets") + .jsonBody(rawRequestBody, { ignoredFields: ["offset"] }) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.secrets.list(); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("get (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : { "id" : "id" , "fqn" : "fqn" , "name" : "name" , "secretGroupId" : "secretGroupId" , "value" : "value" , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "secretVersions" : [ { "id" : "id" , "fqn" : "fqn" } ] , "activeDeploymentsCount" : 1 , "createdBy" : "createdBy" } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: { + id: "id", + fqn: "fqn", + name: "name", + secretGroupId: "secretGroupId", + value: "value", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + secretVersions: [{ id: "id", fqn: "fqn" }], + activeDeploymentsCount: 1, + createdBy: "createdBy", + }, + }; + server .mockEndpoint() - .get("/api/svc/v1/secrets/id").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.secrets.get("id"); - expect(response).toEqual({ - data: { - id: "id", - fqn: "fqn", - name: "name", - secretGroupId: "secretGroupId", - value: "value", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - secretVersions: [{ + .get("/api/svc/v1/secrets/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.secrets.get("id"); + expect(response).toEqual({ + data: { id: "id", - fqn: "fqn" - }], - activeDeploymentsCount: 1, - createdBy: "createdBy" - } -}); - - + fqn: "fqn", + name: "name", + secretGroupId: "secretGroupId", + value: "value", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + secretVersions: [ + { + id: "id", + fqn: "fqn", + }, + ], + activeDeploymentsCount: 1, + createdBy: "createdBy", + }, + }); }); - + test("get (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .get("/api/svc/v1/secrets/id").respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.secrets.get("id") - }).rejects.toThrow(TrueFoundry.ForbiddenError); + .get("/api/svc/v1/secrets/id") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.secrets.get("id"); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("get (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/secrets/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.secrets.get("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .get("/api/svc/v1/secrets/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.secrets.get("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("delete (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawResponseBody = 1.1; - + server .mockEndpoint() - .delete("/api/svc/v1/secrets/id").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.secrets.delete("id", { - forceDelete: true -}); - expect(response).toEqual(1.1); - - + .delete("/api/svc/v1/secrets/id") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.secrets.delete("id"); + expect(response).toEqual(1.1); }); - + test("delete (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .delete("/api/svc/v1/secrets/id").respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.secrets.delete("id") - }).rejects.toThrow(TrueFoundry.ForbiddenError); + .delete("/api/svc/v1/secrets/id") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.secrets.delete("id"); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("delete (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .delete("/api/svc/v1/secrets/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.secrets.delete("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .delete("/api/svc/v1/secrets/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.secrets.delete("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("delete (4)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .delete("/api/svc/v1/secrets/id").respondWith() - .statusCode(424).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.secrets.delete("id") - }).rejects.toThrow(TrueFoundry.FailedDependencyError); + .delete("/api/svc/v1/secrets/id") + .respondWith() + .statusCode(424) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.secrets.delete("id"); + }).rejects.toThrow(TrueFoundry.FailedDependencyError); }); - }); diff --git a/tests/wire/teams.test.ts b/tests/wire/teams.test.ts index 2823252c..68e94329 100644 --- a/tests/wire/teams.test.ts +++ b/tests/wire/teams.test.ts @@ -5,552 +5,659 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("TeamsClient", () => { - test("list", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "description" : "description" , "tenantName" : "tenantName" , "accountId" : "accountId" , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "members" : [ "members" ] , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "manifest" : { "type" : "team" , "name" : "name" , "members" : [ "members" ] } , "isEditable" : true , "roles" : [ "roles" ] , "topMembers" : [ "topMembers" ] , "topManagers" : [ "topManagers" ] , "totalMemberCount" : 1.1 , "totalManagerCount" : 1.1 } ] , "pagination" : { "total" : 100 , "offset" : 0 , "limit" : 10 } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + id: "jqfwg345gi25n5ju2yz5iz6m", + description: "description", + tenantName: "tenantName", + accountId: "accountId", + createdBySubject: { subjectId: "subjectId", subjectType: "user" }, + members: ["members"], + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + manifest: { type: "team", name: "name", members: ["members"] }, + isEditable: true, + roles: ["roles"], + topMembers: ["topMembers"], + topManagers: ["topManagers"], + totalMemberCount: 1.1, + totalManagerCount: 1.1, + }, + ], + pagination: { total: 100, offset: 0, limit: 10 }, + }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/teams/user").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const expected = { - data: [{ - id: "jqfwg345gi25n5ju2yz5iz6m", - description: "description", - tenantName: "tenantName", - accountId: "accountId", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" - }, - members: ["members"], - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - manifest: { - type: "team", - name: "name", - members: ["members"] + .mockEndpoint() + .get("/api/svc/v1/teams/user") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + data: [ + { + id: "jqfwg345gi25n5ju2yz5iz6m", + description: "description", + tenantName: "tenantName", + accountId: "accountId", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + members: ["members"], + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + manifest: { + type: "team", + name: "name", + members: ["members"], + }, + isEditable: true, + roles: ["roles"], + topMembers: ["topMembers"], + topManagers: ["topManagers"], + totalMemberCount: 1.1, + totalManagerCount: 1.1, + }, + ], + pagination: { + total: 100, + offset: 0, + limit: 10, }, - isEditable: true, - roles: ["roles"], - topMembers: ["topMembers"], - topManagers: ["topManagers"], - totalMemberCount: 1.1, - totalManagerCount: 1.1 - }], - pagination: { - total: 100, - offset: 0, - limit: 10 - } -}; - const page = await client.teams.list({ - limit: 10, - offset: 0, - role: "manager", - attributes: ["attributes"] -}); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - + }; + const page = await client.teams.list({ + limit: 10, + offset: 0, + }); + + expect(expected.data).toEqual(page.data); }); - + test("create_or_update (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "team" , "name" : "name" , "members" : [ "members" ] } }; - const rawResponseBody = { "data" : { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "description" : "description" , "tenantName" : "tenantName" , "accountId" : "accountId" , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "members" : [ "members" ] , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "manifest" : { "type" : "team" , "name" : "name" , "displayName" : "displayName" , "description" : "description" , "managers" : [ "managers" ] , "members" : [ "members" ] , "ownedBy" : { "account" : "account" } , "tags" : { "key" : "value" } , "identity_provider_mapping" : [ { "identity_provider" : "identity_provider" , "value" : "value" } ] } , "metadata" : { "createdByScim" : true , "scimExternalId" : "scimExternalId" } , "isEditable" : true , "roles" : [ "roles" ] , "topMembers" : [ "topMembers" ] , "topManagers" : [ "topManagers" ] , "totalMemberCount" : 1.1 , "totalManagerCount" : 1.1 } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { manifest: { type: "team", name: "name", members: ["members"] } }; + const rawResponseBody = { + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + description: "description", + tenantName: "tenantName", + accountId: "accountId", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + members: ["members"], + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + manifest: { + type: "team", + name: "name", + displayName: "displayName", + description: "description", + managers: ["managers"], + members: ["members"], + ownedBy: { account: "account" }, + tags: { key: "value" }, + identity_provider_mapping: [{ identity_provider: "identity_provider", value: "value" }], + }, + metadata: { createdByScim: true, scimExternalId: "scimExternalId" }, + isEditable: true, + roles: ["roles"], + topMembers: ["topMembers"], + topManagers: ["topManagers"], + totalMemberCount: 1.1, + totalManagerCount: 1.1, + }, + }; + server .mockEndpoint() - .put("/api/svc/v1/teams").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.teams.createOrUpdate({ - manifest: { - type: "team", - name: "name", - members: ["members"] - } -}); - expect(response).toEqual({ - data: { - id: "jqfwg345gi25n5ju2yz5iz6m", - description: "description", - tenantName: "tenantName", - accountId: "accountId", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - members: ["members"], - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - manifest: { - type: "team", - name: "name", - displayName: "displayName", - description: "description", - managers: ["managers"], - members: ["members"], - ownedBy: { - account: "account" + .put("/api/svc/v1/teams") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.teams.createOrUpdate({ + manifest: { + type: "team", + name: "name", + members: ["members"], }, - tags: { - "key": "value" + }); + expect(response).toEqual({ + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + description: "description", + tenantName: "tenantName", + accountId: "accountId", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + members: ["members"], + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + manifest: { + type: "team", + name: "name", + displayName: "displayName", + description: "description", + managers: ["managers"], + members: ["members"], + ownedBy: { + account: "account", + }, + tags: { + key: "value", + }, + identityProviderMapping: [ + { + identityProvider: "identity_provider", + value: "value", + }, + ], + }, + metadata: { + createdByScim: true, + scimExternalId: "scimExternalId", + }, + isEditable: true, + roles: ["roles"], + topMembers: ["topMembers"], + topManagers: ["topManagers"], + totalMemberCount: 1.1, + totalManagerCount: 1.1, }, - identityProviderMapping: [{ - identityProvider: "identity_provider", - value: "value" - }] - }, - metadata: { - createdByScim: true, - scimExternalId: "scimExternalId" - }, - isEditable: true, - roles: ["roles"], - topMembers: ["topMembers"], - topManagers: ["topManagers"], - totalMemberCount: 1.1, - totalManagerCount: 1.1 - } -}); - - + }); }); - + test("create_or_update (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "team" , "name" : "name" , "members" : [ "members" , "members" ] } }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { manifest: { type: "team", name: "name", members: ["members", "members"] } }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .put("/api/svc/v1/teams").jsonBody(rawRequestBody) - .respondWith() - .statusCode(409).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.teams.createOrUpdate({ - manifest: { - type: "team", - name: "name", - members: ["members", "members"] - } -}) - }).rejects.toThrow(TrueFoundry.ConflictError); + .put("/api/svc/v1/teams") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.teams.createOrUpdate({ + manifest: { + type: "team", + name: "name", + members: ["members", "members"], + }, + }); + }).rejects.toThrow(TrueFoundry.ConflictError); }); - + test("create_or_update (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "team" , "name" : "name" , "members" : [ "members" , "members" ] } }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { manifest: { type: "team", name: "name", members: ["members", "members"] } }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .put("/api/svc/v1/teams").jsonBody(rawRequestBody) - .respondWith() - .statusCode(422).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.teams.createOrUpdate({ - manifest: { - type: "team", - name: "name", - members: ["members", "members"] - } -}) - }).rejects.toThrow(TrueFoundry.UnprocessableEntityError); + .put("/api/svc/v1/teams") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.teams.createOrUpdate({ + manifest: { + type: "team", + name: "name", + members: ["members", "members"], + }, + }); + }).rejects.toThrow(TrueFoundry.UnprocessableEntityError); }); - + test("list_members (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "subjectId" : "jqfwg345gi25n5ju2yz5iz6m" , "subjectSlug" : "alice@example.com" , "subjectType" : "user" } ] , "pagination" : { "total" : 100 , "offset" : 0 , "limit" : 10 } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [{ subjectId: "jqfwg345gi25n5ju2yz5iz6m", subjectSlug: "alice@example.com", subjectType: "user" }], + pagination: { total: 100, offset: 0, limit: 10 }, + }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/teams/jqfwg345gi25n5ju2yz5iz6m/members").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const expected = { - data: [{ - subjectId: "jqfwg345gi25n5ju2yz5iz6m", - subjectSlug: "alice@example.com", - subjectType: "user" - }], - pagination: { - total: 100, - offset: 0, - limit: 10 - } -}; - const page = await client.teams.listMembers("jqfwg345gi25n5ju2yz5iz6m", { - limit: 10, - offset: 0, - filter: "{\"type\":\"AND\",\"children\":[{\"column\":\"email\",\"op\":\"STRING_CONTAINS\",\"value\":\"@example.com\"}]}" -}); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - + .mockEndpoint() + .get("/api/svc/v1/teams/jqfwg345gi25n5ju2yz5iz6m/members") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + data: [ + { + subjectId: "jqfwg345gi25n5ju2yz5iz6m", + subjectSlug: "alice@example.com", + subjectType: "user", + }, + ], + pagination: { + total: 100, + offset: 0, + limit: 10, + }, + }; + const page = await client.teams.listMembers("jqfwg345gi25n5ju2yz5iz6m", { + offset: 0, + limit: 10, + filter: '{"type":"AND","children":[{"column":"email","op":"STRING_CONTAINS","value":"@example.com"}]}', + }); + + expect(expected.data).toEqual(page.data); }); - + test("list_members (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/teams/id/members").respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.teams.listMembers("id") - }).rejects.toThrow(TrueFoundry.ForbiddenError); + .mockEndpoint() + .get("/api/svc/v1/teams/id/members") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.teams.listMembers("id"); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("list_members (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/teams/id/members").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.teams.listMembers("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .mockEndpoint() + .get("/api/svc/v1/teams/id/members") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.teams.listMembers("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("list_managers (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "subjectId" : "jqfwg345gi25n5ju2yz5iz6m" , "subjectSlug" : "alice@example.com" , "subjectType" : "user" } ] , "pagination" : { "total" : 100 , "offset" : 0 , "limit" : 10 } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [{ subjectId: "jqfwg345gi25n5ju2yz5iz6m", subjectSlug: "alice@example.com", subjectType: "user" }], + pagination: { total: 100, offset: 0, limit: 10 }, + }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/teams/jqfwg345gi25n5ju2yz5iz6m/managers").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const expected = { - data: [{ - subjectId: "jqfwg345gi25n5ju2yz5iz6m", - subjectSlug: "alice@example.com", - subjectType: "user" - }], - pagination: { - total: 100, - offset: 0, - limit: 10 - } -}; - const page = await client.teams.listManagers("jqfwg345gi25n5ju2yz5iz6m", { - limit: 10, - offset: 0, - filter: "{\"type\":\"AND\",\"children\":[{\"column\":\"email\",\"op\":\"STRING_CONTAINS\",\"value\":\"@example.com\"}]}" -}); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - + .mockEndpoint() + .get("/api/svc/v1/teams/jqfwg345gi25n5ju2yz5iz6m/managers") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + data: [ + { + subjectId: "jqfwg345gi25n5ju2yz5iz6m", + subjectSlug: "alice@example.com", + subjectType: "user", + }, + ], + pagination: { + total: 100, + offset: 0, + limit: 10, + }, + }; + const page = await client.teams.listManagers("jqfwg345gi25n5ju2yz5iz6m", { + offset: 0, + limit: 10, + filter: '{"type":"AND","children":[{"column":"email","op":"STRING_CONTAINS","value":"@example.com"}]}', + }); + + expect(expected.data).toEqual(page.data); }); - + test("list_managers (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/teams/id/managers").respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.teams.listManagers("id") - }).rejects.toThrow(TrueFoundry.ForbiddenError); + .mockEndpoint() + .get("/api/svc/v1/teams/id/managers") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.teams.listManagers("id"); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("list_managers (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/teams/id/managers").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.teams.listManagers("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .mockEndpoint() + .get("/api/svc/v1/teams/id/managers") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.teams.listManagers("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("get (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "description" : "description" , "tenantName" : "tenantName" , "accountId" : "accountId" , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "members" : [ "members" ] , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "manifest" : { "type" : "team" , "name" : "name" , "displayName" : "displayName" , "description" : "description" , "managers" : [ "managers" ] , "members" : [ "members" ] , "ownedBy" : { "account" : "account" } , "tags" : { "key" : "value" } , "identity_provider_mapping" : [ { "identity_provider" : "identity_provider" , "value" : "value" } ] } , "metadata" : { "createdByScim" : true , "scimExternalId" : "scimExternalId" } , "isEditable" : true , "roles" : [ "roles" ] , "topMembers" : [ "topMembers" ] , "topManagers" : [ "topManagers" ] , "totalMemberCount" : 1.1 , "totalManagerCount" : 1.1 } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + description: "description", + tenantName: "tenantName", + accountId: "accountId", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + members: ["members"], + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + manifest: { + type: "team", + name: "name", + displayName: "displayName", + description: "description", + managers: ["managers"], + members: ["members"], + ownedBy: { account: "account" }, + tags: { key: "value" }, + identity_provider_mapping: [{ identity_provider: "identity_provider", value: "value" }], + }, + metadata: { createdByScim: true, scimExternalId: "scimExternalId" }, + isEditable: true, + roles: ["roles"], + topMembers: ["topMembers"], + topManagers: ["topManagers"], + totalMemberCount: 1.1, + totalManagerCount: 1.1, + }, + }; + server .mockEndpoint() - .get("/api/svc/v1/teams/jqfwg345gi25n5ju2yz5iz6m").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.teams.get("jqfwg345gi25n5ju2yz5iz6m"); - expect(response).toEqual({ - data: { - id: "jqfwg345gi25n5ju2yz5iz6m", - description: "description", - tenantName: "tenantName", - accountId: "accountId", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - members: ["members"], - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - manifest: { - type: "team", - name: "name", - displayName: "displayName", - description: "description", - managers: ["managers"], - members: ["members"], - ownedBy: { - account: "account" - }, - tags: { - "key": "value" + .get("/api/svc/v1/teams/jqfwg345gi25n5ju2yz5iz6m") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.teams.get("jqfwg345gi25n5ju2yz5iz6m"); + expect(response).toEqual({ + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + description: "description", + tenantName: "tenantName", + accountId: "accountId", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + members: ["members"], + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + manifest: { + type: "team", + name: "name", + displayName: "displayName", + description: "description", + managers: ["managers"], + members: ["members"], + ownedBy: { + account: "account", + }, + tags: { + key: "value", + }, + identityProviderMapping: [ + { + identityProvider: "identity_provider", + value: "value", + }, + ], + }, + metadata: { + createdByScim: true, + scimExternalId: "scimExternalId", + }, + isEditable: true, + roles: ["roles"], + topMembers: ["topMembers"], + topManagers: ["topManagers"], + totalMemberCount: 1.1, + totalManagerCount: 1.1, }, - identityProviderMapping: [{ - identityProvider: "identity_provider", - value: "value" - }] - }, - metadata: { - createdByScim: true, - scimExternalId: "scimExternalId" - }, - isEditable: true, - roles: ["roles"], - topMembers: ["topMembers"], - topManagers: ["topManagers"], - totalMemberCount: 1.1, - totalManagerCount: 1.1 - } -}); - - + }); }); - + test("get (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/teams/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.teams.get("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .get("/api/svc/v1/teams/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.teams.get("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("delete (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = {}; + server .mockEndpoint() - .delete("/api/svc/v1/teams/jqfwg345gi25n5ju2yz5iz6m").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.teams.delete("jqfwg345gi25n5ju2yz5iz6m"); - expect(response).toEqual({}); - - + .delete("/api/svc/v1/teams/jqfwg345gi25n5ju2yz5iz6m") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.teams.delete("jqfwg345gi25n5ju2yz5iz6m"); + expect(response).toEqual({}); }); - + test("delete (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .delete("/api/svc/v1/teams/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.teams.delete("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .delete("/api/svc/v1/teams/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.teams.delete("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("delete (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .delete("/api/svc/v1/teams/id").respondWith() - .statusCode(409).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.teams.delete("id") - }).rejects.toThrow(TrueFoundry.ConflictError); + .delete("/api/svc/v1/teams/id") + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.teams.delete("id"); + }).rejects.toThrow(TrueFoundry.ConflictError); }); - + test("get_permissions (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "resourceType" : "resourceType" , "resourceId" : "resourceId" , "resourceName" : "resourceName" , "resourceFqn" : "resourceFqn" , "roleId" : "roleId" , "roleName" : "roleName" , "subjectId" : "subjectId" , "subjectType" : "subjectType" } ] }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + resourceType: "resourceType", + resourceId: "resourceId", + resourceName: "resourceName", + resourceFqn: "resourceFqn", + roleId: "roleId", + roleName: "roleName", + subjectId: "subjectId", + subjectType: "subjectType", + }, + ], + }; + server .mockEndpoint() - .get("/api/svc/v1/teams/jqfwg345gi25n5ju2yz5iz6m/permissions").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.teams.getPermissions("jqfwg345gi25n5ju2yz5iz6m"); - expect(response).toEqual({ - data: [{ - resourceType: "resourceType", - resourceId: "resourceId", - resourceName: "resourceName", - resourceFqn: "resourceFqn", - roleId: "roleId", - roleName: "roleName", - subjectId: "subjectId", - subjectType: "subjectType" - }] -}); - - + .get("/api/svc/v1/teams/jqfwg345gi25n5ju2yz5iz6m/permissions") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.teams.getPermissions("jqfwg345gi25n5ju2yz5iz6m"); + expect(response).toEqual({ + data: [ + { + resourceType: "resourceType", + resourceId: "resourceId", + resourceName: "resourceName", + resourceFqn: "resourceFqn", + roleId: "roleId", + roleName: "roleName", + subjectId: "subjectId", + subjectType: "subjectType", + }, + ], + }); }); - + test("get_permissions (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .get("/api/svc/v1/teams/id/permissions").respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.teams.getPermissions("id") - }).rejects.toThrow(TrueFoundry.ForbiddenError); + .get("/api/svc/v1/teams/id/permissions") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.teams.getPermissions("id"); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("get_permissions (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/teams/id/permissions").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.teams.getPermissions("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .get("/api/svc/v1/teams/id/permissions") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.teams.getPermissions("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - }); diff --git a/tests/wire/traces.test.ts b/tests/wire/traces.test.ts index c09139da..2c567f7c 100644 --- a/tests/wire/traces.test.ts +++ b/tests/wire/traces.test.ts @@ -4,65 +4,86 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("TracesClient", () => { - test("query_spans", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "startTime" : "startTime" }; - const rawResponseBody = { "data" : [ { "spanId" : "spanId" , "traceId" : "traceId" , "parentSpanId" : "parentSpanId" , "serviceName" : "serviceName" , "spanName" : "spanName" , "spanKind" : "spanKind" , "scopeName" : "scopeName" , "scopeVersion" : "scopeVersion" , "timestamp" : "timestamp" , "durationNs" : 1.1 , "statusCode" : "statusCode" , "statusMessage" : "statusMessage" , "spanAttributes" : { "key" : "value" } , "events" : [ { "key" : "value" } ] , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "feedbacks" : [ [ ] ] } ] , "pagination" : { "limit" : 10 , "nextPageToken" : "nextPageToken" , "previousPageToken" : "previousPageToken" } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { startTime: "startTime" }; + const rawResponseBody = { + data: [ + { + spanId: "spanId", + traceId: "traceId", + parentSpanId: "parentSpanId", + serviceName: "serviceName", + spanName: "spanName", + spanKind: "spanKind", + scopeName: "scopeName", + scopeVersion: "scopeVersion", + timestamp: "timestamp", + durationNs: 1.1, + statusCode: "statusCode", + statusMessage: "statusMessage", + spanAttributes: { key: "value" }, + events: [{ key: "value" }], + createdBySubject: { subjectId: "subjectId", subjectType: "user" }, + feedbacks: [[]], + }, + ], + pagination: { limit: 10, nextPageToken: "nextPageToken", previousPageToken: "previousPageToken" }, + }; + server .mockEndpoint({ once: false }) - .post("/api/svc/v1/spans/query").jsonBody(rawRequestBody, { ignoredFields: [ "pageToken" ] }) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .post("/api/svc/v1/spans/query") + .jsonBody(rawRequestBody, { ignoredFields: ["pageToken"] }) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const expected = { - data: [{ - spanId: "spanId", - traceId: "traceId", - parentSpanId: "parentSpanId", - serviceName: "serviceName", - spanName: "spanName", - spanKind: "spanKind", - scopeName: "scopeName", - scopeVersion: "scopeVersion", - timestamp: "timestamp", - durationNs: 1.1, - statusCode: "statusCode", - statusMessage: "statusMessage", - spanAttributes: { - "key": "value" - }, - events: [{ - "key": "value" - }], - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" + const expected = { + data: [ + { + spanId: "spanId", + traceId: "traceId", + parentSpanId: "parentSpanId", + serviceName: "serviceName", + spanName: "spanName", + spanKind: "spanKind", + scopeName: "scopeName", + scopeVersion: "scopeVersion", + timestamp: "timestamp", + durationNs: 1.1, + statusCode: "statusCode", + statusMessage: "statusMessage", + spanAttributes: { + key: "value", + }, + events: [ + { + key: "value", + }, + ], + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + feedbacks: [[]], + }, + ], + pagination: { + limit: 10, + nextPageToken: "nextPageToken", + previousPageToken: "previousPageToken", }, - feedbacks: [[]] - }], - pagination: { - limit: 10, - nextPageToken: "nextPageToken", - previousPageToken: "previousPageToken" - } -}; - const page = await client.traces.querySpans({ - startTime: "startTime" -}); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - + }; + const page = await client.traces.querySpans({ + startTime: "startTime", + }); + + expect(expected.data).toEqual(page.data); + expect(page.hasNextPage()).toBe(true); + const nextPage = await page.getNextPage(); + expect(expected.data).toEqual(nextPage.data); }); - }); diff --git a/tests/wire/users.test.ts b/tests/wire/users.test.ts index 245f4c73..8ad251bc 100644 --- a/tests/wire/users.test.ts +++ b/tests/wire/users.test.ts @@ -5,835 +5,911 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("UsersClient", () => { - test("list", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "email" : "email" , "tenantName" : "tenantName" , "metadata" : { } , "roles" : [ "roles" ] , "rolesWithResource" : [ { "roleId" : "roleId" , "resourceType" : "role" , "resourceId" : "resourceId" , "roleName" : "roleName" } ] , "accounts" : [ { "accountId" : "accountId" , "name" : "name" } ] , "active" : true , "isEditable" : true , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "lastAccessedAt" : "2024-01-15T09:30:00Z" } ] , "pagination" : { "total" : 100 , "offset" : 0 , "limit" : 10 } }; - - server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/users").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const expected = { - data: [{ - id: "jqfwg345gi25n5ju2yz5iz6m", - email: "email", - tenantName: "tenantName", - metadata: {}, - roles: ["roles"], - rolesWithResource: [{ - roleId: "roleId", - resourceType: "role", - resourceId: "resourceId", - roleName: "roleName" - }], - accounts: [{ - accountId: "accountId", - name: "name" - }], - active: true, - isEditable: true, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - lastAccessedAt: new Date("2024-01-15T09:30:00.000Z") - }], - pagination: { - total: 100, - offset: 0, - limit: 10 - } -}; - const page = await client.users.list({ - limit: 10, - offset: 0, - query: "john@example.com", - showInvalidUsers: true -}); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - - }); - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + id: "jqfwg345gi25n5ju2yz5iz6m", + email: "email", + tenantName: "tenantName", + metadata: {}, + roles: ["roles"], + rolesWithResource: [ + { roleId: "roleId", resourceType: "role", resourceId: "resourceId", roleName: "roleName" }, + ], + accounts: [{ accountId: "accountId", name: "name" }], + active: true, + isEditable: true, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + lastAccessedAt: "2024-01-15T09:30:00Z", + }, + ], + pagination: { total: 100, offset: 0, limit: 10 }, + }; + + server.mockEndpoint().get("/api/svc/v1/users").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); + + const expected = { + data: [ + { + id: "jqfwg345gi25n5ju2yz5iz6m", + email: "email", + tenantName: "tenantName", + metadata: {}, + roles: ["roles"], + rolesWithResource: [ + { + roleId: "roleId", + resourceType: "role", + resourceId: "resourceId", + roleName: "roleName", + }, + ], + accounts: [ + { + accountId: "accountId", + name: "name", + }, + ], + active: true, + isEditable: true, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + lastAccessedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + pagination: { + total: 100, + offset: 0, + limit: 10, + }, + }; + const page = await client.users.list({ + limit: 10, + offset: 0, + query: "john@example.com", + }); + + expect(expected.data).toEqual(page.data); + }); + test("pre_register_users (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "email" : "user@example.com" }; - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { email: "user@example.com" }; + const rawResponseBody = {}; + server .mockEndpoint() - .post("/api/svc/v1/users/register").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .post("/api/svc/v1/users/register") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.users.preRegisterUsers({ - email: "user@example.com" -}); - expect(response).toEqual({}); - - + const response = await client.users.preRegisterUsers({ + email: "user@example.com", + }); + expect(response).toEqual({}); }); - + test("pre_register_users (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "email" : "email" }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { email: "email" }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .post("/api/svc/v1/users/register").jsonBody(rawRequestBody) - .respondWith() - .statusCode(401).jsonBody(rawResponseBody) - .build(); + .post("/api/svc/v1/users/register") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.users.preRegisterUsers({ - email: "email" -}) - }).rejects.toThrow(TrueFoundry.UnauthorizedError); + await expect(async () => { + return await client.users.preRegisterUsers({ + email: "email", + }); + }).rejects.toThrow(TrueFoundry.UnauthorizedError); }); - + test("pre_register_users (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "email" : "email" }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { email: "email" }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .post("/api/svc/v1/users/register").jsonBody(rawRequestBody) - .respondWith() - .statusCode(409).jsonBody(rawResponseBody) - .build(); + .post("/api/svc/v1/users/register") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.users.preRegisterUsers({ - email: "email" -}) - }).rejects.toThrow(TrueFoundry.ConflictError); + await expect(async () => { + return await client.users.preRegisterUsers({ + email: "email", + }); + }).rejects.toThrow(TrueFoundry.ConflictError); }); - + test("pre_register_users (4)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "email" : "email" }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { email: "email" }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .post("/api/svc/v1/users/register").jsonBody(rawRequestBody) - .respondWith() - .statusCode(422).jsonBody(rawResponseBody) - .build(); + .post("/api/svc/v1/users/register") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.users.preRegisterUsers({ - email: "email" -}) - }).rejects.toThrow(TrueFoundry.UnprocessableEntityError); + await expect(async () => { + return await client.users.preRegisterUsers({ + email: "email", + }); + }).rejects.toThrow(TrueFoundry.UnprocessableEntityError); }); - + test("update_roles (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "email" : "user@example.com" , "roles" : [ "tenant-admin" ] }; - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { email: "user@example.com", roles: ["tenant-admin"] }; + const rawResponseBody = {}; + server .mockEndpoint() - .patch("/api/svc/v1/users/roles").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .patch("/api/svc/v1/users/roles") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.users.updateRoles({ - email: "user@example.com", - roles: ["tenant-admin"] -}); - expect(response).toEqual({}); - - + const response = await client.users.updateRoles({ + email: "user@example.com", + roles: ["tenant-admin"], + }); + expect(response).toEqual({}); }); - + test("update_roles (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "email" : "email" , "roles" : [ "roles" , "roles" ] }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { email: "email", roles: ["roles", "roles"] }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .patch("/api/svc/v1/users/roles").jsonBody(rawRequestBody) - .respondWith() - .statusCode(401).jsonBody(rawResponseBody) - .build(); + .patch("/api/svc/v1/users/roles") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.users.updateRoles({ - email: "email", - roles: ["roles", "roles"] -}) - }).rejects.toThrow(TrueFoundry.UnauthorizedError); + await expect(async () => { + return await client.users.updateRoles({ + email: "email", + roles: ["roles", "roles"], + }); + }).rejects.toThrow(TrueFoundry.UnauthorizedError); }); - + test("update_roles (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "email" : "email" , "roles" : [ "roles" , "roles" ] }; - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { email: "email", roles: ["roles", "roles"] }; + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .patch("/api/svc/v1/users/roles").jsonBody(rawRequestBody) - .respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); + .patch("/api/svc/v1/users/roles") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.users.updateRoles({ - email: "email", - roles: ["roles", "roles"] -}) - }).rejects.toThrow(TrueFoundry.NotFoundError); + await expect(async () => { + return await client.users.updateRoles({ + email: "email", + roles: ["roles", "roles"], + }); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("update_roles (4)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "email" : "email" , "roles" : [ "roles" , "roles" ] }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { email: "email", roles: ["roles", "roles"] }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .patch("/api/svc/v1/users/roles").jsonBody(rawRequestBody) - .respondWith() - .statusCode(422).jsonBody(rawResponseBody) - .build(); + .patch("/api/svc/v1/users/roles") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.users.updateRoles({ - email: "email", - roles: ["roles", "roles"] -}) - }).rejects.toThrow(TrueFoundry.UnprocessableEntityError); + await expect(async () => { + return await client.users.updateRoles({ + email: "email", + roles: ["roles", "roles"], + }); + }).rejects.toThrow(TrueFoundry.UnprocessableEntityError); }); - + test("get (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "email" : "email" , "tenantName" : "tenantName" , "metadata" : { "sub" : "sub" , "imageURL" : "imageURL" , "pictureDownloadPath" : "pictureDownloadPath" , "displayName" : "displayName" , "userObject" : { "key" : "value" } , "inviteAccepted" : true , "registeredInIdp" : true , "preference" : { "key" : "value" } , "groups" : [ "groups" ] , "tenantRoleManagedBy" : "manual" , "ssoName" : "ssoName" , "scimUserObject" : { "key" : "value" } , "createdByScim" : true } , "roles" : [ "roles" ] , "rolesWithResource" : [ { "roleId" : "roleId" , "resourceType" : "role" , "resourceId" : "resourceId" , "roleName" : "roleName" } ] , "accounts" : [ { "accountId" : "accountId" , "name" : "name" } ] , "active" : true , "isEditable" : true , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "lastAccessedAt" : "2024-01-15T09:30:00Z" } }; - - server - .mockEndpoint() - .get("/api/svc/v1/users/jqfwg345gi25n5ju2yz5iz6m").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.users.get("jqfwg345gi25n5ju2yz5iz6m"); - expect(response).toEqual({ - data: { - id: "jqfwg345gi25n5ju2yz5iz6m", - email: "email", - tenantName: "tenantName", - metadata: { - sub: "sub", - imageUrl: "imageURL", - pictureDownloadPath: "pictureDownloadPath", - displayName: "displayName", - userObject: { - "key": "value" + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + email: "email", + tenantName: "tenantName", + metadata: { + sub: "sub", + imageURL: "imageURL", + pictureDownloadPath: "pictureDownloadPath", + displayName: "displayName", + userObject: { key: "value" }, + inviteAccepted: true, + registeredInIdp: true, + preference: { key: "value" }, + groups: ["groups"], + tenantRoleManagedBy: "manual", + ssoName: "ssoName", + scimUserObject: { key: "value" }, + createdByScim: true, + }, + roles: ["roles"], + rolesWithResource: [ + { roleId: "roleId", resourceType: "role", resourceId: "resourceId", roleName: "roleName" }, + ], + accounts: [{ accountId: "accountId", name: "name" }], + active: true, + isEditable: true, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + lastAccessedAt: "2024-01-15T09:30:00Z", }, - inviteAccepted: true, - registeredInIdp: true, - preference: { - "key": "value" + }; + + server + .mockEndpoint() + .get("/api/svc/v1/users/jqfwg345gi25n5ju2yz5iz6m") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.users.get("jqfwg345gi25n5ju2yz5iz6m"); + expect(response).toEqual({ + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + email: "email", + tenantName: "tenantName", + metadata: { + sub: "sub", + imageUrl: "imageURL", + pictureDownloadPath: "pictureDownloadPath", + displayName: "displayName", + userObject: { + key: "value", + }, + inviteAccepted: true, + registeredInIdp: true, + preference: { + key: "value", + }, + groups: ["groups"], + tenantRoleManagedBy: "manual", + ssoName: "ssoName", + scimUserObject: { + key: "value", + }, + createdByScim: true, + }, + roles: ["roles"], + rolesWithResource: [ + { + roleId: "roleId", + resourceType: "role", + resourceId: "resourceId", + roleName: "roleName", + }, + ], + accounts: [ + { + accountId: "accountId", + name: "name", + }, + ], + active: true, + isEditable: true, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + lastAccessedAt: new Date("2024-01-15T09:30:00.000Z"), }, - groups: ["groups"], - tenantRoleManagedBy: "manual", - ssoName: "ssoName", - scimUserObject: { - "key": "value" - }, - createdByScim: true - }, - roles: ["roles"], - rolesWithResource: [{ - roleId: "roleId", - resourceType: "role", - resourceId: "resourceId", - roleName: "roleName" - }], - accounts: [{ - accountId: "accountId", - name: "name" - }], - active: true, - isEditable: true, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - lastAccessedAt: new Date("2024-01-15T09:30:00.000Z") - } -}); - - + }); }); - + test("get (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/users/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); + .get("/api/svc/v1/users/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.users.get("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + await expect(async () => { + return await client.users.get("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("delete (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = {}; + server .mockEndpoint() - .delete("/api/svc/v1/users/jqfwg345gi25n5ju2yz5iz6m").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .delete("/api/svc/v1/users/jqfwg345gi25n5ju2yz5iz6m") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.users.delete("jqfwg345gi25n5ju2yz5iz6m", { - tenantName: "tenantName" -}); - expect(response).toEqual({}); - - + const response = await client.users.delete("jqfwg345gi25n5ju2yz5iz6m"); + expect(response).toEqual({}); }); - + test("delete (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .delete("/api/svc/v1/users/id").respondWith() - .statusCode(400).jsonBody(rawResponseBody) - .build(); + .delete("/api/svc/v1/users/id") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.users.delete("id") - }).rejects.toThrow(TrueFoundry.BadRequestError); + await expect(async () => { + return await client.users.delete("id"); + }).rejects.toThrow(TrueFoundry.BadRequestError); }); - + test("delete (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .delete("/api/svc/v1/users/id").respondWith() - .statusCode(401).jsonBody(rawResponseBody) - .build(); + .delete("/api/svc/v1/users/id") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.users.delete("id") - }).rejects.toThrow(TrueFoundry.UnauthorizedError); + await expect(async () => { + return await client.users.delete("id"); + }).rejects.toThrow(TrueFoundry.UnauthorizedError); }); - + test("delete (4)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .delete("/api/svc/v1/users/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); + .delete("/api/svc/v1/users/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.users.delete("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + await expect(async () => { + return await client.users.delete("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("invite_user (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "acceptInviteClientUrl" : "https://app.example.com/invite-accept" , "email" : "user@example.com" }; - const rawResponseBody = { "link" : "link" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + acceptInviteClientUrl: "https://app.example.com/invite-accept", + email: "user@example.com", + }; + const rawResponseBody = { link: "link" }; + server .mockEndpoint() - .post("/api/svc/v1/users/invite").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .post("/api/svc/v1/users/invite") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.users.inviteUser({ - acceptInviteClientUrl: "https://app.example.com/invite-accept", - email: "user@example.com" -}); - expect(response).toEqual({ - link: "link" -}); - - + const response = await client.users.inviteUser({ + acceptInviteClientUrl: "https://app.example.com/invite-accept", + email: "user@example.com", + }); + expect(response).toEqual({ + link: "link", + }); }); - + test("invite_user (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "acceptInviteClientUrl" : "acceptInviteClientUrl" , "email" : "email" }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { acceptInviteClientUrl: "acceptInviteClientUrl", email: "email" }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .post("/api/svc/v1/users/invite").jsonBody(rawRequestBody) - .respondWith() - .statusCode(401).jsonBody(rawResponseBody) - .build(); + .post("/api/svc/v1/users/invite") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.users.inviteUser({ - acceptInviteClientUrl: "acceptInviteClientUrl", - email: "email" -}) - }).rejects.toThrow(TrueFoundry.UnauthorizedError); + await expect(async () => { + return await client.users.inviteUser({ + acceptInviteClientUrl: "acceptInviteClientUrl", + email: "email", + }); + }).rejects.toThrow(TrueFoundry.UnauthorizedError); }); - + test("invite_user (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "acceptInviteClientUrl" : "acceptInviteClientUrl" , "email" : "email" }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { acceptInviteClientUrl: "acceptInviteClientUrl", email: "email" }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .post("/api/svc/v1/users/invite").jsonBody(rawRequestBody) - .respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); + .post("/api/svc/v1/users/invite") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.users.inviteUser({ - acceptInviteClientUrl: "acceptInviteClientUrl", - email: "email" -}) - }).rejects.toThrow(TrueFoundry.ForbiddenError); + await expect(async () => { + return await client.users.inviteUser({ + acceptInviteClientUrl: "acceptInviteClientUrl", + email: "email", + }); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("invite_user (4)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "acceptInviteClientUrl" : "acceptInviteClientUrl" , "email" : "email" }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { acceptInviteClientUrl: "acceptInviteClientUrl", email: "email" }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .post("/api/svc/v1/users/invite").jsonBody(rawRequestBody) - .respondWith() - .statusCode(409).jsonBody(rawResponseBody) - .build(); + .post("/api/svc/v1/users/invite") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.users.inviteUser({ - acceptInviteClientUrl: "acceptInviteClientUrl", - email: "email" -}) - }).rejects.toThrow(TrueFoundry.ConflictError); + await expect(async () => { + return await client.users.inviteUser({ + acceptInviteClientUrl: "acceptInviteClientUrl", + email: "email", + }); + }).rejects.toThrow(TrueFoundry.ConflictError); }); - + test("deactivate (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "email" : "user@example.com" }; - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { email: "user@example.com" }; + const rawResponseBody = {}; + server .mockEndpoint() - .patch("/api/svc/v1/users/deactivate").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .patch("/api/svc/v1/users/deactivate") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.users.deactivate({ - email: "user@example.com" -}); - expect(response).toEqual({}); - - + const response = await client.users.deactivate({ + email: "user@example.com", + }); + expect(response).toEqual({}); }); - + test("deactivate (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "email" : "email" }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { email: "email" }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .patch("/api/svc/v1/users/deactivate").jsonBody(rawRequestBody) - .respondWith() - .statusCode(401).jsonBody(rawResponseBody) - .build(); + .patch("/api/svc/v1/users/deactivate") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.users.deactivate({ - email: "email" -}) - }).rejects.toThrow(TrueFoundry.UnauthorizedError); + await expect(async () => { + return await client.users.deactivate({ + email: "email", + }); + }).rejects.toThrow(TrueFoundry.UnauthorizedError); }); - + test("deactivate (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "email" : "email" }; - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { email: "email" }; + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .patch("/api/svc/v1/users/deactivate").jsonBody(rawRequestBody) - .respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); + .patch("/api/svc/v1/users/deactivate") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.users.deactivate({ - email: "email" -}) - }).rejects.toThrow(TrueFoundry.NotFoundError); + await expect(async () => { + return await client.users.deactivate({ + email: "email", + }); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("activate (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "email" : "user@example.com" }; - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { email: "user@example.com" }; + const rawResponseBody = {}; + server .mockEndpoint() - .patch("/api/svc/v1/users/activate").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .patch("/api/svc/v1/users/activate") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.users.activate({ - email: "user@example.com" -}); - expect(response).toEqual({}); - - + const response = await client.users.activate({ + email: "user@example.com", + }); + expect(response).toEqual({}); }); - + test("activate (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "email" : "email" }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { email: "email" }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .patch("/api/svc/v1/users/activate").jsonBody(rawRequestBody) - .respondWith() - .statusCode(401).jsonBody(rawResponseBody) - .build(); + .patch("/api/svc/v1/users/activate") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.users.activate({ - email: "email" -}) - }).rejects.toThrow(TrueFoundry.UnauthorizedError); + await expect(async () => { + return await client.users.activate({ + email: "email", + }); + }).rejects.toThrow(TrueFoundry.UnauthorizedError); }); - + test("activate (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "email" : "email" }; - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { email: "email" }; + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .patch("/api/svc/v1/users/activate").jsonBody(rawRequestBody) - .respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); + .patch("/api/svc/v1/users/activate") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.users.activate({ - email: "email" -}) - }).rejects.toThrow(TrueFoundry.NotFoundError); + await expect(async () => { + return await client.users.activate({ + email: "email", + }); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("change_password", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "loginId" : "user@example.com" , "newPassword" : "newPassword" , "oldPassword" : "oldPassword" }; - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { loginId: "user@example.com", newPassword: "newPassword", oldPassword: "oldPassword" }; + const rawResponseBody = {}; + server .mockEndpoint() - .post("/api/svc/v1/users/change-password").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .post("/api/svc/v1/users/change-password") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.users.changePassword({ - loginId: "user@example.com", - newPassword: "newPassword", - oldPassword: "oldPassword" -}); - expect(response).toEqual({}); - - + const response = await client.users.changePassword({ + loginId: "user@example.com", + newPassword: "newPassword", + oldPassword: "oldPassword", + }); + expect(response).toEqual({}); }); - + test("get_resources (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "resourceType" : "resourceType" , "resourceId" : "resourceId" , "roleId" : "roleId" , "resourceName" : "resourceName" } ] }; - - server - .mockEndpoint() - .get("/api/svc/v1/x/users/jqfwg345gi25n5ju2yz5iz6m/resources").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.users.getResources("jqfwg345gi25n5ju2yz5iz6m"); - expect(response).toEqual({ - data: [{ - resourceType: "resourceType", - resourceId: "resourceId", - roleId: "roleId", - resourceName: "resourceName" - }] -}); - - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + resourceType: "resourceType", + resourceId: "resourceId", + roleId: "roleId", + resourceName: "resourceName", + }, + ], + }; + + server + .mockEndpoint() + .get("/api/svc/v1/x/users/jqfwg345gi25n5ju2yz5iz6m/resources") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.users.getResources("jqfwg345gi25n5ju2yz5iz6m"); + expect(response).toEqual({ + data: [ + { + resourceType: "resourceType", + resourceId: "resourceId", + roleId: "roleId", + resourceName: "resourceName", + }, + ], + }); }); - + test("get_resources (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .get("/api/svc/v1/x/users/id/resources").respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); + .get("/api/svc/v1/x/users/id/resources") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.users.getResources("id") - }).rejects.toThrow(TrueFoundry.ForbiddenError); + await expect(async () => { + return await client.users.getResources("id"); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("get_resources (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/x/users/id/resources").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); + .get("/api/svc/v1/x/users/id/resources") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.users.getResources("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + await expect(async () => { + return await client.users.getResources("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("get_permissions (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "resourceType" : "resourceType" , "resourceId" : "resourceId" , "resourceName" : "resourceName" , "resourceFqn" : "resourceFqn" , "roleId" : "roleId" , "roleName" : "roleName" , "subjectId" : "subjectId" , "subjectType" : "subjectType" } ] }; - - server - .mockEndpoint() - .get("/api/svc/v1/x/users/jqfwg345gi25n5ju2yz5iz6m/permissions").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.users.getPermissions("jqfwg345gi25n5ju2yz5iz6m"); - expect(response).toEqual({ - data: [{ - resourceType: "resourceType", - resourceId: "resourceId", - resourceName: "resourceName", - resourceFqn: "resourceFqn", - roleId: "roleId", - roleName: "roleName", - subjectId: "subjectId", - subjectType: "subjectType" - }] -}); - - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + resourceType: "resourceType", + resourceId: "resourceId", + resourceName: "resourceName", + resourceFqn: "resourceFqn", + roleId: "roleId", + roleName: "roleName", + subjectId: "subjectId", + subjectType: "subjectType", + }, + ], + }; + + server + .mockEndpoint() + .get("/api/svc/v1/x/users/jqfwg345gi25n5ju2yz5iz6m/permissions") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.users.getPermissions("jqfwg345gi25n5ju2yz5iz6m"); + expect(response).toEqual({ + data: [ + { + resourceType: "resourceType", + resourceId: "resourceId", + resourceName: "resourceName", + resourceFqn: "resourceFqn", + roleId: "roleId", + roleName: "roleName", + subjectId: "subjectId", + subjectType: "subjectType", + }, + ], + }); }); - + test("get_permissions (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .get("/api/svc/v1/x/users/id/permissions").respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); + .get("/api/svc/v1/x/users/id/permissions") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.users.getPermissions("id") - }).rejects.toThrow(TrueFoundry.ForbiddenError); + await expect(async () => { + return await client.users.getPermissions("id"); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("get_permissions (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/x/users/id/permissions").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); + .get("/api/svc/v1/x/users/id/permissions") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.users.getPermissions("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + await expect(async () => { + return await client.users.getPermissions("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("get_teams (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "teamName" : "teamName" , "roles" : [ "roles" ] } ] }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { data: [{ teamName: "teamName", roles: ["roles"] }] }; + server .mockEndpoint() - .get("/api/svc/v1/x/users/jqfwg345gi25n5ju2yz5iz6m/teams").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); + .get("/api/svc/v1/x/users/jqfwg345gi25n5ju2yz5iz6m/teams") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - - - const response = await client.users.getTeams("jqfwg345gi25n5ju2yz5iz6m"); - expect(response).toEqual({ - data: [{ - teamName: "teamName", - roles: ["roles"] - }] -}); - - + const response = await client.users.getTeams("jqfwg345gi25n5ju2yz5iz6m"); + expect(response).toEqual({ + data: [ + { + teamName: "teamName", + roles: ["roles"], + }, + ], + }); }); - + test("get_teams (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .get("/api/svc/v1/x/users/id/teams").respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); + .get("/api/svc/v1/x/users/id/teams") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.users.getTeams("id") - }).rejects.toThrow(TrueFoundry.ForbiddenError); + await expect(async () => { + return await client.users.getTeams("id"); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("get_teams (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/x/users/id/teams").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); + .get("/api/svc/v1/x/users/id/teams") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); - - await expect(async () => { - return await client.users.getTeams("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + await expect(async () => { + return await client.users.getTeams("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - }); diff --git a/tests/wire/virtualAccounts.test.ts b/tests/wire/virtualAccounts.test.ts index ccef6d1c..81b833db 100644 --- a/tests/wire/virtualAccounts.test.ts +++ b/tests/wire/virtualAccounts.test.ts @@ -5,582 +5,775 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("VirtualAccountsClient", () => { - test("list", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "type" : "type" , "tenantName" : "tenantName" , "manifest" : { "name" : "name" , "type" : "virtual-account" , "permissions" : [ { "resource_fqn" : "resource_fqn" , "resource_type" : "resource_type" , "role_id" : "role_id" } ] } , "jwtId" : "jwtId" , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "lastAccessedAt" : "2024-01-15T09:30:00Z" , "isExpired" : true , "jwts" : [ { "id" : "id" , "subjectType" : "subjectType" , "subjectId" : "subjectId" , "expiry" : "2024-01-15T09:30:00Z" , "tokenType" : "jwt" , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" } ] , "accountId" : "accountId" , "metadata" : { "key" : "value" } , "roleIds" : [ "roleIds" ] , "rolesWithResource" : [ { "roleId" : "roleId" , "resourceType" : "role" , "resourceId" : "resourceId" , "roleName" : "roleName" } ] , "createdBy" : "createdBy" , "nextScheduledRotation" : "nextScheduledRotation" } ] , "pagination" : { "total" : 100 , "offset" : 0 , "limit" : 10 } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + id: "jqfwg345gi25n5ju2yz5iz6m", + type: "type", + tenantName: "tenantName", + manifest: { + name: "name", + type: "virtual-account", + permissions: [ + { resource_fqn: "resource_fqn", resource_type: "resource_type", role_id: "role_id" }, + ], + }, + jwtId: "jwtId", + createdBySubject: { subjectId: "subjectId", subjectType: "user" }, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + lastAccessedAt: "2024-01-15T09:30:00Z", + isExpired: true, + jwts: [ + { + id: "id", + subjectType: "subjectType", + subjectId: "subjectId", + expiry: "2024-01-15T09:30:00Z", + tokenType: "jwt", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + }, + ], + accountId: "accountId", + metadata: { key: "value" }, + roleIds: ["roleIds"], + rolesWithResource: [ + { roleId: "roleId", resourceType: "role", resourceId: "resourceId", roleName: "roleName" }, + ], + createdBy: "createdBy", + nextScheduledRotation: "nextScheduledRotation", + }, + ], + pagination: { total: 100, offset: 0, limit: 10 }, + }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/virtual-accounts").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const expected = { - data: [{ - id: "jqfwg345gi25n5ju2yz5iz6m", - type: "type", - tenantName: "tenantName", + .mockEndpoint() + .get("/api/svc/v1/virtual-accounts") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + data: [ + { + id: "jqfwg345gi25n5ju2yz5iz6m", + type: "type", + tenantName: "tenantName", + manifest: { + name: "name", + type: "virtual-account", + permissions: [ + { + resourceFqn: "resource_fqn", + resourceType: "resource_type", + roleId: "role_id", + }, + ], + }, + jwtId: "jwtId", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + lastAccessedAt: new Date("2024-01-15T09:30:00.000Z"), + isExpired: true, + jwts: [ + { + id: "id", + subjectType: "subjectType", + subjectId: "subjectId", + expiry: new Date("2024-01-15T09:30:00.000Z"), + tokenType: "jwt", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + accountId: "accountId", + metadata: { + key: "value", + }, + roleIds: ["roleIds"], + rolesWithResource: [ + { + roleId: "roleId", + resourceType: "role", + resourceId: "resourceId", + roleName: "roleName", + }, + ], + createdBy: "createdBy", + nextScheduledRotation: "nextScheduledRotation", + }, + ], + pagination: { + total: 100, + offset: 0, + limit: 10, + }, + }; + const page = await client.virtualAccounts.list({ + limit: 10, + offset: 0, + nameSearchQuery: "staging-bot", + filter: '{"type":"AND","children":[{"column":"name","op":"STRING_CONTAINS","value":"bot"}]}', + }); + + expect(expected.data).toEqual(page.data); + }); + + test("create_or_update (1)", async () => { + const server = mockServerPool.createServer(); + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { manifest: { name: "name", type: "virtual-account", - permissions: [{ - resourceFqn: "resource_fqn", - resourceType: "resource_type", - roleId: "role_id" - }] - }, - jwtId: "jwtId", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" + permissions: [{ resource_fqn: "resource_fqn", resource_type: "resource_type", role_id: "role_id" }], }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - lastAccessedAt: new Date("2024-01-15T09:30:00.000Z"), - isExpired: true, - jwts: [{ - id: "id", - subjectType: "subjectType", + }; + const rawResponseBody = { + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + type: "type", + tenantName: "tenantName", + manifest: { + name: "name", + type: "virtual-account", + permissions: [{ resource_fqn: "resource_fqn", resource_type: "resource_type", role_id: "role_id" }], + expiration_date: "expiration_date", + auto_rotate: { auto_rotate_interval: 1, grace_period: 1 }, + notification_target: { + type: "email", + notification_channel: "notification_channel", + to_emails: ["to_emails"], + }, + secret_store_config: { integration_fqn: "integration_fqn", secret_path: "secret_path" }, + ownedBy: { team: "team" }, + tags: { key: "value" }, + identity_provider_mapping: [{ identity_provider: "identity_provider", value: "value" }], + token_type: "jwt", + }, + jwtId: "jwtId", + createdBySubject: { subjectId: "subjectId", - expiry: new Date("2024-01-15T09:30:00.000Z"), - tokenType: "jwt", - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z") - }], - accountId: "accountId", - metadata: { - "key": "value" + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + lastAccessedAt: "2024-01-15T09:30:00Z", + isExpired: true, + jwts: [ + { + id: "id", + subjectType: "subjectType", + subjectId: "subjectId", + expiry: "2024-01-15T09:30:00Z", + tokenType: "jwt", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + }, + ], + accountId: "accountId", + metadata: { key: "value" }, + roleIds: ["roleIds"], + rolesWithResource: [ + { roleId: "roleId", resourceType: "role", resourceId: "resourceId", roleName: "roleName" }, + ], + createdBy: "createdBy", + nextScheduledRotation: "nextScheduledRotation", }, - roleIds: ["roleIds"], - rolesWithResource: [{ - roleId: "roleId", - resourceType: "role", - resourceId: "resourceId", - roleName: "roleName" - }], - createdBy: "createdBy", - nextScheduledRotation: "nextScheduledRotation" - }], - pagination: { - total: 100, - offset: 0, - limit: 10 - } -}; - const page = await client.virtualAccounts.list({ - limit: 10, - offset: 0, - nameSearchQuery: "staging-bot", - ownedByTeams: ["ownedByTeams"], - isExpired: true, - filter: "{\"type\":\"AND\",\"children\":[{\"column\":\"name\",\"op\":\"STRING_CONTAINS\",\"value\":\"bot\"}]}" -}); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - - }); - - test("create_or_update (1)", async () => { - const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "name" : "name" , "type" : "virtual-account" , "permissions" : [ { "resource_fqn" : "resource_fqn" , "resource_type" : "resource_type" , "role_id" : "role_id" } ] } }; - const rawResponseBody = { "data" : { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "type" : "type" , "tenantName" : "tenantName" , "manifest" : { "name" : "name" , "type" : "virtual-account" , "permissions" : [ { "resource_fqn" : "resource_fqn" , "resource_type" : "resource_type" , "role_id" : "role_id" } ] , "expiration_date" : "expiration_date" , "auto_rotate" : { "auto_rotate_interval" : 1 , "grace_period" : 1 } , "notification_target" : { "type" : "email" , "notification_channel" : "notification_channel" , "to_emails" : [ "to_emails" ] } , "secret_store_config" : { "integration_fqn" : "integration_fqn" , "secret_path" : "secret_path" } , "ownedBy" : { "team" : "team" } , "tags" : { "key" : "value" } , "identity_provider_mapping" : [ { "identity_provider" : "identity_provider" , "value" : "value" } ] , "token_type" : "jwt" } , "jwtId" : "jwtId" , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "lastAccessedAt" : "2024-01-15T09:30:00Z" , "isExpired" : true , "jwts" : [ { "id" : "id" , "subjectType" : "subjectType" , "subjectId" : "subjectId" , "expiry" : "2024-01-15T09:30:00Z" , "tokenType" : "jwt" , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" } ] , "accountId" : "accountId" , "metadata" : { "key" : "value" } , "roleIds" : [ "roleIds" ] , "rolesWithResource" : [ { "roleId" : "roleId" , "resourceType" : "role" , "resourceId" : "resourceId" , "roleName" : "roleName" } ] , "createdBy" : "createdBy" , "nextScheduledRotation" : "nextScheduledRotation" } , "token" : "token" }; - + token: "token", + }; + server .mockEndpoint() - .put("/api/svc/v1/virtual-accounts").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.virtualAccounts.createOrUpdate({ - manifest: { - name: "name", - type: "virtual-account", - permissions: [{ - resourceFqn: "resource_fqn", - resourceType: "resource_type", - roleId: "role_id" - }] - } -}); - expect(response).toEqual({ - data: { - id: "jqfwg345gi25n5ju2yz5iz6m", - type: "type", - tenantName: "tenantName", - manifest: { - name: "name", - type: "virtual-account", - permissions: [{ - resourceFqn: "resource_fqn", - resourceType: "resource_type", - roleId: "role_id" - }], - expirationDate: "expiration_date", - autoRotate: { - autoRotateInterval: 1, - gracePeriod: 1 - }, - notificationTarget: { - type: "email", - notificationChannel: "notification_channel", - toEmails: ["to_emails"] - }, - secretStoreConfig: { - integrationFqn: "integration_fqn", - secretPath: "secret_path" - }, - ownedBy: { - team: "team" - }, - tags: { - "key": "value" + .put("/api/svc/v1/virtual-accounts") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.virtualAccounts.createOrUpdate({ + manifest: { + name: "name", + type: "virtual-account", + permissions: [ + { + resourceFqn: "resource_fqn", + resourceType: "resource_type", + roleId: "role_id", + }, + ], }, - identityProviderMapping: [{ - identityProvider: "identity_provider", - value: "value" - }], - tokenType: "jwt" - }, - jwtId: "jwtId", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - lastAccessedAt: new Date("2024-01-15T09:30:00.000Z"), - isExpired: true, - jwts: [{ - id: "id", - subjectType: "subjectType", - subjectId: "subjectId", - expiry: new Date("2024-01-15T09:30:00.000Z"), - tokenType: "jwt", + }); + expect(response).toEqual({ + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + type: "type", + tenantName: "tenantName", + manifest: { + name: "name", + type: "virtual-account", + permissions: [ + { + resourceFqn: "resource_fqn", + resourceType: "resource_type", + roleId: "role_id", + }, + ], + expirationDate: "expiration_date", + autoRotate: { + autoRotateInterval: 1, + gracePeriod: 1, + }, + notificationTarget: { + type: "email", + notificationChannel: "notification_channel", + toEmails: ["to_emails"], + }, + secretStoreConfig: { + integrationFqn: "integration_fqn", + secretPath: "secret_path", + }, + ownedBy: { + team: "team", + }, + tags: { + key: "value", + }, + identityProviderMapping: [ + { + identityProvider: "identity_provider", + value: "value", + }, + ], + tokenType: "jwt", + }, + jwtId: "jwtId", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z") - }], - accountId: "accountId", - metadata: { - "key": "value" - }, - roleIds: ["roleIds"], - rolesWithResource: [{ - roleId: "roleId", - resourceType: "role", - resourceId: "resourceId", - roleName: "roleName" - }], - createdBy: "createdBy", - nextScheduledRotation: "nextScheduledRotation" - }, - token: "token" -}); - - + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + lastAccessedAt: new Date("2024-01-15T09:30:00.000Z"), + isExpired: true, + jwts: [ + { + id: "id", + subjectType: "subjectType", + subjectId: "subjectId", + expiry: new Date("2024-01-15T09:30:00.000Z"), + tokenType: "jwt", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + accountId: "accountId", + metadata: { + key: "value", + }, + roleIds: ["roleIds"], + rolesWithResource: [ + { + roleId: "roleId", + resourceType: "role", + resourceId: "resourceId", + roleName: "roleName", + }, + ], + createdBy: "createdBy", + nextScheduledRotation: "nextScheduledRotation", + }, + token: "token", + }); }); - + test("create_or_update (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "name" : "name" , "type" : "virtual-account" , "permissions" : [ { "resource_fqn" : "resource_fqn" , "resource_type" : "resource_type" , "role_id" : "role_id" } , { "resource_fqn" : "resource_fqn" , "resource_type" : "resource_type" , "role_id" : "role_id" } ] } }; - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + name: "name", + type: "virtual-account", + permissions: [ + { resource_fqn: "resource_fqn", resource_type: "resource_type", role_id: "role_id" }, + { resource_fqn: "resource_fqn", resource_type: "resource_type", role_id: "role_id" }, + ], + }, + }; + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .put("/api/svc/v1/virtual-accounts").jsonBody(rawRequestBody) - .respondWith() - .statusCode(400).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.virtualAccounts.createOrUpdate({ - manifest: { - name: "name", - type: "virtual-account", - permissions: [{ - resourceFqn: "resource_fqn", - resourceType: "resource_type", - roleId: "role_id" - }, { - resourceFqn: "resource_fqn", - resourceType: "resource_type", - roleId: "role_id" - }] - } -}) - }).rejects.toThrow(TrueFoundry.BadRequestError); + .put("/api/svc/v1/virtual-accounts") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.virtualAccounts.createOrUpdate({ + manifest: { + name: "name", + type: "virtual-account", + permissions: [ + { + resourceFqn: "resource_fqn", + resourceType: "resource_type", + roleId: "role_id", + }, + { + resourceFqn: "resource_fqn", + resourceType: "resource_type", + roleId: "role_id", + }, + ], + }, + }); + }).rejects.toThrow(TrueFoundry.BadRequestError); }); - + test("create_or_update (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "name" : "name" , "type" : "virtual-account" , "permissions" : [ { "resource_fqn" : "resource_fqn" , "resource_type" : "resource_type" , "role_id" : "role_id" } , { "resource_fqn" : "resource_fqn" , "resource_type" : "resource_type" , "role_id" : "role_id" } ] } }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + manifest: { + name: "name", + type: "virtual-account", + permissions: [ + { resource_fqn: "resource_fqn", resource_type: "resource_type", role_id: "role_id" }, + { resource_fqn: "resource_fqn", resource_type: "resource_type", role_id: "role_id" }, + ], + }, + }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .put("/api/svc/v1/virtual-accounts").jsonBody(rawRequestBody) - .respondWith() - .statusCode(422).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.virtualAccounts.createOrUpdate({ - manifest: { - name: "name", - type: "virtual-account", - permissions: [{ - resourceFqn: "resource_fqn", - resourceType: "resource_type", - roleId: "role_id" - }, { - resourceFqn: "resource_fqn", - resourceType: "resource_type", - roleId: "role_id" - }] - } -}) - }).rejects.toThrow(TrueFoundry.UnprocessableEntityError); + .put("/api/svc/v1/virtual-accounts") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.virtualAccounts.createOrUpdate({ + manifest: { + name: "name", + type: "virtual-account", + permissions: [ + { + resourceFqn: "resource_fqn", + resourceType: "resource_type", + roleId: "role_id", + }, + { + resourceFqn: "resource_fqn", + resourceType: "resource_type", + roleId: "role_id", + }, + ], + }, + }); + }).rejects.toThrow(TrueFoundry.UnprocessableEntityError); }); - + test("get (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "type" : "type" , "tenantName" : "tenantName" , "manifest" : { "name" : "name" , "type" : "virtual-account" , "permissions" : [ { "resource_fqn" : "resource_fqn" , "resource_type" : "resource_type" , "role_id" : "role_id" } ] , "expiration_date" : "expiration_date" , "auto_rotate" : { "auto_rotate_interval" : 1 , "grace_period" : 1 } , "notification_target" : { "type" : "email" , "notification_channel" : "notification_channel" , "to_emails" : [ "to_emails" ] } , "secret_store_config" : { "integration_fqn" : "integration_fqn" , "secret_path" : "secret_path" } , "ownedBy" : { "team" : "team" } , "tags" : { "key" : "value" } , "identity_provider_mapping" : [ { "identity_provider" : "identity_provider" , "value" : "value" } ] , "token_type" : "jwt" } , "jwtId" : "jwtId" , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "lastAccessedAt" : "2024-01-15T09:30:00Z" , "isExpired" : true , "jwts" : [ { "id" : "id" , "subjectType" : "subjectType" , "subjectId" : "subjectId" , "expiry" : "2024-01-15T09:30:00Z" , "tokenType" : "jwt" , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" } ] , "accountId" : "accountId" , "metadata" : { "key" : "value" } , "roleIds" : [ "roleIds" ] , "rolesWithResource" : [ { "roleId" : "roleId" , "resourceType" : "role" , "resourceId" : "resourceId" , "roleName" : "roleName" } ] , "createdBy" : "createdBy" , "nextScheduledRotation" : "nextScheduledRotation" } , "token" : "token" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + type: "type", + tenantName: "tenantName", + manifest: { + name: "name", + type: "virtual-account", + permissions: [{ resource_fqn: "resource_fqn", resource_type: "resource_type", role_id: "role_id" }], + expiration_date: "expiration_date", + auto_rotate: { auto_rotate_interval: 1, grace_period: 1 }, + notification_target: { + type: "email", + notification_channel: "notification_channel", + to_emails: ["to_emails"], + }, + secret_store_config: { integration_fqn: "integration_fqn", secret_path: "secret_path" }, + ownedBy: { team: "team" }, + tags: { key: "value" }, + identity_provider_mapping: [{ identity_provider: "identity_provider", value: "value" }], + token_type: "jwt", + }, + jwtId: "jwtId", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + lastAccessedAt: "2024-01-15T09:30:00Z", + isExpired: true, + jwts: [ + { + id: "id", + subjectType: "subjectType", + subjectId: "subjectId", + expiry: "2024-01-15T09:30:00Z", + tokenType: "jwt", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + }, + ], + accountId: "accountId", + metadata: { key: "value" }, + roleIds: ["roleIds"], + rolesWithResource: [ + { roleId: "roleId", resourceType: "role", resourceId: "resourceId", roleName: "roleName" }, + ], + createdBy: "createdBy", + nextScheduledRotation: "nextScheduledRotation", + }, + token: "token", + }; + server .mockEndpoint() - .get("/api/svc/v1/virtual-accounts/jqfwg345gi25n5ju2yz5iz6m").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.virtualAccounts.get("jqfwg345gi25n5ju2yz5iz6m"); - expect(response).toEqual({ - data: { - id: "jqfwg345gi25n5ju2yz5iz6m", - type: "type", - tenantName: "tenantName", - manifest: { - name: "name", - type: "virtual-account", - permissions: [{ - resourceFqn: "resource_fqn", - resourceType: "resource_type", - roleId: "role_id" - }], - expirationDate: "expiration_date", - autoRotate: { - autoRotateInterval: 1, - gracePeriod: 1 - }, - notificationTarget: { - type: "email", - notificationChannel: "notification_channel", - toEmails: ["to_emails"] - }, - secretStoreConfig: { - integrationFqn: "integration_fqn", - secretPath: "secret_path" - }, - ownedBy: { - team: "team" - }, - tags: { - "key": "value" - }, - identityProviderMapping: [{ - identityProvider: "identity_provider", - value: "value" - }], - tokenType: "jwt" - }, - jwtId: "jwtId", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - lastAccessedAt: new Date("2024-01-15T09:30:00.000Z"), - isExpired: true, - jwts: [{ - id: "id", - subjectType: "subjectType", - subjectId: "subjectId", - expiry: new Date("2024-01-15T09:30:00.000Z"), - tokenType: "jwt", + .get("/api/svc/v1/virtual-accounts/jqfwg345gi25n5ju2yz5iz6m") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.virtualAccounts.get("jqfwg345gi25n5ju2yz5iz6m"); + expect(response).toEqual({ + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + type: "type", + tenantName: "tenantName", + manifest: { + name: "name", + type: "virtual-account", + permissions: [ + { + resourceFqn: "resource_fqn", + resourceType: "resource_type", + roleId: "role_id", + }, + ], + expirationDate: "expiration_date", + autoRotate: { + autoRotateInterval: 1, + gracePeriod: 1, + }, + notificationTarget: { + type: "email", + notificationChannel: "notification_channel", + toEmails: ["to_emails"], + }, + secretStoreConfig: { + integrationFqn: "integration_fqn", + secretPath: "secret_path", + }, + ownedBy: { + team: "team", + }, + tags: { + key: "value", + }, + identityProviderMapping: [ + { + identityProvider: "identity_provider", + value: "value", + }, + ], + tokenType: "jwt", + }, + jwtId: "jwtId", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z") - }], - accountId: "accountId", - metadata: { - "key": "value" - }, - roleIds: ["roleIds"], - rolesWithResource: [{ - roleId: "roleId", - resourceType: "role", - resourceId: "resourceId", - roleName: "roleName" - }], - createdBy: "createdBy", - nextScheduledRotation: "nextScheduledRotation" - }, - token: "token" -}); - - + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + lastAccessedAt: new Date("2024-01-15T09:30:00.000Z"), + isExpired: true, + jwts: [ + { + id: "id", + subjectType: "subjectType", + subjectId: "subjectId", + expiry: new Date("2024-01-15T09:30:00.000Z"), + tokenType: "jwt", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + accountId: "accountId", + metadata: { + key: "value", + }, + roleIds: ["roleIds"], + rolesWithResource: [ + { + roleId: "roleId", + resourceType: "role", + resourceId: "resourceId", + roleName: "roleName", + }, + ], + createdBy: "createdBy", + nextScheduledRotation: "nextScheduledRotation", + }, + token: "token", + }); }); - + test("get (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/virtual-accounts/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.virtualAccounts.get("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .get("/api/svc/v1/virtual-accounts/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.virtualAccounts.get("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("delete (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = {}; + server .mockEndpoint() - .delete("/api/svc/v1/virtual-accounts/jqfwg345gi25n5ju2yz5iz6m").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.virtualAccounts.delete("jqfwg345gi25n5ju2yz5iz6m"); - expect(response).toEqual({}); - - + .delete("/api/svc/v1/virtual-accounts/jqfwg345gi25n5ju2yz5iz6m") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.virtualAccounts.delete("jqfwg345gi25n5ju2yz5iz6m"); + expect(response).toEqual({}); }); - + test("delete (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .delete("/api/svc/v1/virtual-accounts/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.virtualAccounts.delete("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .delete("/api/svc/v1/virtual-accounts/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.virtualAccounts.delete("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("get_token (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "token" : "token" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { token: "token" }; + server .mockEndpoint() - .get("/api/svc/v1/virtual-accounts/jqfwg345gi25n5ju2yz5iz6m/token").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.virtualAccounts.getToken("jqfwg345gi25n5ju2yz5iz6m"); - expect(response).toEqual({ - token: "token" -}); - - + .get("/api/svc/v1/virtual-accounts/jqfwg345gi25n5ju2yz5iz6m/token") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.virtualAccounts.getToken("jqfwg345gi25n5ju2yz5iz6m"); + expect(response).toEqual({ + token: "token", + }); }); - + test("get_token (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/virtual-accounts/id/token").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.virtualAccounts.getToken("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .get("/api/svc/v1/virtual-accounts/id/token") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.virtualAccounts.getToken("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("sync_to_secret_store (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "syncTokenInSecretStoreInfo" : { "updatedAt" : "updatedAt" , "error" : "error" } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { syncTokenInSecretStoreInfo: { updatedAt: "updatedAt", error: "error" } }; + server .mockEndpoint() - .post("/api/svc/v1/virtual-accounts/jqfwg345gi25n5ju2yz5iz6m/sync-to-secret-store").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.virtualAccounts.syncToSecretStore("jqfwg345gi25n5ju2yz5iz6m"); - expect(response).toEqual({ - syncTokenInSecretStoreInfo: { - updatedAt: "updatedAt", - error: "error" - } -}); - - + .post("/api/svc/v1/virtual-accounts/jqfwg345gi25n5ju2yz5iz6m/sync-to-secret-store") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.virtualAccounts.syncToSecretStore("jqfwg345gi25n5ju2yz5iz6m"); + expect(response).toEqual({ + syncTokenInSecretStoreInfo: { + updatedAt: "updatedAt", + error: "error", + }, + }); }); - + test("sync_to_secret_store (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .post("/api/svc/v1/virtual-accounts/id/sync-to-secret-store").respondWith() - .statusCode(400).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.virtualAccounts.syncToSecretStore("id") - }).rejects.toThrow(TrueFoundry.BadRequestError); + .post("/api/svc/v1/virtual-accounts/id/sync-to-secret-store") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.virtualAccounts.syncToSecretStore("id"); + }).rejects.toThrow(TrueFoundry.BadRequestError); }); - + test("sync_to_secret_store (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .post("/api/svc/v1/virtual-accounts/id/sync-to-secret-store").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.virtualAccounts.syncToSecretStore("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .post("/api/svc/v1/virtual-accounts/id/sync-to-secret-store") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.virtualAccounts.syncToSecretStore("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("regenerate_token (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "gracePeriodInDays" : 30 }; - const rawResponseBody = { "token" : "token" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { gracePeriodInDays: 30 }; + const rawResponseBody = { token: "token" }; + server .mockEndpoint() - .post("/api/svc/v1/virtual-accounts/jqfwg345gi25n5ju2yz5iz6m/regenerate-token").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.virtualAccounts.regenerateToken("jqfwg345gi25n5ju2yz5iz6m", { - gracePeriodInDays: 30 -}); - expect(response).toEqual({ - token: "token" -}); - - + .post("/api/svc/v1/virtual-accounts/jqfwg345gi25n5ju2yz5iz6m/regenerate-token") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.virtualAccounts.regenerateToken("jqfwg345gi25n5ju2yz5iz6m", { + gracePeriodInDays: 30, + }); + expect(response).toEqual({ + token: "token", + }); }); - + test("regenerate_token (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "gracePeriodInDays" : 365 }; - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { gracePeriodInDays: 365 }; + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .post("/api/svc/v1/virtual-accounts/id/regenerate-token").jsonBody(rawRequestBody) - .respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.virtualAccounts.regenerateToken("id", { - gracePeriodInDays: 365 -}) - }).rejects.toThrow(TrueFoundry.NotFoundError); + .post("/api/svc/v1/virtual-accounts/id/regenerate-token") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.virtualAccounts.regenerateToken("id", { + gracePeriodInDays: 365, + }); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("delete_jwt", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + server .mockEndpoint() - .delete("/api/svc/v1/virtual-accounts/jqfwg345gi25n5ju2yz5iz6m/jwt/jwt_abc123def456").respondWith() - .statusCode(200).build(); - - - - const response = await client.virtualAccounts.deleteJwt("jqfwg345gi25n5ju2yz5iz6m", "jwt_abc123def456"); - expect(response).toEqual(undefined); - - + .delete("/api/svc/v1/virtual-accounts/jqfwg345gi25n5ju2yz5iz6m/jwt/jwt_abc123def456") + .respondWith() + .statusCode(200) + .build(); + + const response = await client.virtualAccounts.deleteJwt("jqfwg345gi25n5ju2yz5iz6m", "jwt_abc123def456"); + expect(response).toEqual(undefined); }); - }); diff --git a/tests/wire/workspaces.test.ts b/tests/wire/workspaces.test.ts index 7322cae3..2bb71d0f 100644 --- a/tests/wire/workspaces.test.ts +++ b/tests/wire/workspaces.test.ts @@ -5,484 +5,618 @@ import { TrueFoundryClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; describe("WorkspacesClient", () => { - test("list", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "fqn" : "fqn" , "tenantName" : "tenantName" , "clusterId" : "jqfwg345gi25n5ju2yz5iz6m" , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "environmentId" : "jqfwg345gi25n5ju2yz5iz6m" , "manifest" : { "type" : "workspace" , "cluster_fqn" : "cluster_fqn" , "name" : "name" } , "accountId" : "jqfwg345gi25n5ju2yz5iz6m" , "isSystemWs" : true , "createdBy" : "createdBy" } ] , "pagination" : { "total" : 100 , "offset" : 0 , "limit" : 10 } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + id: "jqfwg345gi25n5ju2yz5iz6m", + fqn: "fqn", + tenantName: "tenantName", + clusterId: "jqfwg345gi25n5ju2yz5iz6m", + createdBySubject: { subjectId: "subjectId", subjectType: "user" }, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + environmentId: "jqfwg345gi25n5ju2yz5iz6m", + manifest: { type: "workspace", cluster_fqn: "cluster_fqn", name: "name" }, + accountId: "jqfwg345gi25n5ju2yz5iz6m", + isSystemWs: true, + createdBy: "createdBy", + }, + ], + pagination: { total: 100, offset: 0, limit: 10 }, + }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/workspaces").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const expected = { - data: [{ - id: "jqfwg345gi25n5ju2yz5iz6m", - fqn: "fqn", - tenantName: "tenantName", - clusterId: "jqfwg345gi25n5ju2yz5iz6m", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - environmentId: "jqfwg345gi25n5ju2yz5iz6m", - manifest: { - type: "workspace", - clusterFqn: "cluster_fqn", - name: "name" + .mockEndpoint() + .get("/api/svc/v1/workspaces") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + data: [ + { + id: "jqfwg345gi25n5ju2yz5iz6m", + fqn: "fqn", + tenantName: "tenantName", + clusterId: "jqfwg345gi25n5ju2yz5iz6m", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + environmentId: "jqfwg345gi25n5ju2yz5iz6m", + manifest: { + type: "workspace", + clusterFqn: "cluster_fqn", + name: "name", + }, + accountId: "jqfwg345gi25n5ju2yz5iz6m", + isSystemWs: true, + createdBy: "createdBy", + }, + ], + pagination: { + total: 100, + offset: 0, + limit: 10, }, - accountId: "jqfwg345gi25n5ju2yz5iz6m", - isSystemWs: true, - createdBy: "createdBy" - }], - pagination: { - total: 100, - offset: 0, - limit: 10 - } -}; - const page = await client.workspaces.list({ - limit: 10, - offset: 0, - clusterId: "jqfwg345gi25n5ju2yz5iz6m", - name: "name", - fqn: "fqn", - includeCluster: true, - attributes: ["attributes"] -}); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - + }; + const page = await client.workspaces.list({ + limit: 10, + offset: 0, + clusterId: "jqfwg345gi25n5ju2yz5iz6m", + }); + + expect(expected.data).toEqual(page.data); }); - + test("create_or_update (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "workspace" , "cluster_fqn" : "cluster_fqn" , "name" : "name" } }; - const rawResponseBody = { "data" : { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "fqn" : "fqn" , "tenantName" : "tenantName" , "clusterId" : "jqfwg345gi25n5ju2yz5iz6m" , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "environmentId" : "jqfwg345gi25n5ju2yz5iz6m" , "manifest" : { "type" : "workspace" , "cluster_fqn" : "cluster_fqn" , "name" : "name" , "environment_name" : "environment_name" , "labels" : { "key" : "value" } , "annotations" : { "key" : "value" } , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } ] , "permissions" : [ { "resource_fqn" : "resource_fqn" , "resource_type" : "resource_type" , "role_id" : "role_id" } ] , "ownedBy" : { "account" : "account" } } , "accountId" : "jqfwg345gi25n5ju2yz5iz6m" , "isSystemWs" : true , "createdBy" : "createdBy" } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { manifest: { type: "workspace", cluster_fqn: "cluster_fqn", name: "name" } }; + const rawResponseBody = { + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + fqn: "fqn", + tenantName: "tenantName", + clusterId: "jqfwg345gi25n5ju2yz5iz6m", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + environmentId: "jqfwg345gi25n5ju2yz5iz6m", + manifest: { + type: "workspace", + cluster_fqn: "cluster_fqn", + name: "name", + environment_name: "environment_name", + labels: { key: "value" }, + annotations: { key: "value" }, + collaborators: [{ subject: "subject", role_id: "role_id" }], + permissions: [{ resource_fqn: "resource_fqn", resource_type: "resource_type", role_id: "role_id" }], + ownedBy: { account: "account" }, + }, + accountId: "jqfwg345gi25n5ju2yz5iz6m", + isSystemWs: true, + createdBy: "createdBy", + }, + }; + server .mockEndpoint() - .put("/api/svc/v1/workspaces").jsonBody(rawRequestBody) - .respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.workspaces.createOrUpdate({ - manifest: { - type: "workspace", - clusterFqn: "cluster_fqn", - name: "name" - } -}); - expect(response).toEqual({ - data: { - id: "jqfwg345gi25n5ju2yz5iz6m", - fqn: "fqn", - tenantName: "tenantName", - clusterId: "jqfwg345gi25n5ju2yz5iz6m", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - environmentId: "jqfwg345gi25n5ju2yz5iz6m", - manifest: { - type: "workspace", - clusterFqn: "cluster_fqn", - name: "name", - environmentName: "environment_name", - labels: { - "key": "value" + .put("/api/svc/v1/workspaces") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.workspaces.createOrUpdate({ + manifest: { + type: "workspace", + clusterFqn: "cluster_fqn", + name: "name", }, - annotations: { - "key": "value" + }); + expect(response).toEqual({ + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + fqn: "fqn", + tenantName: "tenantName", + clusterId: "jqfwg345gi25n5ju2yz5iz6m", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + environmentId: "jqfwg345gi25n5ju2yz5iz6m", + manifest: { + type: "workspace", + clusterFqn: "cluster_fqn", + name: "name", + environmentName: "environment_name", + labels: { + key: "value", + }, + annotations: { + key: "value", + }, + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + ], + permissions: [ + { + resourceFqn: "resource_fqn", + resourceType: "resource_type", + roleId: "role_id", + }, + ], + ownedBy: { + account: "account", + }, + }, + accountId: "jqfwg345gi25n5ju2yz5iz6m", + isSystemWs: true, + createdBy: "createdBy", }, - collaborators: [{ - subject: "subject", - roleId: "role_id" - }], - permissions: [{ - resourceFqn: "resource_fqn", - resourceType: "resource_type", - roleId: "role_id" - }], - ownedBy: { - account: "account" - } - }, - accountId: "jqfwg345gi25n5ju2yz5iz6m", - isSystemWs: true, - createdBy: "createdBy" - } -}); - - + }); }); - + test("create_or_update (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "workspace" , "cluster_fqn" : "cluster_fqn" , "name" : "name" } }; - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { manifest: { type: "workspace", cluster_fqn: "cluster_fqn", name: "name" } }; + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .put("/api/svc/v1/workspaces").jsonBody(rawRequestBody) - .respondWith() - .statusCode(400).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.workspaces.createOrUpdate({ - manifest: { - type: "workspace", - clusterFqn: "cluster_fqn", - name: "name" - } -}) - }).rejects.toThrow(TrueFoundry.BadRequestError); + .put("/api/svc/v1/workspaces") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workspaces.createOrUpdate({ + manifest: { + type: "workspace", + clusterFqn: "cluster_fqn", + name: "name", + }, + }); + }).rejects.toThrow(TrueFoundry.BadRequestError); }); - + test("create_or_update (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "workspace" , "cluster_fqn" : "cluster_fqn" , "name" : "name" } }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { manifest: { type: "workspace", cluster_fqn: "cluster_fqn", name: "name" } }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .put("/api/svc/v1/workspaces").jsonBody(rawRequestBody) - .respondWith() - .statusCode(403).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.workspaces.createOrUpdate({ - manifest: { - type: "workspace", - clusterFqn: "cluster_fqn", - name: "name" - } -}) - }).rejects.toThrow(TrueFoundry.ForbiddenError); + .put("/api/svc/v1/workspaces") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workspaces.createOrUpdate({ + manifest: { + type: "workspace", + clusterFqn: "cluster_fqn", + name: "name", + }, + }); + }).rejects.toThrow(TrueFoundry.ForbiddenError); }); - + test("create_or_update (4)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "workspace" , "cluster_fqn" : "cluster_fqn" , "name" : "name" } }; - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { manifest: { type: "workspace", cluster_fqn: "cluster_fqn", name: "name" } }; + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .put("/api/svc/v1/workspaces").jsonBody(rawRequestBody) - .respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.workspaces.createOrUpdate({ - manifest: { - type: "workspace", - clusterFqn: "cluster_fqn", - name: "name" - } -}) - }).rejects.toThrow(TrueFoundry.NotFoundError); + .put("/api/svc/v1/workspaces") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workspaces.createOrUpdate({ + manifest: { + type: "workspace", + clusterFqn: "cluster_fqn", + name: "name", + }, + }); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("create_or_update (5)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - const rawRequestBody = { "manifest" : { "type" : "workspace" , "cluster_fqn" : "cluster_fqn" , "name" : "name" } }; - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { manifest: { type: "workspace", cluster_fqn: "cluster_fqn", name: "name" } }; + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .put("/api/svc/v1/workspaces").jsonBody(rawRequestBody) - .respondWith() - .statusCode(422).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.workspaces.createOrUpdate({ - manifest: { - type: "workspace", - clusterFqn: "cluster_fqn", - name: "name" - } -}) - }).rejects.toThrow(TrueFoundry.UnprocessableEntityError); + .put("/api/svc/v1/workspaces") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(422) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workspaces.createOrUpdate({ + manifest: { + type: "workspace", + clusterFqn: "cluster_fqn", + name: "name", + }, + }); + }).rejects.toThrow(TrueFoundry.UnprocessableEntityError); }); - + test("search", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : [ { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "fqn" : "fqn" , "tenantName" : "tenantName" , "clusterId" : "jqfwg345gi25n5ju2yz5iz6m" , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" } , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "environmentId" : "jqfwg345gi25n5ju2yz5iz6m" , "manifest" : { "type" : "workspace" , "cluster_fqn" : "cluster_fqn" , "name" : "name" } , "accountId" : "jqfwg345gi25n5ju2yz5iz6m" , "isSystemWs" : true , "createdBy" : "createdBy" } ] , "pagination" : { "total" : 100 , "offset" : 0 , "limit" : 10 } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + id: "jqfwg345gi25n5ju2yz5iz6m", + fqn: "fqn", + tenantName: "tenantName", + clusterId: "jqfwg345gi25n5ju2yz5iz6m", + createdBySubject: { subjectId: "subjectId", subjectType: "user" }, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + environmentId: "jqfwg345gi25n5ju2yz5iz6m", + manifest: { type: "workspace", cluster_fqn: "cluster_fqn", name: "name" }, + accountId: "jqfwg345gi25n5ju2yz5iz6m", + isSystemWs: true, + createdBy: "createdBy", + }, + ], + pagination: { total: 100, offset: 0, limit: 10 }, + }; + server - .mockEndpoint({ once: false }) - .get("/api/svc/v1/workspaces/search").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const expected = { - data: [{ - id: "jqfwg345gi25n5ju2yz5iz6m", - fqn: "fqn", - tenantName: "tenantName", - clusterId: "jqfwg345gi25n5ju2yz5iz6m", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user" - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - environmentId: "jqfwg345gi25n5ju2yz5iz6m", - manifest: { - type: "workspace", - clusterFqn: "cluster_fqn", - name: "name" + .mockEndpoint() + .get("/api/svc/v1/workspaces/search") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = { + data: [ + { + id: "jqfwg345gi25n5ju2yz5iz6m", + fqn: "fqn", + tenantName: "tenantName", + clusterId: "jqfwg345gi25n5ju2yz5iz6m", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + environmentId: "jqfwg345gi25n5ju2yz5iz6m", + manifest: { + type: "workspace", + clusterFqn: "cluster_fqn", + name: "name", + }, + accountId: "jqfwg345gi25n5ju2yz5iz6m", + isSystemWs: true, + createdBy: "createdBy", + }, + ], + pagination: { + total: 100, + offset: 0, + limit: 10, }, - accountId: "jqfwg345gi25n5ju2yz5iz6m", - isSystemWs: true, - createdBy: "createdBy" - }], - pagination: { - total: 100, - offset: 0, - limit: 10 - } -}; - const page = await client.workspaces.search({ - limit: 10, - offset: 0, - filter: "[{\"type\":\"name\",\"operator\":\"STRING_CONTAINS\",\"value\":\"prod\"}]", - includeCluster: true -}); - - expect(expected.data).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.data).toEqual(nextPage.data); - - - + }; + const page = await client.workspaces.search({ + limit: 10, + offset: 0, + filter: '[{"type":"name","operator":"STRING_CONTAINS","value":"prod"}]', + }); + + expect(expected.data).toEqual(page.data); }); - + test("get (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "fqn" : "fqn" , "tenantName" : "tenantName" , "clusterId" : "jqfwg345gi25n5ju2yz5iz6m" , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "environmentId" : "jqfwg345gi25n5ju2yz5iz6m" , "manifest" : { "type" : "workspace" , "cluster_fqn" : "cluster_fqn" , "name" : "name" , "environment_name" : "environment_name" , "labels" : { "key" : "value" } , "annotations" : { "key" : "value" } , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } ] , "permissions" : [ { "resource_fqn" : "resource_fqn" , "resource_type" : "resource_type" , "role_id" : "role_id" } ] , "ownedBy" : { "account" : "account" } } , "accountId" : "jqfwg345gi25n5ju2yz5iz6m" , "isSystemWs" : true , "createdBy" : "createdBy" } }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + fqn: "fqn", + tenantName: "tenantName", + clusterId: "jqfwg345gi25n5ju2yz5iz6m", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + environmentId: "jqfwg345gi25n5ju2yz5iz6m", + manifest: { + type: "workspace", + cluster_fqn: "cluster_fqn", + name: "name", + environment_name: "environment_name", + labels: { key: "value" }, + annotations: { key: "value" }, + collaborators: [{ subject: "subject", role_id: "role_id" }], + permissions: [{ resource_fqn: "resource_fqn", resource_type: "resource_type", role_id: "role_id" }], + ownedBy: { account: "account" }, + }, + accountId: "jqfwg345gi25n5ju2yz5iz6m", + isSystemWs: true, + createdBy: "createdBy", + }, + }; + server .mockEndpoint() - .get("/api/svc/v1/workspaces/jqfwg345gi25n5ju2yz5iz6m").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.workspaces.get("jqfwg345gi25n5ju2yz5iz6m"); - expect(response).toEqual({ - data: { - id: "jqfwg345gi25n5ju2yz5iz6m", - fqn: "fqn", - tenantName: "tenantName", - clusterId: "jqfwg345gi25n5ju2yz5iz6m", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - environmentId: "jqfwg345gi25n5ju2yz5iz6m", - manifest: { - type: "workspace", - clusterFqn: "cluster_fqn", - name: "name", - environmentName: "environment_name", - labels: { - "key": "value" - }, - annotations: { - "key": "value" + .get("/api/svc/v1/workspaces/jqfwg345gi25n5ju2yz5iz6m") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.workspaces.get("jqfwg345gi25n5ju2yz5iz6m"); + expect(response).toEqual({ + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + fqn: "fqn", + tenantName: "tenantName", + clusterId: "jqfwg345gi25n5ju2yz5iz6m", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + environmentId: "jqfwg345gi25n5ju2yz5iz6m", + manifest: { + type: "workspace", + clusterFqn: "cluster_fqn", + name: "name", + environmentName: "environment_name", + labels: { + key: "value", + }, + annotations: { + key: "value", + }, + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + ], + permissions: [ + { + resourceFqn: "resource_fqn", + resourceType: "resource_type", + roleId: "role_id", + }, + ], + ownedBy: { + account: "account", + }, + }, + accountId: "jqfwg345gi25n5ju2yz5iz6m", + isSystemWs: true, + createdBy: "createdBy", }, - collaborators: [{ - subject: "subject", - roleId: "role_id" - }], - permissions: [{ - resourceFqn: "resource_fqn", - resourceType: "resource_type", - roleId: "role_id" - }], - ownedBy: { - account: "account" - } - }, - accountId: "jqfwg345gi25n5ju2yz5iz6m", - isSystemWs: true, - createdBy: "createdBy" - } -}); - - + }); }); - + test("get (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .get("/api/svc/v1/workspaces/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.workspaces.get("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .get("/api/svc/v1/workspaces/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workspaces.get("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("delete (1)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "data" : { "id" : "jqfwg345gi25n5ju2yz5iz6m" , "fqn" : "fqn" , "tenantName" : "tenantName" , "clusterId" : "jqfwg345gi25n5ju2yz5iz6m" , "createdBySubject" : { "subjectId" : "subjectId" , "subjectType" : "user" , "subjectSlug" : "subjectSlug" , "subjectDisplayName" : "subjectDisplayName" , "subjectPatName" : "subjectPatName" , "subjectControllerName" : "subjectControllerName" , "subjectExternalIdentitySlug" : "subjectExternalIdentitySlug" } , "createdAt" : "2024-01-15T09:30:00Z" , "updatedAt" : "2024-01-15T09:30:00Z" , "environmentId" : "jqfwg345gi25n5ju2yz5iz6m" , "manifest" : { "type" : "workspace" , "cluster_fqn" : "cluster_fqn" , "name" : "name" , "environment_name" : "environment_name" , "labels" : { "key" : "value" } , "annotations" : { "key" : "value" } , "collaborators" : [ { "subject" : "subject" , "role_id" : "role_id" } ] , "permissions" : [ { "resource_fqn" : "resource_fqn" , "resource_type" : "resource_type" , "role_id" : "role_id" } ] , "ownedBy" : { "account" : "account" } } , "accountId" : "jqfwg345gi25n5ju2yz5iz6m" , "isSystemWs" : true , "createdBy" : "createdBy" } , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + fqn: "fqn", + tenantName: "tenantName", + clusterId: "jqfwg345gi25n5ju2yz5iz6m", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + environmentId: "jqfwg345gi25n5ju2yz5iz6m", + manifest: { + type: "workspace", + cluster_fqn: "cluster_fqn", + name: "name", + environment_name: "environment_name", + labels: { key: "value" }, + annotations: { key: "value" }, + collaborators: [{ subject: "subject", role_id: "role_id" }], + permissions: [{ resource_fqn: "resource_fqn", resource_type: "resource_type", role_id: "role_id" }], + ownedBy: { account: "account" }, + }, + accountId: "jqfwg345gi25n5ju2yz5iz6m", + isSystemWs: true, + createdBy: "createdBy", + }, + message: "message", + }; + server .mockEndpoint() - .delete("/api/svc/v1/workspaces/jqfwg345gi25n5ju2yz5iz6m").respondWith() - .statusCode(200).jsonBody(rawResponseBody) - .build(); - - - - const response = await client.workspaces.delete("jqfwg345gi25n5ju2yz5iz6m"); - expect(response).toEqual({ - data: { - id: "jqfwg345gi25n5ju2yz5iz6m", - fqn: "fqn", - tenantName: "tenantName", - clusterId: "jqfwg345gi25n5ju2yz5iz6m", - createdBySubject: { - subjectId: "subjectId", - subjectType: "user", - subjectSlug: "subjectSlug", - subjectDisplayName: "subjectDisplayName", - subjectPatName: "subjectPatName", - subjectControllerName: "subjectControllerName", - subjectExternalIdentitySlug: "subjectExternalIdentitySlug" - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - environmentId: "jqfwg345gi25n5ju2yz5iz6m", - manifest: { - type: "workspace", - clusterFqn: "cluster_fqn", - name: "name", - environmentName: "environment_name", - labels: { - "key": "value" - }, - annotations: { - "key": "value" + .delete("/api/svc/v1/workspaces/jqfwg345gi25n5ju2yz5iz6m") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.workspaces.delete("jqfwg345gi25n5ju2yz5iz6m"); + expect(response).toEqual({ + data: { + id: "jqfwg345gi25n5ju2yz5iz6m", + fqn: "fqn", + tenantName: "tenantName", + clusterId: "jqfwg345gi25n5ju2yz5iz6m", + createdBySubject: { + subjectId: "subjectId", + subjectType: "user", + subjectSlug: "subjectSlug", + subjectDisplayName: "subjectDisplayName", + subjectPatName: "subjectPatName", + subjectControllerName: "subjectControllerName", + subjectExternalIdentitySlug: "subjectExternalIdentitySlug", + }, + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + environmentId: "jqfwg345gi25n5ju2yz5iz6m", + manifest: { + type: "workspace", + clusterFqn: "cluster_fqn", + name: "name", + environmentName: "environment_name", + labels: { + key: "value", + }, + annotations: { + key: "value", + }, + collaborators: [ + { + subject: "subject", + roleId: "role_id", + }, + ], + permissions: [ + { + resourceFqn: "resource_fqn", + resourceType: "resource_type", + roleId: "role_id", + }, + ], + ownedBy: { + account: "account", + }, + }, + accountId: "jqfwg345gi25n5ju2yz5iz6m", + isSystemWs: true, + createdBy: "createdBy", }, - collaborators: [{ - subject: "subject", - roleId: "role_id" - }], - permissions: [{ - resourceFqn: "resource_fqn", - resourceType: "resource_type", - roleId: "role_id" - }], - ownedBy: { - account: "account" - } - }, - accountId: "jqfwg345gi25n5ju2yz5iz6m", - isSystemWs: true, - createdBy: "createdBy" - }, - message: "message" -}); - - + message: "message", + }); }); - + test("delete (2)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "key" : "value" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .delete("/api/svc/v1/workspaces/id").respondWith() - .statusCode(404).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.workspaces.delete("id") - }).rejects.toThrow(TrueFoundry.NotFoundError); + .delete("/api/svc/v1/workspaces/id") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workspaces.delete("id"); + }).rejects.toThrow(TrueFoundry.NotFoundError); }); - + test("delete (3)", async () => { const server = mockServerPool.createServer(); - const client = new TrueFoundryClient({ "maxRetries" : 0 , "apiKey" : "test" , "environment" : server.baseUrl }); - - const rawResponseBody = { "statusCode" : 1 , "message" : "message" }; - + const client = new TrueFoundryClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { statusCode: 1, message: "message" }; + server .mockEndpoint() - .delete("/api/svc/v1/workspaces/id").respondWith() - .statusCode(417).jsonBody(rawResponseBody) - .build(); - - - await expect(async () => { - return await client.workspaces.delete("id") - }).rejects.toThrow(TrueFoundry.ExpectationFailedError); + .delete("/api/svc/v1/workspaces/id") + .respondWith() + .statusCode(417) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workspaces.delete("id"); + }).rejects.toThrow(TrueFoundry.ExpectationFailedError); }); - }); diff --git a/tsconfig.base.json b/tsconfig.base.json index 25bc10a8..93a92c06 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -12,8 +12,6 @@ "isolatedModules": true, "isolatedDeclarations": true }, - "include": [ - "src" - ], + "include": ["src"], "exclude": [] -} \ No newline at end of file +} diff --git a/tsconfig.cjs.json b/tsconfig.cjs.json index baf12c36..5c11446f 100644 --- a/tsconfig.cjs.json +++ b/tsconfig.cjs.json @@ -4,8 +4,6 @@ "module": "CommonJS", "outDir": "dist/cjs" }, - "include": [ - "src" - ], + "include": ["src"], "exclude": [] -} \ No newline at end of file +} diff --git a/tsconfig.esm.json b/tsconfig.esm.json index 5f8ac6fc..021e74d2 100644 --- a/tsconfig.esm.json +++ b/tsconfig.esm.json @@ -2,11 +2,10 @@ "extends": "./tsconfig.base.json", "compilerOptions": { "module": "esnext", + "moduleResolution": "bundler", "outDir": "dist/esm", "verbatimModuleSyntax": true }, - "include": [ - "src" - ], + "include": ["src"], "exclude": [] -} \ No newline at end of file +} diff --git a/tsconfig.json b/tsconfig.json index ad43234b..d77fdf00 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,3 +1,3 @@ { "extends": "./tsconfig.cjs.json" -} \ No newline at end of file +} diff --git a/vitest.config.mts b/vitest.config.mts index bc1f402d..0dee5a75 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -1,35 +1,32 @@ - - - import { defineConfig } from "vitest/config"; - export default defineConfig({ +import { defineConfig } from "vitest/config"; +export default defineConfig({ + test: { + typecheck: { + enabled: true, + tsconfig: "./tests/tsconfig.json", + }, + projects: [ + { test: { - typecheck: { - enabled: true, - tsconfig: "./tests/tsconfig.json" - }, - projects: [ - { - test: { - globals: true, - name: "unit", - environment: "node", - root: "./tests", - include: ["**/*.test.{js,ts,jsx,tsx}"], - exclude: ["wire/**"], - setupFiles: ["./setup.ts"] - } - }, - { - test: { - globals: true, - name: "wire", - environment: "node", - root: "./tests/wire", - setupFiles: ["../setup.ts", "../mock-server/setup.ts"] - } - }, - ], - passWithNoTests: true - } - }); - \ No newline at end of file + globals: true, + name: "unit", + environment: "node", + root: "./tests", + include: ["**/*.test.{js,ts,jsx,tsx}"], + exclude: ["wire/**"], + setupFiles: ["./setup.ts"], + }, + }, + { + test: { + globals: true, + name: "wire", + environment: "node", + root: "./tests/wire", + setupFiles: ["../setup.ts", "../mock-server/setup.ts"], + }, + }, + ], + passWithNoTests: true, + }, +});