diff --git a/.circleci/config.yml b/.circleci/config.yml index ff9b0431562..e6cbc45ac34 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -117,17 +117,6 @@ jobs: command: | yarn workspace @fern-api/cli publish:cli:prod --tag latest - publish-ir-sdk: - docker: - - image: cimg/node:18.8.0 - steps: - - checkout - - run: - name: Publish ir sdks - command: | - export FERN_TOKEN="$FERN_ORG_TOKEN_PROD" - npx fern-api generate --api ir-types-v31 --group sdks - workflows: version: 2 build: @@ -175,11 +164,3 @@ workflows: - auth0-prod - posthog - - publish-ir-sdk: - filters: - branches: - only: main - tags: - only: /.*/ - context: - - fern-tokens diff --git a/.eslintignore b/.eslintignore index 32e8e1d0efc..6d4b18c3d6a 100644 --- a/.eslintignore +++ b/.eslintignore @@ -5,4 +5,6 @@ dist .husky generated bundle.c?js -.pnp* \ No newline at end of file +.pnp* +packages/ir-sdk/** + diff --git a/.github/workflows/ir-check.yml b/.github/workflows/ir-check.yml new file mode 100644 index 00000000000..52db6dc0020 --- /dev/null +++ b/.github/workflows/ir-check.yml @@ -0,0 +1,35 @@ +name: ir + +on: + workflow_dispatch: + pull_request: + branches: + - main + push: + branches: + - main + +jobs: + check: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Fern + run: npm install -g fern-api + + - name: Check IR Definitions + run: | + cd packages/ir-sdk + fern check + + - name: Check IR Definitions + env: + FERN_TOKEN: dummy + run: | + cd packages/ir-sdk + yarn generate + + - name: Ensure no changes to git-tracked files + run: git --no-pager diff --exit-code diff --git a/.github/workflows/ir-publish.yml b/.github/workflows/ir-publish.yml new file mode 100644 index 00000000000..7c17ba71831 --- /dev/null +++ b/.github/workflows/ir-publish.yml @@ -0,0 +1,26 @@ +name: ir-publish + +on: + workflow_dispatch: + push: + branches: + - main + paths: + - "packages/ir-sdk/fern/apis/ir-types-latest/**" + +jobs: + sdks: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Fern + run: npm install -g fern-api + + - name: Release IR SDKs + env: + FERN_TOKEN: ${{ secrets.FERN_TOKEN }} + run: | + cd packages/ir-sdk + fern generate --api ir-types-latest --group sdks --log-level debug diff --git a/.pnp.cjs b/.pnp.cjs index c243737b888..65d243de053 100644 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -199,6 +199,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "name": "@fern-api/generator-commons",\ "reference": "workspace:packages/generators/commons"\ },\ + {\ + "name": "@fern-api/ir-sdk",\ + "reference": "workspace:packages/ir-sdk"\ + },\ {\ "name": "@fern-api/scripts",\ "reference": "workspace:packages/scripts"\ @@ -232,6 +236,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@fern-api/init", ["workspace:packages/cli/init"]],\ ["@fern-api/ir-generator", ["workspace:packages/cli/generation/ir-generator"]],\ ["@fern-api/ir-migrations", ["workspace:packages/cli/generation/ir-migrations"]],\ + ["@fern-api/ir-sdk", ["workspace:packages/ir-sdk"]],\ ["@fern-api/json-schema", ["workspace:packages/cli/yaml/json-schema"]],\ ["@fern-api/loadable", ["workspace:packages/commons/loadable"]],\ ["@fern-api/local-workspace-runner", ["workspace:packages/cli/generation/local-generation/local-workspace-runner"]],\ @@ -3803,6 +3808,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@fern-api/init", "workspace:packages/cli/init"],\ ["@fern-api/ir-generator", "workspace:packages/cli/generation/ir-generator"],\ ["@fern-api/ir-migrations", "workspace:packages/cli/generation/ir-migrations"],\ + ["@fern-api/ir-sdk", "workspace:packages/ir-sdk"],\ ["@fern-api/local-workspace-runner", "workspace:packages/cli/generation/local-generation/local-workspace-runner"],\ ["@fern-api/logger", "workspace:packages/cli/logger"],\ ["@fern-api/logging-execa", "workspace:packages/commons/logging-execa"],\ @@ -3824,7 +3830,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@fern-api/yaml-migrations", "workspace:packages/cli/yaml/yaml-migrations"],\ ["@fern-api/yaml-schema", "workspace:packages/cli/yaml/yaml-schema"],\ ["@fern-fern/fiddle-sdk", "npm:0.0.386"],\ - ["@fern-fern/ir-sdk", "npm:0.0.3294"],\ ["@types/axios", "npm:0.14.0"],\ ["@types/boxen", "npm:3.0.1"],\ ["@types/is-ci", "npm:3.0.2"],\ @@ -4235,10 +4240,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@fern-api/generator-cli", "workspace:packages/generators/cli"],\ ["@fern-api/fs-utils", "workspace:packages/commons/fs-utils"],\ ["@fern-api/generator-commons", "workspace:packages/generators/commons"],\ + ["@fern-api/ir-sdk", "workspace:packages/ir-sdk"],\ ["@fern-api/logger", "workspace:packages/cli/logger"],\ ["@fern-api/logging-execa", "workspace:packages/commons/logging-execa"],\ ["@fern-fern/generator-exec-sdk", "npm:0.0.472"],\ - ["@fern-fern/ir-sdk", "npm:0.0.3294"],\ ["@types/jest", "npm:29.0.3"],\ ["@types/node", "npm:18.7.18"],\ ["depcheck", "npm:1.4.6"],\ @@ -4258,10 +4263,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "packageDependencies": [\ ["@fern-api/generator-commons", "workspace:packages/generators/commons"],\ ["@fern-api/fs-utils", "workspace:packages/commons/fs-utils"],\ + ["@fern-api/ir-sdk", "workspace:packages/ir-sdk"],\ ["@fern-api/logger", "workspace:packages/cli/logger"],\ ["@fern-api/logging-execa", "workspace:packages/commons/logging-execa"],\ ["@fern-fern/generator-exec-sdk", "npm:0.0.472"],\ - ["@fern-fern/ir-sdk", "npm:0.0.3294"],\ ["@types/jest", "npm:29.0.3"],\ ["@types/node", "npm:18.7.18"],\ ["depcheck", "npm:1.4.6"],\ @@ -4348,12 +4353,12 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@fern-api/core-utils", "workspace:packages/commons/core-utils"],\ ["@fern-api/fs-utils", "workspace:packages/commons/fs-utils"],\ ["@fern-api/generators-configuration", "workspace:packages/cli/config-management/generators-configuration"],\ + ["@fern-api/ir-sdk", "workspace:packages/ir-sdk"],\ ["@fern-api/project-configuration", "workspace:packages/cli/config-management/project-configuration"],\ ["@fern-api/project-loader", "workspace:packages/cli/project-loader"],\ ["@fern-api/task-context", "workspace:packages/cli/task-context"],\ ["@fern-api/workspace-loader", "workspace:packages/cli/workspace-loader"],\ ["@fern-api/yaml-schema", "workspace:packages/cli/yaml/yaml-schema"],\ - ["@fern-fern/ir-sdk", "npm:0.0.3294"],\ ["@types/jest", "npm:29.0.3"],\ ["@types/jest-specific-snapshot", "npm:0.5.7"],\ ["@types/lodash-es", "npm:4.17.7"],\ @@ -4382,11 +4387,11 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@fern-api/fs-utils", "workspace:packages/commons/fs-utils"],\ ["@fern-api/generators-configuration", "workspace:packages/cli/config-management/generators-configuration"],\ ["@fern-api/ir-generator", "workspace:packages/cli/generation/ir-generator"],\ + ["@fern-api/ir-sdk", "workspace:packages/ir-sdk"],\ ["@fern-api/logger", "workspace:packages/cli/logger"],\ ["@fern-api/semver-utils", "workspace:packages/cli/semver-utils"],\ ["@fern-api/task-context", "workspace:packages/cli/task-context"],\ ["@fern-api/workspace-loader", "workspace:packages/cli/workspace-loader"],\ - ["@fern-fern/ir-sdk", "npm:0.0.3294"],\ ["@fern-fern/ir-v1-model", "npm:0.0.1"],\ ["@fern-fern/ir-v10-model", "npm:0.0.1"],\ ["@fern-fern/ir-v11-model", "npm:0.0.2"],\ @@ -4432,6 +4437,23 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "SOFT"\ }]\ ]],\ + ["@fern-api/ir-sdk", [\ + ["workspace:packages/ir-sdk", {\ + "packageLocation": "./packages/ir-sdk/",\ + "packageDependencies": [\ + ["@fern-api/ir-sdk", "workspace:packages/ir-sdk"],\ + ["@types/jest", "npm:29.0.3"],\ + ["@types/node", "npm:18.7.18"],\ + ["depcheck", "npm:1.4.6"],\ + ["eslint", "npm:8.56.0"],\ + ["jest", "virtual:f8e21c9fa0a798b21a87ac455600e39198fef65848556a3a2cd5c956b0460181f9e618173dcff6d9d4fb96fb870055dfe1a3ec3db5db0700e71c0184e4711659#npm:29.7.0"],\ + ["organize-imports-cli", "npm:0.10.0"],\ + ["prettier", "npm:2.7.1"],\ + ["typescript", "patch:typescript@npm%3A4.6.4#~builtin::version=4.6.4&hash=5d3a66"]\ + ],\ + "linkType": "SOFT"\ + }]\ + ]],\ ["@fern-api/json-schema", [\ ["workspace:packages/cli/yaml/json-schema", {\ "packageLocation": "./packages/cli/yaml/json-schema/",\ @@ -4600,8 +4622,8 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "packageDependencies": [\ ["@fern-api/mock", "workspace:packages/cli/mock"],\ ["@fern-api/core-utils", "workspace:packages/commons/core-utils"],\ + ["@fern-api/ir-sdk", "workspace:packages/ir-sdk"],\ ["@fern-api/task-context", "workspace:packages/cli/task-context"],\ - ["@fern-fern/ir-sdk", "npm:0.0.3294"],\ ["@types/express", "npm:4.17.20"],\ ["@types/jest", "npm:29.0.3"],\ ["@types/lodash-es", "npm:4.17.7"],\ @@ -4822,9 +4844,9 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@fern-api/core-utils", "workspace:packages/commons/core-utils"],\ ["@fern-api/fdr-sdk", "npm:0.46.1-18-g26596cb"],\ ["@fern-api/ir-generator", "workspace:packages/cli/generation/ir-generator"],\ + ["@fern-api/ir-sdk", "workspace:packages/ir-sdk"],\ ["@fern-api/task-context", "workspace:packages/cli/task-context"],\ ["@fern-api/workspace-loader", "workspace:packages/cli/workspace-loader"],\ - ["@fern-fern/ir-sdk", "npm:0.0.3294"],\ ["@types/jest", "npm:29.0.3"],\ ["@types/lodash-es", "npm:4.17.7"],\ ["@types/node", "npm:18.7.18"],\ @@ -4854,13 +4876,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@fern-api/generators-configuration", "workspace:packages/cli/config-management/generators-configuration"],\ ["@fern-api/ir-generator", "workspace:packages/cli/generation/ir-generator"],\ ["@fern-api/ir-migrations", "workspace:packages/cli/generation/ir-migrations"],\ + ["@fern-api/ir-sdk", "workspace:packages/ir-sdk"],\ ["@fern-api/logger", "workspace:packages/cli/logger"],\ ["@fern-api/register", "workspace:packages/cli/register"],\ ["@fern-api/task-context", "workspace:packages/cli/task-context"],\ ["@fern-api/workspace-loader", "workspace:packages/cli/workspace-loader"],\ ["@fern-fern/docs-config", "npm:0.0.53"],\ ["@fern-fern/fiddle-sdk", "npm:0.0.386"],\ - ["@fern-fern/ir-sdk", "npm:0.0.3294"],\ ["@types/decompress", "npm:4.2.7"],\ ["@types/jest", "npm:29.0.3"],\ ["@types/lodash-es", "npm:4.17.7"],\ @@ -5165,8 +5187,8 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@fern-api/yaml-schema", "workspace:packages/cli/yaml/yaml-schema"],\ ["@fern-api/core-utils", "workspace:packages/commons/core-utils"],\ ["@fern-api/fs-utils", "workspace:packages/commons/fs-utils"],\ + ["@fern-api/ir-sdk", "workspace:packages/ir-sdk"],\ ["@fern-fern/docs-config", "npm:0.0.53"],\ - ["@fern-fern/ir-sdk", "npm:0.0.3294"],\ ["@types/jest", "npm:29.0.3"],\ ["@types/js-yaml", "npm:4.0.8"],\ ["@types/node", "npm:18.7.18"],\ diff --git a/generators/ruby/sdk/src/utils/EndpointGenerator.ts b/generators/ruby/sdk/src/utils/EndpointGenerator.ts index 6af5c259fe8..910889b92fe 100644 --- a/generators/ruby/sdk/src/utils/EndpointGenerator.ts +++ b/generators/ruby/sdk/src/utils/EndpointGenerator.ts @@ -296,9 +296,12 @@ export class EndpointGenerator { }) ] }); - if (prop.type.some((cr) => cr === FileClassReference)) { + const isFileReference = prop.type.some((cr) => cr === FileClassReference); + // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions + if (isFileReference) { return [ prop.wireValue ?? prop.name, + // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions prop.isOptional ? new ConditionalStatement({ if_: { diff --git a/lint-staged.config.js b/lint-staged.config.js index d286cdb1cac..ee47403b829 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -1,6 +1,6 @@ module.exports = { "**/*.ts{,x}": [ - "eslint --fix --max-warnings 0 --no-eslintrc --config .eslintrc.lint-staged.js", + "eslint --fix --max-warnings 0 --no-eslintrc --config .eslintrc.lint-staged.js --ignore-path .eslintignore", "yarn format:fix", ], "**/*.{js,json,yml,html,css,less,scss,md}": "yarn format", diff --git a/package.json b/package.json index cf9db71c3a2..fd42c69f48f 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "compile": "yarn workspace @fern-api/compile-root run compile", "test": "yarn compile && jest --passWithNoTests", "test:ete": "yarn workspace @fern-api/cli dist:cli:dev && yarn workspace @fern-api/seed-cli dist:cli && yarn workspace @fern-api/ete-tests test", - "lint:eslint": "eslint --max-warnings 0 . --report-unused-disable-directives", + "lint:eslint": "eslint --max-warnings 0 . --report-unused-disable-directives --ignore-path .eslintignore", "lint:eslint:fix": "yarn lint:eslint --fix", "lint:monorepo": "mrlint lint", "lint:monorepo:fix": "yarn lint:monorepo --fix", @@ -44,7 +44,8 @@ "root-package:check": "yarn fern-script check-root-package", "root-package:fix": "yarn root-package:check --fix", "demo-setup": "yarn workspace @fern-api/demo-setup dist:cli && node $(yarn workspace @fern-api/demo-setup bin demo-setup)", - "seed:local": "yarn workspace @fern-api/seed-cli dist:cli && node $(yarn workspace @fern-api/seed-cli bin seed)" + "seed:local": "yarn workspace @fern-api/seed-cli dist:cli && node $(yarn workspace @fern-api/seed-cli bin seed)", + "ir:generate": "yarn workspace @fern-api/ir-sdk generate" }, "devDependencies": { "@babel/core": "^7.23.2", diff --git a/packages/cli/cli/package.json b/packages/cli/cli/package.json index 6ea05359000..9358261baad 100644 --- a/packages/cli/cli/package.json +++ b/packages/cli/cli/package.json @@ -48,6 +48,7 @@ "@fern-api/init": "workspace:*", "@fern-api/ir-generator": "workspace:*", "@fern-api/ir-migrations": "workspace:*", + "@fern-api/ir-sdk": "workspace:*", "@fern-api/local-workspace-runner": "workspace:*", "@fern-api/logger": "workspace:*", "@fern-api/logging-execa": "workspace:*", @@ -69,7 +70,6 @@ "@fern-api/yaml-migrations": "workspace:*", "@fern-api/yaml-schema": "workspace:*", "@fern-fern/fiddle-sdk": "^0.0.386", - "@fern-fern/ir-sdk": "0.0.3294", "ansi-escapes": "^5.0.0", "axios": "^0.27.2", "boxen": "^7.0.0", diff --git a/packages/cli/cli/src/commands/generate-ir/generateIrForFernWorkspace.ts b/packages/cli/cli/src/commands/generate-ir/generateIrForFernWorkspace.ts index 7c565722448..f3cbec164cb 100644 --- a/packages/cli/cli/src/commands/generate-ir/generateIrForFernWorkspace.ts +++ b/packages/cli/cli/src/commands/generate-ir/generateIrForFernWorkspace.ts @@ -1,9 +1,9 @@ import { Audiences } from "@fern-api/config-management-commons"; import { GenerationLanguage } from "@fern-api/generators-configuration"; import { generateIntermediateRepresentation } from "@fern-api/ir-generator"; +import { IntermediateRepresentation } from "@fern-api/ir-sdk"; import { TaskContext } from "@fern-api/task-context"; import { FernWorkspace } from "@fern-api/workspace-loader"; -import { IntermediateRepresentation } from "@fern-fern/ir-sdk/api"; import { validateAPIWorkspaceAndLogIssues } from "../validate/validateAPIWorkspaceAndLogIssues"; export async function generateIrForFernWorkspace({ diff --git a/packages/cli/cli/src/commands/generate-ir/generateIrForWorkspaces.ts b/packages/cli/cli/src/commands/generate-ir/generateIrForWorkspaces.ts index ce5bcf24437..f17b92396f6 100644 --- a/packages/cli/cli/src/commands/generate-ir/generateIrForWorkspaces.ts +++ b/packages/cli/cli/src/commands/generate-ir/generateIrForWorkspaces.ts @@ -5,7 +5,7 @@ import { migrateIntermediateRepresentationThroughVersion } from "@fern-api/ir-mi import { Project } from "@fern-api/project-loader"; import { TaskContext } from "@fern-api/task-context"; import { convertOpenApiWorkspaceToFernWorkspace, FernWorkspace } from "@fern-api/workspace-loader"; -import * as IrSerialization from "@fern-fern/ir-sdk/serialization"; +import { serialization as IrSerialization } from "@fern-api/ir-sdk"; import { writeFile } from "fs/promises"; import path from "path"; import { CliContext } from "../../cli-context/CliContext"; diff --git a/packages/cli/cli/tsconfig.json b/packages/cli/cli/tsconfig.json index 5ec6c831fb4..d70741f2880 100644 --- a/packages/cli/cli/tsconfig.json +++ b/packages/cli/cli/tsconfig.json @@ -7,6 +7,7 @@ { "path": "../../commons/fs-utils" }, { "path": "../../commons/logging-execa" }, { "path": "../../core" }, + { "path": "../../ir-sdk" }, { "path": "../auth" }, { "path": "../config-management/commons" }, { "path": "../config-management/generators-configuration" }, diff --git a/packages/cli/generation/ir-generator/package.json b/packages/cli/generation/ir-generator/package.json index 5c074359826..d0b62d3deec 100644 --- a/packages/cli/generation/ir-generator/package.json +++ b/packages/cli/generation/ir-generator/package.json @@ -31,12 +31,12 @@ "@fern-api/core-utils": "workspace:*", "@fern-api/fs-utils": "workspace:*", "@fern-api/generators-configuration": "workspace:*", + "@fern-api/ir-sdk": "workspace:*", "@fern-api/project-configuration": "workspace:*", "@fern-api/project-loader": "workspace:*", "@fern-api/task-context": "workspace:*", "@fern-api/workspace-loader": "workspace:*", "@fern-api/yaml-schema": "workspace:*", - "@fern-fern/ir-sdk": "0.0.3294", "lodash-es": "^4.17.21", "prettier": "^2.7.1", "url-join": "^5.0.0" diff --git a/packages/cli/generation/ir-generator/src/FernFileContext.ts b/packages/cli/generation/ir-generator/src/FernFileContext.ts index ccf359804a0..a6e06188540 100644 --- a/packages/cli/generation/ir-generator/src/FernFileContext.ts +++ b/packages/cli/generation/ir-generator/src/FernFileContext.ts @@ -1,6 +1,6 @@ import { RelativeFilePath } from "@fern-api/fs-utils"; +import { FernFilepath, TypeReference } from "@fern-api/ir-sdk"; import { DefinitionFileSchema, RootApiFileSchema } from "@fern-api/yaml-schema"; -import { FernFilepath, TypeReference } from "@fern-fern/ir-sdk/api"; import { mapValues } from "lodash-es"; import { CasingsGenerator } from "./casings/CasingsGenerator"; import { convertToFernFilepath } from "./utils/convertToFernFilepath"; diff --git a/packages/cli/generation/ir-generator/src/IdGenerator.ts b/packages/cli/generation/ir-generator/src/IdGenerator.ts index 5847db0a357..594b26bfa90 100644 --- a/packages/cli/generation/ir-generator/src/IdGenerator.ts +++ b/packages/cli/generation/ir-generator/src/IdGenerator.ts @@ -1,5 +1,4 @@ -import { FernIr } from "@fern-fern/ir-sdk"; -import { DeclaredErrorName, DeclaredServiceName, DeclaredTypeName, FernFilepath } from "@fern-fern/ir-sdk/api"; +import { DeclaredErrorName, DeclaredServiceName, DeclaredTypeName, FernFilepath, FernIr } from "@fern-api/ir-sdk"; export const IdGenerator = { generateTypeId: (typeName: Omit): FernIr.commons.TypeId => { diff --git a/packages/cli/generation/ir-generator/src/PackageTreeGenerator.tsx b/packages/cli/generation/ir-generator/src/PackageTreeGenerator.tsx index 0373f07eec0..6fb8221472d 100644 --- a/packages/cli/generation/ir-generator/src/PackageTreeGenerator.tsx +++ b/packages/cli/generation/ir-generator/src/PackageTreeGenerator.tsx @@ -11,7 +11,7 @@ import { TypeDeclaration, TypeId, WebhookGroupId -} from "@fern-fern/ir-sdk/api"; +} from "@fern-api/ir-sdk"; import { mapValues } from "lodash-es"; import { FilteredIr } from "./filtered-ir/FilteredIr"; import { IdGenerator } from "./IdGenerator"; @@ -26,14 +26,14 @@ export class PackageTreeGenerator { fernFilepath: { allParts: [], packagePath: [], - file: undefined, + file: undefined }, service: undefined, types: [], errors: [], subpackages: [], webhooks: undefined, - navigationConfig: undefined, + navigationConfig: undefined }; public addPackageRedirection({ from, to }: { from: FernFilepath; to: FernFilepath }): void { @@ -42,7 +42,7 @@ export class PackageTreeGenerator { throw new Error("Found duplicate navigationConfig for package"); } package_.navigationConfig = { - pointsTo: IdGenerator.generateSubpackageId(to), + pointsTo: IdGenerator.generateSubpackageId(to) }; } @@ -101,7 +101,7 @@ export class PackageTreeGenerator { : undefined, subpackages: subpackage.subpackages.filter((subpackageId) => filteredIr.hasSubpackageId(subpackageId) - ), + ) }; } }); @@ -119,19 +119,19 @@ export class PackageTreeGenerator { subpackages: this.rootPackage.subpackages.filter((subpackageId) => filteredIr.hasSubpackageId(subpackageId) ), - webhooks: this.rootPackage.webhooks != null ? this.rootPackage.webhooks : undefined, + webhooks: this.rootPackage.webhooks != null ? this.rootPackage.webhooks : undefined }; } const allSubpackagesWithEndpoints = new Set(this.getAllChildrenWithEndpoints(this.rootPackage)); return { subpackages: mapValues(this.subpackages, (subpackage, subpackageId) => ({ ...subpackage, - hasEndpointsInTree: allSubpackagesWithEndpoints.has(subpackageId), + hasEndpointsInTree: allSubpackagesWithEndpoints.has(subpackageId) })), rootPackage: { ...this.rootPackage, - hasEndpointsInTree: allSubpackagesWithEndpoints.size > 0 || this.rootPackage.service != null, - }, + hasEndpointsInTree: allSubpackagesWithEndpoints.size > 0 || this.rootPackage.service != null + } }; } @@ -194,7 +194,7 @@ export class PackageTreeGenerator { const fernFilepathForNextParent: FernFilepath = { allParts: fernFilepath.allParts.slice(0, nextIndex), packagePath: fernFilepath.packagePath.slice(0, nextIndex), - file: nextIndex === fernFilepath.allParts.length ? fernFilepath.file : undefined, + file: nextIndex === fernFilepath.allParts.length ? fernFilepath.file : undefined }; let nextParent = subpackagesInParent.find( (subpackage) => subpackage.name.originalName === nextPart.originalName @@ -210,7 +210,7 @@ export class PackageTreeGenerator { errors: [], subpackages: [], navigationConfig: undefined, - webhooks: undefined, + webhooks: undefined }; this.subpackages[newParentId] = newParent; parent.subpackages.push(newParentId); diff --git a/packages/cli/generation/ir-generator/src/__test__/casingsGenerator.test.ts b/packages/cli/generation/ir-generator/src/__test__/casingsGenerator.test.ts index b14985cf340..e8342d43e92 100644 --- a/packages/cli/generation/ir-generator/src/__test__/casingsGenerator.test.ts +++ b/packages/cli/generation/ir-generator/src/__test__/casingsGenerator.test.ts @@ -1,4 +1,4 @@ -import { Name } from "@fern-fern/ir-sdk/api"; +import { Name } from "@fern-api/ir-sdk"; import { constructCasingsGenerator } from "../casings/CasingsGenerator"; describe("casingsGenerator", () => { diff --git a/packages/cli/generation/ir-generator/src/__test__/constructHttpPath.test.ts b/packages/cli/generation/ir-generator/src/__test__/constructHttpPath.test.ts index 39869996475..3f8e6ff8124 100644 --- a/packages/cli/generation/ir-generator/src/__test__/constructHttpPath.test.ts +++ b/packages/cli/generation/ir-generator/src/__test__/constructHttpPath.test.ts @@ -1,4 +1,4 @@ -import { HttpPath } from "@fern-fern/ir-sdk/api"; +import { HttpPath } from "@fern-api/ir-sdk"; import { constructHttpPath } from "../converters/services/constructHttpPath"; describe("constructHttpPath", () => { diff --git a/packages/cli/generation/ir-generator/src/__test__/convertResponseErrors.test.ts b/packages/cli/generation/ir-generator/src/__test__/convertResponseErrors.test.ts index aef9c58fabf..09a38fe07c7 100644 --- a/packages/cli/generation/ir-generator/src/__test__/convertResponseErrors.test.ts +++ b/packages/cli/generation/ir-generator/src/__test__/convertResponseErrors.test.ts @@ -1,5 +1,5 @@ import { RelativeFilePath } from "@fern-api/fs-utils"; -import { ResponseErrors } from "@fern-fern/ir-sdk/api"; +import { ResponseErrors } from "@fern-api/ir-sdk"; import { constructCasingsGenerator } from "../casings/CasingsGenerator"; import { convertResponseErrors } from "../converters/services/convertResponseErrors"; import { constructFernFileContext } from "../FernFileContext"; diff --git a/packages/cli/generation/ir-generator/src/__test__/generateIntermediateRepresentation.test.ts b/packages/cli/generation/ir-generator/src/__test__/generateIntermediateRepresentation.test.ts index 429b425f10c..ba9754472e2 100644 --- a/packages/cli/generation/ir-generator/src/__test__/generateIntermediateRepresentation.test.ts +++ b/packages/cli/generation/ir-generator/src/__test__/generateIntermediateRepresentation.test.ts @@ -3,7 +3,7 @@ import { AbsoluteFilePath, join, RelativeFilePath } from "@fern-api/fs-utils"; import { loadApis } from "@fern-api/project-loader"; import { createMockTaskContext } from "@fern-api/task-context"; import { APIWorkspace, loadAPIWorkspace } from "@fern-api/workspace-loader"; -import * as IrSerialization from "@fern-fern/ir-sdk/serialization"; +import { serialization as IrSerialization } from "@fern-api/ir-sdk"; import path from "path"; // import * as prettier from "prettier"; import { generateIntermediateRepresentation } from "../generateIntermediateRepresentation"; diff --git a/packages/cli/generation/ir-generator/src/__test__/parseInlineType.test.ts b/packages/cli/generation/ir-generator/src/__test__/parseInlineType.test.ts index 26ac49748d0..0fdb1c8f538 100644 --- a/packages/cli/generation/ir-generator/src/__test__/parseInlineType.test.ts +++ b/packages/cli/generation/ir-generator/src/__test__/parseInlineType.test.ts @@ -1,6 +1,5 @@ import { RelativeFilePath } from "@fern-api/fs-utils"; -import { ContainerType, TypeReference } from "@fern-fern/ir-sdk/api"; -import * as IrSerialization from "@fern-fern/ir-sdk/serialization"; +import { ContainerType, serialization as IrSerialization, TypeReference } from "@fern-api/ir-sdk"; import { constructCasingsGenerator } from "../casings/CasingsGenerator"; import { constructFernFileContext } from "../FernFileContext"; import { convertToFernFilepath } from "../utils/convertToFernFilepath"; diff --git a/packages/cli/generation/ir-generator/src/casings/CasingsGenerator.ts b/packages/cli/generation/ir-generator/src/casings/CasingsGenerator.ts index e809a2125b4..e2a8acc8f78 100644 --- a/packages/cli/generation/ir-generator/src/casings/CasingsGenerator.ts +++ b/packages/cli/generation/ir-generator/src/casings/CasingsGenerator.ts @@ -1,5 +1,5 @@ import { GenerationLanguage } from "@fern-api/generators-configuration"; -import { Name, NameAndWireValue, SafeAndUnsafeString } from "@fern-fern/ir-sdk/api"; +import { Name, NameAndWireValue, SafeAndUnsafeString } from "@fern-api/ir-sdk"; import { camelCase, snakeCase, upperFirst, words } from "lodash-es"; import { RESERVED_KEYWORDS } from "./reserved"; diff --git a/packages/cli/generation/ir-generator/src/converters/constants.ts b/packages/cli/generation/ir-generator/src/converters/constants.ts index 3d212004237..ad93eb8cf61 100644 --- a/packages/cli/generation/ir-generator/src/converters/constants.ts +++ b/packages/cli/generation/ir-generator/src/converters/constants.ts @@ -1,4 +1,4 @@ -import { Constants } from "@fern-fern/ir-sdk/api"; +import { Constants } from "@fern-api/ir-sdk"; import { CasingsGenerator } from "../casings/CasingsGenerator"; export function generateFernConstants(casingsGenerator: CasingsGenerator): Constants { diff --git a/packages/cli/generation/ir-generator/src/converters/convertApiAuth.ts b/packages/cli/generation/ir-generator/src/converters/convertApiAuth.ts index 11585904ced..052eee87ed7 100644 --- a/packages/cli/generation/ir-generator/src/converters/convertApiAuth.ts +++ b/packages/cli/generation/ir-generator/src/converters/convertApiAuth.ts @@ -1,5 +1,5 @@ +import { ApiAuth, AuthScheme, AuthSchemesRequirement } from "@fern-api/ir-sdk"; import { RawSchemas, visitRawApiAuth, visitRawAuthSchemeDeclaration } from "@fern-api/yaml-schema"; -import { ApiAuth, AuthScheme, AuthSchemesRequirement } from "@fern-fern/ir-sdk/api"; import { FernFileContext } from "../FernFileContext"; export function convertApiAuth({ diff --git a/packages/cli/generation/ir-generator/src/converters/convertDeclaration.ts b/packages/cli/generation/ir-generator/src/converters/convertDeclaration.ts index 3c030b00be1..e8102cd3b2c 100644 --- a/packages/cli/generation/ir-generator/src/converters/convertDeclaration.ts +++ b/packages/cli/generation/ir-generator/src/converters/convertDeclaration.ts @@ -1,6 +1,6 @@ import { assertNever } from "@fern-api/core-utils"; +import { Availability, AvailabilityStatus, Declaration } from "@fern-api/ir-sdk"; import { RawSchemas } from "@fern-api/yaml-schema"; -import { Availability, AvailabilityStatus, Declaration } from "@fern-fern/ir-sdk/api"; import { formatDocs } from "../formatDocs"; const DEFAULT_DECLARATION = { diff --git a/packages/cli/generation/ir-generator/src/converters/convertEnvironments.ts b/packages/cli/generation/ir-generator/src/converters/convertEnvironments.ts index 71895367f2d..12ef2a28a95 100644 --- a/packages/cli/generation/ir-generator/src/converters/convertEnvironments.ts +++ b/packages/cli/generation/ir-generator/src/converters/convertEnvironments.ts @@ -1,4 +1,3 @@ -import { RawSchemas, visitRawEnvironmentDeclaration } from "@fern-api/yaml-schema"; import { Environments, EnvironmentsConfig, @@ -6,7 +5,8 @@ import { MultipleBaseUrlsEnvironments, SingleBaseUrlEnvironment, SingleBaseUrlEnvironments -} from "@fern-fern/ir-sdk/api"; +} from "@fern-api/ir-sdk"; +import { RawSchemas, visitRawEnvironmentDeclaration } from "@fern-api/yaml-schema"; import { CasingsGenerator } from "../casings/CasingsGenerator"; export function convertEnvironments({ diff --git a/packages/cli/generation/ir-generator/src/converters/convertErrorDeclaration.ts b/packages/cli/generation/ir-generator/src/converters/convertErrorDeclaration.ts index b53d9fcfd9a..e003df58bf6 100644 --- a/packages/cli/generation/ir-generator/src/converters/convertErrorDeclaration.ts +++ b/packages/cli/generation/ir-generator/src/converters/convertErrorDeclaration.ts @@ -1,5 +1,5 @@ +import { ErrorDeclaration } from "@fern-api/ir-sdk"; import { RawSchemas } from "@fern-api/yaml-schema"; -import { ErrorDeclaration } from "@fern-fern/ir-sdk/api"; import { FernFileContext } from "../FernFileContext"; import { parseErrorName } from "../utils/parseErrorName"; diff --git a/packages/cli/generation/ir-generator/src/converters/convertErrorDiscriminationStrategy.ts b/packages/cli/generation/ir-generator/src/converters/convertErrorDiscriminationStrategy.ts index 68ac776f904..108e13aebfb 100644 --- a/packages/cli/generation/ir-generator/src/converters/convertErrorDiscriminationStrategy.ts +++ b/packages/cli/generation/ir-generator/src/converters/convertErrorDiscriminationStrategy.ts @@ -1,6 +1,6 @@ import { assertNever } from "@fern-api/core-utils"; +import { ErrorDiscriminationStrategy } from "@fern-api/ir-sdk"; import { RawSchemas } from "@fern-api/yaml-schema"; -import { ErrorDiscriminationStrategy } from "@fern-fern/ir-sdk/api"; import { FernFileContext } from "../FernFileContext"; const ERROR_CONTENT_PROPERTY_NAME = "content"; diff --git a/packages/cli/generation/ir-generator/src/converters/convertWebhookGroup.ts b/packages/cli/generation/ir-generator/src/converters/convertWebhookGroup.ts index 45029daad7f..ad89cc8d5d7 100644 --- a/packages/cli/generation/ir-generator/src/converters/convertWebhookGroup.ts +++ b/packages/cli/generation/ir-generator/src/converters/convertWebhookGroup.ts @@ -1,5 +1,5 @@ +import { InlinedWebhookPayloadProperty, Webhook, WebhookGroup, WebhookPayload } from "@fern-api/ir-sdk"; import { RawSchemas } from "@fern-api/yaml-schema"; -import { InlinedWebhookPayloadProperty, Webhook, WebhookGroup, WebhookPayload } from "@fern-fern/ir-sdk/api"; import { FernFileContext } from "../FernFileContext"; import { parseTypeName } from "../utils/parseTypeName"; import { convertAvailability } from "./convertDeclaration"; diff --git a/packages/cli/generation/ir-generator/src/converters/services/constructHttpPath.ts b/packages/cli/generation/ir-generator/src/converters/services/constructHttpPath.ts index 29225bd84a1..6e31b986192 100644 --- a/packages/cli/generation/ir-generator/src/converters/services/constructHttpPath.ts +++ b/packages/cli/generation/ir-generator/src/converters/services/constructHttpPath.ts @@ -1,4 +1,4 @@ -import { HttpPath, HttpPathPart } from "@fern-fern/ir-sdk/api"; +import { HttpPath, HttpPathPart } from "@fern-api/ir-sdk"; export function constructHttpPath(rawPath: string): HttpPath { const rawPathGenerator = createStringGenerator(rawPath); diff --git a/packages/cli/generation/ir-generator/src/converters/services/convertExampleEndpointCall.ts b/packages/cli/generation/ir-generator/src/converters/services/convertExampleEndpointCall.ts index aab8930900e..50e67d4ba87 100644 --- a/packages/cli/generation/ir-generator/src/converters/services/convertExampleEndpointCall.ts +++ b/packages/cli/generation/ir-generator/src/converters/services/convertExampleEndpointCall.ts @@ -1,6 +1,4 @@ import { isPlainObject } from "@fern-api/core-utils"; -import { FernWorkspace } from "@fern-api/workspace-loader"; -import { isInlineRequestBody, RawSchemas } from "@fern-api/yaml-schema"; import { ExampleEndpointCall, ExampleHeader, @@ -9,7 +7,9 @@ import { ExampleRequestBody, ExampleResponse, Name -} from "@fern-fern/ir-sdk/api"; +} from "@fern-api/ir-sdk"; +import { FernWorkspace } from "@fern-api/workspace-loader"; +import { isInlineRequestBody, RawSchemas } from "@fern-api/yaml-schema"; import { FernFileContext } from "../../FernFileContext"; import { ErrorResolver } from "../../resolvers/ErrorResolver"; import { ExampleResolver } from "../../resolvers/ExampleResolver"; diff --git a/packages/cli/generation/ir-generator/src/converters/services/convertHttpRequestBody.ts b/packages/cli/generation/ir-generator/src/converters/services/convertHttpRequestBody.ts index db9f46f1f04..9743d37e846 100644 --- a/packages/cli/generation/ir-generator/src/converters/services/convertHttpRequestBody.ts +++ b/packages/cli/generation/ir-generator/src/converters/services/convertHttpRequestBody.ts @@ -1,10 +1,10 @@ -import { isInlineRequestBody, parseBytesRequest, parseFileUploadRequest, RawSchemas } from "@fern-api/yaml-schema"; import { FileUploadRequestProperty, HttpRequestBody, HttpRequestBodyReference, InlinedRequestBodyProperty -} from "@fern-fern/ir-sdk/api"; +} from "@fern-api/ir-sdk"; +import { isInlineRequestBody, parseBytesRequest, parseFileUploadRequest, RawSchemas } from "@fern-api/yaml-schema"; import { FernFileContext } from "../../FernFileContext"; import { parseTypeName } from "../../utils/parseTypeName"; import { getExtensionsAsList, getPropertyName } from "../type-declarations/convertObjectTypeDeclaration"; diff --git a/packages/cli/generation/ir-generator/src/converters/services/convertHttpResponse.ts b/packages/cli/generation/ir-generator/src/converters/services/convertHttpResponse.ts index 67fb8a4d80e..d9240934d41 100644 --- a/packages/cli/generation/ir-generator/src/converters/services/convertHttpResponse.ts +++ b/packages/cli/generation/ir-generator/src/converters/services/convertHttpResponse.ts @@ -1,6 +1,6 @@ import { assertNever } from "@fern-api/core-utils"; +import { HttpResponse, JsonResponse, ObjectProperty, StreamingResponseChunkType } from "@fern-api/ir-sdk"; import { isRawTextType, parseRawFileType, parseRawTextType, RawSchemas } from "@fern-api/yaml-schema"; -import { HttpResponse, JsonResponse, ObjectProperty, StreamingResponseChunkType } from "@fern-fern/ir-sdk/api"; import { FernFileContext } from "../../FernFileContext"; import { ResolvedType } from "../../resolvers/ResolvedType"; import { TypeResolver } from "../../resolvers/TypeResolver"; diff --git a/packages/cli/generation/ir-generator/src/converters/services/convertHttpSdkRequest.ts b/packages/cli/generation/ir-generator/src/converters/services/convertHttpSdkRequest.ts index 9ceafd27f3c..dffa10080fc 100644 --- a/packages/cli/generation/ir-generator/src/converters/services/convertHttpSdkRequest.ts +++ b/packages/cli/generation/ir-generator/src/converters/services/convertHttpSdkRequest.ts @@ -1,5 +1,5 @@ +import { SdkRequest, SdkRequestBodyType, SdkRequestShape } from "@fern-api/ir-sdk"; import { isInlineRequestBody, parseRawBytesType, RawSchemas } from "@fern-api/yaml-schema"; -import { SdkRequest, SdkRequestBodyType, SdkRequestShape } from "@fern-fern/ir-sdk/api"; import { size } from "lodash-es"; import { FernFileContext } from "../../FernFileContext"; import { TypeResolver } from "../../resolvers/TypeResolver"; diff --git a/packages/cli/generation/ir-generator/src/converters/services/convertHttpService.ts b/packages/cli/generation/ir-generator/src/converters/services/convertHttpService.ts index 076e69c1e00..62ff237bfcb 100644 --- a/packages/cli/generation/ir-generator/src/converters/services/convertHttpService.ts +++ b/packages/cli/generation/ir-generator/src/converters/services/convertHttpService.ts @@ -1,6 +1,4 @@ import { assertNever } from "@fern-api/core-utils"; -import { FernWorkspace } from "@fern-api/workspace-loader"; -import { isVariablePathParameter, RawSchemas } from "@fern-api/yaml-schema"; import { HttpEndpoint, HttpHeader, @@ -10,7 +8,9 @@ import { PathParameterLocation, ResponseErrors, TypeReference -} from "@fern-fern/ir-sdk/api"; +} from "@fern-api/ir-sdk"; +import { FernWorkspace } from "@fern-api/workspace-loader"; +import { isVariablePathParameter, RawSchemas } from "@fern-api/yaml-schema"; import urlJoin from "url-join"; import { FernFileContext } from "../../FernFileContext"; import { IdGenerator } from "../../IdGenerator"; diff --git a/packages/cli/generation/ir-generator/src/converters/services/convertResponseErrors.ts b/packages/cli/generation/ir-generator/src/converters/services/convertResponseErrors.ts index 9e1af1bee1a..f6f9cdd6d1f 100644 --- a/packages/cli/generation/ir-generator/src/converters/services/convertResponseErrors.ts +++ b/packages/cli/generation/ir-generator/src/converters/services/convertResponseErrors.ts @@ -1,5 +1,5 @@ +import { ResponseErrors } from "@fern-api/ir-sdk"; import { RawSchemas } from "@fern-api/yaml-schema"; -import { ResponseErrors } from "@fern-fern/ir-sdk/api"; import { FernFileContext } from "../../FernFileContext"; import { parseErrorName } from "../../utils/parseErrorName"; diff --git a/packages/cli/generation/ir-generator/src/converters/type-declarations/convertAliasTypeDeclaration.ts b/packages/cli/generation/ir-generator/src/converters/type-declarations/convertAliasTypeDeclaration.ts index 3b2512f97ff..5a201f97244 100644 --- a/packages/cli/generation/ir-generator/src/converters/type-declarations/convertAliasTypeDeclaration.ts +++ b/packages/cli/generation/ir-generator/src/converters/type-declarations/convertAliasTypeDeclaration.ts @@ -1,4 +1,5 @@ import { assertNever } from "@fern-api/core-utils"; +import { ResolvedTypeReference, ShapeType, Type } from "@fern-api/ir-sdk"; import { isRawDiscriminatedUnionDefinition, isRawEnumDefinition, @@ -6,7 +7,6 @@ import { isRawUndiscriminatedUnionDefinition, RawSchemas } from "@fern-api/yaml-schema"; -import { ResolvedTypeReference, ShapeType, Type } from "@fern-fern/ir-sdk/api"; import { FernFileContext } from "../../FernFileContext"; import { TypeResolver } from "../../resolvers/TypeResolver"; diff --git a/packages/cli/generation/ir-generator/src/converters/type-declarations/convertDiscriminatedUnionTypeDeclaration.ts b/packages/cli/generation/ir-generator/src/converters/type-declarations/convertDiscriminatedUnionTypeDeclaration.ts index b29c868f6ba..ee58a3f0167 100644 --- a/packages/cli/generation/ir-generator/src/converters/type-declarations/convertDiscriminatedUnionTypeDeclaration.ts +++ b/packages/cli/generation/ir-generator/src/converters/type-declarations/convertDiscriminatedUnionTypeDeclaration.ts @@ -1,5 +1,5 @@ +import { SingleUnionType, SingleUnionTypeProperties, Type, TypeReference } from "@fern-api/ir-sdk"; import { isRawObjectDefinition, RawSchemas } from "@fern-api/yaml-schema"; -import { SingleUnionType, SingleUnionTypeProperties, Type, TypeReference } from "@fern-fern/ir-sdk/api"; import { FernFileContext } from "../../FernFileContext"; import { TypeResolver } from "../../resolvers/TypeResolver"; import { getDocs } from "../../utils/getDocs"; diff --git a/packages/cli/generation/ir-generator/src/converters/type-declarations/convertEnumTypeDeclaration.ts b/packages/cli/generation/ir-generator/src/converters/type-declarations/convertEnumTypeDeclaration.ts index 7c2f8b46916..fb12e3274b9 100644 --- a/packages/cli/generation/ir-generator/src/converters/type-declarations/convertEnumTypeDeclaration.ts +++ b/packages/cli/generation/ir-generator/src/converters/type-declarations/convertEnumTypeDeclaration.ts @@ -1,5 +1,5 @@ +import { Type } from "@fern-api/ir-sdk"; import { RawSchemas } from "@fern-api/yaml-schema"; -import { Type } from "@fern-fern/ir-sdk/api"; import { FernFileContext } from "../../FernFileContext"; import { convertDeclaration } from "../convertDeclaration"; diff --git a/packages/cli/generation/ir-generator/src/converters/type-declarations/convertExampleType.ts b/packages/cli/generation/ir-generator/src/converters/type-declarations/convertExampleType.ts index 2f64c482048..f01e37e87a9 100644 --- a/packages/cli/generation/ir-generator/src/converters/type-declarations/convertExampleType.ts +++ b/packages/cli/generation/ir-generator/src/converters/type-declarations/convertExampleType.ts @@ -1,11 +1,4 @@ import { assertNever, isPlainObject } from "@fern-api/core-utils"; -import { FernWorkspace } from "@fern-api/workspace-loader"; -import { - isRawObjectDefinition, - RawSchemas, - visitRawTypeDeclaration, - visitRawTypeReference -} from "@fern-api/yaml-schema"; import { DeclaredTypeName, ExampleContainer, @@ -17,7 +10,14 @@ import { ExampleTypeReferenceShape, ExampleTypeShape, PrimitiveType -} from "@fern-fern/ir-sdk/api"; +} from "@fern-api/ir-sdk"; +import { FernWorkspace } from "@fern-api/workspace-loader"; +import { + isRawObjectDefinition, + RawSchemas, + visitRawTypeDeclaration, + visitRawTypeReference +} from "@fern-api/yaml-schema"; import { validateTypeReferenceExample } from "../../examples/validateTypeReferenceExample"; import { FernFileContext } from "../../FernFileContext"; import { IdGenerator } from "../../IdGenerator"; diff --git a/packages/cli/generation/ir-generator/src/converters/type-declarations/convertObjectTypeDeclaration.ts b/packages/cli/generation/ir-generator/src/converters/type-declarations/convertObjectTypeDeclaration.ts index c8ea2294edf..30db379e155 100644 --- a/packages/cli/generation/ir-generator/src/converters/type-declarations/convertObjectTypeDeclaration.ts +++ b/packages/cli/generation/ir-generator/src/converters/type-declarations/convertObjectTypeDeclaration.ts @@ -1,5 +1,5 @@ +import { ObjectProperty, Type } from "@fern-api/ir-sdk"; import { RawSchemas } from "@fern-api/yaml-schema"; -import { ObjectProperty, Type } from "@fern-fern/ir-sdk/api"; import { FernFileContext } from "../../FernFileContext"; import { parseTypeName } from "../../utils/parseTypeName"; import { convertDeclaration } from "../convertDeclaration"; diff --git a/packages/cli/generation/ir-generator/src/converters/type-declarations/convertTypeDeclaration.ts b/packages/cli/generation/ir-generator/src/converters/type-declarations/convertTypeDeclaration.ts index 91cbdfb6184..5df926a2e4b 100644 --- a/packages/cli/generation/ir-generator/src/converters/type-declarations/convertTypeDeclaration.ts +++ b/packages/cli/generation/ir-generator/src/converters/type-declarations/convertTypeDeclaration.ts @@ -1,6 +1,6 @@ +import { ExampleType, FernFilepath, Type, TypeDeclaration } from "@fern-api/ir-sdk"; import { FernWorkspace } from "@fern-api/workspace-loader"; import { isRawObjectDefinition, RawSchemas, visitRawTypeDeclaration } from "@fern-api/yaml-schema"; -import { ExampleType, FernFilepath, Type, TypeDeclaration } from "@fern-fern/ir-sdk/api"; import { FernFileContext } from "../../FernFileContext"; import { AudienceId } from "../../filtered-ir/ids"; import { ExampleResolver } from "../../resolvers/ExampleResolver"; diff --git a/packages/cli/generation/ir-generator/src/converters/type-declarations/convertUndiscriminatedUnionTypeDeclaration.ts b/packages/cli/generation/ir-generator/src/converters/type-declarations/convertUndiscriminatedUnionTypeDeclaration.ts index 44043f71855..a60996ec085 100644 --- a/packages/cli/generation/ir-generator/src/converters/type-declarations/convertUndiscriminatedUnionTypeDeclaration.ts +++ b/packages/cli/generation/ir-generator/src/converters/type-declarations/convertUndiscriminatedUnionTypeDeclaration.ts @@ -1,5 +1,5 @@ +import { Type } from "@fern-api/ir-sdk"; import { RawSchemas } from "@fern-api/yaml-schema"; -import { Type } from "@fern-fern/ir-sdk/api"; import { FernFileContext } from "../../FernFileContext"; export function convertUndiscriminatedUnionTypeDeclaration({ diff --git a/packages/cli/generation/ir-generator/src/converters/type-declarations/getReferencedTypesFromRawDeclaration.ts b/packages/cli/generation/ir-generator/src/converters/type-declarations/getReferencedTypesFromRawDeclaration.ts index 65e3c717c72..e58b6522914 100644 --- a/packages/cli/generation/ir-generator/src/converters/type-declarations/getReferencedTypesFromRawDeclaration.ts +++ b/packages/cli/generation/ir-generator/src/converters/type-declarations/getReferencedTypesFromRawDeclaration.ts @@ -1,5 +1,5 @@ +import { DeclaredTypeName } from "@fern-api/ir-sdk"; import { RawSchemas, recursivelyVisitRawTypeReference, visitRawTypeDeclaration } from "@fern-api/yaml-schema"; -import { DeclaredTypeName } from "@fern-fern/ir-sdk/api"; import { FernFileContext } from "../../FernFileContext"; import { TypeResolver } from "../../resolvers/TypeResolver"; import { parseTypeName } from "../../utils/parseTypeName"; diff --git a/packages/cli/generation/ir-generator/src/examples/validateTypeReferenceExample.ts b/packages/cli/generation/ir-generator/src/examples/validateTypeReferenceExample.ts index d76d845ee11..dc4810bcbfa 100644 --- a/packages/cli/generation/ir-generator/src/examples/validateTypeReferenceExample.ts +++ b/packages/cli/generation/ir-generator/src/examples/validateTypeReferenceExample.ts @@ -1,7 +1,7 @@ import { assertNever, getDuplicates, isPlainObject } from "@fern-api/core-utils"; +import { Literal, PrimitiveType } from "@fern-api/ir-sdk"; import { FernWorkspace } from "@fern-api/workspace-loader"; import { EXAMPLE_REFERENCE_PREFIX, RawSchemas, visitRawTypeReference } from "@fern-api/yaml-schema"; -import { Literal, PrimitiveType } from "@fern-fern/ir-sdk/api"; import { FernFileContext } from "../FernFileContext"; import { ExampleResolver } from "../resolvers/ExampleResolver"; import { ResolvedType } from "../resolvers/ResolvedType"; diff --git a/packages/cli/generation/ir-generator/src/filtered-ir/FilteredIr.ts b/packages/cli/generation/ir-generator/src/filtered-ir/FilteredIr.ts index b3bcb6f7f68..134f790abd7 100644 --- a/packages/cli/generation/ir-generator/src/filtered-ir/FilteredIr.ts +++ b/packages/cli/generation/ir-generator/src/filtered-ir/FilteredIr.ts @@ -1,4 +1,4 @@ -import { ErrorDeclaration, HttpEndpoint, HttpService, TypeDeclaration } from "@fern-fern/ir-sdk/api"; +import { ErrorDeclaration, HttpEndpoint, HttpService, TypeDeclaration } from "@fern-api/ir-sdk"; import { IdGenerator } from "../IdGenerator"; import { EndpointId, ErrorId, ServiceId, SubpackageId, TypeId } from "./ids"; diff --git a/packages/cli/generation/ir-generator/src/filtered-ir/IrGraph.ts b/packages/cli/generation/ir-generator/src/filtered-ir/IrGraph.ts index 376f21d06e7..72092dd0f9d 100644 --- a/packages/cli/generation/ir-generator/src/filtered-ir/IrGraph.ts +++ b/packages/cli/generation/ir-generator/src/filtered-ir/IrGraph.ts @@ -1,6 +1,5 @@ import { Audiences as ConfigAudiences } from "@fern-api/config-management-commons"; import { assertNever, noop } from "@fern-api/core-utils"; -import { isInlineRequestBody, RawSchemas } from "@fern-api/yaml-schema"; import { ContainerType, DeclaredServiceName, @@ -14,7 +13,8 @@ import { HttpService, StreamingResponseChunkType, TypeReference -} from "@fern-fern/ir-sdk/api"; +} from "@fern-api/ir-sdk"; +import { isInlineRequestBody, RawSchemas } from "@fern-api/yaml-schema"; import { IdGenerator } from "../IdGenerator"; import { getPropertiesForAudience } from "../utils/getPropertiesForAudience"; import { FilteredIr, FilteredIrImpl } from "./FilteredIr"; diff --git a/packages/cli/generation/ir-generator/src/filtered-ir/ids.ts b/packages/cli/generation/ir-generator/src/filtered-ir/ids.ts index d7045e488bc..266767822b4 100644 --- a/packages/cli/generation/ir-generator/src/filtered-ir/ids.ts +++ b/packages/cli/generation/ir-generator/src/filtered-ir/ids.ts @@ -1,4 +1,4 @@ -import { FernFilepath } from "@fern-fern/ir-sdk/api"; +import { FernFilepath } from "@fern-api/ir-sdk"; export type AudienceId = string; export type TypeId = string; diff --git a/packages/cli/generation/ir-generator/src/generateIntermediateRepresentation.ts b/packages/cli/generation/ir-generator/src/generateIntermediateRepresentation.ts index 5f99602616e..e54a871fa0b 100644 --- a/packages/cli/generation/ir-generator/src/generateIntermediateRepresentation.ts +++ b/packages/cli/generation/ir-generator/src/generateIntermediateRepresentation.ts @@ -2,8 +2,6 @@ import { Audiences } from "@fern-api/config-management-commons"; import { noop, visitObject } from "@fern-api/core-utils"; import { dirname, join, RelativeFilePath } from "@fern-api/fs-utils"; import { GenerationLanguage } from "@fern-api/generators-configuration"; -import { FERN_PACKAGE_MARKER_FILENAME } from "@fern-api/project-configuration"; -import { FernWorkspace, visitAllDefinitionFiles, visitAllPackageMarkers } from "@fern-api/workspace-loader"; import { HttpEndpoint, IntermediateRepresentation, @@ -13,7 +11,9 @@ import { ServiceTypeReferenceInfo, Type, TypeId -} from "@fern-fern/ir-sdk/api"; +} from "@fern-api/ir-sdk"; +import { FERN_PACKAGE_MARKER_FILENAME } from "@fern-api/project-configuration"; +import { FernWorkspace, visitAllDefinitionFiles, visitAllPackageMarkers } from "@fern-api/workspace-loader"; import { mapValues, pickBy } from "lodash-es"; import { constructCasingsGenerator } from "./casings/CasingsGenerator"; import { generateFernConstants } from "./converters/constants"; diff --git a/packages/cli/generation/ir-generator/src/resolvers/ResolvedType.ts b/packages/cli/generation/ir-generator/src/resolvers/ResolvedType.ts index 1f97f451c09..62e0e2063ec 100644 --- a/packages/cli/generation/ir-generator/src/resolvers/ResolvedType.ts +++ b/packages/cli/generation/ir-generator/src/resolvers/ResolvedType.ts @@ -1,6 +1,6 @@ import { RelativeFilePath } from "@fern-api/fs-utils"; +import { DeclaredTypeName, Literal as IrLiteral, PrimitiveType, TypeReference } from "@fern-api/ir-sdk"; import { RawSchemas } from "@fern-api/yaml-schema"; -import { DeclaredTypeName, Literal as IrLiteral, PrimitiveType, TypeReference } from "@fern-fern/ir-sdk/api"; import { FernFileContext } from "../FernFileContext"; export declare type ResolvedType = diff --git a/packages/cli/generation/ir-generator/src/resolvers/TypeResolver.ts b/packages/cli/generation/ir-generator/src/resolvers/TypeResolver.ts index 2e260cd648a..c875623073c 100644 --- a/packages/cli/generation/ir-generator/src/resolvers/TypeResolver.ts +++ b/packages/cli/generation/ir-generator/src/resolvers/TypeResolver.ts @@ -1,6 +1,6 @@ +import { ContainerType, TypeReference } from "@fern-api/ir-sdk"; import { FernWorkspace, getDefinitionFile } from "@fern-api/workspace-loader"; import { isRawAliasDefinition, RawSchemas, recursivelyVisitRawTypeReference } from "@fern-api/yaml-schema"; -import { ContainerType, TypeReference } from "@fern-fern/ir-sdk/api"; import { constructFernFileContext, FernFileContext } from "../FernFileContext"; import { parseInlineType } from "../utils/parseInlineType"; import { parseReferenceToTypeName } from "../utils/parseReferenceToTypeName"; diff --git a/packages/cli/generation/ir-generator/src/resolvers/VariableResolver.ts b/packages/cli/generation/ir-generator/src/resolvers/VariableResolver.ts index d7cf7660c58..28a10c4a55f 100644 --- a/packages/cli/generation/ir-generator/src/resolvers/VariableResolver.ts +++ b/packages/cli/generation/ir-generator/src/resolvers/VariableResolver.ts @@ -1,5 +1,5 @@ +import { VariableId } from "@fern-api/ir-sdk"; import { RawSchemas } from "@fern-api/yaml-schema"; -import { VariableId } from "@fern-fern/ir-sdk/api"; import { constructRootApiFileContext, FernFileContext } from "../FernFileContext"; export interface VariableResolver { diff --git a/packages/cli/generation/ir-generator/src/utils/convertToFernFilepath.ts b/packages/cli/generation/ir-generator/src/utils/convertToFernFilepath.ts index 4a2a9532805..1c2b910239b 100644 --- a/packages/cli/generation/ir-generator/src/utils/convertToFernFilepath.ts +++ b/packages/cli/generation/ir-generator/src/utils/convertToFernFilepath.ts @@ -1,6 +1,6 @@ import { dirname, RelativeFilePath } from "@fern-api/fs-utils"; +import { FernFilepath } from "@fern-api/ir-sdk"; import { FERN_PACKAGE_MARKER_FILENAME } from "@fern-api/project-configuration"; -import { FernFilepath } from "@fern-fern/ir-sdk/api"; import path, { basename } from "path"; import { CasingsGenerator } from "../casings/CasingsGenerator"; diff --git a/packages/cli/generation/ir-generator/src/utils/parseErrorName.ts b/packages/cli/generation/ir-generator/src/utils/parseErrorName.ts index 11b11b19547..5dfe2f3c827 100644 --- a/packages/cli/generation/ir-generator/src/utils/parseErrorName.ts +++ b/packages/cli/generation/ir-generator/src/utils/parseErrorName.ts @@ -1,4 +1,4 @@ -import { DeclaredErrorName } from "@fern-fern/ir-sdk/api"; +import { DeclaredErrorName } from "@fern-api/ir-sdk"; import { FernFileContext } from "../FernFileContext"; import { IdGenerator } from "../IdGenerator"; import { convertToFernFilepath } from "./convertToFernFilepath"; diff --git a/packages/cli/generation/ir-generator/src/utils/parseInlineType.ts b/packages/cli/generation/ir-generator/src/utils/parseInlineType.ts index 6504cc655d4..65f3ffaf09b 100644 --- a/packages/cli/generation/ir-generator/src/utils/parseInlineType.ts +++ b/packages/cli/generation/ir-generator/src/utils/parseInlineType.ts @@ -1,5 +1,5 @@ +import { ContainerType, TypeReference } from "@fern-api/ir-sdk"; import { RawSchemas, recursivelyVisitRawTypeReference } from "@fern-api/yaml-schema"; -import { ContainerType, TypeReference } from "@fern-fern/ir-sdk/api"; import { FernFileContext } from "../FernFileContext"; import { parseTypeName } from "./parseTypeName"; diff --git a/packages/cli/generation/ir-generator/src/utils/parseTypeName.ts b/packages/cli/generation/ir-generator/src/utils/parseTypeName.ts index 1fcab4a79fa..fcfd40fec55 100644 --- a/packages/cli/generation/ir-generator/src/utils/parseTypeName.ts +++ b/packages/cli/generation/ir-generator/src/utils/parseTypeName.ts @@ -1,4 +1,4 @@ -import { DeclaredTypeName } from "@fern-fern/ir-sdk/api"; +import { DeclaredTypeName } from "@fern-api/ir-sdk"; import { FernFileContext } from "../FernFileContext"; import { IdGenerator } from "../IdGenerator"; import { convertToFernFilepath } from "./convertToFernFilepath"; diff --git a/packages/cli/generation/ir-generator/tsconfig.json b/packages/cli/generation/ir-generator/tsconfig.json index 7db392abde9..4f3941235e5 100644 --- a/packages/cli/generation/ir-generator/tsconfig.json +++ b/packages/cli/generation/ir-generator/tsconfig.json @@ -5,6 +5,7 @@ "references": [ { "path": "../../../commons/core-utils" }, { "path": "../../../commons/fs-utils" }, + { "path": "../../../ir-sdk" }, { "path": "../../config-management/commons" }, { "path": "../../config-management/generators-configuration" }, { "path": "../../config-management/project-configuration" }, diff --git a/packages/cli/generation/ir-migrations/package.json b/packages/cli/generation/ir-migrations/package.json index 68dd7a4bd39..b8441aaf0f8 100644 --- a/packages/cli/generation/ir-migrations/package.json +++ b/packages/cli/generation/ir-migrations/package.json @@ -31,11 +31,11 @@ "@fern-api/fs-utils": "workspace:*", "@fern-api/generators-configuration": "workspace:*", "@fern-api/ir-generator": "workspace:*", + "@fern-api/ir-sdk": "workspace:*", "@fern-api/logger": "workspace:*", "@fern-api/semver-utils": "workspace:*", "@fern-api/task-context": "workspace:*", "@fern-api/workspace-loader": "workspace:*", - "@fern-fern/ir-sdk": "0.0.3294", "@fern-fern/ir-v1-model": "0.0.1", "@fern-fern/ir-v10-model": "0.0.1", "@fern-fern/ir-v11-model": "0.0.2", diff --git a/packages/cli/generation/ir-migrations/src/IntermediateRepresentationMigrator.ts b/packages/cli/generation/ir-migrations/src/IntermediateRepresentationMigrator.ts index 6c5329b2f37..015265073ae 100644 --- a/packages/cli/generation/ir-migrations/src/IntermediateRepresentationMigrator.ts +++ b/packages/cli/generation/ir-migrations/src/IntermediateRepresentationMigrator.ts @@ -1,8 +1,7 @@ import { GeneratorName } from "@fern-api/generators-configuration"; +import { IntermediateRepresentation, serialization as IrSerialization } from "@fern-api/ir-sdk"; import { isVersionAhead } from "@fern-api/semver-utils"; import { TaskContext } from "@fern-api/task-context"; -import { IntermediateRepresentation } from "@fern-fern/ir-sdk/api"; -import * as IrSerialization from "@fern-fern/ir-sdk/serialization"; import { GeneratorNameAndVersion } from "./IrMigrationContext"; import { V10_TO_V9_MIGRATION } from "./migrations/v10-to-v9/migrateFromV10ToV9"; import { V11_TO_V10_MIGRATION } from "./migrations/v11-to-v10/migrateFromV11ToV10"; diff --git a/packages/cli/generation/ir-migrations/src/__test__/migrateIntermediateRepresentation.test.ts b/packages/cli/generation/ir-migrations/src/__test__/migrateIntermediateRepresentation.test.ts index bc948b9372b..4d52655e290 100644 --- a/packages/cli/generation/ir-migrations/src/__test__/migrateIntermediateRepresentation.test.ts +++ b/packages/cli/generation/ir-migrations/src/__test__/migrateIntermediateRepresentation.test.ts @@ -1,8 +1,8 @@ import { AbsoluteFilePath, join, RelativeFilePath } from "@fern-api/fs-utils"; import { GeneratorName } from "@fern-api/generators-configuration"; +import { IntermediateRepresentation } from "@fern-api/ir-sdk"; import { isVersionAhead } from "@fern-api/semver-utils"; import { createMockTaskContext } from "@fern-api/task-context"; -import { IntermediateRepresentation } from "@fern-fern/ir-sdk/api"; import { getIntermediateRepresentationMigrator } from "../IntermediateRepresentationMigrator"; import { IrVersions } from "../ir-versions"; import { migrateIntermediateRepresentationForGenerator } from "../migrateIntermediateRepresentationForGenerator"; diff --git a/packages/cli/generation/ir-migrations/src/__test__/utils/getIrForApi.ts b/packages/cli/generation/ir-migrations/src/__test__/utils/getIrForApi.ts index d1242666231..de5b3e4bab5 100644 --- a/packages/cli/generation/ir-migrations/src/__test__/utils/getIrForApi.ts +++ b/packages/cli/generation/ir-migrations/src/__test__/utils/getIrForApi.ts @@ -1,8 +1,8 @@ import { AbsoluteFilePath } from "@fern-api/fs-utils"; import { generateIntermediateRepresentation } from "@fern-api/ir-generator"; +import { IntermediateRepresentation } from "@fern-api/ir-sdk"; import { createMockTaskContext } from "@fern-api/task-context"; import { loadAPIWorkspace } from "@fern-api/workspace-loader"; -import { IntermediateRepresentation } from "@fern-fern/ir-sdk/api"; export async function getIrForApi(absolutePathToWorkspace: AbsoluteFilePath): Promise { const context = createMockTaskContext(); diff --git a/packages/cli/generation/ir-migrations/src/ir-serialization/IrSerialization.ts b/packages/cli/generation/ir-migrations/src/ir-serialization/IrSerialization.ts index 30b5d53436a..71852f3a0c7 100644 --- a/packages/cli/generation/ir-migrations/src/ir-serialization/IrSerialization.ts +++ b/packages/cli/generation/ir-migrations/src/ir-serialization/IrSerialization.ts @@ -1,4 +1,4 @@ -export * as V32 from "@fern-fern/ir-sdk/serialization"; +export { serialization as V32 } from "@fern-api/ir-sdk"; export * as V23 from "@fern-fern/ir-v23-sdk/serialization"; export * as V24 from "@fern-fern/ir-v24-sdk/serialization"; export * as V25 from "@fern-fern/ir-v25-sdk/serialization"; diff --git a/packages/cli/generation/ir-migrations/src/ir-versions/IrVersions.ts b/packages/cli/generation/ir-migrations/src/ir-versions/IrVersions.ts index a0516729d86..8e47bcb38d4 100644 --- a/packages/cli/generation/ir-migrations/src/ir-versions/IrVersions.ts +++ b/packages/cli/generation/ir-migrations/src/ir-versions/IrVersions.ts @@ -1,4 +1,4 @@ -export { FernIr as V32 } from "@fern-fern/ir-sdk"; +export { FernIr as V32 } from "@fern-api/ir-sdk"; export * as V1 from "@fern-fern/ir-v1-model"; export * as V10 from "@fern-fern/ir-v10-model"; export * as V11 from "@fern-fern/ir-v11-model"; diff --git a/packages/cli/generation/ir-migrations/src/migrateIntermediateRepresentationForGenerator.ts b/packages/cli/generation/ir-migrations/src/migrateIntermediateRepresentationForGenerator.ts index b150c1f8699..cb43c55e9e7 100644 --- a/packages/cli/generation/ir-migrations/src/migrateIntermediateRepresentationForGenerator.ts +++ b/packages/cli/generation/ir-migrations/src/migrateIntermediateRepresentationForGenerator.ts @@ -1,5 +1,5 @@ +import { IntermediateRepresentation } from "@fern-api/ir-sdk"; import { TaskContext } from "@fern-api/task-context"; -import { IntermediateRepresentation } from "@fern-fern/ir-sdk/api"; import { getIntermediateRepresentationMigrator } from "./IntermediateRepresentationMigrator"; import { GeneratorNameAndVersion } from "./IrMigrationContext"; diff --git a/packages/cli/generation/ir-migrations/src/migrateIntermediateRepresentationThroughVersion.ts b/packages/cli/generation/ir-migrations/src/migrateIntermediateRepresentationThroughVersion.ts index 13af860da98..931b5f9e1f6 100644 --- a/packages/cli/generation/ir-migrations/src/migrateIntermediateRepresentationThroughVersion.ts +++ b/packages/cli/generation/ir-migrations/src/migrateIntermediateRepresentationThroughVersion.ts @@ -1,5 +1,5 @@ +import { IntermediateRepresentation } from "@fern-api/ir-sdk"; import { TaskContext } from "@fern-api/task-context"; -import { IntermediateRepresentation } from "@fern-fern/ir-sdk/api"; import { getIntermediateRepresentationMigrator } from "./IntermediateRepresentationMigrator"; export function migrateIntermediateRepresentationThroughVersion({ diff --git a/packages/cli/generation/ir-migrations/src/migrations/v28-to-v27/migrateFromV28ToV27.ts b/packages/cli/generation/ir-migrations/src/migrations/v28-to-v27/migrateFromV28ToV27.ts index 4d193ab9496..62f492db7c9 100644 --- a/packages/cli/generation/ir-migrations/src/migrations/v28-to-v27/migrateFromV28ToV27.ts +++ b/packages/cli/generation/ir-migrations/src/migrations/v28-to-v27/migrateFromV28ToV27.ts @@ -1,6 +1,6 @@ import { assertNever } from "@fern-api/core-utils"; import { GeneratorName } from "@fern-api/generators-configuration"; -import { PrimitiveType } from "@fern-fern/ir-sdk/api"; +import { PrimitiveType } from "@fern-api/ir-sdk"; import { IrSerialization } from "../../ir-serialization"; import { IrVersions } from "../../ir-versions"; import { diff --git a/packages/cli/generation/ir-migrations/src/migrations/v29-to-v28/migrateFromV29ToV28.ts b/packages/cli/generation/ir-migrations/src/migrations/v29-to-v28/migrateFromV29ToV28.ts index a2a3539d763..3ad5aa063f3 100644 --- a/packages/cli/generation/ir-migrations/src/migrations/v29-to-v28/migrateFromV29ToV28.ts +++ b/packages/cli/generation/ir-migrations/src/migrations/v29-to-v28/migrateFromV29ToV28.ts @@ -1,5 +1,5 @@ import { GeneratorName } from "@fern-api/generators-configuration"; -import { commons } from "@fern-fern/ir-sdk/api"; +import { commons } from "@fern-api/ir-sdk"; import { IrSerialization } from "../../ir-serialization"; import { IrVersions } from "../../ir-versions"; import { diff --git a/packages/cli/generation/ir-migrations/tsconfig.json b/packages/cli/generation/ir-migrations/tsconfig.json index 30f1b1c7282..edce10044d1 100644 --- a/packages/cli/generation/ir-migrations/tsconfig.json +++ b/packages/cli/generation/ir-migrations/tsconfig.json @@ -5,6 +5,7 @@ "references": [ { "path": "../../../commons/core-utils" }, { "path": "../../../commons/fs-utils" }, + { "path": "../../../ir-sdk" }, { "path": "../../config-management/generators-configuration" }, { "path": "../../logger" }, { "path": "../../semver-utils" }, diff --git a/packages/cli/generation/remote-generation/remote-workspace-runner/package.json b/packages/cli/generation/remote-generation/remote-workspace-runner/package.json index 1c75b7e4eef..307a130423f 100644 --- a/packages/cli/generation/remote-generation/remote-workspace-runner/package.json +++ b/packages/cli/generation/remote-generation/remote-workspace-runner/package.json @@ -37,13 +37,13 @@ "@fern-api/generators-configuration": "workspace:*", "@fern-api/ir-generator": "workspace:*", "@fern-api/ir-migrations": "workspace:*", + "@fern-api/ir-sdk": "workspace:*", "@fern-api/logger": "workspace:*", "@fern-api/register": "workspace:*", "@fern-api/task-context": "workspace:*", "@fern-api/workspace-loader": "workspace:*", "@fern-fern/docs-config": "0.0.53", "@fern-fern/fiddle-sdk": "^0.0.386", - "@fern-fern/ir-sdk": "0.0.3294", "axios": "^0.27.2", "chalk": "^5.0.1", "decompress": "^4.2.1", diff --git a/packages/cli/generation/remote-generation/remote-workspace-runner/src/createAndStartJob.ts b/packages/cli/generation/remote-generation/remote-workspace-runner/src/createAndStartJob.ts index acd6820975e..f3ad2760dbb 100644 --- a/packages/cli/generation/remote-generation/remote-workspace-runner/src/createAndStartJob.ts +++ b/packages/cli/generation/remote-generation/remote-workspace-runner/src/createAndStartJob.ts @@ -3,11 +3,11 @@ import { createFiddleService, getFiddleOrigin } from "@fern-api/core"; import { stringifyLargeObject } from "@fern-api/fs-utils"; import { GeneratorInvocation } from "@fern-api/generators-configuration"; import { migrateIntermediateRepresentationForGenerator } from "@fern-api/ir-migrations"; +import { IntermediateRepresentation } from "@fern-api/ir-sdk"; import { TaskContext } from "@fern-api/task-context"; import { APIWorkspace } from "@fern-api/workspace-loader"; import { FernFiddle } from "@fern-fern/fiddle-sdk"; import { Fetcher } from "@fern-fern/fiddle-sdk/core"; -import { IntermediateRepresentation } from "@fern-fern/ir-sdk/api"; import axios, { AxiosError } from "axios"; import FormData from "form-data"; import urlJoin from "url-join"; diff --git a/packages/cli/generation/remote-generation/remote-workspace-runner/tsconfig.json b/packages/cli/generation/remote-generation/remote-workspace-runner/tsconfig.json index 91b97f21c98..7fcba19c56b 100644 --- a/packages/cli/generation/remote-generation/remote-workspace-runner/tsconfig.json +++ b/packages/cli/generation/remote-generation/remote-workspace-runner/tsconfig.json @@ -6,6 +6,7 @@ { "path": "../../../../commons/core-utils" }, { "path": "../../../../commons/fs-utils" }, { "path": "../../../../core" }, + { "path": "../../../../ir-sdk" }, { "path": "../../../auth" }, { "path": "../../../config-management/commons" }, { "path": "../../../config-management/docs-configuration" }, diff --git a/packages/cli/mock/package.json b/packages/cli/mock/package.json index 6d5300b9632..71859023098 100644 --- a/packages/cli/mock/package.json +++ b/packages/cli/mock/package.json @@ -28,8 +28,8 @@ }, "dependencies": { "@fern-api/core-utils": "workspace:*", + "@fern-api/ir-sdk": "workspace:*", "@fern-api/task-context": "workspace:*", - "@fern-fern/ir-sdk": "0.0.3294", "@types/lodash-es": "^4.17.7", "express": "^4.18.2", "get-port": "7.0.0", diff --git a/packages/cli/mock/src/runMockServer.ts b/packages/cli/mock/src/runMockServer.ts index 0135ff3d05a..9b618efd03b 100644 --- a/packages/cli/mock/src/runMockServer.ts +++ b/packages/cli/mock/src/runMockServer.ts @@ -1,5 +1,4 @@ import { assertNever } from "@fern-api/core-utils"; -import { TaskContext } from "@fern-api/task-context"; import { ExampleEndpointCall, ExamplePathParameter, @@ -7,7 +6,8 @@ import { HttpEndpoint, IntermediateRepresentation, NameAndWireValue -} from "@fern-fern/ir-sdk/api"; +} from "@fern-api/ir-sdk"; +import { TaskContext } from "@fern-api/task-context"; import express, { Request, Response } from "express"; import getPort from "get-port"; import { IncomingHttpHeaders } from "http"; diff --git a/packages/cli/mock/tsconfig.json b/packages/cli/mock/tsconfig.json index eb445079da9..7cae79b9afa 100644 --- a/packages/cli/mock/tsconfig.json +++ b/packages/cli/mock/tsconfig.json @@ -2,5 +2,5 @@ "extends": "../../../shared/tsconfig.shared.json", "compilerOptions": { "composite": true, "outDir": "lib", "rootDir": "src" }, "include": ["./src"], - "references": [{ "path": "../../commons/core-utils" }, { "path": "../task-context" }] + "references": [{ "path": "../../commons/core-utils" }, { "path": "../../ir-sdk" }, { "path": "../task-context" }] } diff --git a/packages/cli/register/package.json b/packages/cli/register/package.json index 9e51d35c280..79c259b1b91 100644 --- a/packages/cli/register/package.json +++ b/packages/cli/register/package.json @@ -33,9 +33,9 @@ "@fern-api/core-utils": "workspace:*", "@fern-api/fdr-sdk": "0.46.1-18-g26596cb", "@fern-api/ir-generator": "workspace:*", + "@fern-api/ir-sdk": "workspace:*", "@fern-api/task-context": "workspace:*", "@fern-api/workspace-loader": "workspace:*", - "@fern-fern/ir-sdk": "0.0.3294", "lodash-es": "^4.17.21" }, "devDependencies": { diff --git a/packages/cli/register/src/ir-to-fdr-converter/convertIrToFdrApi.ts b/packages/cli/register/src/ir-to-fdr-converter/convertIrToFdrApi.ts index 7e432271378..3a49eb01d78 100644 --- a/packages/cli/register/src/ir-to-fdr-converter/convertIrToFdrApi.ts +++ b/packages/cli/register/src/ir-to-fdr-converter/convertIrToFdrApi.ts @@ -1,6 +1,6 @@ import { entries } from "@fern-api/core-utils"; import { APIV1Write } from "@fern-api/fdr-sdk"; -import { IntermediateRepresentation } from "@fern-fern/ir-sdk/api"; +import { IntermediateRepresentation } from "@fern-api/ir-sdk"; import { convertIrAvailability, convertPackage } from "./convertPackage"; import { convertTypeReference, convertTypeShape } from "./convertTypeShape"; import { convertAuth } from "./covertAuth"; diff --git a/packages/cli/register/src/ir-to-fdr-converter/convertPackage.ts b/packages/cli/register/src/ir-to-fdr-converter/convertPackage.ts index 6d0e1d46bc9..444409661f2 100644 --- a/packages/cli/register/src/ir-to-fdr-converter/convertPackage.ts +++ b/packages/cli/register/src/ir-to-fdr-converter/convertPackage.ts @@ -1,6 +1,6 @@ import { assertNever } from "@fern-api/core-utils"; import { APIV1Write } from "@fern-api/fdr-sdk"; -import { FernIr as Ir } from "@fern-fern/ir-sdk"; +import { FernIr as Ir } from "@fern-api/ir-sdk"; import { startCase } from "lodash-es"; import { convertTypeReference } from "./convertTypeShape"; diff --git a/packages/cli/register/src/ir-to-fdr-converter/convertTypeShape.ts b/packages/cli/register/src/ir-to-fdr-converter/convertTypeShape.ts index 80e58e61965..3d00ea05399 100644 --- a/packages/cli/register/src/ir-to-fdr-converter/convertTypeShape.ts +++ b/packages/cli/register/src/ir-to-fdr-converter/convertTypeShape.ts @@ -1,5 +1,5 @@ import { APIV1Write } from "@fern-api/fdr-sdk"; -import { FernIr as Ir } from "@fern-fern/ir-sdk"; +import { FernIr as Ir } from "@fern-api/ir-sdk"; import { convertIrAvailability } from "./convertPackage"; export function convertTypeShape(irType: Ir.types.Type): APIV1Write.TypeShape { diff --git a/packages/cli/register/src/ir-to-fdr-converter/covertAuth.ts b/packages/cli/register/src/ir-to-fdr-converter/covertAuth.ts index 1010ce4c5d6..10677517ed4 100644 --- a/packages/cli/register/src/ir-to-fdr-converter/covertAuth.ts +++ b/packages/cli/register/src/ir-to-fdr-converter/covertAuth.ts @@ -1,6 +1,6 @@ import { assertNever } from "@fern-api/core-utils"; import { APIV1Write } from "@fern-api/fdr-sdk"; -import { FernIr as Ir } from "@fern-fern/ir-sdk"; +import { FernIr as Ir } from "@fern-api/ir-sdk"; export function convertAuth(auth: Ir.auth.ApiAuth): APIV1Write.ApiAuth | undefined { const scheme = auth.schemes[0]; diff --git a/packages/cli/register/tsconfig.json b/packages/cli/register/tsconfig.json index 9a6b2c49170..11c3863f856 100644 --- a/packages/cli/register/tsconfig.json +++ b/packages/cli/register/tsconfig.json @@ -5,6 +5,7 @@ "references": [ { "path": "../../commons/core-utils" }, { "path": "../../core" }, + { "path": "../../ir-sdk" }, { "path": "../auth" }, { "path": "../config-management/commons" }, { "path": "../generation/ir-generator" }, diff --git a/packages/cli/yaml/yaml-schema/package.json b/packages/cli/yaml/yaml-schema/package.json index b51d252088a..fbf97cbd3a5 100644 --- a/packages/cli/yaml/yaml-schema/package.json +++ b/packages/cli/yaml/yaml-schema/package.json @@ -29,8 +29,8 @@ "dependencies": { "@fern-api/core-utils": "workspace:*", "@fern-api/fs-utils": "workspace:*", + "@fern-api/ir-sdk": "workspace:*", "@fern-fern/docs-config": "0.0.53", - "@fern-fern/ir-sdk": "0.0.3294", "js-yaml": "^4.1.0", "zod": "^3.22.3" }, diff --git a/packages/cli/yaml/yaml-schema/src/utils/recursivelyVisitRawTypeReference.ts b/packages/cli/yaml/yaml-schema/src/utils/recursivelyVisitRawTypeReference.ts index 5ac47073aec..3730eb53603 100644 --- a/packages/cli/yaml/yaml-schema/src/utils/recursivelyVisitRawTypeReference.ts +++ b/packages/cli/yaml/yaml-schema/src/utils/recursivelyVisitRawTypeReference.ts @@ -1,4 +1,4 @@ -import { Literal, PrimitiveType } from "@fern-fern/ir-sdk/api"; +import { Literal, PrimitiveType } from "@fern-api/ir-sdk"; import { visitRawTypeReference } from "./visitRawTypeReference"; export interface RecursiveRawTypeReferenceVisitor { diff --git a/packages/cli/yaml/yaml-schema/src/utils/visitRawTypeReference.ts b/packages/cli/yaml/yaml-schema/src/utils/visitRawTypeReference.ts index 1f6ecbe584c..35fda8a1ec1 100644 --- a/packages/cli/yaml/yaml-schema/src/utils/visitRawTypeReference.ts +++ b/packages/cli/yaml/yaml-schema/src/utils/visitRawTypeReference.ts @@ -1,4 +1,4 @@ -import { Literal, PrimitiveType } from "@fern-fern/ir-sdk/api"; +import { Literal, PrimitiveType } from "@fern-api/ir-sdk"; import { RawPrimitiveType } from "./RawPrimitiveType"; export const FernContainerRegex = { diff --git a/packages/cli/yaml/yaml-schema/tsconfig.json b/packages/cli/yaml/yaml-schema/tsconfig.json index 373f97bd623..efe0bc84e82 100644 --- a/packages/cli/yaml/yaml-schema/tsconfig.json +++ b/packages/cli/yaml/yaml-schema/tsconfig.json @@ -2,5 +2,9 @@ "extends": "../../../../shared/tsconfig.shared.json", "compilerOptions": { "composite": true, "outDir": "lib", "rootDir": "src" }, "include": ["./src"], - "references": [{ "path": "../../../commons/core-utils" }, { "path": "../../../commons/fs-utils" }] + "references": [ + { "path": "../../../commons/core-utils" }, + { "path": "../../../commons/fs-utils" }, + { "path": "../../../ir-sdk" } + ] } diff --git a/packages/generators/cli/package.json b/packages/generators/cli/package.json index 60d81bb3577..3b3c6d0fa2f 100644 --- a/packages/generators/cli/package.json +++ b/packages/generators/cli/package.json @@ -29,10 +29,10 @@ "dependencies": { "@fern-api/fs-utils": "workspace:*", "@fern-api/generator-commons": "workspace:*", + "@fern-api/ir-sdk": "workspace:*", "@fern-api/logger": "workspace:*", "@fern-api/logging-execa": "workspace:*", "@fern-fern/generator-exec-sdk": "^0.0.472", - "@fern-fern/ir-sdk": "0.0.3294", "tmp-promise": "^3.0.3" }, "devDependencies": { diff --git a/packages/generators/cli/src/AbstractGeneratorCli.ts b/packages/generators/cli/src/AbstractGeneratorCli.ts index 2c7fb5322c7..6189e30e227 100644 --- a/packages/generators/cli/src/AbstractGeneratorCli.ts +++ b/packages/generators/cli/src/AbstractGeneratorCli.ts @@ -1,10 +1,10 @@ import { AbsoluteFilePath, join, RelativeFilePath } from "@fern-api/fs-utils"; import { GeneratorContext } from "@fern-api/generator-commons"; +import { IntermediateRepresentation } from "@fern-api/ir-sdk"; import { CONSOLE_LOGGER, createLogger, Logger, LogLevel } from "@fern-api/logger"; import { createLoggingExecutable } from "@fern-api/logging-execa"; import { FernGeneratorExec } from "@fern-fern/generator-exec-sdk"; import * as GeneratorExecParsing from "@fern-fern/generator-exec-sdk/serialization"; -import { IntermediateRepresentation } from "@fern-fern/ir-sdk/api"; import { cp, readdir, readFile } from "fs/promises"; import tmp from "tmp-promise"; import { GeneratorNotificationServiceImpl } from "./GeneratorNotificationService"; diff --git a/packages/generators/cli/src/loadIntermediateRepresentation.ts b/packages/generators/cli/src/loadIntermediateRepresentation.ts index a7672ac559a..42c6f5741c6 100644 --- a/packages/generators/cli/src/loadIntermediateRepresentation.ts +++ b/packages/generators/cli/src/loadIntermediateRepresentation.ts @@ -1,5 +1,5 @@ -import { IntermediateRepresentation } from "@fern-fern/ir-sdk/api"; -import * as IrSerialization from "@fern-fern/ir-sdk/serialization"; +import { IntermediateRepresentation } from "@fern-api/ir-sdk"; +import { serialization as IrSerialization } from "@fern-api/ir-sdk"; import { readFile } from "fs/promises"; export async function loadIntermediateRepresentation(pathToFile: string): Promise { diff --git a/packages/generators/cli/tsconfig.json b/packages/generators/cli/tsconfig.json index 06b8a0a3922..b4410e17177 100644 --- a/packages/generators/cli/tsconfig.json +++ b/packages/generators/cli/tsconfig.json @@ -6,6 +6,7 @@ { "path": "../../cli/logger" }, { "path": "../../commons/fs-utils" }, { "path": "../../commons/logging-execa" }, + { "path": "../../ir-sdk" }, { "path": "../commons" } ] } diff --git a/packages/generators/commons/package.json b/packages/generators/commons/package.json index 6f7af4f1e7e..0bda4dd5d83 100644 --- a/packages/generators/commons/package.json +++ b/packages/generators/commons/package.json @@ -28,10 +28,10 @@ }, "dependencies": { "@fern-api/fs-utils": "workspace:*", + "@fern-api/ir-sdk": "workspace:*", "@fern-api/logger": "workspace:*", "@fern-api/logging-execa": "workspace:*", "@fern-fern/generator-exec-sdk": "^0.0.472", - "@fern-fern/ir-sdk": "0.0.3294", "tmp-promise": "^3.0.3", "zod": "^3.22.3" }, diff --git a/packages/generators/commons/src/ConfigUtilities.ts b/packages/generators/commons/src/ConfigUtilities.ts index b613d786dcd..44bdcc40d9e 100644 --- a/packages/generators/commons/src/ConfigUtilities.ts +++ b/packages/generators/commons/src/ConfigUtilities.ts @@ -1,5 +1,5 @@ +import { HttpPath, IntermediateRepresentation, PathParameter } from "@fern-api/ir-sdk"; import { FernGeneratorExec } from "@fern-fern/generator-exec-sdk"; -import { HttpPath, IntermediateRepresentation, PathParameter } from "@fern-fern/ir-sdk/api"; import { format } from "util"; export function getSdkVersion(config: FernGeneratorExec.GeneratorConfig): string | undefined { diff --git a/packages/generators/commons/tsconfig.json b/packages/generators/commons/tsconfig.json index 2a75b883aa4..1d694f48dd8 100644 --- a/packages/generators/commons/tsconfig.json +++ b/packages/generators/commons/tsconfig.json @@ -5,6 +5,7 @@ "references": [ { "path": "../../cli/logger" }, { "path": "../../commons/fs-utils" }, - { "path": "../../commons/logging-execa" } + { "path": "../../commons/logging-execa" }, + { "path": "../../ir-sdk" } ] } diff --git a/packages/ir-sdk/.depcheckrc.json b/packages/ir-sdk/.depcheckrc.json new file mode 100644 index 00000000000..57573daed03 --- /dev/null +++ b/packages/ir-sdk/.depcheckrc.json @@ -0,0 +1 @@ +{ "ignores": ["@types/jest", "@types/node"], "ignore-patterns": ["lib"] } diff --git a/packages/ir-sdk/.fernignore b/packages/ir-sdk/.fernignore new file mode 100644 index 00000000000..a2e78d7482c --- /dev/null +++ b/packages/ir-sdk/.fernignore @@ -0,0 +1 @@ +index.ts \ No newline at end of file diff --git a/packages/ir-sdk/.mrlint.json b/packages/ir-sdk/.mrlint.json new file mode 100644 index 00000000000..6ca87b96cd4 --- /dev/null +++ b/packages/ir-sdk/.mrlint.json @@ -0,0 +1,11 @@ +{ + "type": "library", + "private": true, + "rules": { + "package-json": { + "scripts": { + "generate": "fern generate --api ir-types-latest --local" + } + } + } +} diff --git a/packages/ir-sdk/.prettierrc.cjs b/packages/ir-sdk/.prettierrc.cjs new file mode 100644 index 00000000000..2b5cf5b0c04 --- /dev/null +++ b/packages/ir-sdk/.prettierrc.cjs @@ -0,0 +1 @@ +module.exports = require("../../.prettierrc.json"); diff --git a/fern/apis/ir-types-v32/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-latest/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v32/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-latest/definition/api.yml diff --git a/fern/apis/ir-types-v26/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-latest/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v26/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-latest/definition/auth.yml diff --git a/fern/apis/ir-types-v30/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-latest/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v30/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-latest/definition/commons.yml diff --git a/fern/apis/ir-types-v10/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-latest/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v10/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-latest/definition/constants.yml diff --git a/fern/apis/ir-types-v10/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-latest/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v10/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-latest/definition/environment.yml diff --git a/fern/apis/ir-types-v10/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-latest/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v10/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-latest/definition/errors.yml diff --git a/fern/apis/ir-types-v32/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-latest/definition/http.yml similarity index 100% rename from fern/apis/ir-types-v32/definition/http.yml rename to packages/ir-sdk/fern/apis/ir-types-latest/definition/http.yml diff --git a/fern/apis/ir-types-v31/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-latest/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v31/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-latest/definition/ir.yml diff --git a/fern/apis/ir-types-v32/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-latest/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v32/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-latest/definition/types.yml diff --git a/fern/apis/ir-types-v16/definition/variables.yml b/packages/ir-sdk/fern/apis/ir-types-latest/definition/variables.yml similarity index 100% rename from fern/apis/ir-types-v16/definition/variables.yml rename to packages/ir-sdk/fern/apis/ir-types-latest/definition/variables.yml diff --git a/fern/apis/ir-types-v24/definition/webhooks.yml b/packages/ir-sdk/fern/apis/ir-types-latest/definition/webhooks.yml similarity index 100% rename from fern/apis/ir-types-v24/definition/webhooks.yml rename to packages/ir-sdk/fern/apis/ir-types-latest/definition/webhooks.yml diff --git a/fern/apis/ir-types-v32/generators.yml b/packages/ir-sdk/fern/apis/ir-types-latest/generators.yml similarity index 78% rename from fern/apis/ir-types-v32/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-latest/generators.yml index c2e965ba75a..4fd04beddd4 100644 --- a/fern/apis/ir-types-v32/generators.yml +++ b/packages/ir-sdk/fern/apis/ir-types-latest/generators.yml @@ -1,6 +1,17 @@ default-group: local groups: local: + generators: + - name: fernapi/fern-typescript-node-sdk + version: 0.8.13 + output: + location: local-file-system + path: ../../../src/sdk + config: + outputSourceFiles: true + includeUtilsOnUnionMembers: true + noOptionalProperties: true + sdks: generators: - name: fernapi/fern-typescript-node-sdk version: 0.8.13 @@ -11,8 +22,6 @@ groups: config: includeUtilsOnUnionMembers: true noOptionalProperties: true - sdks: - generators: - name: fernapi/java-model version: 0.5.20 output: diff --git a/fern/apis/ir-types-v1/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v1/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v1/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v1/definition/api.yml diff --git a/fern/apis/ir-types-v1/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v1/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v1/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v1/definition/auth.yml diff --git a/fern/apis/ir-types-v1/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v1/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v1/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v1/definition/commons.yml diff --git a/fern/apis/ir-types-v1/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v1/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v1/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v1/definition/constants.yml diff --git a/fern/apis/ir-types-v1/definition/declaration.yml b/packages/ir-sdk/fern/apis/ir-types-v1/definition/declaration.yml similarity index 100% rename from fern/apis/ir-types-v1/definition/declaration.yml rename to packages/ir-sdk/fern/apis/ir-types-v1/definition/declaration.yml diff --git a/fern/apis/ir-types-v1/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v1/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v1/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v1/definition/environment.yml diff --git a/fern/apis/ir-types-v1/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v1/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v1/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v1/definition/errors.yml diff --git a/fern/apis/ir-types-v1/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v1/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v1/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v1/definition/ir.yml diff --git a/fern/apis/ir-types-v1/definition/services/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v1/definition/services/commons.yml similarity index 100% rename from fern/apis/ir-types-v1/definition/services/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v1/definition/services/commons.yml diff --git a/fern/apis/ir-types-v1/definition/services/http.yml b/packages/ir-sdk/fern/apis/ir-types-v1/definition/services/http.yml similarity index 100% rename from fern/apis/ir-types-v1/definition/services/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v1/definition/services/http.yml diff --git a/fern/apis/ir-types-v1/definition/services/websocket.yml b/packages/ir-sdk/fern/apis/ir-types-v1/definition/services/websocket.yml similarity index 100% rename from fern/apis/ir-types-v1/definition/services/websocket.yml rename to packages/ir-sdk/fern/apis/ir-types-v1/definition/services/websocket.yml diff --git a/fern/apis/ir-types-v1/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v1/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v1/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v1/definition/types.yml diff --git a/fern/apis/ir-types-v1/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v1/generators.yml similarity index 100% rename from fern/apis/ir-types-v1/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v1/generators.yml diff --git a/fern/apis/ir-types-v10/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v10/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v10/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v10/definition/api.yml diff --git a/fern/apis/ir-types-v10/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v10/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v10/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v10/definition/auth.yml diff --git a/fern/apis/ir-types-v10/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v10/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v10/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v10/definition/commons.yml diff --git a/fern/apis/ir-types-v11/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v10/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v11/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v10/definition/constants.yml diff --git a/fern/apis/ir-types-v11/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v10/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v11/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v10/definition/environment.yml diff --git a/fern/apis/ir-types-v11/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v10/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v11/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v10/definition/errors.yml diff --git a/fern/apis/ir-types-v10/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-v10/definition/http.yml similarity index 100% rename from fern/apis/ir-types-v10/definition/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v10/definition/http.yml diff --git a/fern/apis/ir-types-v10/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v10/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v10/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v10/definition/ir.yml diff --git a/fern/apis/ir-types-v10/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v10/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v10/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v10/definition/types.yml diff --git a/fern/apis/ir-types-v10/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v10/generators.yml similarity index 100% rename from fern/apis/ir-types-v10/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v10/generators.yml diff --git a/fern/apis/ir-types-v11/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v11/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v11/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v11/definition/api.yml diff --git a/fern/apis/ir-types-v11/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v11/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v11/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v11/definition/auth.yml diff --git a/fern/apis/ir-types-v11/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v11/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v11/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v11/definition/commons.yml diff --git a/fern/apis/ir-types-v12/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v11/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v12/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v11/definition/constants.yml diff --git a/fern/apis/ir-types-v12/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v11/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v12/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v11/definition/environment.yml diff --git a/fern/apis/ir-types-v12/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v11/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v12/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v11/definition/errors.yml diff --git a/fern/apis/ir-types-v11/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-v11/definition/http.yml similarity index 100% rename from fern/apis/ir-types-v11/definition/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v11/definition/http.yml diff --git a/fern/apis/ir-types-v11/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v11/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v11/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v11/definition/ir.yml diff --git a/fern/apis/ir-types-v11/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v11/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v11/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v11/definition/types.yml diff --git a/fern/apis/ir-types-v11/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v11/generators.yml similarity index 100% rename from fern/apis/ir-types-v11/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v11/generators.yml diff --git a/fern/apis/ir-types-v12/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v12/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v12/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v12/definition/api.yml diff --git a/fern/apis/ir-types-v12/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v12/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v12/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v12/definition/auth.yml diff --git a/fern/apis/ir-types-v12/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v12/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v12/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v12/definition/commons.yml diff --git a/fern/apis/ir-types-v13/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v12/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v13/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v12/definition/constants.yml diff --git a/fern/apis/ir-types-v13/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v12/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v13/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v12/definition/environment.yml diff --git a/fern/apis/ir-types-v13/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v12/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v13/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v12/definition/errors.yml diff --git a/fern/apis/ir-types-v12/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-v12/definition/http.yml similarity index 100% rename from fern/apis/ir-types-v12/definition/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v12/definition/http.yml diff --git a/fern/apis/ir-types-v12/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v12/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v12/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v12/definition/ir.yml diff --git a/fern/apis/ir-types-v12/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v12/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v12/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v12/definition/types.yml diff --git a/fern/apis/ir-types-v12/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v12/generators.yml similarity index 100% rename from fern/apis/ir-types-v12/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v12/generators.yml diff --git a/fern/apis/ir-types-v13/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v13/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v13/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v13/definition/api.yml diff --git a/fern/apis/ir-types-v13/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v13/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v13/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v13/definition/auth.yml diff --git a/fern/apis/ir-types-v13/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v13/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v13/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v13/definition/commons.yml diff --git a/fern/apis/ir-types-v14/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v13/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v14/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v13/definition/constants.yml diff --git a/fern/apis/ir-types-v14/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v13/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v14/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v13/definition/environment.yml diff --git a/fern/apis/ir-types-v14/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v13/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v14/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v13/definition/errors.yml diff --git a/fern/apis/ir-types-v13/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-v13/definition/http.yml similarity index 100% rename from fern/apis/ir-types-v13/definition/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v13/definition/http.yml diff --git a/fern/apis/ir-types-v13/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v13/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v13/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v13/definition/ir.yml diff --git a/fern/apis/ir-types-v13/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v13/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v13/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v13/definition/types.yml diff --git a/fern/apis/ir-types-v13/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v13/generators.yml similarity index 100% rename from fern/apis/ir-types-v13/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v13/generators.yml diff --git a/fern/apis/ir-types-v14/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v14/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v14/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v14/definition/api.yml diff --git a/fern/apis/ir-types-v14/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v14/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v14/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v14/definition/auth.yml diff --git a/fern/apis/ir-types-v14/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v14/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v14/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v14/definition/commons.yml diff --git a/fern/apis/ir-types-v15/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v14/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v15/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v14/definition/constants.yml diff --git a/fern/apis/ir-types-v15/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v14/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v15/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v14/definition/environment.yml diff --git a/fern/apis/ir-types-v15/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v14/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v15/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v14/definition/errors.yml diff --git a/fern/apis/ir-types-v14/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-v14/definition/http.yml similarity index 100% rename from fern/apis/ir-types-v14/definition/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v14/definition/http.yml diff --git a/fern/apis/ir-types-v14/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v14/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v14/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v14/definition/ir.yml diff --git a/fern/apis/ir-types-v14/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v14/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v14/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v14/definition/types.yml diff --git a/fern/apis/ir-types-v14/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v14/generators.yml similarity index 100% rename from fern/apis/ir-types-v14/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v14/generators.yml diff --git a/fern/apis/ir-types-v15/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v15/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v15/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v15/definition/api.yml diff --git a/fern/apis/ir-types-v15/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v15/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v15/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v15/definition/auth.yml diff --git a/fern/apis/ir-types-v15/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v15/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v15/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v15/definition/commons.yml diff --git a/fern/apis/ir-types-v16/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v15/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v16/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v15/definition/constants.yml diff --git a/fern/apis/ir-types-v16/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v15/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v16/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v15/definition/environment.yml diff --git a/fern/apis/ir-types-v16/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v15/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v16/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v15/definition/errors.yml diff --git a/fern/apis/ir-types-v15/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-v15/definition/http.yml similarity index 100% rename from fern/apis/ir-types-v15/definition/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v15/definition/http.yml diff --git a/fern/apis/ir-types-v15/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v15/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v15/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v15/definition/ir.yml diff --git a/fern/apis/ir-types-v15/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v15/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v15/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v15/definition/types.yml diff --git a/fern/apis/ir-types-v15/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v15/generators.yml similarity index 100% rename from fern/apis/ir-types-v15/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v15/generators.yml diff --git a/fern/apis/ir-types-v16/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v16/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v16/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v16/definition/api.yml diff --git a/fern/apis/ir-types-v16/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v16/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v16/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v16/definition/auth.yml diff --git a/fern/apis/ir-types-v16/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v16/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v16/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v16/definition/commons.yml diff --git a/fern/apis/ir-types-v17/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v16/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v17/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v16/definition/constants.yml diff --git a/fern/apis/ir-types-v17/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v16/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v17/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v16/definition/environment.yml diff --git a/fern/apis/ir-types-v17/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v16/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v17/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v16/definition/errors.yml diff --git a/fern/apis/ir-types-v16/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-v16/definition/http.yml similarity index 100% rename from fern/apis/ir-types-v16/definition/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v16/definition/http.yml diff --git a/fern/apis/ir-types-v16/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v16/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v16/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v16/definition/ir.yml diff --git a/fern/apis/ir-types-v16/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v16/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v16/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v16/definition/types.yml diff --git a/fern/apis/ir-types-v17/definition/variables.yml b/packages/ir-sdk/fern/apis/ir-types-v16/definition/variables.yml similarity index 100% rename from fern/apis/ir-types-v17/definition/variables.yml rename to packages/ir-sdk/fern/apis/ir-types-v16/definition/variables.yml diff --git a/fern/apis/ir-types-v16/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v16/generators.yml similarity index 100% rename from fern/apis/ir-types-v16/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v16/generators.yml diff --git a/fern/apis/ir-types-v17/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v17/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v17/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v17/definition/api.yml diff --git a/fern/apis/ir-types-v17/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v17/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v17/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v17/definition/auth.yml diff --git a/fern/apis/ir-types-v17/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v17/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v17/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v17/definition/commons.yml diff --git a/fern/apis/ir-types-v18/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v17/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v18/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v17/definition/constants.yml diff --git a/fern/apis/ir-types-v18/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v17/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v18/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v17/definition/environment.yml diff --git a/fern/apis/ir-types-v18/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v17/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v18/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v17/definition/errors.yml diff --git a/fern/apis/ir-types-v17/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-v17/definition/http.yml similarity index 100% rename from fern/apis/ir-types-v17/definition/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v17/definition/http.yml diff --git a/fern/apis/ir-types-v17/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v17/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v17/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v17/definition/ir.yml diff --git a/fern/apis/ir-types-v17/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v17/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v17/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v17/definition/types.yml diff --git a/fern/apis/ir-types-v18/definition/variables.yml b/packages/ir-sdk/fern/apis/ir-types-v17/definition/variables.yml similarity index 100% rename from fern/apis/ir-types-v18/definition/variables.yml rename to packages/ir-sdk/fern/apis/ir-types-v17/definition/variables.yml diff --git a/fern/apis/ir-types-v17/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v17/generators.yml similarity index 100% rename from fern/apis/ir-types-v17/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v17/generators.yml diff --git a/fern/apis/ir-types-v18/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v18/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v18/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v18/definition/api.yml diff --git a/fern/apis/ir-types-v18/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v18/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v18/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v18/definition/auth.yml diff --git a/fern/apis/ir-types-v18/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v18/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v18/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v18/definition/commons.yml diff --git a/fern/apis/ir-types-v19/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v18/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v19/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v18/definition/constants.yml diff --git a/fern/apis/ir-types-v19/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v18/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v19/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v18/definition/environment.yml diff --git a/fern/apis/ir-types-v19/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v18/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v19/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v18/definition/errors.yml diff --git a/fern/apis/ir-types-v18/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-v18/definition/http.yml similarity index 100% rename from fern/apis/ir-types-v18/definition/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v18/definition/http.yml diff --git a/fern/apis/ir-types-v18/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v18/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v18/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v18/definition/ir.yml diff --git a/fern/apis/ir-types-v18/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v18/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v18/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v18/definition/types.yml diff --git a/fern/apis/ir-types-v19/definition/variables.yml b/packages/ir-sdk/fern/apis/ir-types-v18/definition/variables.yml similarity index 100% rename from fern/apis/ir-types-v19/definition/variables.yml rename to packages/ir-sdk/fern/apis/ir-types-v18/definition/variables.yml diff --git a/fern/apis/ir-types-v18/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v18/generators.yml similarity index 100% rename from fern/apis/ir-types-v18/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v18/generators.yml diff --git a/fern/apis/ir-types-v19/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v19/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v19/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v19/definition/api.yml diff --git a/fern/apis/ir-types-v19/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v19/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v19/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v19/definition/auth.yml diff --git a/fern/apis/ir-types-v19/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v19/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v19/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v19/definition/commons.yml diff --git a/fern/apis/ir-types-v20/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v19/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v20/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v19/definition/constants.yml diff --git a/fern/apis/ir-types-v20/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v19/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v20/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v19/definition/environment.yml diff --git a/fern/apis/ir-types-v20/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v19/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v20/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v19/definition/errors.yml diff --git a/fern/apis/ir-types-v19/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-v19/definition/http.yml similarity index 100% rename from fern/apis/ir-types-v19/definition/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v19/definition/http.yml diff --git a/fern/apis/ir-types-v19/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v19/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v19/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v19/definition/ir.yml diff --git a/fern/apis/ir-types-v19/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v19/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v19/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v19/definition/types.yml diff --git a/fern/apis/ir-types-v20/definition/variables.yml b/packages/ir-sdk/fern/apis/ir-types-v19/definition/variables.yml similarity index 100% rename from fern/apis/ir-types-v20/definition/variables.yml rename to packages/ir-sdk/fern/apis/ir-types-v19/definition/variables.yml diff --git a/fern/apis/ir-types-v19/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v19/generators.yml similarity index 100% rename from fern/apis/ir-types-v19/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v19/generators.yml diff --git a/fern/apis/ir-types-v2/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v2/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v2/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v2/definition/api.yml diff --git a/fern/apis/ir-types-v2/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v2/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v2/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v2/definition/auth.yml diff --git a/fern/apis/ir-types-v2/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v2/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v2/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v2/definition/commons.yml diff --git a/fern/apis/ir-types-v2/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v2/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v2/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v2/definition/constants.yml diff --git a/fern/apis/ir-types-v2/definition/declaration.yml b/packages/ir-sdk/fern/apis/ir-types-v2/definition/declaration.yml similarity index 100% rename from fern/apis/ir-types-v2/definition/declaration.yml rename to packages/ir-sdk/fern/apis/ir-types-v2/definition/declaration.yml diff --git a/fern/apis/ir-types-v2/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v2/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v2/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v2/definition/environment.yml diff --git a/fern/apis/ir-types-v2/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v2/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v2/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v2/definition/errors.yml diff --git a/fern/apis/ir-types-v2/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v2/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v2/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v2/definition/ir.yml diff --git a/fern/apis/ir-types-v2/definition/services/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v2/definition/services/commons.yml similarity index 100% rename from fern/apis/ir-types-v2/definition/services/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v2/definition/services/commons.yml diff --git a/fern/apis/ir-types-v2/definition/services/http.yml b/packages/ir-sdk/fern/apis/ir-types-v2/definition/services/http.yml similarity index 100% rename from fern/apis/ir-types-v2/definition/services/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v2/definition/services/http.yml diff --git a/fern/apis/ir-types-v2/definition/services/websocket.yml b/packages/ir-sdk/fern/apis/ir-types-v2/definition/services/websocket.yml similarity index 100% rename from fern/apis/ir-types-v2/definition/services/websocket.yml rename to packages/ir-sdk/fern/apis/ir-types-v2/definition/services/websocket.yml diff --git a/fern/apis/ir-types-v2/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v2/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v2/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v2/definition/types.yml diff --git a/fern/apis/ir-types-v2/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v2/generators.yml similarity index 100% rename from fern/apis/ir-types-v2/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v2/generators.yml diff --git a/fern/apis/ir-types-v20/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v20/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v20/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v20/definition/api.yml diff --git a/fern/apis/ir-types-v20/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v20/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v20/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v20/definition/auth.yml diff --git a/fern/apis/ir-types-v20/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v20/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v20/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v20/definition/commons.yml diff --git a/fern/apis/ir-types-v21/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v20/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v21/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v20/definition/constants.yml diff --git a/fern/apis/ir-types-v21/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v20/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v21/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v20/definition/environment.yml diff --git a/fern/apis/ir-types-v21/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v20/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v21/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v20/definition/errors.yml diff --git a/fern/apis/ir-types-v20/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-v20/definition/http.yml similarity index 100% rename from fern/apis/ir-types-v20/definition/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v20/definition/http.yml diff --git a/fern/apis/ir-types-v20/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v20/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v20/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v20/definition/ir.yml diff --git a/fern/apis/ir-types-v20/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v20/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v20/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v20/definition/types.yml diff --git a/fern/apis/ir-types-v21/definition/variables.yml b/packages/ir-sdk/fern/apis/ir-types-v20/definition/variables.yml similarity index 100% rename from fern/apis/ir-types-v21/definition/variables.yml rename to packages/ir-sdk/fern/apis/ir-types-v20/definition/variables.yml diff --git a/fern/apis/ir-types-v20/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v20/generators.yml similarity index 100% rename from fern/apis/ir-types-v20/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v20/generators.yml diff --git a/fern/apis/ir-types-v21/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v21/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v21/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v21/definition/api.yml diff --git a/fern/apis/ir-types-v21/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v21/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v21/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v21/definition/auth.yml diff --git a/fern/apis/ir-types-v21/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v21/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v21/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v21/definition/commons.yml diff --git a/fern/apis/ir-types-v22/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v21/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v22/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v21/definition/constants.yml diff --git a/fern/apis/ir-types-v22/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v21/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v22/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v21/definition/environment.yml diff --git a/fern/apis/ir-types-v22/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v21/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v22/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v21/definition/errors.yml diff --git a/fern/apis/ir-types-v21/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-v21/definition/http.yml similarity index 100% rename from fern/apis/ir-types-v21/definition/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v21/definition/http.yml diff --git a/fern/apis/ir-types-v21/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v21/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v21/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v21/definition/ir.yml diff --git a/fern/apis/ir-types-v21/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v21/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v21/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v21/definition/types.yml diff --git a/fern/apis/ir-types-v22/definition/variables.yml b/packages/ir-sdk/fern/apis/ir-types-v21/definition/variables.yml similarity index 100% rename from fern/apis/ir-types-v22/definition/variables.yml rename to packages/ir-sdk/fern/apis/ir-types-v21/definition/variables.yml diff --git a/fern/apis/ir-types-v21/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v21/generators.yml similarity index 100% rename from fern/apis/ir-types-v21/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v21/generators.yml diff --git a/fern/apis/ir-types-v22/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v22/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v22/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v22/definition/api.yml diff --git a/fern/apis/ir-types-v22/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v22/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v22/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v22/definition/auth.yml diff --git a/fern/apis/ir-types-v22/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v22/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v22/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v22/definition/commons.yml diff --git a/fern/apis/ir-types-v23/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v22/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v23/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v22/definition/constants.yml diff --git a/fern/apis/ir-types-v23/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v22/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v23/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v22/definition/environment.yml diff --git a/fern/apis/ir-types-v23/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v22/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v23/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v22/definition/errors.yml diff --git a/fern/apis/ir-types-v22/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-v22/definition/http.yml similarity index 100% rename from fern/apis/ir-types-v22/definition/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v22/definition/http.yml diff --git a/fern/apis/ir-types-v22/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v22/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v22/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v22/definition/ir.yml diff --git a/fern/apis/ir-types-v22/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v22/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v22/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v22/definition/types.yml diff --git a/fern/apis/ir-types-v23/definition/variables.yml b/packages/ir-sdk/fern/apis/ir-types-v22/definition/variables.yml similarity index 100% rename from fern/apis/ir-types-v23/definition/variables.yml rename to packages/ir-sdk/fern/apis/ir-types-v22/definition/variables.yml diff --git a/fern/apis/ir-types-v22/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v22/generators.yml similarity index 100% rename from fern/apis/ir-types-v22/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v22/generators.yml diff --git a/fern/apis/ir-types-v23/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v23/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v23/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v23/definition/api.yml diff --git a/fern/apis/ir-types-v23/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v23/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v23/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v23/definition/auth.yml diff --git a/fern/apis/ir-types-v23/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v23/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v23/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v23/definition/commons.yml diff --git a/fern/apis/ir-types-v24/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v23/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v24/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v23/definition/constants.yml diff --git a/fern/apis/ir-types-v24/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v23/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v24/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v23/definition/environment.yml diff --git a/fern/apis/ir-types-v24/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v23/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v24/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v23/definition/errors.yml diff --git a/fern/apis/ir-types-v23/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-v23/definition/http.yml similarity index 100% rename from fern/apis/ir-types-v23/definition/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v23/definition/http.yml diff --git a/fern/apis/ir-types-v23/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v23/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v23/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v23/definition/ir.yml diff --git a/fern/apis/ir-types-v23/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v23/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v23/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v23/definition/types.yml diff --git a/fern/apis/ir-types-v24/definition/variables.yml b/packages/ir-sdk/fern/apis/ir-types-v23/definition/variables.yml similarity index 100% rename from fern/apis/ir-types-v24/definition/variables.yml rename to packages/ir-sdk/fern/apis/ir-types-v23/definition/variables.yml diff --git a/fern/apis/ir-types-v23/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v23/generators.yml similarity index 100% rename from fern/apis/ir-types-v23/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v23/generators.yml diff --git a/fern/apis/ir-types-v24/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v24/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v24/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v24/definition/api.yml diff --git a/fern/apis/ir-types-v24/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v24/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v24/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v24/definition/auth.yml diff --git a/fern/apis/ir-types-v24/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v24/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v24/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v24/definition/commons.yml diff --git a/fern/apis/ir-types-v25/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v24/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v25/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v24/definition/constants.yml diff --git a/fern/apis/ir-types-v25/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v24/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v25/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v24/definition/environment.yml diff --git a/fern/apis/ir-types-v25/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v24/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v25/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v24/definition/errors.yml diff --git a/fern/apis/ir-types-v24/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-v24/definition/http.yml similarity index 100% rename from fern/apis/ir-types-v24/definition/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v24/definition/http.yml diff --git a/fern/apis/ir-types-v24/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v24/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v24/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v24/definition/ir.yml diff --git a/fern/apis/ir-types-v24/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v24/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v24/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v24/definition/types.yml diff --git a/fern/apis/ir-types-v25/definition/variables.yml b/packages/ir-sdk/fern/apis/ir-types-v24/definition/variables.yml similarity index 100% rename from fern/apis/ir-types-v25/definition/variables.yml rename to packages/ir-sdk/fern/apis/ir-types-v24/definition/variables.yml diff --git a/fern/apis/ir-types-v25/definition/webhooks.yml b/packages/ir-sdk/fern/apis/ir-types-v24/definition/webhooks.yml similarity index 100% rename from fern/apis/ir-types-v25/definition/webhooks.yml rename to packages/ir-sdk/fern/apis/ir-types-v24/definition/webhooks.yml diff --git a/fern/apis/ir-types-v24/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v24/generators.yml similarity index 100% rename from fern/apis/ir-types-v24/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v24/generators.yml diff --git a/fern/apis/ir-types-v25/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v25/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v25/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v25/definition/api.yml diff --git a/fern/apis/ir-types-v25/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v25/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v25/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v25/definition/auth.yml diff --git a/fern/apis/ir-types-v25/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v25/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v25/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v25/definition/commons.yml diff --git a/fern/apis/ir-types-v26/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v25/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v26/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v25/definition/constants.yml diff --git a/fern/apis/ir-types-v26/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v25/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v26/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v25/definition/environment.yml diff --git a/fern/apis/ir-types-v26/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v25/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v26/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v25/definition/errors.yml diff --git a/fern/apis/ir-types-v25/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-v25/definition/http.yml similarity index 100% rename from fern/apis/ir-types-v25/definition/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v25/definition/http.yml diff --git a/fern/apis/ir-types-v25/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v25/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v25/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v25/definition/ir.yml diff --git a/fern/apis/ir-types-v25/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v25/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v25/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v25/definition/types.yml diff --git a/fern/apis/ir-types-v26/definition/variables.yml b/packages/ir-sdk/fern/apis/ir-types-v25/definition/variables.yml similarity index 100% rename from fern/apis/ir-types-v26/definition/variables.yml rename to packages/ir-sdk/fern/apis/ir-types-v25/definition/variables.yml diff --git a/fern/apis/ir-types-v26/definition/webhooks.yml b/packages/ir-sdk/fern/apis/ir-types-v25/definition/webhooks.yml similarity index 100% rename from fern/apis/ir-types-v26/definition/webhooks.yml rename to packages/ir-sdk/fern/apis/ir-types-v25/definition/webhooks.yml diff --git a/fern/apis/ir-types-v25/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v25/generators.yml similarity index 100% rename from fern/apis/ir-types-v25/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v25/generators.yml diff --git a/fern/apis/ir-types-v26/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v26/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v26/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v26/definition/api.yml diff --git a/fern/apis/ir-types-v27/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v26/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v27/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v26/definition/auth.yml diff --git a/fern/apis/ir-types-v26/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v26/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v26/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v26/definition/commons.yml diff --git a/fern/apis/ir-types-v27/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v26/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v27/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v26/definition/constants.yml diff --git a/fern/apis/ir-types-v27/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v26/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v27/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v26/definition/environment.yml diff --git a/fern/apis/ir-types-v27/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v26/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v27/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v26/definition/errors.yml diff --git a/fern/apis/ir-types-v26/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-v26/definition/http.yml similarity index 100% rename from fern/apis/ir-types-v26/definition/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v26/definition/http.yml diff --git a/fern/apis/ir-types-v26/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v26/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v26/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v26/definition/ir.yml diff --git a/fern/apis/ir-types-v26/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v26/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v26/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v26/definition/types.yml diff --git a/fern/apis/ir-types-v27/definition/variables.yml b/packages/ir-sdk/fern/apis/ir-types-v26/definition/variables.yml similarity index 100% rename from fern/apis/ir-types-v27/definition/variables.yml rename to packages/ir-sdk/fern/apis/ir-types-v26/definition/variables.yml diff --git a/fern/apis/ir-types-v27/definition/webhooks.yml b/packages/ir-sdk/fern/apis/ir-types-v26/definition/webhooks.yml similarity index 100% rename from fern/apis/ir-types-v27/definition/webhooks.yml rename to packages/ir-sdk/fern/apis/ir-types-v26/definition/webhooks.yml diff --git a/fern/apis/ir-types-v26/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v26/generators.yml similarity index 100% rename from fern/apis/ir-types-v26/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v26/generators.yml diff --git a/fern/apis/ir-types-v27/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v27/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v27/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v27/definition/api.yml diff --git a/fern/apis/ir-types-v28/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v27/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v28/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v27/definition/auth.yml diff --git a/fern/apis/ir-types-v27/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v27/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v27/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v27/definition/commons.yml diff --git a/fern/apis/ir-types-v28/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v27/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v28/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v27/definition/constants.yml diff --git a/fern/apis/ir-types-v28/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v27/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v28/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v27/definition/environment.yml diff --git a/fern/apis/ir-types-v28/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v27/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v28/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v27/definition/errors.yml diff --git a/fern/apis/ir-types-v27/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-v27/definition/http.yml similarity index 100% rename from fern/apis/ir-types-v27/definition/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v27/definition/http.yml diff --git a/fern/apis/ir-types-v27/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v27/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v27/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v27/definition/ir.yml diff --git a/fern/apis/ir-types-v27/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v27/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v27/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v27/definition/types.yml diff --git a/fern/apis/ir-types-v28/definition/variables.yml b/packages/ir-sdk/fern/apis/ir-types-v27/definition/variables.yml similarity index 100% rename from fern/apis/ir-types-v28/definition/variables.yml rename to packages/ir-sdk/fern/apis/ir-types-v27/definition/variables.yml diff --git a/fern/apis/ir-types-v28/definition/webhooks.yml b/packages/ir-sdk/fern/apis/ir-types-v27/definition/webhooks.yml similarity index 100% rename from fern/apis/ir-types-v28/definition/webhooks.yml rename to packages/ir-sdk/fern/apis/ir-types-v27/definition/webhooks.yml diff --git a/fern/apis/ir-types-v27/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v27/generators.yml similarity index 100% rename from fern/apis/ir-types-v27/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v27/generators.yml diff --git a/fern/apis/ir-types-v28/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v28/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v28/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v28/definition/api.yml diff --git a/fern/apis/ir-types-v29/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v28/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v29/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v28/definition/auth.yml diff --git a/fern/apis/ir-types-v28/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v28/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v28/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v28/definition/commons.yml diff --git a/fern/apis/ir-types-v29/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v28/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v29/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v28/definition/constants.yml diff --git a/fern/apis/ir-types-v29/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v28/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v29/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v28/definition/environment.yml diff --git a/fern/apis/ir-types-v29/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v28/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v29/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v28/definition/errors.yml diff --git a/fern/apis/ir-types-v28/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-v28/definition/http.yml similarity index 100% rename from fern/apis/ir-types-v28/definition/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v28/definition/http.yml diff --git a/fern/apis/ir-types-v28/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v28/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v28/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v28/definition/ir.yml diff --git a/fern/apis/ir-types-v28/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v28/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v28/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v28/definition/types.yml diff --git a/fern/apis/ir-types-v29/definition/variables.yml b/packages/ir-sdk/fern/apis/ir-types-v28/definition/variables.yml similarity index 100% rename from fern/apis/ir-types-v29/definition/variables.yml rename to packages/ir-sdk/fern/apis/ir-types-v28/definition/variables.yml diff --git a/fern/apis/ir-types-v29/definition/webhooks.yml b/packages/ir-sdk/fern/apis/ir-types-v28/definition/webhooks.yml similarity index 100% rename from fern/apis/ir-types-v29/definition/webhooks.yml rename to packages/ir-sdk/fern/apis/ir-types-v28/definition/webhooks.yml diff --git a/fern/apis/ir-types-v28/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v28/generators.yml similarity index 100% rename from fern/apis/ir-types-v28/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v28/generators.yml diff --git a/fern/apis/ir-types-v29/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v29/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v29/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v29/definition/api.yml diff --git a/fern/apis/ir-types-v30/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v29/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v30/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v29/definition/auth.yml diff --git a/fern/apis/ir-types-v29/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v29/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v29/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v29/definition/commons.yml diff --git a/fern/apis/ir-types-v30/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v29/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v30/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v29/definition/constants.yml diff --git a/fern/apis/ir-types-v30/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v29/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v30/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v29/definition/environment.yml diff --git a/fern/apis/ir-types-v30/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v29/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v30/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v29/definition/errors.yml diff --git a/fern/apis/ir-types-v29/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-v29/definition/http.yml similarity index 100% rename from fern/apis/ir-types-v29/definition/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v29/definition/http.yml diff --git a/fern/apis/ir-types-v29/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v29/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v29/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v29/definition/ir.yml diff --git a/fern/apis/ir-types-v29/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v29/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v29/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v29/definition/types.yml diff --git a/fern/apis/ir-types-v30/definition/variables.yml b/packages/ir-sdk/fern/apis/ir-types-v29/definition/variables.yml similarity index 100% rename from fern/apis/ir-types-v30/definition/variables.yml rename to packages/ir-sdk/fern/apis/ir-types-v29/definition/variables.yml diff --git a/fern/apis/ir-types-v30/definition/webhooks.yml b/packages/ir-sdk/fern/apis/ir-types-v29/definition/webhooks.yml similarity index 100% rename from fern/apis/ir-types-v30/definition/webhooks.yml rename to packages/ir-sdk/fern/apis/ir-types-v29/definition/webhooks.yml diff --git a/fern/apis/ir-types-v29/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v29/generators.yml similarity index 100% rename from fern/apis/ir-types-v29/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v29/generators.yml diff --git a/fern/apis/ir-types-v3/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v3/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v3/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v3/definition/api.yml diff --git a/fern/apis/ir-types-v3/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v3/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v3/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v3/definition/auth.yml diff --git a/fern/apis/ir-types-v3/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v3/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v3/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v3/definition/commons.yml diff --git a/fern/apis/ir-types-v3/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v3/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v3/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v3/definition/constants.yml diff --git a/fern/apis/ir-types-v3/definition/declaration.yml b/packages/ir-sdk/fern/apis/ir-types-v3/definition/declaration.yml similarity index 100% rename from fern/apis/ir-types-v3/definition/declaration.yml rename to packages/ir-sdk/fern/apis/ir-types-v3/definition/declaration.yml diff --git a/fern/apis/ir-types-v3/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v3/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v3/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v3/definition/environment.yml diff --git a/fern/apis/ir-types-v3/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v3/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v3/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v3/definition/errors.yml diff --git a/fern/apis/ir-types-v3/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v3/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v3/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v3/definition/ir.yml diff --git a/fern/apis/ir-types-v3/definition/services/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v3/definition/services/commons.yml similarity index 100% rename from fern/apis/ir-types-v3/definition/services/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v3/definition/services/commons.yml diff --git a/fern/apis/ir-types-v3/definition/services/http.yml b/packages/ir-sdk/fern/apis/ir-types-v3/definition/services/http.yml similarity index 100% rename from fern/apis/ir-types-v3/definition/services/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v3/definition/services/http.yml diff --git a/fern/apis/ir-types-v3/definition/services/websocket.yml b/packages/ir-sdk/fern/apis/ir-types-v3/definition/services/websocket.yml similarity index 100% rename from fern/apis/ir-types-v3/definition/services/websocket.yml rename to packages/ir-sdk/fern/apis/ir-types-v3/definition/services/websocket.yml diff --git a/fern/apis/ir-types-v3/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v3/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v3/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v3/definition/types.yml diff --git a/fern/apis/ir-types-v3/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v3/generators.yml similarity index 100% rename from fern/apis/ir-types-v3/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v3/generators.yml diff --git a/fern/apis/ir-types-v30/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v30/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v30/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v30/definition/api.yml diff --git a/fern/apis/ir-types-v31/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v30/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v31/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v30/definition/auth.yml diff --git a/fern/apis/ir-types-v31/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v30/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v31/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v30/definition/commons.yml diff --git a/fern/apis/ir-types-v31/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v30/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v31/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v30/definition/constants.yml diff --git a/fern/apis/ir-types-v31/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v30/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v31/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v30/definition/environment.yml diff --git a/fern/apis/ir-types-v31/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v30/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v31/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v30/definition/errors.yml diff --git a/fern/apis/ir-types-v30/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-v30/definition/http.yml similarity index 100% rename from fern/apis/ir-types-v30/definition/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v30/definition/http.yml diff --git a/fern/apis/ir-types-v30/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v30/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v30/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v30/definition/ir.yml diff --git a/fern/apis/ir-types-v30/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v30/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v30/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v30/definition/types.yml diff --git a/fern/apis/ir-types-v31/definition/variables.yml b/packages/ir-sdk/fern/apis/ir-types-v30/definition/variables.yml similarity index 100% rename from fern/apis/ir-types-v31/definition/variables.yml rename to packages/ir-sdk/fern/apis/ir-types-v30/definition/variables.yml diff --git a/fern/apis/ir-types-v31/definition/webhooks.yml b/packages/ir-sdk/fern/apis/ir-types-v30/definition/webhooks.yml similarity index 100% rename from fern/apis/ir-types-v31/definition/webhooks.yml rename to packages/ir-sdk/fern/apis/ir-types-v30/definition/webhooks.yml diff --git a/fern/apis/ir-types-v30/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v30/generators.yml similarity index 100% rename from fern/apis/ir-types-v30/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v30/generators.yml diff --git a/fern/apis/ir-types-v31/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v31/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v31/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v31/definition/api.yml diff --git a/fern/apis/ir-types-v32/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v31/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v32/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v31/definition/auth.yml diff --git a/fern/apis/ir-types-v32/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v31/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v32/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v31/definition/commons.yml diff --git a/fern/apis/ir-types-v32/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v31/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v32/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v31/definition/constants.yml diff --git a/fern/apis/ir-types-v32/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v31/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v32/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v31/definition/environment.yml diff --git a/fern/apis/ir-types-v32/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v31/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v32/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v31/definition/errors.yml diff --git a/fern/apis/ir-types-v31/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-v31/definition/http.yml similarity index 100% rename from fern/apis/ir-types-v31/definition/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v31/definition/http.yml diff --git a/fern/apis/ir-types-v32/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v31/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v32/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v31/definition/ir.yml diff --git a/fern/apis/ir-types-v31/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v31/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v31/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v31/definition/types.yml diff --git a/fern/apis/ir-types-v32/definition/variables.yml b/packages/ir-sdk/fern/apis/ir-types-v31/definition/variables.yml similarity index 100% rename from fern/apis/ir-types-v32/definition/variables.yml rename to packages/ir-sdk/fern/apis/ir-types-v31/definition/variables.yml diff --git a/fern/apis/ir-types-v32/definition/webhooks.yml b/packages/ir-sdk/fern/apis/ir-types-v31/definition/webhooks.yml similarity index 100% rename from fern/apis/ir-types-v32/definition/webhooks.yml rename to packages/ir-sdk/fern/apis/ir-types-v31/definition/webhooks.yml diff --git a/fern/apis/ir-types-v31/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v31/generators.yml similarity index 100% rename from fern/apis/ir-types-v31/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v31/generators.yml diff --git a/fern/apis/ir-types-v4/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v4/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v4/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v4/definition/api.yml diff --git a/fern/apis/ir-types-v4/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v4/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v4/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v4/definition/auth.yml diff --git a/fern/apis/ir-types-v4/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v4/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v4/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v4/definition/commons.yml diff --git a/fern/apis/ir-types-v4/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v4/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v4/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v4/definition/constants.yml diff --git a/fern/apis/ir-types-v4/definition/declaration.yml b/packages/ir-sdk/fern/apis/ir-types-v4/definition/declaration.yml similarity index 100% rename from fern/apis/ir-types-v4/definition/declaration.yml rename to packages/ir-sdk/fern/apis/ir-types-v4/definition/declaration.yml diff --git a/fern/apis/ir-types-v4/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v4/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v4/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v4/definition/environment.yml diff --git a/fern/apis/ir-types-v4/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v4/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v4/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v4/definition/errors.yml diff --git a/fern/apis/ir-types-v4/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v4/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v4/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v4/definition/ir.yml diff --git a/fern/apis/ir-types-v4/definition/services/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v4/definition/services/commons.yml similarity index 100% rename from fern/apis/ir-types-v4/definition/services/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v4/definition/services/commons.yml diff --git a/fern/apis/ir-types-v4/definition/services/http.yml b/packages/ir-sdk/fern/apis/ir-types-v4/definition/services/http.yml similarity index 100% rename from fern/apis/ir-types-v4/definition/services/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v4/definition/services/http.yml diff --git a/fern/apis/ir-types-v4/definition/services/websocket.yml b/packages/ir-sdk/fern/apis/ir-types-v4/definition/services/websocket.yml similarity index 100% rename from fern/apis/ir-types-v4/definition/services/websocket.yml rename to packages/ir-sdk/fern/apis/ir-types-v4/definition/services/websocket.yml diff --git a/fern/apis/ir-types-v4/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v4/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v4/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v4/definition/types.yml diff --git a/fern/apis/ir-types-v4/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v4/generators.yml similarity index 100% rename from fern/apis/ir-types-v4/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v4/generators.yml diff --git a/fern/apis/ir-types-v5/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v5/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v5/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v5/definition/api.yml diff --git a/fern/apis/ir-types-v5/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v5/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v5/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v5/definition/auth.yml diff --git a/fern/apis/ir-types-v5/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v5/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v5/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v5/definition/commons.yml diff --git a/fern/apis/ir-types-v5/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v5/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v5/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v5/definition/constants.yml diff --git a/fern/apis/ir-types-v5/definition/declaration.yml b/packages/ir-sdk/fern/apis/ir-types-v5/definition/declaration.yml similarity index 100% rename from fern/apis/ir-types-v5/definition/declaration.yml rename to packages/ir-sdk/fern/apis/ir-types-v5/definition/declaration.yml diff --git a/fern/apis/ir-types-v5/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v5/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v5/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v5/definition/environment.yml diff --git a/fern/apis/ir-types-v5/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v5/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v5/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v5/definition/errors.yml diff --git a/fern/apis/ir-types-v5/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-v5/definition/http.yml similarity index 100% rename from fern/apis/ir-types-v5/definition/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v5/definition/http.yml diff --git a/fern/apis/ir-types-v5/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v5/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v5/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v5/definition/ir.yml diff --git a/fern/apis/ir-types-v5/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v5/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v5/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v5/definition/types.yml diff --git a/fern/apis/ir-types-v5/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v5/generators.yml similarity index 100% rename from fern/apis/ir-types-v5/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v5/generators.yml diff --git a/fern/apis/ir-types-v6/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v6/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v6/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v6/definition/api.yml diff --git a/fern/apis/ir-types-v6/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v6/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v6/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v6/definition/auth.yml diff --git a/fern/apis/ir-types-v6/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v6/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v6/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v6/definition/commons.yml diff --git a/fern/apis/ir-types-v6/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v6/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v6/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v6/definition/constants.yml diff --git a/fern/apis/ir-types-v6/definition/declaration.yml b/packages/ir-sdk/fern/apis/ir-types-v6/definition/declaration.yml similarity index 100% rename from fern/apis/ir-types-v6/definition/declaration.yml rename to packages/ir-sdk/fern/apis/ir-types-v6/definition/declaration.yml diff --git a/fern/apis/ir-types-v6/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v6/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v6/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v6/definition/environment.yml diff --git a/fern/apis/ir-types-v6/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v6/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v6/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v6/definition/errors.yml diff --git a/fern/apis/ir-types-v6/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-v6/definition/http.yml similarity index 100% rename from fern/apis/ir-types-v6/definition/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v6/definition/http.yml diff --git a/fern/apis/ir-types-v6/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v6/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v6/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v6/definition/ir.yml diff --git a/fern/apis/ir-types-v6/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v6/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v6/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v6/definition/types.yml diff --git a/fern/apis/ir-types-v6/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v6/generators.yml similarity index 100% rename from fern/apis/ir-types-v6/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v6/generators.yml diff --git a/fern/apis/ir-types-v7/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v7/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v7/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v7/definition/api.yml diff --git a/fern/apis/ir-types-v7/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v7/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v7/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v7/definition/auth.yml diff --git a/fern/apis/ir-types-v7/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v7/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v7/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v7/definition/commons.yml diff --git a/fern/apis/ir-types-v7/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v7/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v7/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v7/definition/constants.yml diff --git a/fern/apis/ir-types-v7/definition/declaration.yml b/packages/ir-sdk/fern/apis/ir-types-v7/definition/declaration.yml similarity index 100% rename from fern/apis/ir-types-v7/definition/declaration.yml rename to packages/ir-sdk/fern/apis/ir-types-v7/definition/declaration.yml diff --git a/fern/apis/ir-types-v7/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v7/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v7/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v7/definition/environment.yml diff --git a/fern/apis/ir-types-v7/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v7/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v7/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v7/definition/errors.yml diff --git a/fern/apis/ir-types-v7/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-v7/definition/http.yml similarity index 100% rename from fern/apis/ir-types-v7/definition/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v7/definition/http.yml diff --git a/fern/apis/ir-types-v7/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v7/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v7/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v7/definition/ir.yml diff --git a/fern/apis/ir-types-v7/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v7/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v7/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v7/definition/types.yml diff --git a/fern/apis/ir-types-v7/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v7/generators.yml similarity index 100% rename from fern/apis/ir-types-v7/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v7/generators.yml diff --git a/fern/apis/ir-types-v8/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v8/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v8/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v8/definition/api.yml diff --git a/fern/apis/ir-types-v8/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v8/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v8/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v8/definition/auth.yml diff --git a/fern/apis/ir-types-v8/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v8/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v8/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v8/definition/commons.yml diff --git a/fern/apis/ir-types-v8/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v8/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v8/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v8/definition/constants.yml diff --git a/fern/apis/ir-types-v8/definition/declaration.yml b/packages/ir-sdk/fern/apis/ir-types-v8/definition/declaration.yml similarity index 100% rename from fern/apis/ir-types-v8/definition/declaration.yml rename to packages/ir-sdk/fern/apis/ir-types-v8/definition/declaration.yml diff --git a/fern/apis/ir-types-v8/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v8/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v8/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v8/definition/environment.yml diff --git a/fern/apis/ir-types-v8/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v8/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v8/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v8/definition/errors.yml diff --git a/fern/apis/ir-types-v8/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-v8/definition/http.yml similarity index 100% rename from fern/apis/ir-types-v8/definition/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v8/definition/http.yml diff --git a/fern/apis/ir-types-v8/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v8/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v8/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v8/definition/ir.yml diff --git a/fern/apis/ir-types-v8/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v8/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v8/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v8/definition/types.yml diff --git a/fern/apis/ir-types-v8/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v8/generators.yml similarity index 100% rename from fern/apis/ir-types-v8/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v8/generators.yml diff --git a/fern/apis/ir-types-v9/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v9/definition/api.yml similarity index 100% rename from fern/apis/ir-types-v9/definition/api.yml rename to packages/ir-sdk/fern/apis/ir-types-v9/definition/api.yml diff --git a/fern/apis/ir-types-v9/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v9/definition/auth.yml similarity index 100% rename from fern/apis/ir-types-v9/definition/auth.yml rename to packages/ir-sdk/fern/apis/ir-types-v9/definition/auth.yml diff --git a/fern/apis/ir-types-v9/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v9/definition/commons.yml similarity index 100% rename from fern/apis/ir-types-v9/definition/commons.yml rename to packages/ir-sdk/fern/apis/ir-types-v9/definition/commons.yml diff --git a/fern/apis/ir-types-v9/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v9/definition/constants.yml similarity index 100% rename from fern/apis/ir-types-v9/definition/constants.yml rename to packages/ir-sdk/fern/apis/ir-types-v9/definition/constants.yml diff --git a/fern/apis/ir-types-v9/definition/declaration.yml b/packages/ir-sdk/fern/apis/ir-types-v9/definition/declaration.yml similarity index 100% rename from fern/apis/ir-types-v9/definition/declaration.yml rename to packages/ir-sdk/fern/apis/ir-types-v9/definition/declaration.yml diff --git a/fern/apis/ir-types-v9/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v9/definition/environment.yml similarity index 100% rename from fern/apis/ir-types-v9/definition/environment.yml rename to packages/ir-sdk/fern/apis/ir-types-v9/definition/environment.yml diff --git a/fern/apis/ir-types-v9/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v9/definition/errors.yml similarity index 100% rename from fern/apis/ir-types-v9/definition/errors.yml rename to packages/ir-sdk/fern/apis/ir-types-v9/definition/errors.yml diff --git a/fern/apis/ir-types-v9/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-v9/definition/http.yml similarity index 100% rename from fern/apis/ir-types-v9/definition/http.yml rename to packages/ir-sdk/fern/apis/ir-types-v9/definition/http.yml diff --git a/fern/apis/ir-types-v9/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v9/definition/ir.yml similarity index 100% rename from fern/apis/ir-types-v9/definition/ir.yml rename to packages/ir-sdk/fern/apis/ir-types-v9/definition/ir.yml diff --git a/fern/apis/ir-types-v9/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v9/definition/types.yml similarity index 100% rename from fern/apis/ir-types-v9/definition/types.yml rename to packages/ir-sdk/fern/apis/ir-types-v9/definition/types.yml diff --git a/fern/apis/ir-types-v9/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v9/generators.yml similarity index 100% rename from fern/apis/ir-types-v9/generators.yml rename to packages/ir-sdk/fern/apis/ir-types-v9/generators.yml diff --git a/packages/ir-sdk/fern/fern.config.json b/packages/ir-sdk/fern/fern.config.json new file mode 100644 index 00000000000..1bd43e63828 --- /dev/null +++ b/packages/ir-sdk/fern/fern.config.json @@ -0,0 +1,4 @@ +{ + "organization": "fern", + "version": "0.16.42" +} diff --git a/packages/ir-sdk/jest.config.ts b/packages/ir-sdk/jest.config.ts new file mode 100644 index 00000000000..867f2c1f738 --- /dev/null +++ b/packages/ir-sdk/jest.config.ts @@ -0,0 +1 @@ +export { default } from "../../shared/jest.config.shared"; diff --git a/packages/ir-sdk/package.json b/packages/ir-sdk/package.json new file mode 100644 index 00000000000..bdbf0c09458 --- /dev/null +++ b/packages/ir-sdk/package.json @@ -0,0 +1,40 @@ +{ + "name": "@fern-api/ir-sdk", + "version": "0.0.0", + "repository": { + "type": "git", + "url": "https://github.com/fern-api/fern.git", + "directory": "packages/ir-sdk" + }, + "private": true, + "files": [ + "lib" + ], + "type": "module", + "source": "src/index.ts", + "main": "lib/index.js", + "types": "lib/index.d.ts", + "sideEffects": false, + "scripts": { + "clean": "rm -rf ./lib && tsc --build --clean", + "compile": "tsc --build", + "test": "yarn compile && jest --passWithNoTests", + "lint:eslint": "eslint --max-warnings 0 . --ignore-path=../../.eslintignore --report-unused-disable-directives", + "lint:eslint:fix": "yarn lint:eslint --fix", + "format": "prettier --write --ignore-unknown --ignore-path ../../shared/.prettierignore \"**\"", + "format:check": "prettier --check --ignore-unknown --ignore-path ../../shared/.prettierignore \"**\"", + "organize-imports": "organize-imports-cli tsconfig.json", + "depcheck": "depcheck", + "generate": "fern generate --api ir-types-latest --local" + }, + "devDependencies": { + "@types/jest": "^29.0.3", + "@types/node": "^18.7.18", + "depcheck": "^1.4.6", + "eslint": "^8.56.0", + "jest": "^29.7.0", + "organize-imports-cli": "^0.10.0", + "prettier": "^2.7.1", + "typescript": "4.6.4" + } +} diff --git a/packages/ir-sdk/src/index.ts b/packages/ir-sdk/src/index.ts new file mode 100644 index 00000000000..61066e2555a --- /dev/null +++ b/packages/ir-sdk/src/index.ts @@ -0,0 +1,3 @@ +export * from "./sdk"; +export * from "./sdk/api"; +export * as serialization from "./sdk/serialization"; \ No newline at end of file diff --git a/packages/ir-sdk/src/sdk/api/index.ts b/packages/ir-sdk/src/sdk/api/index.ts new file mode 100644 index 00000000000..3e5335fe421 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/index.ts @@ -0,0 +1 @@ +export * from "./resources"; diff --git a/packages/ir-sdk/src/sdk/api/resources/auth/index.ts b/packages/ir-sdk/src/sdk/api/resources/auth/index.ts new file mode 100644 index 00000000000..eea524d6557 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/auth/index.ts @@ -0,0 +1 @@ +export * from "./types"; diff --git a/packages/ir-sdk/src/sdk/api/resources/auth/types/ApiAuth.ts b/packages/ir-sdk/src/sdk/api/resources/auth/types/ApiAuth.ts new file mode 100644 index 00000000000..bd3b3de9f1e --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/auth/types/ApiAuth.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface ApiAuth extends FernIr.WithDocs { + requirement: FernIr.AuthSchemesRequirement; + schemes: FernIr.AuthScheme[]; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/auth/types/AuthScheme.ts b/packages/ir-sdk/src/sdk/api/resources/auth/types/AuthScheme.ts new file mode 100644 index 00000000000..388b05bd59a --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/auth/types/AuthScheme.ts @@ -0,0 +1,77 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export type AuthScheme = FernIr.AuthScheme.Bearer | FernIr.AuthScheme.Basic | FernIr.AuthScheme.Header; + +export declare namespace AuthScheme { + interface Bearer extends FernIr.BearerAuthScheme, _Utils { + type: "bearer"; + } + + interface Basic extends FernIr.BasicAuthScheme, _Utils { + type: "basic"; + } + + interface Header extends FernIr.HeaderAuthScheme, _Utils { + type: "header"; + } + + interface _Utils { + _visit: <_Result>(visitor: FernIr.AuthScheme._Visitor<_Result>) => _Result; + } + + interface _Visitor<_Result> { + bearer: (value: FernIr.BearerAuthScheme) => _Result; + basic: (value: FernIr.BasicAuthScheme) => _Result; + header: (value: FernIr.HeaderAuthScheme) => _Result; + _other: (value: { type: string }) => _Result; + } +} + +export const AuthScheme = { + bearer: (value: FernIr.BearerAuthScheme): FernIr.AuthScheme.Bearer => { + return { + ...value, + type: "bearer", + _visit: function <_Result>(this: FernIr.AuthScheme.Bearer, visitor: FernIr.AuthScheme._Visitor<_Result>) { + return FernIr.AuthScheme._visit(this, visitor); + }, + }; + }, + + basic: (value: FernIr.BasicAuthScheme): FernIr.AuthScheme.Basic => { + return { + ...value, + type: "basic", + _visit: function <_Result>(this: FernIr.AuthScheme.Basic, visitor: FernIr.AuthScheme._Visitor<_Result>) { + return FernIr.AuthScheme._visit(this, visitor); + }, + }; + }, + + header: (value: FernIr.HeaderAuthScheme): FernIr.AuthScheme.Header => { + return { + ...value, + type: "header", + _visit: function <_Result>(this: FernIr.AuthScheme.Header, visitor: FernIr.AuthScheme._Visitor<_Result>) { + return FernIr.AuthScheme._visit(this, visitor); + }, + }; + }, + + _visit: <_Result>(value: FernIr.AuthScheme, visitor: FernIr.AuthScheme._Visitor<_Result>): _Result => { + switch (value.type) { + case "bearer": + return visitor.bearer(value); + case "basic": + return visitor.basic(value); + case "header": + return visitor.header(value); + default: + return visitor._other(value as any); + } + }, +} as const; diff --git a/packages/ir-sdk/src/sdk/api/resources/auth/types/AuthSchemesRequirement.ts b/packages/ir-sdk/src/sdk/api/resources/auth/types/AuthSchemesRequirement.ts new file mode 100644 index 00000000000..8ffef975e89 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/auth/types/AuthSchemesRequirement.ts @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type AuthSchemesRequirement = "ALL" | "ANY"; + +export const AuthSchemesRequirement = { + All: "ALL", + Any: "ANY", + _visit: (value: AuthSchemesRequirement, visitor: AuthSchemesRequirement.Visitor) => { + switch (value) { + case AuthSchemesRequirement.All: + return visitor.all(); + case AuthSchemesRequirement.Any: + return visitor.any(); + default: + return visitor._other(); + } + }, +} as const; + +export declare namespace AuthSchemesRequirement { + interface Visitor { + all: () => R; + any: () => R; + _other: () => R; + } +} diff --git a/packages/ir-sdk/src/sdk/api/resources/auth/types/BasicAuthScheme.ts b/packages/ir-sdk/src/sdk/api/resources/auth/types/BasicAuthScheme.ts new file mode 100644 index 00000000000..f8dfe95b35b --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/auth/types/BasicAuthScheme.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface BasicAuthScheme extends FernIr.WithDocs { + username: FernIr.Name; + /** The environment variable the SDK should use to read the username. */ + usernameEnvVar: FernIr.EnvironmentVariable | undefined; + password: FernIr.Name; + /** The environment variable the SDK should use to read the password. */ + passwordEnvVar: FernIr.EnvironmentVariable | undefined; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/auth/types/BearerAuthScheme.ts b/packages/ir-sdk/src/sdk/api/resources/auth/types/BearerAuthScheme.ts new file mode 100644 index 00000000000..4b6746cdc56 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/auth/types/BearerAuthScheme.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface BearerAuthScheme extends FernIr.WithDocs { + token: FernIr.Name; + /** The environment variable the SDK should use to read the token. */ + tokenEnvVar: FernIr.EnvironmentVariable | undefined; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/auth/types/EnvironmentVariable.ts b/packages/ir-sdk/src/sdk/api/resources/auth/types/EnvironmentVariable.ts new file mode 100644 index 00000000000..a4328b9976e --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/auth/types/EnvironmentVariable.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type EnvironmentVariable = string; diff --git a/packages/ir-sdk/src/sdk/api/resources/auth/types/HeaderAuthScheme.ts b/packages/ir-sdk/src/sdk/api/resources/auth/types/HeaderAuthScheme.ts new file mode 100644 index 00000000000..d59cfd3d39b --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/auth/types/HeaderAuthScheme.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface HeaderAuthScheme extends FernIr.WithDocs { + name: FernIr.NameAndWireValue; + valueType: FernIr.TypeReference; + prefix: string | undefined; + /** The environment variable the SDK should use to read the header. */ + headerEnvVar: FernIr.EnvironmentVariable | undefined; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/auth/types/index.ts b/packages/ir-sdk/src/sdk/api/resources/auth/types/index.ts new file mode 100644 index 00000000000..a6a3e4914f6 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/auth/types/index.ts @@ -0,0 +1,7 @@ +export * from "./EnvironmentVariable"; +export * from "./ApiAuth"; +export * from "./AuthSchemesRequirement"; +export * from "./AuthScheme"; +export * from "./BearerAuthScheme"; +export * from "./BasicAuthScheme"; +export * from "./HeaderAuthScheme"; diff --git a/packages/ir-sdk/src/sdk/api/resources/commons/index.ts b/packages/ir-sdk/src/sdk/api/resources/commons/index.ts new file mode 100644 index 00000000000..eea524d6557 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/commons/index.ts @@ -0,0 +1 @@ +export * from "./types"; diff --git a/packages/ir-sdk/src/sdk/api/resources/commons/types/Availability.ts b/packages/ir-sdk/src/sdk/api/resources/commons/types/Availability.ts new file mode 100644 index 00000000000..be03005bab9 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/commons/types/Availability.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface Availability { + status: FernIr.AvailabilityStatus; + message: string | undefined; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/commons/types/AvailabilityStatus.ts b/packages/ir-sdk/src/sdk/api/resources/commons/types/AvailabilityStatus.ts new file mode 100644 index 00000000000..059948ad348 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/commons/types/AvailabilityStatus.ts @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type AvailabilityStatus = "IN_DEVELOPMENT" | "PRE_RELEASE" | "GENERAL_AVAILABILITY" | "DEPRECATED"; + +export const AvailabilityStatus = { + InDevelopment: "IN_DEVELOPMENT", + PreRelease: "PRE_RELEASE", + GeneralAvailability: "GENERAL_AVAILABILITY", + Deprecated: "DEPRECATED", + _visit: (value: AvailabilityStatus, visitor: AvailabilityStatus.Visitor) => { + switch (value) { + case AvailabilityStatus.InDevelopment: + return visitor.inDevelopment(); + case AvailabilityStatus.PreRelease: + return visitor.preRelease(); + case AvailabilityStatus.GeneralAvailability: + return visitor.generalAvailability(); + case AvailabilityStatus.Deprecated: + return visitor.deprecated(); + default: + return visitor._other(); + } + }, +} as const; + +export declare namespace AvailabilityStatus { + interface Visitor { + inDevelopment: () => R; + preRelease: () => R; + generalAvailability: () => R; + deprecated: () => R; + _other: () => R; + } +} diff --git a/packages/ir-sdk/src/sdk/api/resources/commons/types/Declaration.ts b/packages/ir-sdk/src/sdk/api/resources/commons/types/Declaration.ts new file mode 100644 index 00000000000..2eccaaf4783 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/commons/types/Declaration.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface Declaration extends FernIr.WithDocs { + availability: FernIr.Availability | undefined; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/commons/types/EndpointId.ts b/packages/ir-sdk/src/sdk/api/resources/commons/types/EndpointId.ts new file mode 100644 index 00000000000..d04eeb26443 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/commons/types/EndpointId.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type EndpointId = string; diff --git a/packages/ir-sdk/src/sdk/api/resources/commons/types/ErrorId.ts b/packages/ir-sdk/src/sdk/api/resources/commons/types/ErrorId.ts new file mode 100644 index 00000000000..974e72c4dec --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/commons/types/ErrorId.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ErrorId = string; diff --git a/packages/ir-sdk/src/sdk/api/resources/commons/types/EscapedString.ts b/packages/ir-sdk/src/sdk/api/resources/commons/types/EscapedString.ts new file mode 100644 index 00000000000..f8e49e55081 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/commons/types/EscapedString.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Defines the original string, and its escaped-equivalent (depending on the target programming language). + * This is paricularly relevant to example string literals. + * + * For example, in Python we escape strings that contain single or double quotes by using triple quotes, + * in Go we use backticks, etc. + */ +export interface EscapedString { + original: string; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/commons/types/FernFilepath.ts b/packages/ir-sdk/src/sdk/api/resources/commons/types/FernFilepath.ts new file mode 100644 index 00000000000..863dde6bf6c --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/commons/types/FernFilepath.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface FernFilepath { + allParts: FernIr.Name[]; + packagePath: FernIr.Name[]; + file: FernIr.Name | undefined; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/commons/types/Name.ts b/packages/ir-sdk/src/sdk/api/resources/commons/types/Name.ts new file mode 100644 index 00000000000..e417483e84e --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/commons/types/Name.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface Name { + originalName: string; + camelCase: FernIr.SafeAndUnsafeString; + pascalCase: FernIr.SafeAndUnsafeString; + snakeCase: FernIr.SafeAndUnsafeString; + screamingSnakeCase: FernIr.SafeAndUnsafeString; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/commons/types/NameAndWireValue.ts b/packages/ir-sdk/src/sdk/api/resources/commons/types/NameAndWireValue.ts new file mode 100644 index 00000000000..5cd524f34bc --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/commons/types/NameAndWireValue.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface NameAndWireValue { + wireValue: string; + name: FernIr.Name; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/commons/types/SafeAndUnsafeString.ts b/packages/ir-sdk/src/sdk/api/resources/commons/types/SafeAndUnsafeString.ts new file mode 100644 index 00000000000..ad04d49397a --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/commons/types/SafeAndUnsafeString.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface SafeAndUnsafeString { + /** this name might overlap with reserved keywords of the language being generated */ + unsafeName: string; + /** this name will NOT overlap with reserved keywords of the language being generated */ + safeName: string; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/commons/types/ServiceId.ts b/packages/ir-sdk/src/sdk/api/resources/commons/types/ServiceId.ts new file mode 100644 index 00000000000..efc85294cae --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/commons/types/ServiceId.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ServiceId = string; diff --git a/packages/ir-sdk/src/sdk/api/resources/commons/types/SubpackageId.ts b/packages/ir-sdk/src/sdk/api/resources/commons/types/SubpackageId.ts new file mode 100644 index 00000000000..9566608e440 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/commons/types/SubpackageId.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type SubpackageId = string; diff --git a/packages/ir-sdk/src/sdk/api/resources/commons/types/TypeId.ts b/packages/ir-sdk/src/sdk/api/resources/commons/types/TypeId.ts new file mode 100644 index 00000000000..6676f7dc4df --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/commons/types/TypeId.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type TypeId = string; diff --git a/packages/ir-sdk/src/sdk/api/resources/commons/types/WebhookGroupId.ts b/packages/ir-sdk/src/sdk/api/resources/commons/types/WebhookGroupId.ts new file mode 100644 index 00000000000..9662c90159a --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/commons/types/WebhookGroupId.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type WebhookGroupId = string; diff --git a/packages/ir-sdk/src/sdk/api/resources/commons/types/WithDocs.ts b/packages/ir-sdk/src/sdk/api/resources/commons/types/WithDocs.ts new file mode 100644 index 00000000000..307969c10bc --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/commons/types/WithDocs.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface WithDocs { + docs: string | undefined; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/commons/types/WithJsonExample.ts b/packages/ir-sdk/src/sdk/api/resources/commons/types/WithJsonExample.ts new file mode 100644 index 00000000000..af49d40e158 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/commons/types/WithJsonExample.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface WithJsonExample { + jsonExample: unknown; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/commons/types/index.ts b/packages/ir-sdk/src/sdk/api/resources/commons/types/index.ts new file mode 100644 index 00000000000..02b5a2bf676 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/commons/types/index.ts @@ -0,0 +1,16 @@ +export * from "./WithDocs"; +export * from "./FernFilepath"; +export * from "./Name"; +export * from "./NameAndWireValue"; +export * from "./SafeAndUnsafeString"; +export * from "./EscapedString"; +export * from "./WithJsonExample"; +export * from "./SubpackageId"; +export * from "./ServiceId"; +export * from "./EndpointId"; +export * from "./TypeId"; +export * from "./ErrorId"; +export * from "./WebhookGroupId"; +export * from "./Declaration"; +export * from "./Availability"; +export * from "./AvailabilityStatus"; diff --git a/packages/ir-sdk/src/sdk/api/resources/constants/index.ts b/packages/ir-sdk/src/sdk/api/resources/constants/index.ts new file mode 100644 index 00000000000..eea524d6557 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/constants/index.ts @@ -0,0 +1 @@ +export * from "./types"; diff --git a/packages/ir-sdk/src/sdk/api/resources/constants/types/Constants.ts b/packages/ir-sdk/src/sdk/api/resources/constants/types/Constants.ts new file mode 100644 index 00000000000..4cc48bd2365 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/constants/types/Constants.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface Constants { + errorInstanceIdKey: FernIr.NameAndWireValue; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/constants/types/index.ts b/packages/ir-sdk/src/sdk/api/resources/constants/types/index.ts new file mode 100644 index 00000000000..86ad2cf489d --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/constants/types/index.ts @@ -0,0 +1 @@ +export * from "./Constants"; diff --git a/packages/ir-sdk/src/sdk/api/resources/environment/index.ts b/packages/ir-sdk/src/sdk/api/resources/environment/index.ts new file mode 100644 index 00000000000..eea524d6557 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/environment/index.ts @@ -0,0 +1 @@ +export * from "./types"; diff --git a/packages/ir-sdk/src/sdk/api/resources/environment/types/EnvironmentBaseUrlId.ts b/packages/ir-sdk/src/sdk/api/resources/environment/types/EnvironmentBaseUrlId.ts new file mode 100644 index 00000000000..1b0ff322ea5 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/environment/types/EnvironmentBaseUrlId.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type EnvironmentBaseUrlId = string; diff --git a/packages/ir-sdk/src/sdk/api/resources/environment/types/EnvironmentBaseUrlWithId.ts b/packages/ir-sdk/src/sdk/api/resources/environment/types/EnvironmentBaseUrlWithId.ts new file mode 100644 index 00000000000..4d925d12a9d --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/environment/types/EnvironmentBaseUrlWithId.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface EnvironmentBaseUrlWithId { + id: FernIr.EnvironmentBaseUrlId; + name: FernIr.Name; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/environment/types/EnvironmentId.ts b/packages/ir-sdk/src/sdk/api/resources/environment/types/EnvironmentId.ts new file mode 100644 index 00000000000..17d4496928a --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/environment/types/EnvironmentId.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type EnvironmentId = string; diff --git a/packages/ir-sdk/src/sdk/api/resources/environment/types/EnvironmentUrl.ts b/packages/ir-sdk/src/sdk/api/resources/environment/types/EnvironmentUrl.ts new file mode 100644 index 00000000000..538100b1489 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/environment/types/EnvironmentUrl.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type EnvironmentUrl = string; diff --git a/packages/ir-sdk/src/sdk/api/resources/environment/types/Environments.ts b/packages/ir-sdk/src/sdk/api/resources/environment/types/Environments.ts new file mode 100644 index 00000000000..900de0550d8 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/environment/types/Environments.ts @@ -0,0 +1,66 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export type Environments = FernIr.Environments.SingleBaseUrl | FernIr.Environments.MultipleBaseUrls; + +export declare namespace Environments { + interface SingleBaseUrl extends FernIr.SingleBaseUrlEnvironments, _Utils { + type: "singleBaseUrl"; + } + + interface MultipleBaseUrls extends FernIr.MultipleBaseUrlsEnvironments, _Utils { + type: "multipleBaseUrls"; + } + + interface _Utils { + _visit: <_Result>(visitor: FernIr.Environments._Visitor<_Result>) => _Result; + } + + interface _Visitor<_Result> { + singleBaseUrl: (value: FernIr.SingleBaseUrlEnvironments) => _Result; + multipleBaseUrls: (value: FernIr.MultipleBaseUrlsEnvironments) => _Result; + _other: (value: { type: string }) => _Result; + } +} + +export const Environments = { + singleBaseUrl: (value: FernIr.SingleBaseUrlEnvironments): FernIr.Environments.SingleBaseUrl => { + return { + ...value, + type: "singleBaseUrl", + _visit: function <_Result>( + this: FernIr.Environments.SingleBaseUrl, + visitor: FernIr.Environments._Visitor<_Result> + ) { + return FernIr.Environments._visit(this, visitor); + }, + }; + }, + + multipleBaseUrls: (value: FernIr.MultipleBaseUrlsEnvironments): FernIr.Environments.MultipleBaseUrls => { + return { + ...value, + type: "multipleBaseUrls", + _visit: function <_Result>( + this: FernIr.Environments.MultipleBaseUrls, + visitor: FernIr.Environments._Visitor<_Result> + ) { + return FernIr.Environments._visit(this, visitor); + }, + }; + }, + + _visit: <_Result>(value: FernIr.Environments, visitor: FernIr.Environments._Visitor<_Result>): _Result => { + switch (value.type) { + case "singleBaseUrl": + return visitor.singleBaseUrl(value); + case "multipleBaseUrls": + return visitor.multipleBaseUrls(value); + default: + return visitor._other(value as any); + } + }, +} as const; diff --git a/packages/ir-sdk/src/sdk/api/resources/environment/types/EnvironmentsConfig.ts b/packages/ir-sdk/src/sdk/api/resources/environment/types/EnvironmentsConfig.ts new file mode 100644 index 00000000000..e76b57c2bb5 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/environment/types/EnvironmentsConfig.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface EnvironmentsConfig { + defaultEnvironment: FernIr.EnvironmentId | undefined; + environments: FernIr.Environments; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/environment/types/MultipleBaseUrlsEnvironment.ts b/packages/ir-sdk/src/sdk/api/resources/environment/types/MultipleBaseUrlsEnvironment.ts new file mode 100644 index 00000000000..dfb59cfc546 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/environment/types/MultipleBaseUrlsEnvironment.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface MultipleBaseUrlsEnvironment extends FernIr.WithDocs { + id: FernIr.EnvironmentId; + name: FernIr.Name; + urls: Record; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/environment/types/MultipleBaseUrlsEnvironments.ts b/packages/ir-sdk/src/sdk/api/resources/environment/types/MultipleBaseUrlsEnvironments.ts new file mode 100644 index 00000000000..82fa173f7f1 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/environment/types/MultipleBaseUrlsEnvironments.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface MultipleBaseUrlsEnvironments { + baseUrls: FernIr.EnvironmentBaseUrlWithId[]; + environments: FernIr.MultipleBaseUrlsEnvironment[]; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/environment/types/SingleBaseUrlEnvironment.ts b/packages/ir-sdk/src/sdk/api/resources/environment/types/SingleBaseUrlEnvironment.ts new file mode 100644 index 00000000000..38850ca44ff --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/environment/types/SingleBaseUrlEnvironment.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface SingleBaseUrlEnvironment extends FernIr.WithDocs { + id: FernIr.EnvironmentId; + name: FernIr.Name; + url: FernIr.EnvironmentUrl; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/environment/types/SingleBaseUrlEnvironments.ts b/packages/ir-sdk/src/sdk/api/resources/environment/types/SingleBaseUrlEnvironments.ts new file mode 100644 index 00000000000..da4c135ebe5 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/environment/types/SingleBaseUrlEnvironments.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface SingleBaseUrlEnvironments { + environments: FernIr.SingleBaseUrlEnvironment[]; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/environment/types/index.ts b/packages/ir-sdk/src/sdk/api/resources/environment/types/index.ts new file mode 100644 index 00000000000..4342806fe4b --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/environment/types/index.ts @@ -0,0 +1,10 @@ +export * from "./EnvironmentId"; +export * from "./EnvironmentBaseUrlId"; +export * from "./EnvironmentUrl"; +export * from "./EnvironmentsConfig"; +export * from "./Environments"; +export * from "./SingleBaseUrlEnvironments"; +export * from "./SingleBaseUrlEnvironment"; +export * from "./MultipleBaseUrlsEnvironments"; +export * from "./MultipleBaseUrlsEnvironment"; +export * from "./EnvironmentBaseUrlWithId"; diff --git a/packages/ir-sdk/src/sdk/api/resources/errors/index.ts b/packages/ir-sdk/src/sdk/api/resources/errors/index.ts new file mode 100644 index 00000000000..eea524d6557 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/errors/index.ts @@ -0,0 +1 @@ +export * from "./types"; diff --git a/packages/ir-sdk/src/sdk/api/resources/errors/types/DeclaredErrorName.ts b/packages/ir-sdk/src/sdk/api/resources/errors/types/DeclaredErrorName.ts new file mode 100644 index 00000000000..4c64f0fc9e5 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/errors/types/DeclaredErrorName.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface DeclaredErrorName { + errorId: FernIr.ErrorId; + fernFilepath: FernIr.FernFilepath; + name: FernIr.Name; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/errors/types/ErrorDeclaration.ts b/packages/ir-sdk/src/sdk/api/resources/errors/types/ErrorDeclaration.ts new file mode 100644 index 00000000000..84f717f5999 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/errors/types/ErrorDeclaration.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface ErrorDeclaration extends FernIr.WithDocs { + name: FernIr.DeclaredErrorName; + discriminantValue: FernIr.NameAndWireValue; + type: FernIr.TypeReference | undefined; + statusCode: number; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/errors/types/ErrorDeclarationDiscriminantValue.ts b/packages/ir-sdk/src/sdk/api/resources/errors/types/ErrorDeclarationDiscriminantValue.ts new file mode 100644 index 00000000000..38990abc76a --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/errors/types/ErrorDeclarationDiscriminantValue.ts @@ -0,0 +1,70 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export type ErrorDeclarationDiscriminantValue = + | FernIr.ErrorDeclarationDiscriminantValue.Property + | FernIr.ErrorDeclarationDiscriminantValue.StatusCode; + +export declare namespace ErrorDeclarationDiscriminantValue { + interface Property extends FernIr.NameAndWireValue, _Utils { + type: "property"; + } + + interface StatusCode extends _Utils { + type: "statusCode"; + } + + interface _Utils { + _visit: <_Result>(visitor: FernIr.ErrorDeclarationDiscriminantValue._Visitor<_Result>) => _Result; + } + + interface _Visitor<_Result> { + property: (value: FernIr.NameAndWireValue) => _Result; + statusCode: () => _Result; + _other: (value: { type: string }) => _Result; + } +} + +export const ErrorDeclarationDiscriminantValue = { + property: (value: FernIr.NameAndWireValue): FernIr.ErrorDeclarationDiscriminantValue.Property => { + return { + ...value, + type: "property", + _visit: function <_Result>( + this: FernIr.ErrorDeclarationDiscriminantValue.Property, + visitor: FernIr.ErrorDeclarationDiscriminantValue._Visitor<_Result> + ) { + return FernIr.ErrorDeclarationDiscriminantValue._visit(this, visitor); + }, + }; + }, + + statusCode: (): FernIr.ErrorDeclarationDiscriminantValue.StatusCode => { + return { + type: "statusCode", + _visit: function <_Result>( + this: FernIr.ErrorDeclarationDiscriminantValue.StatusCode, + visitor: FernIr.ErrorDeclarationDiscriminantValue._Visitor<_Result> + ) { + return FernIr.ErrorDeclarationDiscriminantValue._visit(this, visitor); + }, + }; + }, + + _visit: <_Result>( + value: FernIr.ErrorDeclarationDiscriminantValue, + visitor: FernIr.ErrorDeclarationDiscriminantValue._Visitor<_Result> + ): _Result => { + switch (value.type) { + case "property": + return visitor.property(value); + case "statusCode": + return visitor.statusCode(); + default: + return visitor._other(value as any); + } + }, +} as const; diff --git a/packages/ir-sdk/src/sdk/api/resources/errors/types/index.ts b/packages/ir-sdk/src/sdk/api/resources/errors/types/index.ts new file mode 100644 index 00000000000..00c0d87ca97 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/errors/types/index.ts @@ -0,0 +1,3 @@ +export * from "./ErrorDeclaration"; +export * from "./ErrorDeclarationDiscriminantValue"; +export * from "./DeclaredErrorName"; diff --git a/packages/ir-sdk/src/sdk/api/resources/http/index.ts b/packages/ir-sdk/src/sdk/api/resources/http/index.ts new file mode 100644 index 00000000000..eea524d6557 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/index.ts @@ -0,0 +1 @@ +export * from "./types"; diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/BytesRequest.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/BytesRequest.ts new file mode 100644 index 00000000000..0084860f576 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/BytesRequest.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface BytesRequest { + isOptional: boolean; + contentType: string | undefined; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/DeclaredServiceName.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/DeclaredServiceName.ts new file mode 100644 index 00000000000..dc8ac40b37f --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/DeclaredServiceName.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface DeclaredServiceName { + fernFilepath: FernIr.FernFilepath; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/EndpointName.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/EndpointName.ts new file mode 100644 index 00000000000..498b55261d9 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/EndpointName.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export type EndpointName = FernIr.Name; diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/ExampleCodeSample.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/ExampleCodeSample.ts new file mode 100644 index 00000000000..212ae61decc --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/ExampleCodeSample.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface ExampleCodeSample extends FernIr.WithDocs { + name: FernIr.Name | undefined; + language: string; + code: string; + install: string | undefined; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/ExampleEndpointCall.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/ExampleEndpointCall.ts new file mode 100644 index 00000000000..676032d0b8b --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/ExampleEndpointCall.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface ExampleEndpointCall extends FernIr.WithDocs { + name: FernIr.Name | undefined; + url: string; + rootPathParameters: FernIr.ExamplePathParameter[]; + servicePathParameters: FernIr.ExamplePathParameter[]; + endpointPathParameters: FernIr.ExamplePathParameter[]; + serviceHeaders: FernIr.ExampleHeader[]; + endpointHeaders: FernIr.ExampleHeader[]; + queryParameters: FernIr.ExampleQueryParameter[]; + request: FernIr.ExampleRequestBody | undefined; + response: FernIr.ExampleResponse; + /** + * Hand-written code samples for this endpoint.These code samples should match the + * example that it's attached to, so that we can spin up an API Playground with + * the code sample that's being displayed in the API Reference. + */ + codeSamples: FernIr.ExampleCodeSample[] | undefined; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/ExampleEndpointErrorResponse.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/ExampleEndpointErrorResponse.ts new file mode 100644 index 00000000000..c61b13b394b --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/ExampleEndpointErrorResponse.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface ExampleEndpointErrorResponse { + error: FernIr.DeclaredErrorName; + body: FernIr.ExampleTypeReference | undefined; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/ExampleEndpointSuccessResponse.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/ExampleEndpointSuccessResponse.ts new file mode 100644 index 00000000000..194ce097def --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/ExampleEndpointSuccessResponse.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface ExampleEndpointSuccessResponse { + body: FernIr.ExampleTypeReference | undefined; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/ExampleHeader.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/ExampleHeader.ts new file mode 100644 index 00000000000..e41fb8d815a --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/ExampleHeader.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface ExampleHeader { + name: FernIr.NameAndWireValue; + value: FernIr.ExampleTypeReference; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/ExampleInlinedRequestBody.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/ExampleInlinedRequestBody.ts new file mode 100644 index 00000000000..2bbb9bdb424 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/ExampleInlinedRequestBody.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface ExampleInlinedRequestBody extends FernIr.WithJsonExample { + properties: FernIr.ExampleInlinedRequestBodyProperty[]; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/ExampleInlinedRequestBodyProperty.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/ExampleInlinedRequestBodyProperty.ts new file mode 100644 index 00000000000..880c6a29d1f --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/ExampleInlinedRequestBodyProperty.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface ExampleInlinedRequestBodyProperty { + name: FernIr.NameAndWireValue; + value: FernIr.ExampleTypeReference; + /** + * This property may have been brought in via extension. originalTypeDeclaration + * is the name of the type that contains this property + */ + originalTypeDeclaration: FernIr.DeclaredTypeName | undefined; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/ExamplePathParameter.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/ExamplePathParameter.ts new file mode 100644 index 00000000000..867ac9a9395 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/ExamplePathParameter.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface ExamplePathParameter { + name: FernIr.Name; + value: FernIr.ExampleTypeReference; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/ExampleQueryParameter.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/ExampleQueryParameter.ts new file mode 100644 index 00000000000..2ace09761aa --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/ExampleQueryParameter.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface ExampleQueryParameter { + name: FernIr.NameAndWireValue; + value: FernIr.ExampleTypeReference; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/ExampleRequestBody.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/ExampleRequestBody.ts new file mode 100644 index 00000000000..7bd7395c00c --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/ExampleRequestBody.ts @@ -0,0 +1,69 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export type ExampleRequestBody = FernIr.ExampleRequestBody.InlinedRequestBody | FernIr.ExampleRequestBody.Reference; + +export declare namespace ExampleRequestBody { + interface InlinedRequestBody extends FernIr.ExampleInlinedRequestBody, _Utils { + type: "inlinedRequestBody"; + } + + interface Reference extends FernIr.ExampleTypeReference, _Utils { + type: "reference"; + } + + interface _Utils { + _visit: <_Result>(visitor: FernIr.ExampleRequestBody._Visitor<_Result>) => _Result; + } + + interface _Visitor<_Result> { + inlinedRequestBody: (value: FernIr.ExampleInlinedRequestBody) => _Result; + reference: (value: FernIr.ExampleTypeReference) => _Result; + _other: (value: { type: string }) => _Result; + } +} + +export const ExampleRequestBody = { + inlinedRequestBody: (value: FernIr.ExampleInlinedRequestBody): FernIr.ExampleRequestBody.InlinedRequestBody => { + return { + ...value, + type: "inlinedRequestBody", + _visit: function <_Result>( + this: FernIr.ExampleRequestBody.InlinedRequestBody, + visitor: FernIr.ExampleRequestBody._Visitor<_Result> + ) { + return FernIr.ExampleRequestBody._visit(this, visitor); + }, + }; + }, + + reference: (value: FernIr.ExampleTypeReference): FernIr.ExampleRequestBody.Reference => { + return { + ...value, + type: "reference", + _visit: function <_Result>( + this: FernIr.ExampleRequestBody.Reference, + visitor: FernIr.ExampleRequestBody._Visitor<_Result> + ) { + return FernIr.ExampleRequestBody._visit(this, visitor); + }, + }; + }, + + _visit: <_Result>( + value: FernIr.ExampleRequestBody, + visitor: FernIr.ExampleRequestBody._Visitor<_Result> + ): _Result => { + switch (value.type) { + case "inlinedRequestBody": + return visitor.inlinedRequestBody(value); + case "reference": + return visitor.reference(value); + default: + return visitor._other(value as any); + } + }, +} as const; diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/ExampleResponse.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/ExampleResponse.ts new file mode 100644 index 00000000000..7414e2951d2 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/ExampleResponse.ts @@ -0,0 +1,66 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export type ExampleResponse = FernIr.ExampleResponse.Ok | FernIr.ExampleResponse.Error_; + +export declare namespace ExampleResponse { + interface Ok extends FernIr.ExampleEndpointSuccessResponse, _Utils { + type: "ok"; + } + + interface Error_ extends FernIr.ExampleEndpointErrorResponse, _Utils { + type: "error"; + } + + interface _Utils { + _visit: <_Result>(visitor: FernIr.ExampleResponse._Visitor<_Result>) => _Result; + } + + interface _Visitor<_Result> { + ok: (value: FernIr.ExampleEndpointSuccessResponse) => _Result; + error: (value: FernIr.ExampleEndpointErrorResponse) => _Result; + _other: (value: { type: string }) => _Result; + } +} + +export const ExampleResponse = { + ok: (value: FernIr.ExampleEndpointSuccessResponse): FernIr.ExampleResponse.Ok => { + return { + ...value, + type: "ok", + _visit: function <_Result>( + this: FernIr.ExampleResponse.Ok, + visitor: FernIr.ExampleResponse._Visitor<_Result> + ) { + return FernIr.ExampleResponse._visit(this, visitor); + }, + }; + }, + + error: (value: FernIr.ExampleEndpointErrorResponse): FernIr.ExampleResponse.Error_ => { + return { + ...value, + type: "error", + _visit: function <_Result>( + this: FernIr.ExampleResponse.Error_, + visitor: FernIr.ExampleResponse._Visitor<_Result> + ) { + return FernIr.ExampleResponse._visit(this, visitor); + }, + }; + }, + + _visit: <_Result>(value: FernIr.ExampleResponse, visitor: FernIr.ExampleResponse._Visitor<_Result>): _Result => { + switch (value.type) { + case "ok": + return visitor.ok(value); + case "error": + return visitor.error(value); + default: + return visitor._other(value as any); + } + }, +} as const; diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/FileDownloadResponse.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/FileDownloadResponse.ts new file mode 100644 index 00000000000..b6b3ac235e9 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/FileDownloadResponse.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface FileDownloadResponse extends FernIr.WithDocs {} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/FileProperty.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/FileProperty.ts new file mode 100644 index 00000000000..ac642b1c2fd --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/FileProperty.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface FileProperty { + key: FernIr.NameAndWireValue; + isOptional: boolean; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/FileUploadRequest.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/FileUploadRequest.ts new file mode 100644 index 00000000000..26197cbf249 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/FileUploadRequest.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface FileUploadRequest { + name: FernIr.Name; + properties: FernIr.FileUploadRequestProperty[]; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/FileUploadRequestProperty.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/FileUploadRequestProperty.ts new file mode 100644 index 00000000000..cec24491e6c --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/FileUploadRequestProperty.ts @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export type FileUploadRequestProperty = + | FernIr.FileUploadRequestProperty.File_ + | FernIr.FileUploadRequestProperty.BodyProperty; + +export declare namespace FileUploadRequestProperty { + interface File_ extends FernIr.FileProperty, _Utils { + type: "file"; + } + + interface BodyProperty extends FernIr.InlinedRequestBodyProperty, _Utils { + type: "bodyProperty"; + } + + interface _Utils { + _visit: <_Result>(visitor: FernIr.FileUploadRequestProperty._Visitor<_Result>) => _Result; + } + + interface _Visitor<_Result> { + file: (value: FernIr.FileProperty) => _Result; + bodyProperty: (value: FernIr.InlinedRequestBodyProperty) => _Result; + _other: (value: { type: string }) => _Result; + } +} + +export const FileUploadRequestProperty = { + file: (value: FernIr.FileProperty): FernIr.FileUploadRequestProperty.File_ => { + return { + ...value, + type: "file", + _visit: function <_Result>( + this: FernIr.FileUploadRequestProperty.File_, + visitor: FernIr.FileUploadRequestProperty._Visitor<_Result> + ) { + return FernIr.FileUploadRequestProperty._visit(this, visitor); + }, + }; + }, + + bodyProperty: (value: FernIr.InlinedRequestBodyProperty): FernIr.FileUploadRequestProperty.BodyProperty => { + return { + ...value, + type: "bodyProperty", + _visit: function <_Result>( + this: FernIr.FileUploadRequestProperty.BodyProperty, + visitor: FernIr.FileUploadRequestProperty._Visitor<_Result> + ) { + return FernIr.FileUploadRequestProperty._visit(this, visitor); + }, + }; + }, + + _visit: <_Result>( + value: FernIr.FileUploadRequestProperty, + visitor: FernIr.FileUploadRequestProperty._Visitor<_Result> + ): _Result => { + switch (value.type) { + case "file": + return visitor.file(value); + case "bodyProperty": + return visitor.bodyProperty(value); + default: + return visitor._other(value as any); + } + }, +} as const; diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/HttpEndpoint.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/HttpEndpoint.ts new file mode 100644 index 00000000000..f4ad35e81af --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/HttpEndpoint.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface HttpEndpoint extends FernIr.Declaration { + id: FernIr.EndpointId; + name: FernIr.EndpointName; + displayName: string | undefined; + method: FernIr.HttpMethod; + headers: FernIr.HttpHeader[]; + baseUrl: FernIr.EnvironmentBaseUrlId | undefined; + path: FernIr.HttpPath; + fullPath: FernIr.HttpPath; + pathParameters: FernIr.PathParameter[]; + allPathParameters: FernIr.PathParameter[]; + queryParameters: FernIr.QueryParameter[]; + requestBody: FernIr.HttpRequestBody | undefined; + sdkRequest: FernIr.SdkRequest | undefined; + response: FernIr.HttpResponse | undefined; + errors: FernIr.ResponseErrors; + auth: boolean; + idempotent: boolean; + examples: FernIr.ExampleEndpointCall[]; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/HttpHeader.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/HttpHeader.ts new file mode 100644 index 00000000000..0eff8244ca3 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/HttpHeader.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface HttpHeader extends FernIr.Declaration { + name: FernIr.NameAndWireValue; + valueType: FernIr.TypeReference; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/HttpMethod.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/HttpMethod.ts new file mode 100644 index 00000000000..287d7ff96e0 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/HttpMethod.ts @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE"; + +export const HttpMethod = { + Get: "GET", + Post: "POST", + Put: "PUT", + Patch: "PATCH", + Delete: "DELETE", + _visit: (value: HttpMethod, visitor: HttpMethod.Visitor) => { + switch (value) { + case HttpMethod.Get: + return visitor.get(); + case HttpMethod.Post: + return visitor.post(); + case HttpMethod.Put: + return visitor.put(); + case HttpMethod.Patch: + return visitor.patch(); + case HttpMethod.Delete: + return visitor.delete(); + default: + return visitor._other(); + } + }, +} as const; + +export declare namespace HttpMethod { + interface Visitor { + get: () => R; + post: () => R; + put: () => R; + patch: () => R; + delete: () => R; + _other: () => R; + } +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/HttpPath.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/HttpPath.ts new file mode 100644 index 00000000000..2af8ff87b54 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/HttpPath.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface HttpPath { + head: string; + parts: FernIr.HttpPathPart[]; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/HttpPathPart.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/HttpPathPart.ts new file mode 100644 index 00000000000..e607f24c498 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/HttpPathPart.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface HttpPathPart { + pathParameter: string; + tail: string; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/HttpRequestBody.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/HttpRequestBody.ts new file mode 100644 index 00000000000..ac36b133c84 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/HttpRequestBody.ts @@ -0,0 +1,110 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export type HttpRequestBody = + | FernIr.HttpRequestBody.InlinedRequestBody + | FernIr.HttpRequestBody.Reference + | FernIr.HttpRequestBody.FileUpload + | FernIr.HttpRequestBody.Bytes; + +export declare namespace HttpRequestBody { + interface InlinedRequestBody extends FernIr.InlinedRequestBody, _Utils { + type: "inlinedRequestBody"; + } + + interface Reference extends FernIr.HttpRequestBodyReference, _Utils { + type: "reference"; + } + + interface FileUpload extends FernIr.FileUploadRequest, _Utils { + type: "fileUpload"; + } + + interface Bytes extends FernIr.BytesRequest, _Utils { + type: "bytes"; + } + + interface _Utils { + _visit: <_Result>(visitor: FernIr.HttpRequestBody._Visitor<_Result>) => _Result; + } + + interface _Visitor<_Result> { + inlinedRequestBody: (value: FernIr.InlinedRequestBody) => _Result; + reference: (value: FernIr.HttpRequestBodyReference) => _Result; + fileUpload: (value: FernIr.FileUploadRequest) => _Result; + bytes: (value: FernIr.BytesRequest) => _Result; + _other: (value: { type: string }) => _Result; + } +} + +export const HttpRequestBody = { + inlinedRequestBody: (value: FernIr.InlinedRequestBody): FernIr.HttpRequestBody.InlinedRequestBody => { + return { + ...value, + type: "inlinedRequestBody", + _visit: function <_Result>( + this: FernIr.HttpRequestBody.InlinedRequestBody, + visitor: FernIr.HttpRequestBody._Visitor<_Result> + ) { + return FernIr.HttpRequestBody._visit(this, visitor); + }, + }; + }, + + reference: (value: FernIr.HttpRequestBodyReference): FernIr.HttpRequestBody.Reference => { + return { + ...value, + type: "reference", + _visit: function <_Result>( + this: FernIr.HttpRequestBody.Reference, + visitor: FernIr.HttpRequestBody._Visitor<_Result> + ) { + return FernIr.HttpRequestBody._visit(this, visitor); + }, + }; + }, + + fileUpload: (value: FernIr.FileUploadRequest): FernIr.HttpRequestBody.FileUpload => { + return { + ...value, + type: "fileUpload", + _visit: function <_Result>( + this: FernIr.HttpRequestBody.FileUpload, + visitor: FernIr.HttpRequestBody._Visitor<_Result> + ) { + return FernIr.HttpRequestBody._visit(this, visitor); + }, + }; + }, + + bytes: (value: FernIr.BytesRequest): FernIr.HttpRequestBody.Bytes => { + return { + ...value, + type: "bytes", + _visit: function <_Result>( + this: FernIr.HttpRequestBody.Bytes, + visitor: FernIr.HttpRequestBody._Visitor<_Result> + ) { + return FernIr.HttpRequestBody._visit(this, visitor); + }, + }; + }, + + _visit: <_Result>(value: FernIr.HttpRequestBody, visitor: FernIr.HttpRequestBody._Visitor<_Result>): _Result => { + switch (value.type) { + case "inlinedRequestBody": + return visitor.inlinedRequestBody(value); + case "reference": + return visitor.reference(value); + case "fileUpload": + return visitor.fileUpload(value); + case "bytes": + return visitor.bytes(value); + default: + return visitor._other(value as any); + } + }, +} as const; diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/HttpRequestBodyReference.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/HttpRequestBodyReference.ts new file mode 100644 index 00000000000..ee11930cc61 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/HttpRequestBodyReference.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface HttpRequestBodyReference extends FernIr.WithDocs { + requestBodyType: FernIr.TypeReference; + contentType: string | undefined; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/HttpResponse.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/HttpResponse.ts new file mode 100644 index 00000000000..d827158efaa --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/HttpResponse.ts @@ -0,0 +1,105 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export type HttpResponse = + | FernIr.HttpResponse.Json + | FernIr.HttpResponse.FileDownload + | FernIr.HttpResponse.Text + | FernIr.HttpResponse.Streaming; + +export declare namespace HttpResponse { + interface Json extends _Utils { + type: "json"; + value: FernIr.JsonResponse; + } + + interface FileDownload extends FernIr.FileDownloadResponse, _Utils { + type: "fileDownload"; + } + + interface Text extends FernIr.TextResponse, _Utils { + type: "text"; + } + + interface Streaming extends FernIr.StreamingResponse, _Utils { + type: "streaming"; + } + + interface _Utils { + _visit: <_Result>(visitor: FernIr.HttpResponse._Visitor<_Result>) => _Result; + } + + interface _Visitor<_Result> { + json: (value: FernIr.JsonResponse) => _Result; + fileDownload: (value: FernIr.FileDownloadResponse) => _Result; + text: (value: FernIr.TextResponse) => _Result; + streaming: (value: FernIr.StreamingResponse) => _Result; + _other: (value: { type: string }) => _Result; + } +} + +export const HttpResponse = { + json: (value: FernIr.JsonResponse): FernIr.HttpResponse.Json => { + return { + value: value, + type: "json", + _visit: function <_Result>(this: FernIr.HttpResponse.Json, visitor: FernIr.HttpResponse._Visitor<_Result>) { + return FernIr.HttpResponse._visit(this, visitor); + }, + }; + }, + + fileDownload: (value: FernIr.FileDownloadResponse): FernIr.HttpResponse.FileDownload => { + return { + ...value, + type: "fileDownload", + _visit: function <_Result>( + this: FernIr.HttpResponse.FileDownload, + visitor: FernIr.HttpResponse._Visitor<_Result> + ) { + return FernIr.HttpResponse._visit(this, visitor); + }, + }; + }, + + text: (value: FernIr.TextResponse): FernIr.HttpResponse.Text => { + return { + ...value, + type: "text", + _visit: function <_Result>(this: FernIr.HttpResponse.Text, visitor: FernIr.HttpResponse._Visitor<_Result>) { + return FernIr.HttpResponse._visit(this, visitor); + }, + }; + }, + + streaming: (value: FernIr.StreamingResponse): FernIr.HttpResponse.Streaming => { + return { + ...value, + type: "streaming", + _visit: function <_Result>( + this: FernIr.HttpResponse.Streaming, + visitor: FernIr.HttpResponse._Visitor<_Result> + ) { + return FernIr.HttpResponse._visit(this, visitor); + }, + }; + }, + + _visit: <_Result>(value: FernIr.HttpResponse, visitor: FernIr.HttpResponse._Visitor<_Result>): _Result => { + switch (value.type) { + case "json": + return visitor.json(value.value); + case "fileDownload": + return visitor.fileDownload(value); + case "text": + return visitor.text(value); + case "streaming": + return visitor.streaming(value); + default: + return visitor._other(value as any); + } + }, +} as const; diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/HttpService.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/HttpService.ts new file mode 100644 index 00000000000..f1f7f58a90a --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/HttpService.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface HttpService { + availability: FernIr.Availability | undefined; + name: FernIr.DeclaredServiceName; + displayName: string | undefined; + basePath: FernIr.HttpPath; + endpoints: FernIr.HttpEndpoint[]; + headers: FernIr.HttpHeader[]; + pathParameters: FernIr.PathParameter[]; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/InlinedRequestBody.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/InlinedRequestBody.ts new file mode 100644 index 00000000000..f0b4a189e16 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/InlinedRequestBody.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface InlinedRequestBody { + name: FernIr.Name; + extends: FernIr.DeclaredTypeName[]; + properties: FernIr.InlinedRequestBodyProperty[]; + contentType: string | undefined; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/InlinedRequestBodyProperty.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/InlinedRequestBodyProperty.ts new file mode 100644 index 00000000000..c28b9790783 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/InlinedRequestBodyProperty.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface InlinedRequestBodyProperty extends FernIr.WithDocs { + name: FernIr.NameAndWireValue; + valueType: FernIr.TypeReference; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/JsonResponse.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/JsonResponse.ts new file mode 100644 index 00000000000..b6d59e7aec6 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/JsonResponse.ts @@ -0,0 +1,68 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export type JsonResponse = FernIr.JsonResponse.Response | FernIr.JsonResponse.NestedPropertyAsResponse; + +export declare namespace JsonResponse { + interface Response extends FernIr.JsonResponseBody, _Utils { + type: "response"; + } + + interface NestedPropertyAsResponse extends FernIr.JsonResponseBodyWithProperty, _Utils { + type: "nestedPropertyAsResponse"; + } + + interface _Utils { + _visit: <_Result>(visitor: FernIr.JsonResponse._Visitor<_Result>) => _Result; + } + + interface _Visitor<_Result> { + response: (value: FernIr.JsonResponseBody) => _Result; + nestedPropertyAsResponse: (value: FernIr.JsonResponseBodyWithProperty) => _Result; + _other: (value: { type: string }) => _Result; + } +} + +export const JsonResponse = { + response: (value: FernIr.JsonResponseBody): FernIr.JsonResponse.Response => { + return { + ...value, + type: "response", + _visit: function <_Result>( + this: FernIr.JsonResponse.Response, + visitor: FernIr.JsonResponse._Visitor<_Result> + ) { + return FernIr.JsonResponse._visit(this, visitor); + }, + }; + }, + + nestedPropertyAsResponse: ( + value: FernIr.JsonResponseBodyWithProperty + ): FernIr.JsonResponse.NestedPropertyAsResponse => { + return { + ...value, + type: "nestedPropertyAsResponse", + _visit: function <_Result>( + this: FernIr.JsonResponse.NestedPropertyAsResponse, + visitor: FernIr.JsonResponse._Visitor<_Result> + ) { + return FernIr.JsonResponse._visit(this, visitor); + }, + }; + }, + + _visit: <_Result>(value: FernIr.JsonResponse, visitor: FernIr.JsonResponse._Visitor<_Result>): _Result => { + switch (value.type) { + case "response": + return visitor.response(value); + case "nestedPropertyAsResponse": + return visitor.nestedPropertyAsResponse(value); + default: + return visitor._other(value as any); + } + }, +} as const; diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/JsonResponseBody.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/JsonResponseBody.ts new file mode 100644 index 00000000000..5482b76f82a --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/JsonResponseBody.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface JsonResponseBody extends FernIr.WithDocs { + responseBodyType: FernIr.TypeReference; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/JsonResponseBodyWithProperty.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/JsonResponseBodyWithProperty.ts new file mode 100644 index 00000000000..8f7dcf73057 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/JsonResponseBodyWithProperty.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface JsonResponseBodyWithProperty extends FernIr.WithDocs { + responseBodyType: FernIr.TypeReference; + /** + * If set, the SDK will return this property from + * the response, rather than the response itself. + * + * This is particularly useful for JSON API structures + * (e.g. configure 'data' to return 'response.data'). + */ + responseProperty: FernIr.ObjectProperty | undefined; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/PathParameter.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/PathParameter.ts new file mode 100644 index 00000000000..8387f8e3698 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/PathParameter.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface PathParameter extends FernIr.WithDocs { + name: FernIr.Name; + valueType: FernIr.TypeReference; + location: FernIr.PathParameterLocation; + variable: FernIr.VariableId | undefined; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/PathParameterLocation.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/PathParameterLocation.ts new file mode 100644 index 00000000000..923b0a711bb --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/PathParameterLocation.ts @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type PathParameterLocation = "ROOT" | "SERVICE" | "ENDPOINT"; + +export const PathParameterLocation = { + Root: "ROOT", + Service: "SERVICE", + Endpoint: "ENDPOINT", + _visit: (value: PathParameterLocation, visitor: PathParameterLocation.Visitor) => { + switch (value) { + case PathParameterLocation.Root: + return visitor.root(); + case PathParameterLocation.Service: + return visitor.service(); + case PathParameterLocation.Endpoint: + return visitor.endpoint(); + default: + return visitor._other(); + } + }, +} as const; + +export declare namespace PathParameterLocation { + interface Visitor { + root: () => R; + service: () => R; + endpoint: () => R; + _other: () => R; + } +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/QueryParameter.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/QueryParameter.ts new file mode 100644 index 00000000000..b89b0632807 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/QueryParameter.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface QueryParameter extends FernIr.Declaration { + name: FernIr.NameAndWireValue; + valueType: FernIr.TypeReference; + allowMultiple: boolean; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/ResponseError.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/ResponseError.ts new file mode 100644 index 00000000000..643e2f95f8b --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/ResponseError.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface ResponseError extends FernIr.WithDocs { + error: FernIr.DeclaredErrorName; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/ResponseErrors.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/ResponseErrors.ts new file mode 100644 index 00000000000..e127480c85e --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/ResponseErrors.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export type ResponseErrors = FernIr.ResponseError[]; diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/SdkRequest.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/SdkRequest.ts new file mode 100644 index 00000000000..23c70b09cf9 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/SdkRequest.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface SdkRequest { + requestParameterName: FernIr.Name; + shape: FernIr.SdkRequestShape; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/SdkRequestBodyType.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/SdkRequestBodyType.ts new file mode 100644 index 00000000000..660ac799f20 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/SdkRequestBodyType.ts @@ -0,0 +1,69 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export type SdkRequestBodyType = FernIr.SdkRequestBodyType.TypeReference | FernIr.SdkRequestBodyType.Bytes; + +export declare namespace SdkRequestBodyType { + interface TypeReference extends FernIr.HttpRequestBodyReference, _Utils { + type: "typeReference"; + } + + interface Bytes extends FernIr.BytesRequest, _Utils { + type: "bytes"; + } + + interface _Utils { + _visit: <_Result>(visitor: FernIr.SdkRequestBodyType._Visitor<_Result>) => _Result; + } + + interface _Visitor<_Result> { + typeReference: (value: FernIr.HttpRequestBodyReference) => _Result; + bytes: (value: FernIr.BytesRequest) => _Result; + _other: (value: { type: string }) => _Result; + } +} + +export const SdkRequestBodyType = { + typeReference: (value: FernIr.HttpRequestBodyReference): FernIr.SdkRequestBodyType.TypeReference => { + return { + ...value, + type: "typeReference", + _visit: function <_Result>( + this: FernIr.SdkRequestBodyType.TypeReference, + visitor: FernIr.SdkRequestBodyType._Visitor<_Result> + ) { + return FernIr.SdkRequestBodyType._visit(this, visitor); + }, + }; + }, + + bytes: (value: FernIr.BytesRequest): FernIr.SdkRequestBodyType.Bytes => { + return { + ...value, + type: "bytes", + _visit: function <_Result>( + this: FernIr.SdkRequestBodyType.Bytes, + visitor: FernIr.SdkRequestBodyType._Visitor<_Result> + ) { + return FernIr.SdkRequestBodyType._visit(this, visitor); + }, + }; + }, + + _visit: <_Result>( + value: FernIr.SdkRequestBodyType, + visitor: FernIr.SdkRequestBodyType._Visitor<_Result> + ): _Result => { + switch (value.type) { + case "typeReference": + return visitor.typeReference(value); + case "bytes": + return visitor.bytes(value); + default: + return visitor._other(value as any); + } + }, +} as const; diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/SdkRequestShape.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/SdkRequestShape.ts new file mode 100644 index 00000000000..3764639aebc --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/SdkRequestShape.ts @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export type SdkRequestShape = FernIr.SdkRequestShape.JustRequestBody | FernIr.SdkRequestShape.Wrapper; + +export declare namespace SdkRequestShape { + interface JustRequestBody extends _Utils { + type: "justRequestBody"; + value: FernIr.SdkRequestBodyType; + } + + interface Wrapper extends FernIr.SdkRequestWrapper, _Utils { + type: "wrapper"; + } + + interface _Utils { + _visit: <_Result>(visitor: FernIr.SdkRequestShape._Visitor<_Result>) => _Result; + } + + interface _Visitor<_Result> { + justRequestBody: (value: FernIr.SdkRequestBodyType) => _Result; + wrapper: (value: FernIr.SdkRequestWrapper) => _Result; + _other: (value: { type: string }) => _Result; + } +} + +export const SdkRequestShape = { + justRequestBody: (value: FernIr.SdkRequestBodyType): FernIr.SdkRequestShape.JustRequestBody => { + return { + value: value, + type: "justRequestBody", + _visit: function <_Result>( + this: FernIr.SdkRequestShape.JustRequestBody, + visitor: FernIr.SdkRequestShape._Visitor<_Result> + ) { + return FernIr.SdkRequestShape._visit(this, visitor); + }, + }; + }, + + wrapper: (value: FernIr.SdkRequestWrapper): FernIr.SdkRequestShape.Wrapper => { + return { + ...value, + type: "wrapper", + _visit: function <_Result>( + this: FernIr.SdkRequestShape.Wrapper, + visitor: FernIr.SdkRequestShape._Visitor<_Result> + ) { + return FernIr.SdkRequestShape._visit(this, visitor); + }, + }; + }, + + _visit: <_Result>(value: FernIr.SdkRequestShape, visitor: FernIr.SdkRequestShape._Visitor<_Result>): _Result => { + switch (value.type) { + case "justRequestBody": + return visitor.justRequestBody(value.value); + case "wrapper": + return visitor.wrapper(value); + default: + return visitor._other(value as any); + } + }, +} as const; diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/SdkRequestWrapper.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/SdkRequestWrapper.ts new file mode 100644 index 00000000000..00abaa97ddb --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/SdkRequestWrapper.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface SdkRequestWrapper { + wrapperName: FernIr.Name; + bodyKey: FernIr.Name; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/StreamingResponse.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/StreamingResponse.ts new file mode 100644 index 00000000000..cccec042a66 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/StreamingResponse.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface StreamingResponse extends FernIr.WithDocs { + dataEventType: FernIr.StreamingResponseChunkType; + terminator: string | undefined; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/StreamingResponseChunkType.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/StreamingResponseChunkType.ts new file mode 100644 index 00000000000..71d4266028a --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/StreamingResponseChunkType.ts @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export type StreamingResponseChunkType = + | FernIr.StreamingResponseChunkType.Json + | FernIr.StreamingResponseChunkType.Text; + +export declare namespace StreamingResponseChunkType { + interface Json extends _Utils { + type: "json"; + json: FernIr.TypeReference; + } + + interface Text extends _Utils { + type: "text"; + } + + interface _Utils { + _visit: <_Result>(visitor: FernIr.StreamingResponseChunkType._Visitor<_Result>) => _Result; + } + + interface _Visitor<_Result> { + json: (value: FernIr.TypeReference) => _Result; + text: () => _Result; + _other: (value: { type: string }) => _Result; + } +} + +export const StreamingResponseChunkType = { + json: (value: FernIr.TypeReference): FernIr.StreamingResponseChunkType.Json => { + return { + json: value, + type: "json", + _visit: function <_Result>( + this: FernIr.StreamingResponseChunkType.Json, + visitor: FernIr.StreamingResponseChunkType._Visitor<_Result> + ) { + return FernIr.StreamingResponseChunkType._visit(this, visitor); + }, + }; + }, + + text: (): FernIr.StreamingResponseChunkType.Text => { + return { + type: "text", + _visit: function <_Result>( + this: FernIr.StreamingResponseChunkType.Text, + visitor: FernIr.StreamingResponseChunkType._Visitor<_Result> + ) { + return FernIr.StreamingResponseChunkType._visit(this, visitor); + }, + }; + }, + + _visit: <_Result>( + value: FernIr.StreamingResponseChunkType, + visitor: FernIr.StreamingResponseChunkType._Visitor<_Result> + ): _Result => { + switch (value.type) { + case "json": + return visitor.json(value.json); + case "text": + return visitor.text(); + default: + return visitor._other(value as any); + } + }, +} as const; diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/TextResponse.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/TextResponse.ts new file mode 100644 index 00000000000..ce3d337f36f --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/TextResponse.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface TextResponse extends FernIr.WithDocs {} diff --git a/packages/ir-sdk/src/sdk/api/resources/http/types/index.ts b/packages/ir-sdk/src/sdk/api/resources/http/types/index.ts new file mode 100644 index 00000000000..ab6bfac2a2a --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/index.ts @@ -0,0 +1,44 @@ +export * from "./HttpService"; +export * from "./DeclaredServiceName"; +export * from "./HttpEndpoint"; +export * from "./EndpointName"; +export * from "./HttpPath"; +export * from "./HttpPathPart"; +export * from "./HttpMethod"; +export * from "./HttpHeader"; +export * from "./PathParameter"; +export * from "./PathParameterLocation"; +export * from "./QueryParameter"; +export * from "./HttpRequestBody"; +export * from "./InlinedRequestBody"; +export * from "./InlinedRequestBodyProperty"; +export * from "./FileUploadRequest"; +export * from "./BytesRequest"; +export * from "./FileUploadRequestProperty"; +export * from "./FileProperty"; +export * from "./HttpRequestBodyReference"; +export * from "./SdkRequestBodyType"; +export * from "./SdkRequest"; +export * from "./SdkRequestShape"; +export * from "./SdkRequestWrapper"; +export * from "./HttpResponse"; +export * from "./JsonResponse"; +export * from "./JsonResponseBody"; +export * from "./JsonResponseBodyWithProperty"; +export * from "./FileDownloadResponse"; +export * from "./TextResponse"; +export * from "./StreamingResponse"; +export * from "./StreamingResponseChunkType"; +export * from "./ResponseErrors"; +export * from "./ResponseError"; +export * from "./ExampleEndpointCall"; +export * from "./ExampleCodeSample"; +export * from "./ExamplePathParameter"; +export * from "./ExampleQueryParameter"; +export * from "./ExampleHeader"; +export * from "./ExampleRequestBody"; +export * from "./ExampleInlinedRequestBody"; +export * from "./ExampleInlinedRequestBodyProperty"; +export * from "./ExampleResponse"; +export * from "./ExampleEndpointSuccessResponse"; +export * from "./ExampleEndpointErrorResponse"; diff --git a/packages/ir-sdk/src/sdk/api/resources/index.ts b/packages/ir-sdk/src/sdk/api/resources/index.ts new file mode 100644 index 00000000000..0dd12b05bcd --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/index.ts @@ -0,0 +1,20 @@ +export * as auth from "./auth"; +export * from "./auth/types"; +export * as commons from "./commons"; +export * from "./commons/types"; +export * as constants from "./constants"; +export * from "./constants/types"; +export * as environment from "./environment"; +export * from "./environment/types"; +export * as errors from "./errors"; +export * from "./errors/types"; +export * as http from "./http"; +export * from "./http/types"; +export * as ir from "./ir"; +export * from "./ir/types"; +export * as types from "./types"; +export * from "./types/types"; +export * as variables from "./variables"; +export * from "./variables/types"; +export * as webhooks from "./webhooks"; +export * from "./webhooks/types"; diff --git a/packages/ir-sdk/src/sdk/api/resources/ir/index.ts b/packages/ir-sdk/src/sdk/api/resources/ir/index.ts new file mode 100644 index 00000000000..eea524d6557 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/ir/index.ts @@ -0,0 +1 @@ +export * from "./types"; diff --git a/packages/ir-sdk/src/sdk/api/resources/ir/types/ErrorDiscriminationByPropertyStrategy.ts b/packages/ir-sdk/src/sdk/api/resources/ir/types/ErrorDiscriminationByPropertyStrategy.ts new file mode 100644 index 00000000000..5008489a848 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/ir/types/ErrorDiscriminationByPropertyStrategy.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface ErrorDiscriminationByPropertyStrategy { + discriminant: FernIr.NameAndWireValue; + contentProperty: FernIr.NameAndWireValue; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/ir/types/ErrorDiscriminationStrategy.ts b/packages/ir-sdk/src/sdk/api/resources/ir/types/ErrorDiscriminationStrategy.ts new file mode 100644 index 00000000000..49dc1fee129 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/ir/types/ErrorDiscriminationStrategy.ts @@ -0,0 +1,70 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export type ErrorDiscriminationStrategy = + | FernIr.ErrorDiscriminationStrategy.StatusCode + | FernIr.ErrorDiscriminationStrategy.Property; + +export declare namespace ErrorDiscriminationStrategy { + interface StatusCode extends _Utils { + type: "statusCode"; + } + + interface Property extends FernIr.ErrorDiscriminationByPropertyStrategy, _Utils { + type: "property"; + } + + interface _Utils { + _visit: <_Result>(visitor: FernIr.ErrorDiscriminationStrategy._Visitor<_Result>) => _Result; + } + + interface _Visitor<_Result> { + statusCode: () => _Result; + property: (value: FernIr.ErrorDiscriminationByPropertyStrategy) => _Result; + _other: (value: { type: string }) => _Result; + } +} + +export const ErrorDiscriminationStrategy = { + statusCode: (): FernIr.ErrorDiscriminationStrategy.StatusCode => { + return { + type: "statusCode", + _visit: function <_Result>( + this: FernIr.ErrorDiscriminationStrategy.StatusCode, + visitor: FernIr.ErrorDiscriminationStrategy._Visitor<_Result> + ) { + return FernIr.ErrorDiscriminationStrategy._visit(this, visitor); + }, + }; + }, + + property: (value: FernIr.ErrorDiscriminationByPropertyStrategy): FernIr.ErrorDiscriminationStrategy.Property => { + return { + ...value, + type: "property", + _visit: function <_Result>( + this: FernIr.ErrorDiscriminationStrategy.Property, + visitor: FernIr.ErrorDiscriminationStrategy._Visitor<_Result> + ) { + return FernIr.ErrorDiscriminationStrategy._visit(this, visitor); + }, + }; + }, + + _visit: <_Result>( + value: FernIr.ErrorDiscriminationStrategy, + visitor: FernIr.ErrorDiscriminationStrategy._Visitor<_Result> + ): _Result => { + switch (value.type) { + case "statusCode": + return visitor.statusCode(); + case "property": + return visitor.property(value); + default: + return visitor._other(value as any); + } + }, +} as const; diff --git a/packages/ir-sdk/src/sdk/api/resources/ir/types/IntermediateRepresentation.ts b/packages/ir-sdk/src/sdk/api/resources/ir/types/IntermediateRepresentation.ts new file mode 100644 index 00000000000..9248f8a57e1 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/ir/types/IntermediateRepresentation.ts @@ -0,0 +1,37 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +/** + * Complete representation of the API schema + */ +export interface IntermediateRepresentation { + /** This is the human readable unique id for the API. */ + apiName: FernIr.Name; + apiDisplayName: string | undefined; + apiDocs: string | undefined; + auth: FernIr.ApiAuth; + /** API Wide headers that are sent on every request */ + headers: FernIr.HttpHeader[]; + /** Headers that are sent for idempotent endpoints */ + idempotencyHeaders: FernIr.HttpHeader[]; + /** The types described by this API */ + types: Record; + /** The services exposed by this API */ + services: Record; + /** The webhooks sent by this API */ + webhookGroups: Record; + errors: Record; + subpackages: Record; + rootPackage: FernIr.Package; + constants: FernIr.Constants; + environments: FernIr.EnvironmentsConfig | undefined; + basePath: FernIr.HttpPath | undefined; + pathParameters: FernIr.PathParameter[]; + errorDiscriminationStrategy: FernIr.ErrorDiscriminationStrategy; + sdkConfig: FernIr.SdkConfig; + variables: FernIr.VariableDeclaration[]; + serviceTypeReferenceInfo: FernIr.ServiceTypeReferenceInfo; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/ir/types/Package.ts b/packages/ir-sdk/src/sdk/api/resources/ir/types/Package.ts new file mode 100644 index 00000000000..81043714551 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/ir/types/Package.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface Package extends FernIr.WithDocs { + fernFilepath: FernIr.FernFilepath; + service: FernIr.ServiceId | undefined; + types: FernIr.TypeId[]; + errors: FernIr.ErrorId[]; + webhooks: FernIr.WebhookGroupId | undefined; + subpackages: FernIr.SubpackageId[]; + hasEndpointsInTree: boolean; + navigationConfig: FernIr.PackageNavigationConfig | undefined; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/ir/types/PackageNavigationConfig.ts b/packages/ir-sdk/src/sdk/api/resources/ir/types/PackageNavigationConfig.ts new file mode 100644 index 00000000000..68a5b47f54e --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/ir/types/PackageNavigationConfig.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface PackageNavigationConfig { + pointsTo: FernIr.SubpackageId; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/ir/types/PlatformHeaders.ts b/packages/ir-sdk/src/sdk/api/resources/ir/types/PlatformHeaders.ts new file mode 100644 index 00000000000..9a1e1ee5c57 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/ir/types/PlatformHeaders.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface PlatformHeaders { + language: string; + sdkName: string; + sdkVersion: string; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/ir/types/SdkConfig.ts b/packages/ir-sdk/src/sdk/api/resources/ir/types/SdkConfig.ts new file mode 100644 index 00000000000..d6420a2eefa --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/ir/types/SdkConfig.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface SdkConfig { + isAuthMandatory: boolean; + hasStreamingEndpoints: boolean; + hasFileDownloadEndpoints: boolean; + platformHeaders: FernIr.PlatformHeaders; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/ir/types/ServiceTypeReferenceInfo.ts b/packages/ir-sdk/src/sdk/api/resources/ir/types/ServiceTypeReferenceInfo.ts new file mode 100644 index 00000000000..1e38a2c509d --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/ir/types/ServiceTypeReferenceInfo.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface ServiceTypeReferenceInfo { + /** Types referenced by exactly one service. */ + typesReferencedOnlyByService: Record; + /** Types referenced by either zero or multiple services. */ + sharedTypes: FernIr.TypeId[]; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/ir/types/Subpackage.ts b/packages/ir-sdk/src/sdk/api/resources/ir/types/Subpackage.ts new file mode 100644 index 00000000000..da60b545ad4 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/ir/types/Subpackage.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface Subpackage extends FernIr.Package { + name: FernIr.Name; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/ir/types/index.ts b/packages/ir-sdk/src/sdk/api/resources/ir/types/index.ts new file mode 100644 index 00000000000..5a21b5d1b96 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/ir/types/index.ts @@ -0,0 +1,9 @@ +export * from "./IntermediateRepresentation"; +export * from "./SdkConfig"; +export * from "./PlatformHeaders"; +export * from "./ErrorDiscriminationStrategy"; +export * from "./ErrorDiscriminationByPropertyStrategy"; +export * from "./Package"; +export * from "./Subpackage"; +export * from "./PackageNavigationConfig"; +export * from "./ServiceTypeReferenceInfo"; diff --git a/packages/ir-sdk/src/sdk/api/resources/types/index.ts b/packages/ir-sdk/src/sdk/api/resources/types/index.ts new file mode 100644 index 00000000000..eea524d6557 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/index.ts @@ -0,0 +1 @@ +export * from "./types"; diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/AliasTypeDeclaration.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/AliasTypeDeclaration.ts new file mode 100644 index 00000000000..9c17cd9a40b --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/AliasTypeDeclaration.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface AliasTypeDeclaration { + aliasOf: FernIr.TypeReference; + resolvedType: FernIr.ResolvedTypeReference; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/ContainerType.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/ContainerType.ts new file mode 100644 index 00000000000..ab097fc978b --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/ContainerType.ts @@ -0,0 +1,135 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export type ContainerType = + | FernIr.ContainerType.List + | FernIr.ContainerType.Map + | FernIr.ContainerType.Optional + | FernIr.ContainerType.Set + | FernIr.ContainerType.Literal; + +export declare namespace ContainerType { + interface List extends _Utils { + type: "list"; + list: FernIr.TypeReference; + } + + interface Map extends FernIr.MapType, _Utils { + type: "map"; + } + + interface Optional extends _Utils { + type: "optional"; + optional: FernIr.TypeReference; + } + + interface Set extends _Utils { + type: "set"; + set: FernIr.TypeReference; + } + + interface Literal extends _Utils { + type: "literal"; + literal: FernIr.Literal; + } + + interface _Utils { + _visit: <_Result>(visitor: FernIr.ContainerType._Visitor<_Result>) => _Result; + } + + interface _Visitor<_Result> { + list: (value: FernIr.TypeReference) => _Result; + map: (value: FernIr.MapType) => _Result; + optional: (value: FernIr.TypeReference) => _Result; + set: (value: FernIr.TypeReference) => _Result; + literal: (value: FernIr.Literal) => _Result; + _other: (value: { type: string }) => _Result; + } +} + +export const ContainerType = { + list: (value: FernIr.TypeReference): FernIr.ContainerType.List => { + return { + list: value, + type: "list", + _visit: function <_Result>( + this: FernIr.ContainerType.List, + visitor: FernIr.ContainerType._Visitor<_Result> + ) { + return FernIr.ContainerType._visit(this, visitor); + }, + }; + }, + + map: (value: FernIr.MapType): FernIr.ContainerType.Map => { + return { + ...value, + type: "map", + _visit: function <_Result>( + this: FernIr.ContainerType.Map, + visitor: FernIr.ContainerType._Visitor<_Result> + ) { + return FernIr.ContainerType._visit(this, visitor); + }, + }; + }, + + optional: (value: FernIr.TypeReference): FernIr.ContainerType.Optional => { + return { + optional: value, + type: "optional", + _visit: function <_Result>( + this: FernIr.ContainerType.Optional, + visitor: FernIr.ContainerType._Visitor<_Result> + ) { + return FernIr.ContainerType._visit(this, visitor); + }, + }; + }, + + set: (value: FernIr.TypeReference): FernIr.ContainerType.Set => { + return { + set: value, + type: "set", + _visit: function <_Result>( + this: FernIr.ContainerType.Set, + visitor: FernIr.ContainerType._Visitor<_Result> + ) { + return FernIr.ContainerType._visit(this, visitor); + }, + }; + }, + + literal: (value: FernIr.Literal): FernIr.ContainerType.Literal => { + return { + literal: value, + type: "literal", + _visit: function <_Result>( + this: FernIr.ContainerType.Literal, + visitor: FernIr.ContainerType._Visitor<_Result> + ) { + return FernIr.ContainerType._visit(this, visitor); + }, + }; + }, + + _visit: <_Result>(value: FernIr.ContainerType, visitor: FernIr.ContainerType._Visitor<_Result>): _Result => { + switch (value.type) { + case "list": + return visitor.list(value.list); + case "map": + return visitor.map(value); + case "optional": + return visitor.optional(value.optional); + case "set": + return visitor.set(value.set); + case "literal": + return visitor.literal(value.literal); + default: + return visitor._other(value as any); + } + }, +} as const; diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/DeclaredTypeName.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/DeclaredTypeName.ts new file mode 100644 index 00000000000..8b4e7ca873b --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/DeclaredTypeName.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface DeclaredTypeName { + typeId: FernIr.TypeId; + fernFilepath: FernIr.FernFilepath; + name: FernIr.Name; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/EnumTypeDeclaration.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/EnumTypeDeclaration.ts new file mode 100644 index 00000000000..c1754ad7f4f --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/EnumTypeDeclaration.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface EnumTypeDeclaration { + values: FernIr.EnumValue[]; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/EnumValue.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/EnumValue.ts new file mode 100644 index 00000000000..9b8c85507c1 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/EnumValue.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface EnumValue extends FernIr.Declaration { + name: FernIr.NameAndWireValue; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleAliasType.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleAliasType.ts new file mode 100644 index 00000000000..493e5f34e31 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleAliasType.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface ExampleAliasType { + value: FernIr.ExampleTypeReference; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleContainer.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleContainer.ts new file mode 100644 index 00000000000..11541d146a3 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleContainer.ts @@ -0,0 +1,114 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export type ExampleContainer = + | FernIr.ExampleContainer.List + | FernIr.ExampleContainer.Set + | FernIr.ExampleContainer.Optional + | FernIr.ExampleContainer.Map; + +export declare namespace ExampleContainer { + interface List extends _Utils { + type: "list"; + list: FernIr.ExampleTypeReference[]; + } + + interface Set extends _Utils { + type: "set"; + set: FernIr.ExampleTypeReference[]; + } + + interface Optional extends _Utils { + type: "optional"; + optional: FernIr.ExampleTypeReference | undefined; + } + + interface Map extends _Utils { + type: "map"; + map: FernIr.ExampleKeyValuePair[]; + } + + interface _Utils { + _visit: <_Result>(visitor: FernIr.ExampleContainer._Visitor<_Result>) => _Result; + } + + interface _Visitor<_Result> { + list: (value: FernIr.ExampleTypeReference[]) => _Result; + set: (value: FernIr.ExampleTypeReference[]) => _Result; + optional: (value: FernIr.ExampleTypeReference | undefined) => _Result; + map: (value: FernIr.ExampleKeyValuePair[]) => _Result; + _other: (value: { type: string }) => _Result; + } +} + +export const ExampleContainer = { + list: (value: FernIr.ExampleTypeReference[]): FernIr.ExampleContainer.List => { + return { + list: value, + type: "list", + _visit: function <_Result>( + this: FernIr.ExampleContainer.List, + visitor: FernIr.ExampleContainer._Visitor<_Result> + ) { + return FernIr.ExampleContainer._visit(this, visitor); + }, + }; + }, + + set: (value: FernIr.ExampleTypeReference[]): FernIr.ExampleContainer.Set => { + return { + set: value, + type: "set", + _visit: function <_Result>( + this: FernIr.ExampleContainer.Set, + visitor: FernIr.ExampleContainer._Visitor<_Result> + ) { + return FernIr.ExampleContainer._visit(this, visitor); + }, + }; + }, + + optional: (value?: FernIr.ExampleTypeReference): FernIr.ExampleContainer.Optional => { + return { + optional: value, + type: "optional", + _visit: function <_Result>( + this: FernIr.ExampleContainer.Optional, + visitor: FernIr.ExampleContainer._Visitor<_Result> + ) { + return FernIr.ExampleContainer._visit(this, visitor); + }, + }; + }, + + map: (value: FernIr.ExampleKeyValuePair[]): FernIr.ExampleContainer.Map => { + return { + map: value, + type: "map", + _visit: function <_Result>( + this: FernIr.ExampleContainer.Map, + visitor: FernIr.ExampleContainer._Visitor<_Result> + ) { + return FernIr.ExampleContainer._visit(this, visitor); + }, + }; + }, + + _visit: <_Result>(value: FernIr.ExampleContainer, visitor: FernIr.ExampleContainer._Visitor<_Result>): _Result => { + switch (value.type) { + case "list": + return visitor.list(value.list); + case "set": + return visitor.set(value.set); + case "optional": + return visitor.optional(value.optional); + case "map": + return visitor.map(value.map); + default: + return visitor._other(value as any); + } + }, +} as const; diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleEnumType.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleEnumType.ts new file mode 100644 index 00000000000..3aecfbe34a3 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleEnumType.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface ExampleEnumType { + value: FernIr.NameAndWireValue; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleKeyValuePair.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleKeyValuePair.ts new file mode 100644 index 00000000000..4c2e341f808 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleKeyValuePair.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface ExampleKeyValuePair { + key: FernIr.ExampleTypeReference; + value: FernIr.ExampleTypeReference; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleNamedType.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleNamedType.ts new file mode 100644 index 00000000000..1e636e71125 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleNamedType.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface ExampleNamedType { + typeName: FernIr.DeclaredTypeName; + shape: FernIr.ExampleTypeShape; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleObjectProperty.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleObjectProperty.ts new file mode 100644 index 00000000000..c4388fa5795 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleObjectProperty.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface ExampleObjectProperty { + name: FernIr.NameAndWireValue; + value: FernIr.ExampleTypeReference; + /** + * This property may have been brought in via extension. originalTypeDeclaration + * is the name of the type that contains this property. + */ + originalTypeDeclaration: FernIr.DeclaredTypeName; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleObjectType.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleObjectType.ts new file mode 100644 index 00000000000..624e7b6782a --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleObjectType.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface ExampleObjectType { + properties: FernIr.ExampleObjectProperty[]; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleObjectTypeWithTypeId.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleObjectTypeWithTypeId.ts new file mode 100644 index 00000000000..9b4f7d7afce --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleObjectTypeWithTypeId.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface ExampleObjectTypeWithTypeId { + typeId: FernIr.TypeId; + object: FernIr.ExampleObjectType; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/ExamplePrimitive.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/ExamplePrimitive.ts new file mode 100644 index 00000000000..b699f38c9f5 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/ExamplePrimitive.ts @@ -0,0 +1,202 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export type ExamplePrimitive = + | FernIr.ExamplePrimitive.Integer + | FernIr.ExamplePrimitive.Double + | FernIr.ExamplePrimitive.String + | FernIr.ExamplePrimitive.Boolean + | FernIr.ExamplePrimitive.Long + | FernIr.ExamplePrimitive.Datetime + | FernIr.ExamplePrimitive.Date_ + | FernIr.ExamplePrimitive.Uuid; + +export declare namespace ExamplePrimitive { + interface Integer extends _Utils { + type: "integer"; + integer: number; + } + + interface Double extends _Utils { + type: "double"; + double: number; + } + + interface String extends _Utils { + type: "string"; + string: FernIr.EscapedString; + } + + interface Boolean extends _Utils { + type: "boolean"; + boolean: boolean; + } + + interface Long extends _Utils { + type: "long"; + long: number; + } + + interface Datetime extends _Utils { + type: "datetime"; + datetime: Date; + } + + interface Date_ extends _Utils { + type: "date"; + date: string; + } + + interface Uuid extends _Utils { + type: "uuid"; + uuid: string; + } + + interface _Utils { + _visit: <_Result>(visitor: FernIr.ExamplePrimitive._Visitor<_Result>) => _Result; + } + + interface _Visitor<_Result> { + integer: (value: number) => _Result; + double: (value: number) => _Result; + string: (value: FernIr.EscapedString) => _Result; + boolean: (value: boolean) => _Result; + long: (value: number) => _Result; + datetime: (value: Date) => _Result; + date: (value: string) => _Result; + uuid: (value: string) => _Result; + _other: (value: { type: string }) => _Result; + } +} + +export const ExamplePrimitive = { + integer: (value: number): FernIr.ExamplePrimitive.Integer => { + return { + integer: value, + type: "integer", + _visit: function <_Result>( + this: FernIr.ExamplePrimitive.Integer, + visitor: FernIr.ExamplePrimitive._Visitor<_Result> + ) { + return FernIr.ExamplePrimitive._visit(this, visitor); + }, + }; + }, + + double: (value: number): FernIr.ExamplePrimitive.Double => { + return { + double: value, + type: "double", + _visit: function <_Result>( + this: FernIr.ExamplePrimitive.Double, + visitor: FernIr.ExamplePrimitive._Visitor<_Result> + ) { + return FernIr.ExamplePrimitive._visit(this, visitor); + }, + }; + }, + + string: (value: FernIr.EscapedString): FernIr.ExamplePrimitive.String => { + return { + string: value, + type: "string", + _visit: function <_Result>( + this: FernIr.ExamplePrimitive.String, + visitor: FernIr.ExamplePrimitive._Visitor<_Result> + ) { + return FernIr.ExamplePrimitive._visit(this, visitor); + }, + }; + }, + + boolean: (value: boolean): FernIr.ExamplePrimitive.Boolean => { + return { + boolean: value, + type: "boolean", + _visit: function <_Result>( + this: FernIr.ExamplePrimitive.Boolean, + visitor: FernIr.ExamplePrimitive._Visitor<_Result> + ) { + return FernIr.ExamplePrimitive._visit(this, visitor); + }, + }; + }, + + long: (value: number): FernIr.ExamplePrimitive.Long => { + return { + long: value, + type: "long", + _visit: function <_Result>( + this: FernIr.ExamplePrimitive.Long, + visitor: FernIr.ExamplePrimitive._Visitor<_Result> + ) { + return FernIr.ExamplePrimitive._visit(this, visitor); + }, + }; + }, + + datetime: (value: Date): FernIr.ExamplePrimitive.Datetime => { + return { + datetime: value, + type: "datetime", + _visit: function <_Result>( + this: FernIr.ExamplePrimitive.Datetime, + visitor: FernIr.ExamplePrimitive._Visitor<_Result> + ) { + return FernIr.ExamplePrimitive._visit(this, visitor); + }, + }; + }, + + date: (value: string): FernIr.ExamplePrimitive.Date_ => { + return { + date: value, + type: "date", + _visit: function <_Result>( + this: FernIr.ExamplePrimitive.Date_, + visitor: FernIr.ExamplePrimitive._Visitor<_Result> + ) { + return FernIr.ExamplePrimitive._visit(this, visitor); + }, + }; + }, + + uuid: (value: string): FernIr.ExamplePrimitive.Uuid => { + return { + uuid: value, + type: "uuid", + _visit: function <_Result>( + this: FernIr.ExamplePrimitive.Uuid, + visitor: FernIr.ExamplePrimitive._Visitor<_Result> + ) { + return FernIr.ExamplePrimitive._visit(this, visitor); + }, + }; + }, + + _visit: <_Result>(value: FernIr.ExamplePrimitive, visitor: FernIr.ExamplePrimitive._Visitor<_Result>): _Result => { + switch (value.type) { + case "integer": + return visitor.integer(value.integer); + case "double": + return visitor.double(value.double); + case "string": + return visitor.string(value.string); + case "boolean": + return visitor.boolean(value.boolean); + case "long": + return visitor.long(value.long); + case "datetime": + return visitor.datetime(value.datetime); + case "date": + return visitor.date(value.date); + case "uuid": + return visitor.uuid(value.uuid); + default: + return visitor._other(value as any); + } + }, +} as const; diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleSingleUnionType.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleSingleUnionType.ts new file mode 100644 index 00000000000..a6736671d33 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleSingleUnionType.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface ExampleSingleUnionType { + wireDiscriminantValue: FernIr.NameAndWireValue; + shape: FernIr.ExampleSingleUnionTypeProperties; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleSingleUnionTypeProperties.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleSingleUnionTypeProperties.ts new file mode 100644 index 00000000000..7121f26073e --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleSingleUnionTypeProperties.ts @@ -0,0 +1,93 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export type ExampleSingleUnionTypeProperties = + | FernIr.ExampleSingleUnionTypeProperties.SamePropertiesAsObject + | FernIr.ExampleSingleUnionTypeProperties.SingleProperty + | FernIr.ExampleSingleUnionTypeProperties.NoProperties; + +export declare namespace ExampleSingleUnionTypeProperties { + interface SamePropertiesAsObject extends FernIr.ExampleObjectTypeWithTypeId, _Utils { + type: "samePropertiesAsObject"; + } + + interface SingleProperty extends FernIr.ExampleTypeReference, _Utils { + type: "singleProperty"; + } + + interface NoProperties extends _Utils { + type: "noProperties"; + } + + interface _Utils { + _visit: <_Result>(visitor: FernIr.ExampleSingleUnionTypeProperties._Visitor<_Result>) => _Result; + } + + interface _Visitor<_Result> { + samePropertiesAsObject: (value: FernIr.ExampleObjectTypeWithTypeId) => _Result; + singleProperty: (value: FernIr.ExampleTypeReference) => _Result; + noProperties: () => _Result; + _other: (value: { type: string }) => _Result; + } +} + +export const ExampleSingleUnionTypeProperties = { + samePropertiesAsObject: ( + value: FernIr.ExampleObjectTypeWithTypeId + ): FernIr.ExampleSingleUnionTypeProperties.SamePropertiesAsObject => { + return { + ...value, + type: "samePropertiesAsObject", + _visit: function <_Result>( + this: FernIr.ExampleSingleUnionTypeProperties.SamePropertiesAsObject, + visitor: FernIr.ExampleSingleUnionTypeProperties._Visitor<_Result> + ) { + return FernIr.ExampleSingleUnionTypeProperties._visit(this, visitor); + }, + }; + }, + + singleProperty: (value: FernIr.ExampleTypeReference): FernIr.ExampleSingleUnionTypeProperties.SingleProperty => { + return { + ...value, + type: "singleProperty", + _visit: function <_Result>( + this: FernIr.ExampleSingleUnionTypeProperties.SingleProperty, + visitor: FernIr.ExampleSingleUnionTypeProperties._Visitor<_Result> + ) { + return FernIr.ExampleSingleUnionTypeProperties._visit(this, visitor); + }, + }; + }, + + noProperties: (): FernIr.ExampleSingleUnionTypeProperties.NoProperties => { + return { + type: "noProperties", + _visit: function <_Result>( + this: FernIr.ExampleSingleUnionTypeProperties.NoProperties, + visitor: FernIr.ExampleSingleUnionTypeProperties._Visitor<_Result> + ) { + return FernIr.ExampleSingleUnionTypeProperties._visit(this, visitor); + }, + }; + }, + + _visit: <_Result>( + value: FernIr.ExampleSingleUnionTypeProperties, + visitor: FernIr.ExampleSingleUnionTypeProperties._Visitor<_Result> + ): _Result => { + switch (value.type) { + case "samePropertiesAsObject": + return visitor.samePropertiesAsObject(value); + case "singleProperty": + return visitor.singleProperty(value); + case "noProperties": + return visitor.noProperties(); + default: + return visitor._other(value as any); + } + }, +} as const; diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleType.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleType.ts new file mode 100644 index 00000000000..a07b1ee3152 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleType.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface ExampleType extends FernIr.WithJsonExample, FernIr.WithDocs { + name: FernIr.Name | undefined; + shape: FernIr.ExampleTypeShape; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleTypeReference.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleTypeReference.ts new file mode 100644 index 00000000000..331fd0d63b5 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleTypeReference.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface ExampleTypeReference extends FernIr.WithJsonExample { + shape: FernIr.ExampleTypeReferenceShape; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleTypeReferenceShape.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleTypeReferenceShape.ts new file mode 100644 index 00000000000..c42c1aaf252 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleTypeReferenceShape.ts @@ -0,0 +1,116 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export type ExampleTypeReferenceShape = + | FernIr.ExampleTypeReferenceShape.Primitive + | FernIr.ExampleTypeReferenceShape.Container + | FernIr.ExampleTypeReferenceShape.Unknown + | FernIr.ExampleTypeReferenceShape.Named; + +export declare namespace ExampleTypeReferenceShape { + interface Primitive extends _Utils { + type: "primitive"; + primitive: FernIr.ExamplePrimitive; + } + + interface Container extends _Utils { + type: "container"; + container: FernIr.ExampleContainer; + } + + interface Unknown extends _Utils { + type: "unknown"; + unknown: unknown; + } + + interface Named extends FernIr.ExampleNamedType, _Utils { + type: "named"; + } + + interface _Utils { + _visit: <_Result>(visitor: FernIr.ExampleTypeReferenceShape._Visitor<_Result>) => _Result; + } + + interface _Visitor<_Result> { + primitive: (value: FernIr.ExamplePrimitive) => _Result; + container: (value: FernIr.ExampleContainer) => _Result; + unknown: (value: unknown) => _Result; + named: (value: FernIr.ExampleNamedType) => _Result; + _other: (value: { type: string }) => _Result; + } +} + +export const ExampleTypeReferenceShape = { + primitive: (value: FernIr.ExamplePrimitive): FernIr.ExampleTypeReferenceShape.Primitive => { + return { + primitive: value, + type: "primitive", + _visit: function <_Result>( + this: FernIr.ExampleTypeReferenceShape.Primitive, + visitor: FernIr.ExampleTypeReferenceShape._Visitor<_Result> + ) { + return FernIr.ExampleTypeReferenceShape._visit(this, visitor); + }, + }; + }, + + container: (value: FernIr.ExampleContainer): FernIr.ExampleTypeReferenceShape.Container => { + return { + container: value, + type: "container", + _visit: function <_Result>( + this: FernIr.ExampleTypeReferenceShape.Container, + visitor: FernIr.ExampleTypeReferenceShape._Visitor<_Result> + ) { + return FernIr.ExampleTypeReferenceShape._visit(this, visitor); + }, + }; + }, + + unknown: (value?: unknown): FernIr.ExampleTypeReferenceShape.Unknown => { + return { + unknown: value, + type: "unknown", + _visit: function <_Result>( + this: FernIr.ExampleTypeReferenceShape.Unknown, + visitor: FernIr.ExampleTypeReferenceShape._Visitor<_Result> + ) { + return FernIr.ExampleTypeReferenceShape._visit(this, visitor); + }, + }; + }, + + named: (value: FernIr.ExampleNamedType): FernIr.ExampleTypeReferenceShape.Named => { + return { + ...value, + type: "named", + _visit: function <_Result>( + this: FernIr.ExampleTypeReferenceShape.Named, + visitor: FernIr.ExampleTypeReferenceShape._Visitor<_Result> + ) { + return FernIr.ExampleTypeReferenceShape._visit(this, visitor); + }, + }; + }, + + _visit: <_Result>( + value: FernIr.ExampleTypeReferenceShape, + visitor: FernIr.ExampleTypeReferenceShape._Visitor<_Result> + ): _Result => { + switch (value.type) { + case "primitive": + return visitor.primitive(value.primitive); + case "container": + return visitor.container(value.container); + case "unknown": + return visitor.unknown(value.unknown); + case "named": + return visitor.named(value); + default: + return visitor._other(value as any); + } + }, +} as const; diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleTypeShape.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleTypeShape.ts new file mode 100644 index 00000000000..d77f6c022e5 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleTypeShape.ts @@ -0,0 +1,133 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export type ExampleTypeShape = + | FernIr.ExampleTypeShape.Alias + | FernIr.ExampleTypeShape.Enum + | FernIr.ExampleTypeShape.Object_ + | FernIr.ExampleTypeShape.Union + | FernIr.ExampleTypeShape.UndiscriminatedUnion; + +export declare namespace ExampleTypeShape { + interface Alias extends FernIr.ExampleAliasType, _Utils { + type: "alias"; + } + + interface Enum extends FernIr.ExampleEnumType, _Utils { + type: "enum"; + } + + interface Object_ extends FernIr.ExampleObjectType, _Utils { + type: "object"; + } + + interface Union extends FernIr.ExampleUnionType, _Utils { + type: "union"; + } + + interface UndiscriminatedUnion extends FernIr.ExampleUndiscriminatedUnionType, _Utils { + type: "undiscriminatedUnion"; + } + + interface _Utils { + _visit: <_Result>(visitor: FernIr.ExampleTypeShape._Visitor<_Result>) => _Result; + } + + interface _Visitor<_Result> { + alias: (value: FernIr.ExampleAliasType) => _Result; + enum: (value: FernIr.ExampleEnumType) => _Result; + object: (value: FernIr.ExampleObjectType) => _Result; + union: (value: FernIr.ExampleUnionType) => _Result; + undiscriminatedUnion: (value: FernIr.ExampleUndiscriminatedUnionType) => _Result; + _other: (value: { type: string }) => _Result; + } +} + +export const ExampleTypeShape = { + alias: (value: FernIr.ExampleAliasType): FernIr.ExampleTypeShape.Alias => { + return { + ...value, + type: "alias", + _visit: function <_Result>( + this: FernIr.ExampleTypeShape.Alias, + visitor: FernIr.ExampleTypeShape._Visitor<_Result> + ) { + return FernIr.ExampleTypeShape._visit(this, visitor); + }, + }; + }, + + enum: (value: FernIr.ExampleEnumType): FernIr.ExampleTypeShape.Enum => { + return { + ...value, + type: "enum", + _visit: function <_Result>( + this: FernIr.ExampleTypeShape.Enum, + visitor: FernIr.ExampleTypeShape._Visitor<_Result> + ) { + return FernIr.ExampleTypeShape._visit(this, visitor); + }, + }; + }, + + object: (value: FernIr.ExampleObjectType): FernIr.ExampleTypeShape.Object_ => { + return { + ...value, + type: "object", + _visit: function <_Result>( + this: FernIr.ExampleTypeShape.Object_, + visitor: FernIr.ExampleTypeShape._Visitor<_Result> + ) { + return FernIr.ExampleTypeShape._visit(this, visitor); + }, + }; + }, + + union: (value: FernIr.ExampleUnionType): FernIr.ExampleTypeShape.Union => { + return { + ...value, + type: "union", + _visit: function <_Result>( + this: FernIr.ExampleTypeShape.Union, + visitor: FernIr.ExampleTypeShape._Visitor<_Result> + ) { + return FernIr.ExampleTypeShape._visit(this, visitor); + }, + }; + }, + + undiscriminatedUnion: ( + value: FernIr.ExampleUndiscriminatedUnionType + ): FernIr.ExampleTypeShape.UndiscriminatedUnion => { + return { + ...value, + type: "undiscriminatedUnion", + _visit: function <_Result>( + this: FernIr.ExampleTypeShape.UndiscriminatedUnion, + visitor: FernIr.ExampleTypeShape._Visitor<_Result> + ) { + return FernIr.ExampleTypeShape._visit(this, visitor); + }, + }; + }, + + _visit: <_Result>(value: FernIr.ExampleTypeShape, visitor: FernIr.ExampleTypeShape._Visitor<_Result>): _Result => { + switch (value.type) { + case "alias": + return visitor.alias(value); + case "enum": + return visitor.enum(value); + case "object": + return visitor.object(value); + case "union": + return visitor.union(value); + case "undiscriminatedUnion": + return visitor.undiscriminatedUnion(value); + default: + return visitor._other(value as any); + } + }, +} as const; diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleUndiscriminatedUnionType.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleUndiscriminatedUnionType.ts new file mode 100644 index 00000000000..6d08e022b79 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleUndiscriminatedUnionType.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface ExampleUndiscriminatedUnionType { + /** + * The zero-based index of the undiscriminated union variant. + * For the following undiscriminated union + * + * ``` + * MyUnion: + * discriminated: false + * union: + * - string + * - integer + * ``` + * + * a string example would have an index 0 and an integer example + * would have an index 1. + */ + index: number; + singleUnionType: FernIr.ExampleTypeReference; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleUnionType.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleUnionType.ts new file mode 100644 index 00000000000..078c0da7a9f --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/ExampleUnionType.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface ExampleUnionType { + discriminant: FernIr.NameAndWireValue; + singleUnionType: FernIr.ExampleSingleUnionType; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/Literal.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/Literal.ts new file mode 100644 index 00000000000..a0e72864399 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/Literal.ts @@ -0,0 +1,62 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export type Literal = FernIr.Literal.String | FernIr.Literal.Boolean; + +export declare namespace Literal { + interface String extends _Utils { + type: "string"; + string: string; + } + + interface Boolean extends _Utils { + type: "boolean"; + boolean: boolean; + } + + interface _Utils { + _visit: <_Result>(visitor: FernIr.Literal._Visitor<_Result>) => _Result; + } + + interface _Visitor<_Result> { + string: (value: string) => _Result; + boolean: (value: boolean) => _Result; + _other: (value: { type: string }) => _Result; + } +} + +export const Literal = { + string: (value: string): FernIr.Literal.String => { + return { + string: value, + type: "string", + _visit: function <_Result>(this: FernIr.Literal.String, visitor: FernIr.Literal._Visitor<_Result>) { + return FernIr.Literal._visit(this, visitor); + }, + }; + }, + + boolean: (value: boolean): FernIr.Literal.Boolean => { + return { + boolean: value, + type: "boolean", + _visit: function <_Result>(this: FernIr.Literal.Boolean, visitor: FernIr.Literal._Visitor<_Result>) { + return FernIr.Literal._visit(this, visitor); + }, + }; + }, + + _visit: <_Result>(value: FernIr.Literal, visitor: FernIr.Literal._Visitor<_Result>): _Result => { + switch (value.type) { + case "string": + return visitor.string(value.string); + case "boolean": + return visitor.boolean(value.boolean); + default: + return visitor._other(value as any); + } + }, +} as const; diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/MapType.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/MapType.ts new file mode 100644 index 00000000000..99eef4f2030 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/MapType.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface MapType { + keyType: FernIr.TypeReference; + valueType: FernIr.TypeReference; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/ObjectProperty.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/ObjectProperty.ts new file mode 100644 index 00000000000..a458a566899 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/ObjectProperty.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface ObjectProperty extends FernIr.Declaration { + name: FernIr.NameAndWireValue; + valueType: FernIr.TypeReference; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/ObjectTypeDeclaration.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/ObjectTypeDeclaration.ts new file mode 100644 index 00000000000..378d9c9b2f4 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/ObjectTypeDeclaration.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface ObjectTypeDeclaration { + /** A list of other types to inherit from */ + extends: FernIr.DeclaredTypeName[]; + properties: FernIr.ObjectProperty[]; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/PrimitiveType.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/PrimitiveType.ts new file mode 100644 index 00000000000..3200da2ce02 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/PrimitiveType.ts @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type PrimitiveType = + | "INTEGER" + | "DOUBLE" + | "STRING" + | "BOOLEAN" + /** + * Within the range -2^53 to 2^53 */ + | "LONG" + | "DATE_TIME" + | "DATE" + | "UUID" + | "BASE_64"; + +export const PrimitiveType = { + Integer: "INTEGER", + Double: "DOUBLE", + String: "STRING", + Boolean: "BOOLEAN", + Long: "LONG", + DateTime: "DATE_TIME", + Date: "DATE", + Uuid: "UUID", + Base64: "BASE_64", + _visit: (value: PrimitiveType, visitor: PrimitiveType.Visitor) => { + switch (value) { + case PrimitiveType.Integer: + return visitor.integer(); + case PrimitiveType.Double: + return visitor.double(); + case PrimitiveType.String: + return visitor.string(); + case PrimitiveType.Boolean: + return visitor.boolean(); + case PrimitiveType.Long: + return visitor.long(); + case PrimitiveType.DateTime: + return visitor.dateTime(); + case PrimitiveType.Date: + return visitor.date(); + case PrimitiveType.Uuid: + return visitor.uuid(); + case PrimitiveType.Base64: + return visitor.base64(); + default: + return visitor._other(); + } + }, +} as const; + +export declare namespace PrimitiveType { + interface Visitor { + integer: () => R; + double: () => R; + string: () => R; + boolean: () => R; + long: () => R; + dateTime: () => R; + date: () => R; + uuid: () => R; + base64: () => R; + _other: () => R; + } +} diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/ResolvedNamedType.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/ResolvedNamedType.ts new file mode 100644 index 00000000000..51f5d6aa1fa --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/ResolvedNamedType.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface ResolvedNamedType { + name: FernIr.DeclaredTypeName; + shape: FernIr.ShapeType; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/ResolvedTypeReference.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/ResolvedTypeReference.ts new file mode 100644 index 00000000000..ee784734091 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/ResolvedTypeReference.ts @@ -0,0 +1,114 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export type ResolvedTypeReference = + | FernIr.ResolvedTypeReference.Container + | FernIr.ResolvedTypeReference.Named + | FernIr.ResolvedTypeReference.Primitive + | FernIr.ResolvedTypeReference.Unknown; + +export declare namespace ResolvedTypeReference { + interface Container extends _Utils { + type: "container"; + container: FernIr.ContainerType; + } + + interface Named extends FernIr.ResolvedNamedType, _Utils { + type: "named"; + } + + interface Primitive extends _Utils { + type: "primitive"; + primitive: FernIr.PrimitiveType; + } + + interface Unknown extends _Utils { + type: "unknown"; + } + + interface _Utils { + _visit: <_Result>(visitor: FernIr.ResolvedTypeReference._Visitor<_Result>) => _Result; + } + + interface _Visitor<_Result> { + container: (value: FernIr.ContainerType) => _Result; + named: (value: FernIr.ResolvedNamedType) => _Result; + primitive: (value: FernIr.PrimitiveType) => _Result; + unknown: () => _Result; + _other: (value: { type: string }) => _Result; + } +} + +export const ResolvedTypeReference = { + container: (value: FernIr.ContainerType): FernIr.ResolvedTypeReference.Container => { + return { + container: value, + type: "container", + _visit: function <_Result>( + this: FernIr.ResolvedTypeReference.Container, + visitor: FernIr.ResolvedTypeReference._Visitor<_Result> + ) { + return FernIr.ResolvedTypeReference._visit(this, visitor); + }, + }; + }, + + named: (value: FernIr.ResolvedNamedType): FernIr.ResolvedTypeReference.Named => { + return { + ...value, + type: "named", + _visit: function <_Result>( + this: FernIr.ResolvedTypeReference.Named, + visitor: FernIr.ResolvedTypeReference._Visitor<_Result> + ) { + return FernIr.ResolvedTypeReference._visit(this, visitor); + }, + }; + }, + + primitive: (value: FernIr.PrimitiveType): FernIr.ResolvedTypeReference.Primitive => { + return { + primitive: value, + type: "primitive", + _visit: function <_Result>( + this: FernIr.ResolvedTypeReference.Primitive, + visitor: FernIr.ResolvedTypeReference._Visitor<_Result> + ) { + return FernIr.ResolvedTypeReference._visit(this, visitor); + }, + }; + }, + + unknown: (): FernIr.ResolvedTypeReference.Unknown => { + return { + type: "unknown", + _visit: function <_Result>( + this: FernIr.ResolvedTypeReference.Unknown, + visitor: FernIr.ResolvedTypeReference._Visitor<_Result> + ) { + return FernIr.ResolvedTypeReference._visit(this, visitor); + }, + }; + }, + + _visit: <_Result>( + value: FernIr.ResolvedTypeReference, + visitor: FernIr.ResolvedTypeReference._Visitor<_Result> + ): _Result => { + switch (value.type) { + case "container": + return visitor.container(value.container); + case "named": + return visitor.named(value); + case "primitive": + return visitor.primitive(value.primitive); + case "unknown": + return visitor.unknown(); + default: + return visitor._other(value as any); + } + }, +} as const; diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/ShapeType.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/ShapeType.ts new file mode 100644 index 00000000000..eead84be79d --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/ShapeType.ts @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ShapeType = "ENUM" | "OBJECT" | "UNION" | "UNDISCRIMINATED_UNION"; + +export const ShapeType = { + Enum: "ENUM", + Object: "OBJECT", + Union: "UNION", + UndiscriminatedUnion: "UNDISCRIMINATED_UNION", + _visit: (value: ShapeType, visitor: ShapeType.Visitor) => { + switch (value) { + case ShapeType.Enum: + return visitor.enum(); + case ShapeType.Object: + return visitor.object(); + case ShapeType.Union: + return visitor.union(); + case ShapeType.UndiscriminatedUnion: + return visitor.undiscriminatedUnion(); + default: + return visitor._other(); + } + }, +} as const; + +export declare namespace ShapeType { + interface Visitor { + enum: () => R; + object: () => R; + union: () => R; + undiscriminatedUnion: () => R; + _other: () => R; + } +} diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/SingleUnionType.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/SingleUnionType.ts new file mode 100644 index 00000000000..c9e11ab5ad4 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/SingleUnionType.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface SingleUnionType extends FernIr.WithDocs { + discriminantValue: FernIr.NameAndWireValue; + shape: FernIr.SingleUnionTypeProperties; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/SingleUnionTypeProperties.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/SingleUnionTypeProperties.ts new file mode 100644 index 00000000000..cd8843ea095 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/SingleUnionTypeProperties.ts @@ -0,0 +1,93 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export type SingleUnionTypeProperties = + | FernIr.SingleUnionTypeProperties.SamePropertiesAsObject + | FernIr.SingleUnionTypeProperties.SingleProperty + | FernIr.SingleUnionTypeProperties.NoProperties; + +export declare namespace SingleUnionTypeProperties { + interface SamePropertiesAsObject extends FernIr.DeclaredTypeName, _Utils { + propertiesType: "samePropertiesAsObject"; + } + + interface SingleProperty extends FernIr.SingleUnionTypeProperty, _Utils { + propertiesType: "singleProperty"; + } + + interface NoProperties extends _Utils { + propertiesType: "noProperties"; + } + + interface _Utils { + _visit: <_Result>(visitor: FernIr.SingleUnionTypeProperties._Visitor<_Result>) => _Result; + } + + interface _Visitor<_Result> { + samePropertiesAsObject: (value: FernIr.DeclaredTypeName) => _Result; + singleProperty: (value: FernIr.SingleUnionTypeProperty) => _Result; + noProperties: () => _Result; + _other: (value: { propertiesType: string }) => _Result; + } +} + +export const SingleUnionTypeProperties = { + samePropertiesAsObject: ( + value: FernIr.DeclaredTypeName + ): FernIr.SingleUnionTypeProperties.SamePropertiesAsObject => { + return { + ...value, + propertiesType: "samePropertiesAsObject", + _visit: function <_Result>( + this: FernIr.SingleUnionTypeProperties.SamePropertiesAsObject, + visitor: FernIr.SingleUnionTypeProperties._Visitor<_Result> + ) { + return FernIr.SingleUnionTypeProperties._visit(this, visitor); + }, + }; + }, + + singleProperty: (value: FernIr.SingleUnionTypeProperty): FernIr.SingleUnionTypeProperties.SingleProperty => { + return { + ...value, + propertiesType: "singleProperty", + _visit: function <_Result>( + this: FernIr.SingleUnionTypeProperties.SingleProperty, + visitor: FernIr.SingleUnionTypeProperties._Visitor<_Result> + ) { + return FernIr.SingleUnionTypeProperties._visit(this, visitor); + }, + }; + }, + + noProperties: (): FernIr.SingleUnionTypeProperties.NoProperties => { + return { + propertiesType: "noProperties", + _visit: function <_Result>( + this: FernIr.SingleUnionTypeProperties.NoProperties, + visitor: FernIr.SingleUnionTypeProperties._Visitor<_Result> + ) { + return FernIr.SingleUnionTypeProperties._visit(this, visitor); + }, + }; + }, + + _visit: <_Result>( + value: FernIr.SingleUnionTypeProperties, + visitor: FernIr.SingleUnionTypeProperties._Visitor<_Result> + ): _Result => { + switch (value.propertiesType) { + case "samePropertiesAsObject": + return visitor.samePropertiesAsObject(value); + case "singleProperty": + return visitor.singleProperty(value); + case "noProperties": + return visitor.noProperties(); + default: + return visitor._other(value as any); + } + }, +} as const; diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/SingleUnionTypeProperty.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/SingleUnionTypeProperty.ts new file mode 100644 index 00000000000..a2927eeabc6 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/SingleUnionTypeProperty.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface SingleUnionTypeProperty { + name: FernIr.NameAndWireValue; + type: FernIr.TypeReference; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/Type.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/Type.ts new file mode 100644 index 00000000000..42e9f075aab --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/Type.ts @@ -0,0 +1,116 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export type Type = + | FernIr.Type.Alias + | FernIr.Type.Enum + | FernIr.Type.Object_ + | FernIr.Type.Union + | FernIr.Type.UndiscriminatedUnion; + +export declare namespace Type { + interface Alias extends FernIr.AliasTypeDeclaration, _Utils { + type: "alias"; + } + + interface Enum extends FernIr.EnumTypeDeclaration, _Utils { + type: "enum"; + } + + interface Object_ extends FernIr.ObjectTypeDeclaration, _Utils { + type: "object"; + } + + interface Union extends FernIr.UnionTypeDeclaration, _Utils { + type: "union"; + } + + interface UndiscriminatedUnion extends FernIr.UndiscriminatedUnionTypeDeclaration, _Utils { + type: "undiscriminatedUnion"; + } + + interface _Utils { + _visit: <_Result>(visitor: FernIr.Type._Visitor<_Result>) => _Result; + } + + interface _Visitor<_Result> { + alias: (value: FernIr.AliasTypeDeclaration) => _Result; + enum: (value: FernIr.EnumTypeDeclaration) => _Result; + object: (value: FernIr.ObjectTypeDeclaration) => _Result; + union: (value: FernIr.UnionTypeDeclaration) => _Result; + undiscriminatedUnion: (value: FernIr.UndiscriminatedUnionTypeDeclaration) => _Result; + _other: (value: { type: string }) => _Result; + } +} + +export const Type = { + alias: (value: FernIr.AliasTypeDeclaration): FernIr.Type.Alias => { + return { + ...value, + type: "alias", + _visit: function <_Result>(this: FernIr.Type.Alias, visitor: FernIr.Type._Visitor<_Result>) { + return FernIr.Type._visit(this, visitor); + }, + }; + }, + + enum: (value: FernIr.EnumTypeDeclaration): FernIr.Type.Enum => { + return { + ...value, + type: "enum", + _visit: function <_Result>(this: FernIr.Type.Enum, visitor: FernIr.Type._Visitor<_Result>) { + return FernIr.Type._visit(this, visitor); + }, + }; + }, + + object: (value: FernIr.ObjectTypeDeclaration): FernIr.Type.Object_ => { + return { + ...value, + type: "object", + _visit: function <_Result>(this: FernIr.Type.Object_, visitor: FernIr.Type._Visitor<_Result>) { + return FernIr.Type._visit(this, visitor); + }, + }; + }, + + union: (value: FernIr.UnionTypeDeclaration): FernIr.Type.Union => { + return { + ...value, + type: "union", + _visit: function <_Result>(this: FernIr.Type.Union, visitor: FernIr.Type._Visitor<_Result>) { + return FernIr.Type._visit(this, visitor); + }, + }; + }, + + undiscriminatedUnion: (value: FernIr.UndiscriminatedUnionTypeDeclaration): FernIr.Type.UndiscriminatedUnion => { + return { + ...value, + type: "undiscriminatedUnion", + _visit: function <_Result>(this: FernIr.Type.UndiscriminatedUnion, visitor: FernIr.Type._Visitor<_Result>) { + return FernIr.Type._visit(this, visitor); + }, + }; + }, + + _visit: <_Result>(value: FernIr.Type, visitor: FernIr.Type._Visitor<_Result>): _Result => { + switch (value.type) { + case "alias": + return visitor.alias(value); + case "enum": + return visitor.enum(value); + case "object": + return visitor.object(value); + case "union": + return visitor.union(value); + case "undiscriminatedUnion": + return visitor.undiscriminatedUnion(value); + default: + return visitor._other(value as any); + } + }, +} as const; diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/TypeDeclaration.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/TypeDeclaration.ts new file mode 100644 index 00000000000..78e23b57164 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/TypeDeclaration.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +/** + * A type, which is a name and a shape + */ +export interface TypeDeclaration extends FernIr.Declaration { + name: FernIr.DeclaredTypeName; + shape: FernIr.Type; + examples: FernIr.ExampleType[]; + /** All other named types that this type references (directly or indirectly) */ + referencedTypes: Set; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/TypeReference.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/TypeReference.ts new file mode 100644 index 00000000000..5022baf9de8 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/TypeReference.ts @@ -0,0 +1,111 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export type TypeReference = + | FernIr.TypeReference.Container + | FernIr.TypeReference.Named + | FernIr.TypeReference.Primitive + | FernIr.TypeReference.Unknown; + +export declare namespace TypeReference { + interface Container extends _Utils { + type: "container"; + container: FernIr.ContainerType; + } + + interface Named extends FernIr.DeclaredTypeName, _Utils { + type: "named"; + } + + interface Primitive extends _Utils { + type: "primitive"; + primitive: FernIr.PrimitiveType; + } + + interface Unknown extends _Utils { + type: "unknown"; + } + + interface _Utils { + _visit: <_Result>(visitor: FernIr.TypeReference._Visitor<_Result>) => _Result; + } + + interface _Visitor<_Result> { + container: (value: FernIr.ContainerType) => _Result; + named: (value: FernIr.DeclaredTypeName) => _Result; + primitive: (value: FernIr.PrimitiveType) => _Result; + unknown: () => _Result; + _other: (value: { type: string }) => _Result; + } +} + +export const TypeReference = { + container: (value: FernIr.ContainerType): FernIr.TypeReference.Container => { + return { + container: value, + type: "container", + _visit: function <_Result>( + this: FernIr.TypeReference.Container, + visitor: FernIr.TypeReference._Visitor<_Result> + ) { + return FernIr.TypeReference._visit(this, visitor); + }, + }; + }, + + named: (value: FernIr.DeclaredTypeName): FernIr.TypeReference.Named => { + return { + ...value, + type: "named", + _visit: function <_Result>( + this: FernIr.TypeReference.Named, + visitor: FernIr.TypeReference._Visitor<_Result> + ) { + return FernIr.TypeReference._visit(this, visitor); + }, + }; + }, + + primitive: (value: FernIr.PrimitiveType): FernIr.TypeReference.Primitive => { + return { + primitive: value, + type: "primitive", + _visit: function <_Result>( + this: FernIr.TypeReference.Primitive, + visitor: FernIr.TypeReference._Visitor<_Result> + ) { + return FernIr.TypeReference._visit(this, visitor); + }, + }; + }, + + unknown: (): FernIr.TypeReference.Unknown => { + return { + type: "unknown", + _visit: function <_Result>( + this: FernIr.TypeReference.Unknown, + visitor: FernIr.TypeReference._Visitor<_Result> + ) { + return FernIr.TypeReference._visit(this, visitor); + }, + }; + }, + + _visit: <_Result>(value: FernIr.TypeReference, visitor: FernIr.TypeReference._Visitor<_Result>): _Result => { + switch (value.type) { + case "container": + return visitor.container(value.container); + case "named": + return visitor.named(value); + case "primitive": + return visitor.primitive(value.primitive); + case "unknown": + return visitor.unknown(); + default: + return visitor._other(value as any); + } + }, +} as const; diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/UndiscriminatedUnionMember.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/UndiscriminatedUnionMember.ts new file mode 100644 index 00000000000..6e1bf8dded7 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/UndiscriminatedUnionMember.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface UndiscriminatedUnionMember extends FernIr.WithDocs { + type: FernIr.TypeReference; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/UndiscriminatedUnionTypeDeclaration.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/UndiscriminatedUnionTypeDeclaration.ts new file mode 100644 index 00000000000..56bc58d0fe4 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/UndiscriminatedUnionTypeDeclaration.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface UndiscriminatedUnionTypeDeclaration { + members: FernIr.UndiscriminatedUnionMember[]; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/UnionTypeDeclaration.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/UnionTypeDeclaration.ts new file mode 100644 index 00000000000..5c9fe26d68e --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/UnionTypeDeclaration.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface UnionTypeDeclaration { + discriminant: FernIr.NameAndWireValue; + /** A list of other types to inherit from */ + extends: FernIr.DeclaredTypeName[]; + types: FernIr.SingleUnionType[]; + baseProperties: FernIr.ObjectProperty[]; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/types/types/index.ts b/packages/ir-sdk/src/sdk/api/resources/types/types/index.ts new file mode 100644 index 00000000000..a5a7212d91d --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/types/types/index.ts @@ -0,0 +1,39 @@ +export * from "./TypeDeclaration"; +export * from "./DeclaredTypeName"; +export * from "./Type"; +export * from "./AliasTypeDeclaration"; +export * from "./ResolvedTypeReference"; +export * from "./ResolvedNamedType"; +export * from "./ShapeType"; +export * from "./EnumTypeDeclaration"; +export * from "./EnumValue"; +export * from "./ObjectTypeDeclaration"; +export * from "./ObjectProperty"; +export * from "./UnionTypeDeclaration"; +export * from "./SingleUnionType"; +export * from "./SingleUnionTypeProperties"; +export * from "./SingleUnionTypeProperty"; +export * from "./UndiscriminatedUnionTypeDeclaration"; +export * from "./UndiscriminatedUnionMember"; +export * from "./TypeReference"; +export * from "./ContainerType"; +export * from "./MapType"; +export * from "./PrimitiveType"; +export * from "./Literal"; +export * from "./ExampleType"; +export * from "./ExampleTypeShape"; +export * from "./ExampleAliasType"; +export * from "./ExampleEnumType"; +export * from "./ExampleObjectType"; +export * from "./ExampleObjectProperty"; +export * from "./ExampleUnionType"; +export * from "./ExampleUndiscriminatedUnionType"; +export * from "./ExampleSingleUnionType"; +export * from "./ExampleSingleUnionTypeProperties"; +export * from "./ExampleTypeReference"; +export * from "./ExampleTypeReferenceShape"; +export * from "./ExampleContainer"; +export * from "./ExampleKeyValuePair"; +export * from "./ExamplePrimitive"; +export * from "./ExampleNamedType"; +export * from "./ExampleObjectTypeWithTypeId"; diff --git a/packages/ir-sdk/src/sdk/api/resources/variables/index.ts b/packages/ir-sdk/src/sdk/api/resources/variables/index.ts new file mode 100644 index 00000000000..eea524d6557 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/variables/index.ts @@ -0,0 +1 @@ +export * from "./types"; diff --git a/packages/ir-sdk/src/sdk/api/resources/variables/types/VariableDeclaration.ts b/packages/ir-sdk/src/sdk/api/resources/variables/types/VariableDeclaration.ts new file mode 100644 index 00000000000..4c881586841 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/variables/types/VariableDeclaration.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface VariableDeclaration extends FernIr.WithDocs { + id: FernIr.VariableId; + name: FernIr.Name; + type: FernIr.TypeReference; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/variables/types/VariableId.ts b/packages/ir-sdk/src/sdk/api/resources/variables/types/VariableId.ts new file mode 100644 index 00000000000..d8eaee87e0f --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/variables/types/VariableId.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type VariableId = string; diff --git a/packages/ir-sdk/src/sdk/api/resources/variables/types/index.ts b/packages/ir-sdk/src/sdk/api/resources/variables/types/index.ts new file mode 100644 index 00000000000..e16556a7edc --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/variables/types/index.ts @@ -0,0 +1,2 @@ +export * from "./VariableId"; +export * from "./VariableDeclaration"; diff --git a/packages/ir-sdk/src/sdk/api/resources/webhooks/index.ts b/packages/ir-sdk/src/sdk/api/resources/webhooks/index.ts new file mode 100644 index 00000000000..eea524d6557 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/webhooks/index.ts @@ -0,0 +1 @@ +export * from "./types"; diff --git a/packages/ir-sdk/src/sdk/api/resources/webhooks/types/InlinedWebhookPayload.ts b/packages/ir-sdk/src/sdk/api/resources/webhooks/types/InlinedWebhookPayload.ts new file mode 100644 index 00000000000..d13d18f2d45 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/webhooks/types/InlinedWebhookPayload.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface InlinedWebhookPayload { + name: FernIr.Name; + extends: FernIr.DeclaredTypeName[]; + properties: FernIr.InlinedWebhookPayloadProperty[]; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/webhooks/types/InlinedWebhookPayloadProperty.ts b/packages/ir-sdk/src/sdk/api/resources/webhooks/types/InlinedWebhookPayloadProperty.ts new file mode 100644 index 00000000000..05c2a71df61 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/webhooks/types/InlinedWebhookPayloadProperty.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface InlinedWebhookPayloadProperty extends FernIr.WithDocs { + name: FernIr.NameAndWireValue; + valueType: FernIr.TypeReference; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/webhooks/types/Webhook.ts b/packages/ir-sdk/src/sdk/api/resources/webhooks/types/Webhook.ts new file mode 100644 index 00000000000..4eccb4cdad9 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/webhooks/types/Webhook.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface Webhook extends FernIr.Declaration { + name: FernIr.WebhookName; + displayName: string | undefined; + method: FernIr.WebhookHttpMethod; + headers: FernIr.HttpHeader[]; + payload: FernIr.WebhookPayload; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/webhooks/types/WebhookGroup.ts b/packages/ir-sdk/src/sdk/api/resources/webhooks/types/WebhookGroup.ts new file mode 100644 index 00000000000..314cb33c522 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/webhooks/types/WebhookGroup.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export type WebhookGroup = FernIr.Webhook[]; diff --git a/packages/ir-sdk/src/sdk/api/resources/webhooks/types/WebhookHttpMethod.ts b/packages/ir-sdk/src/sdk/api/resources/webhooks/types/WebhookHttpMethod.ts new file mode 100644 index 00000000000..94b8362c041 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/webhooks/types/WebhookHttpMethod.ts @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type WebhookHttpMethod = "GET" | "POST"; + +export const WebhookHttpMethod = { + Get: "GET", + Post: "POST", + _visit: (value: WebhookHttpMethod, visitor: WebhookHttpMethod.Visitor) => { + switch (value) { + case WebhookHttpMethod.Get: + return visitor.get(); + case WebhookHttpMethod.Post: + return visitor.post(); + default: + return visitor._other(); + } + }, +} as const; + +export declare namespace WebhookHttpMethod { + interface Visitor { + get: () => R; + post: () => R; + _other: () => R; + } +} diff --git a/packages/ir-sdk/src/sdk/api/resources/webhooks/types/WebhookName.ts b/packages/ir-sdk/src/sdk/api/resources/webhooks/types/WebhookName.ts new file mode 100644 index 00000000000..b686dd1d3f4 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/webhooks/types/WebhookName.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export type WebhookName = FernIr.Name; diff --git a/packages/ir-sdk/src/sdk/api/resources/webhooks/types/WebhookPayload.ts b/packages/ir-sdk/src/sdk/api/resources/webhooks/types/WebhookPayload.ts new file mode 100644 index 00000000000..325c84b2cb2 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/webhooks/types/WebhookPayload.ts @@ -0,0 +1,66 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export type WebhookPayload = FernIr.WebhookPayload.InlinedPayload | FernIr.WebhookPayload.Reference; + +export declare namespace WebhookPayload { + interface InlinedPayload extends FernIr.InlinedWebhookPayload, _Utils { + type: "inlinedPayload"; + } + + interface Reference extends FernIr.WebhookPayloadReference, _Utils { + type: "reference"; + } + + interface _Utils { + _visit: <_Result>(visitor: FernIr.WebhookPayload._Visitor<_Result>) => _Result; + } + + interface _Visitor<_Result> { + inlinedPayload: (value: FernIr.InlinedWebhookPayload) => _Result; + reference: (value: FernIr.WebhookPayloadReference) => _Result; + _other: (value: { type: string }) => _Result; + } +} + +export const WebhookPayload = { + inlinedPayload: (value: FernIr.InlinedWebhookPayload): FernIr.WebhookPayload.InlinedPayload => { + return { + ...value, + type: "inlinedPayload", + _visit: function <_Result>( + this: FernIr.WebhookPayload.InlinedPayload, + visitor: FernIr.WebhookPayload._Visitor<_Result> + ) { + return FernIr.WebhookPayload._visit(this, visitor); + }, + }; + }, + + reference: (value: FernIr.WebhookPayloadReference): FernIr.WebhookPayload.Reference => { + return { + ...value, + type: "reference", + _visit: function <_Result>( + this: FernIr.WebhookPayload.Reference, + visitor: FernIr.WebhookPayload._Visitor<_Result> + ) { + return FernIr.WebhookPayload._visit(this, visitor); + }, + }; + }, + + _visit: <_Result>(value: FernIr.WebhookPayload, visitor: FernIr.WebhookPayload._Visitor<_Result>): _Result => { + switch (value.type) { + case "inlinedPayload": + return visitor.inlinedPayload(value); + case "reference": + return visitor.reference(value); + default: + return visitor._other(value as any); + } + }, +} as const; diff --git a/packages/ir-sdk/src/sdk/api/resources/webhooks/types/WebhookPayloadReference.ts b/packages/ir-sdk/src/sdk/api/resources/webhooks/types/WebhookPayloadReference.ts new file mode 100644 index 00000000000..a456f83bd93 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/webhooks/types/WebhookPayloadReference.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../.."; + +export interface WebhookPayloadReference extends FernIr.WithDocs { + payloadType: FernIr.TypeReference; +} diff --git a/packages/ir-sdk/src/sdk/api/resources/webhooks/types/index.ts b/packages/ir-sdk/src/sdk/api/resources/webhooks/types/index.ts new file mode 100644 index 00000000000..2c43a9cd9bf --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/webhooks/types/index.ts @@ -0,0 +1,8 @@ +export * from "./WebhookGroup"; +export * from "./Webhook"; +export * from "./WebhookName"; +export * from "./WebhookPayload"; +export * from "./WebhookPayloadReference"; +export * from "./InlinedWebhookPayload"; +export * from "./InlinedWebhookPayloadProperty"; +export * from "./WebhookHttpMethod"; diff --git a/packages/ir-sdk/src/sdk/core/index.ts b/packages/ir-sdk/src/sdk/core/index.ts new file mode 100644 index 00000000000..3ae53c06d38 --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/index.ts @@ -0,0 +1 @@ +export * as serialization from "./schemas"; diff --git a/packages/ir-sdk/src/sdk/core/schemas/Schema.ts b/packages/ir-sdk/src/sdk/core/schemas/Schema.ts new file mode 100644 index 00000000000..870f373ba87 --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/Schema.ts @@ -0,0 +1,94 @@ +import { SchemaUtils } from "./builders"; +import { MaybePromise } from "./utils/MaybePromise"; + +export type Schema = BaseSchema & SchemaUtils; + +export type inferRaw = S extends Schema ? Raw : never; +export type inferParsed = S extends Schema ? Parsed : never; + +export interface BaseSchema { + parse: (raw: unknown, opts?: SchemaOptions) => MaybePromise>; + json: (parsed: unknown, opts?: SchemaOptions) => MaybePromise>; + getType: () => SchemaType | Promise; +} + +export const SchemaType = { + DATE: "date", + ENUM: "enum", + LIST: "list", + STRING_LITERAL: "stringLiteral", + BOOLEAN_LITERAL: "booleanLiteral", + OBJECT: "object", + ANY: "any", + BOOLEAN: "boolean", + NUMBER: "number", + STRING: "string", + UNKNOWN: "unknown", + RECORD: "record", + SET: "set", + UNION: "union", + UNDISCRIMINATED_UNION: "undiscriminatedUnion", + OPTIONAL: "optional", +} as const; +export type SchemaType = typeof SchemaType[keyof typeof SchemaType]; + +export type MaybeValid = Valid | Invalid; + +export interface Valid { + ok: true; + value: T; +} + +export interface Invalid { + ok: false; + errors: ValidationError[]; +} + +export interface ValidationError { + path: string[]; + message: string; +} + +export interface SchemaOptions { + /** + * how to handle unrecognized keys in objects + * + * @default "fail" + */ + unrecognizedObjectKeys?: "fail" | "passthrough" | "strip"; + + /** + * whether to fail when an unrecognized discriminant value is + * encountered in a union + * + * @default false + */ + allowUnrecognizedUnionMembers?: boolean; + + /** + * whether to fail when an unrecognized enum value is encountered + * + * @default false + */ + allowUnrecognizedEnumValues?: boolean; + + /** + * whether to allow data that doesn't conform to the schema. + * invalid data is passed through without transformation. + * + * when this is enabled, .parse() and .json() will always + * return `ok: true`. `.parseOrThrow()` and `.jsonOrThrow()` + * will never fail. + * + * @default false + */ + skipValidation?: boolean; + + /** + * each validation failure contains a "path" property, which is + * the breadcrumbs to the offending node in the JSON. you can supply + * a prefix that is prepended to all the errors' paths. this can be + * helpful for zurg's internal debug logging. + */ + breadcrumbsPrefix?: string[]; +} diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/date/date.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/date/date.ts new file mode 100644 index 00000000000..b70f24b045a --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/date/date.ts @@ -0,0 +1,65 @@ +import { BaseSchema, Schema, SchemaType } from "../../Schema"; +import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; +import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; +import { getSchemaUtils } from "../schema-utils"; + +// https://stackoverflow.com/questions/12756159/regex-and-iso8601-formatted-datetime +const ISO_8601_REGEX = + /^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/; + +export function date(): Schema { + const baseSchema: BaseSchema = { + parse: (raw, { breadcrumbsPrefix = [] } = {}) => { + if (typeof raw !== "string") { + return { + ok: false, + errors: [ + { + path: breadcrumbsPrefix, + message: getErrorMessageForIncorrectType(raw, "string"), + }, + ], + }; + } + if (!ISO_8601_REGEX.test(raw)) { + return { + ok: false, + errors: [ + { + path: breadcrumbsPrefix, + message: getErrorMessageForIncorrectType(raw, "ISO 8601 date string"), + }, + ], + }; + } + return { + ok: true, + value: new Date(raw), + }; + }, + json: (date, { breadcrumbsPrefix = [] } = {}) => { + if (date instanceof Date) { + return { + ok: true, + value: date.toISOString(), + }; + } else { + return { + ok: false, + errors: [ + { + path: breadcrumbsPrefix, + message: getErrorMessageForIncorrectType(date, "Date object"), + }, + ], + }; + } + }, + getType: () => SchemaType.DATE, + }; + + return { + ...maybeSkipValidation(baseSchema), + ...getSchemaUtils(baseSchema), + }; +} diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/date/index.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/date/index.ts new file mode 100644 index 00000000000..187b29040f6 --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/date/index.ts @@ -0,0 +1 @@ +export { date } from "./date"; diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/enum/enum.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/enum/enum.ts new file mode 100644 index 00000000000..c1e24d69dec --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/enum/enum.ts @@ -0,0 +1,43 @@ +import { Schema, SchemaType } from "../../Schema"; +import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; +import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; + +export function enum_(values: E): Schema { + const validValues = new Set(values); + + const schemaCreator = createIdentitySchemaCreator( + SchemaType.ENUM, + (value, { allowUnrecognizedEnumValues, breadcrumbsPrefix = [] } = {}) => { + if (typeof value !== "string") { + return { + ok: false, + errors: [ + { + path: breadcrumbsPrefix, + message: getErrorMessageForIncorrectType(value, "string"), + }, + ], + }; + } + + if (!validValues.has(value) && !allowUnrecognizedEnumValues) { + return { + ok: false, + errors: [ + { + path: breadcrumbsPrefix, + message: getErrorMessageForIncorrectType(value, "enum"), + }, + ], + }; + } + + return { + ok: true, + value: value as U, + }; + } + ); + + return schemaCreator(); +} diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/enum/index.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/enum/index.ts new file mode 100644 index 00000000000..fe6faed93e3 --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/enum/index.ts @@ -0,0 +1 @@ +export { enum_ } from "./enum"; diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/index.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/index.ts new file mode 100644 index 00000000000..050cd2c4efb --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/index.ts @@ -0,0 +1,13 @@ +export * from "./date"; +export * from "./enum"; +export * from "./lazy"; +export * from "./list"; +export * from "./literals"; +export * from "./object"; +export * from "./object-like"; +export * from "./primitives"; +export * from "./record"; +export * from "./schema-utils"; +export * from "./set"; +export * from "./undiscriminated-union"; +export * from "./union"; diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/lazy/index.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/lazy/index.ts new file mode 100644 index 00000000000..77420fb031c --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/lazy/index.ts @@ -0,0 +1,3 @@ +export { lazy } from "./lazy"; +export type { SchemaGetter } from "./lazy"; +export { lazyObject } from "./lazyObject"; diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/lazy/lazy.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/lazy/lazy.ts new file mode 100644 index 00000000000..a665472d22c --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/lazy/lazy.ts @@ -0,0 +1,34 @@ +import { BaseSchema, Schema } from "../../Schema"; +import { getSchemaUtils } from "../schema-utils"; + +export type SchemaGetter> = () => SchemaType | Promise; + +export function lazy(getter: SchemaGetter>): Schema { + const baseSchema = constructLazyBaseSchema(getter); + return { + ...baseSchema, + ...getSchemaUtils(baseSchema), + }; +} + +export function constructLazyBaseSchema( + getter: SchemaGetter> +): BaseSchema { + return { + parse: async (raw, opts) => (await getMemoizedSchema(getter)).parse(raw, opts), + json: async (parsed, opts) => (await getMemoizedSchema(getter)).json(parsed, opts), + getType: async () => (await getMemoizedSchema(getter)).getType(), + }; +} + +type MemoizedGetter> = SchemaGetter & { __zurg_memoized?: SchemaType }; + +export async function getMemoizedSchema>( + getter: SchemaGetter +): Promise { + const castedGetter = getter as MemoizedGetter; + if (castedGetter.__zurg_memoized == null) { + castedGetter.__zurg_memoized = await getter(); + } + return castedGetter.__zurg_memoized; +} diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/lazy/lazyObject.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/lazy/lazyObject.ts new file mode 100644 index 00000000000..e48c0166677 --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/lazy/lazyObject.ts @@ -0,0 +1,20 @@ +import { getObjectUtils } from "../object"; +import { getObjectLikeUtils } from "../object-like"; +import { BaseObjectSchema, ObjectSchema } from "../object/types"; +import { getSchemaUtils } from "../schema-utils"; +import { constructLazyBaseSchema, getMemoizedSchema, SchemaGetter } from "./lazy"; + +export function lazyObject(getter: SchemaGetter>): ObjectSchema { + const baseSchema: BaseObjectSchema = { + ...constructLazyBaseSchema(getter), + _getRawProperties: async () => (await getMemoizedSchema(getter))._getRawProperties(), + _getParsedProperties: async () => (await getMemoizedSchema(getter))._getParsedProperties(), + }; + + return { + ...baseSchema, + ...getSchemaUtils(baseSchema), + ...getObjectLikeUtils(baseSchema), + ...getObjectUtils(baseSchema), + }; +} diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/list/index.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/list/index.ts new file mode 100644 index 00000000000..25f4bcc1737 --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/list/index.ts @@ -0,0 +1 @@ +export { list } from "./list"; diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/list/list.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/list/list.ts new file mode 100644 index 00000000000..b333321b507 --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/list/list.ts @@ -0,0 +1,74 @@ +import { BaseSchema, MaybeValid, Schema, SchemaType, ValidationError } from "../../Schema"; +import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; +import { MaybePromise } from "../../utils/MaybePromise"; +import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; +import { getSchemaUtils } from "../schema-utils"; + +export function list(schema: Schema): Schema { + const baseSchema: BaseSchema = { + parse: async (raw, opts) => + validateAndTransformArray(raw, (item, index) => + schema.parse(item, { + ...opts, + breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `[${index}]`], + }) + ), + json: (parsed, opts) => + validateAndTransformArray(parsed, (item, index) => + schema.json(item, { + ...opts, + breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `[${index}]`], + }) + ), + getType: () => SchemaType.LIST, + }; + + return { + ...maybeSkipValidation(baseSchema), + ...getSchemaUtils(baseSchema), + }; +} + +async function validateAndTransformArray( + value: unknown, + transformItem: (item: Raw, index: number) => MaybePromise> +): Promise> { + if (!Array.isArray(value)) { + return { + ok: false, + errors: [ + { + message: getErrorMessageForIncorrectType(value, "list"), + path: [], + }, + ], + }; + } + + const maybeValidItems = await Promise.all(value.map((item, index) => transformItem(item, index))); + + return maybeValidItems.reduce>( + (acc, item) => { + if (acc.ok && item.ok) { + return { + ok: true, + value: [...acc.value, item.value], + }; + } + + const errors: ValidationError[] = []; + if (!acc.ok) { + errors.push(...acc.errors); + } + if (!item.ok) { + errors.push(...item.errors); + } + + return { + ok: false, + errors, + }; + }, + { ok: true, value: [] } + ); +} diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/literals/booleanLiteral.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/literals/booleanLiteral.ts new file mode 100644 index 00000000000..a83d22cd48a --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/literals/booleanLiteral.ts @@ -0,0 +1,29 @@ +import { Schema, SchemaType } from "../../Schema"; +import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; +import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; + +export function booleanLiteral(literal: V): Schema { + const schemaCreator = createIdentitySchemaCreator( + SchemaType.BOOLEAN_LITERAL, + (value, { breadcrumbsPrefix = [] } = {}) => { + if (value === literal) { + return { + ok: true, + value: literal, + }; + } else { + return { + ok: false, + errors: [ + { + path: breadcrumbsPrefix, + message: getErrorMessageForIncorrectType(value, `${literal.toString()}`), + }, + ], + }; + } + } + ); + + return schemaCreator(); +} diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/literals/index.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/literals/index.ts new file mode 100644 index 00000000000..d2bf08fc6ca --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/literals/index.ts @@ -0,0 +1,2 @@ +export { stringLiteral } from "./stringLiteral"; +export { booleanLiteral } from "./booleanLiteral"; diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/literals/stringLiteral.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/literals/stringLiteral.ts new file mode 100644 index 00000000000..3939b76b48d --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/literals/stringLiteral.ts @@ -0,0 +1,29 @@ +import { Schema, SchemaType } from "../../Schema"; +import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; +import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; + +export function stringLiteral(literal: V): Schema { + const schemaCreator = createIdentitySchemaCreator( + SchemaType.STRING_LITERAL, + (value, { breadcrumbsPrefix = [] } = {}) => { + if (value === literal) { + return { + ok: true, + value: literal, + }; + } else { + return { + ok: false, + errors: [ + { + path: breadcrumbsPrefix, + message: getErrorMessageForIncorrectType(value, `"${literal}"`), + }, + ], + }; + } + } + ); + + return schemaCreator(); +} diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/object-like/getObjectLikeUtils.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/object-like/getObjectLikeUtils.ts new file mode 100644 index 00000000000..270ea170c85 --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/object-like/getObjectLikeUtils.ts @@ -0,0 +1,79 @@ +import { BaseSchema } from "../../Schema"; +import { filterObject } from "../../utils/filterObject"; +import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; +import { isPlainObject } from "../../utils/isPlainObject"; +import { getSchemaUtils } from "../schema-utils"; +import { ObjectLikeSchema, ObjectLikeUtils } from "./types"; + +export function getObjectLikeUtils(schema: BaseSchema): ObjectLikeUtils { + return { + withParsedProperties: (properties) => withParsedProperties(schema, properties), + }; +} + +/** + * object-like utils are defined in one file to resolve issues with circular imports + */ + +export function withParsedProperties( + objectLike: BaseSchema, + properties: { [K in keyof Properties]: Properties[K] | ((parsed: ParsedObjectShape) => Properties[K]) } +): ObjectLikeSchema { + const objectSchema: BaseSchema = { + parse: async (raw, opts) => { + const parsedObject = await objectLike.parse(raw, opts); + if (!parsedObject.ok) { + return parsedObject; + } + + const additionalProperties = Object.entries(properties).reduce>( + (processed, [key, value]) => { + return { + ...processed, + [key]: typeof value === "function" ? value(parsedObject.value) : value, + }; + }, + {} + ); + + return { + ok: true, + value: { + ...parsedObject.value, + ...(additionalProperties as Properties), + }, + }; + }, + + json: (parsed, opts) => { + if (!isPlainObject(parsed)) { + return { + ok: false, + errors: [ + { + path: opts?.breadcrumbsPrefix ?? [], + message: getErrorMessageForIncorrectType(parsed, "object"), + }, + ], + }; + } + + // strip out added properties + const addedPropertyKeys = new Set(Object.keys(properties)); + const parsedWithoutAddedProperties = filterObject( + parsed, + Object.keys(parsed).filter((key) => !addedPropertyKeys.has(key)) + ); + + return objectLike.json(parsedWithoutAddedProperties as ParsedObjectShape, opts); + }, + + getType: () => objectLike.getType(), + }; + + return { + ...objectSchema, + ...getSchemaUtils(objectSchema), + ...getObjectLikeUtils(objectSchema), + }; +} diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/object-like/index.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/object-like/index.ts new file mode 100644 index 00000000000..c342e72cf9d --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/object-like/index.ts @@ -0,0 +1,2 @@ +export { getObjectLikeUtils, withParsedProperties } from "./getObjectLikeUtils"; +export type { ObjectLikeSchema, ObjectLikeUtils } from "./types"; diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/object-like/types.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/object-like/types.ts new file mode 100644 index 00000000000..75b3698729c --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/object-like/types.ts @@ -0,0 +1,11 @@ +import { BaseSchema, Schema } from "../../Schema"; + +export type ObjectLikeSchema = Schema & + BaseSchema & + ObjectLikeUtils; + +export interface ObjectLikeUtils { + withParsedProperties: >(properties: { + [K in keyof T]: T[K] | ((parsed: Parsed) => T[K]); + }) => ObjectLikeSchema; +} diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/object/index.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/object/index.ts new file mode 100644 index 00000000000..e3f4388db28 --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/object/index.ts @@ -0,0 +1,22 @@ +export { getObjectUtils, object } from "./object"; +export { objectWithoutOptionalProperties } from "./objectWithoutOptionalProperties"; +export type { + inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas, + inferParsedObjectWithoutOptionalPropertiesFromPropertySchemas, +} from "./objectWithoutOptionalProperties"; +export { isProperty, property } from "./property"; +export type { Property } from "./property"; +export type { + BaseObjectSchema, + inferObjectSchemaFromPropertySchemas, + inferParsedObject, + inferParsedObjectFromPropertySchemas, + inferParsedPropertySchema, + inferRawKey, + inferRawObject, + inferRawObjectFromPropertySchemas, + inferRawPropertySchema, + ObjectSchema, + ObjectUtils, + PropertySchemas, +} from "./types"; diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/object/object.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/object/object.ts new file mode 100644 index 00000000000..4abadfb38be --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/object/object.ts @@ -0,0 +1,333 @@ +import { MaybeValid, Schema, SchemaType, ValidationError } from "../../Schema"; +import { entries } from "../../utils/entries"; +import { filterObject } from "../../utils/filterObject"; +import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; +import { isPlainObject } from "../../utils/isPlainObject"; +import { keys } from "../../utils/keys"; +import { MaybePromise } from "../../utils/MaybePromise"; +import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; +import { partition } from "../../utils/partition"; +import { getObjectLikeUtils } from "../object-like"; +import { getSchemaUtils } from "../schema-utils"; +import { isProperty } from "./property"; +import { + BaseObjectSchema, + inferObjectSchemaFromPropertySchemas, + inferParsedObjectFromPropertySchemas, + inferRawObjectFromPropertySchemas, + ObjectSchema, + ObjectUtils, + PropertySchemas, +} from "./types"; + +interface ObjectPropertyWithRawKey { + rawKey: string; + parsedKey: string; + valueSchema: Schema; +} + +export function object>( + schemas: T +): inferObjectSchemaFromPropertySchemas { + const baseSchema: BaseObjectSchema< + inferRawObjectFromPropertySchemas, + inferParsedObjectFromPropertySchemas + > = { + _getRawProperties: () => + Promise.resolve( + Object.entries(schemas).map(([parsedKey, propertySchema]) => + isProperty(propertySchema) ? propertySchema.rawKey : parsedKey + ) as unknown as (keyof inferRawObjectFromPropertySchemas)[] + ), + _getParsedProperties: () => + Promise.resolve(keys(schemas) as unknown as (keyof inferParsedObjectFromPropertySchemas)[]), + + parse: async (raw, opts) => { + const rawKeyToProperty: Record = {}; + const requiredKeys: string[] = []; + + for (const [parsedKey, schemaOrObjectProperty] of entries(schemas)) { + const rawKey = isProperty(schemaOrObjectProperty) ? schemaOrObjectProperty.rawKey : parsedKey; + const valueSchema: Schema = isProperty(schemaOrObjectProperty) + ? schemaOrObjectProperty.valueSchema + : schemaOrObjectProperty; + + const property: ObjectPropertyWithRawKey = { + rawKey, + parsedKey: parsedKey as string, + valueSchema, + }; + + rawKeyToProperty[rawKey] = property; + + if (await isSchemaRequired(valueSchema)) { + requiredKeys.push(rawKey); + } + } + + return validateAndTransformObject({ + value: raw, + requiredKeys, + getProperty: (rawKey) => { + const property = rawKeyToProperty[rawKey]; + if (property == null) { + return undefined; + } + return { + transformedKey: property.parsedKey, + transform: (propertyValue) => + property.valueSchema.parse(propertyValue, { + ...opts, + breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), rawKey], + }), + }; + }, + unrecognizedObjectKeys: opts?.unrecognizedObjectKeys, + skipValidation: opts?.skipValidation, + breadcrumbsPrefix: opts?.breadcrumbsPrefix, + }); + }, + + json: async (parsed, opts) => { + const requiredKeys: string[] = []; + + for (const [parsedKey, schemaOrObjectProperty] of entries(schemas)) { + const valueSchema: Schema = isProperty(schemaOrObjectProperty) + ? schemaOrObjectProperty.valueSchema + : schemaOrObjectProperty; + + if (await isSchemaRequired(valueSchema)) { + requiredKeys.push(parsedKey as string); + } + } + + return validateAndTransformObject({ + value: parsed, + requiredKeys, + getProperty: ( + parsedKey + ): + | { transformedKey: string; transform: (propertyValue: unknown) => MaybePromise> } + | undefined => { + const property = schemas[parsedKey as keyof T]; + + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (property == null) { + return undefined; + } + + if (isProperty(property)) { + return { + transformedKey: property.rawKey, + transform: (propertyValue) => + property.valueSchema.json(propertyValue, { + ...opts, + breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), parsedKey], + }), + }; + } else { + return { + transformedKey: parsedKey, + transform: (propertyValue) => + property.json(propertyValue, { + ...opts, + breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), parsedKey], + }), + }; + } + }, + unrecognizedObjectKeys: opts?.unrecognizedObjectKeys, + skipValidation: opts?.skipValidation, + breadcrumbsPrefix: opts?.breadcrumbsPrefix, + }); + }, + + getType: () => SchemaType.OBJECT, + }; + + return { + ...maybeSkipValidation(baseSchema), + ...getSchemaUtils(baseSchema), + ...getObjectLikeUtils(baseSchema), + ...getObjectUtils(baseSchema), + }; +} + +async function validateAndTransformObject({ + value, + requiredKeys, + getProperty, + unrecognizedObjectKeys = "fail", + skipValidation = false, + breadcrumbsPrefix = [], +}: { + value: unknown; + requiredKeys: string[]; + getProperty: ( + preTransformedKey: string + ) => { transformedKey: string; transform: (propertyValue: unknown) => MaybePromise> } | undefined; + unrecognizedObjectKeys: "fail" | "passthrough" | "strip" | undefined; + skipValidation: boolean | undefined; + breadcrumbsPrefix: string[] | undefined; +}): Promise> { + if (!isPlainObject(value)) { + return { + ok: false, + errors: [ + { + path: breadcrumbsPrefix, + message: getErrorMessageForIncorrectType(value, "object"), + }, + ], + }; + } + + const missingRequiredKeys = new Set(requiredKeys); + const errors: ValidationError[] = []; + const transformed: Record = {}; + + for (const [preTransformedKey, preTransformedItemValue] of Object.entries(value)) { + const property = getProperty(preTransformedKey); + + if (property != null) { + missingRequiredKeys.delete(preTransformedKey); + + const value = await property.transform(preTransformedItemValue); + if (value.ok) { + transformed[property.transformedKey] = value.value; + } else { + transformed[preTransformedKey] = preTransformedItemValue; + errors.push(...value.errors); + } + } else { + switch (unrecognizedObjectKeys) { + case "fail": + errors.push({ + path: [...breadcrumbsPrefix, preTransformedKey], + message: `Unexpected key "${preTransformedKey}"`, + }); + break; + case "strip": + break; + case "passthrough": + transformed[preTransformedKey] = preTransformedItemValue; + break; + } + } + } + + errors.push( + ...requiredKeys + .filter((key) => missingRequiredKeys.has(key)) + .map((key) => ({ + path: breadcrumbsPrefix, + message: `Missing required key "${key}"`, + })) + ); + + if (errors.length === 0 || skipValidation) { + return { + ok: true, + value: transformed as Transformed, + }; + } else { + return { + ok: false, + errors, + }; + } +} + +export function getObjectUtils(schema: BaseObjectSchema): ObjectUtils { + return { + extend: (extension: ObjectSchema) => { + const baseSchema: BaseObjectSchema = { + _getParsedProperties: async () => [ + ...(await schema._getParsedProperties()), + ...(await extension._getParsedProperties()), + ], + _getRawProperties: async () => [ + ...(await schema._getRawProperties()), + ...(await extension._getRawProperties()), + ], + parse: async (raw, opts) => { + return validateAndTransformExtendedObject({ + extensionKeys: await extension._getRawProperties(), + value: raw, + transformBase: (rawBase) => schema.parse(rawBase, opts), + transformExtension: (rawExtension) => extension.parse(rawExtension, opts), + }); + }, + json: async (parsed, opts) => { + return validateAndTransformExtendedObject({ + extensionKeys: await extension._getParsedProperties(), + value: parsed, + transformBase: (parsedBase) => schema.json(parsedBase, opts), + transformExtension: (parsedExtension) => extension.json(parsedExtension, opts), + }); + }, + getType: () => SchemaType.OBJECT, + }; + + return { + ...baseSchema, + ...getSchemaUtils(baseSchema), + ...getObjectLikeUtils(baseSchema), + ...getObjectUtils(baseSchema), + }; + }, + }; +} + +async function validateAndTransformExtendedObject({ + extensionKeys, + value, + transformBase, + transformExtension, +}: { + extensionKeys: (keyof PreTransformedExtension)[]; + value: unknown; + transformBase: (value: unknown) => MaybePromise>; + transformExtension: (value: unknown) => MaybePromise>; +}): Promise> { + const extensionPropertiesSet = new Set(extensionKeys); + const [extensionProperties, baseProperties] = partition(keys(value), (key) => + extensionPropertiesSet.has(key as keyof PreTransformedExtension) + ); + + const transformedBase = await transformBase(filterObject(value, baseProperties)); + const transformedExtension = await transformExtension(filterObject(value, extensionProperties)); + + if (transformedBase.ok && transformedExtension.ok) { + return { + ok: true, + value: { + ...transformedBase.value, + ...transformedExtension.value, + }, + }; + } else { + return { + ok: false, + errors: [ + ...(transformedBase.ok ? [] : transformedBase.errors), + ...(transformedExtension.ok ? [] : transformedExtension.errors), + ], + }; + } +} + +async function isSchemaRequired(schema: Schema): Promise { + return !(await isSchemaOptional(schema)); +} + +async function isSchemaOptional(schema: Schema): Promise { + switch (await schema.getType()) { + case SchemaType.ANY: + case SchemaType.UNKNOWN: + case SchemaType.OPTIONAL: + return true; + default: + return false; + } +} diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/object/objectWithoutOptionalProperties.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/object/objectWithoutOptionalProperties.ts new file mode 100644 index 00000000000..a0951f48efc --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/object/objectWithoutOptionalProperties.ts @@ -0,0 +1,18 @@ +import { object } from "./object"; +import { inferParsedPropertySchema, inferRawObjectFromPropertySchemas, ObjectSchema, PropertySchemas } from "./types"; + +export function objectWithoutOptionalProperties>( + schemas: T +): inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas { + return object(schemas) as unknown as inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas; +} + +export type inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas> = + ObjectSchema< + inferRawObjectFromPropertySchemas, + inferParsedObjectWithoutOptionalPropertiesFromPropertySchemas + >; + +export type inferParsedObjectWithoutOptionalPropertiesFromPropertySchemas> = { + [K in keyof T]: inferParsedPropertySchema; +}; diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/object/property.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/object/property.ts new file mode 100644 index 00000000000..d245c4b193a --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/object/property.ts @@ -0,0 +1,23 @@ +import { Schema } from "../../Schema"; + +export function property( + rawKey: RawKey, + valueSchema: Schema +): Property { + return { + rawKey, + valueSchema, + isProperty: true, + }; +} + +export interface Property { + rawKey: RawKey; + valueSchema: Schema; + isProperty: true; +} + +export function isProperty>(maybeProperty: unknown): maybeProperty is O { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + return (maybeProperty as O).isProperty; +} diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/object/types.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/object/types.ts new file mode 100644 index 00000000000..17cff4f86dd --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/object/types.ts @@ -0,0 +1,72 @@ +import { BaseSchema, inferParsed, inferRaw, Schema } from "../../Schema"; +import { addQuestionMarksToNullableProperties } from "../../utils/addQuestionMarksToNullableProperties"; +import { ObjectLikeUtils } from "../object-like"; +import { SchemaUtils } from "../schema-utils"; +import { Property } from "./property"; + +export type ObjectSchema = BaseObjectSchema & + ObjectLikeUtils & + ObjectUtils & + SchemaUtils; + +export interface BaseObjectSchema extends BaseSchema { + _getRawProperties: () => Promise<(keyof Raw)[]>; + _getParsedProperties: () => Promise<(keyof Parsed)[]>; +} + +export interface ObjectUtils { + extend: ( + schemas: ObjectSchema + ) => ObjectSchema; +} + +export type inferRawObject> = O extends ObjectSchema ? Raw : never; + +export type inferParsedObject> = O extends ObjectSchema + ? Parsed + : never; + +export type inferObjectSchemaFromPropertySchemas> = ObjectSchema< + inferRawObjectFromPropertySchemas, + inferParsedObjectFromPropertySchemas +>; + +export type inferRawObjectFromPropertySchemas> = + addQuestionMarksToNullableProperties<{ + [ParsedKey in keyof T as inferRawKey]: inferRawPropertySchema; + }>; + +export type inferParsedObjectFromPropertySchemas> = + addQuestionMarksToNullableProperties<{ + [K in keyof T]: inferParsedPropertySchema; + }>; + +export type PropertySchemas = Record< + ParsedKeys, + Property | Schema +>; + +export type inferRawPropertySchema

| Schema> = P extends Property< + any, + infer Raw, + any +> + ? Raw + : P extends Schema + ? inferRaw

+ : never; + +export type inferParsedPropertySchema

| Schema> = P extends Property< + any, + any, + infer Parsed +> + ? Parsed + : P extends Schema + ? inferParsed

+ : never; + +export type inferRawKey< + ParsedKey extends string | number | symbol, + P extends Property | Schema +> = P extends Property ? Raw : ParsedKey; diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/primitives/any.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/primitives/any.ts new file mode 100644 index 00000000000..fcaeb04255a --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/primitives/any.ts @@ -0,0 +1,4 @@ +import { SchemaType } from "../../Schema"; +import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; + +export const any = createIdentitySchemaCreator(SchemaType.ANY, (value) => ({ ok: true, value })); diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/primitives/boolean.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/primitives/boolean.ts new file mode 100644 index 00000000000..fad60562120 --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/primitives/boolean.ts @@ -0,0 +1,25 @@ +import { SchemaType } from "../../Schema"; +import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; +import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; + +export const boolean = createIdentitySchemaCreator( + SchemaType.BOOLEAN, + (value, { breadcrumbsPrefix = [] } = {}) => { + if (typeof value === "boolean") { + return { + ok: true, + value, + }; + } else { + return { + ok: false, + errors: [ + { + path: breadcrumbsPrefix, + message: getErrorMessageForIncorrectType(value, "boolean"), + }, + ], + }; + } + } +); diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/primitives/index.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/primitives/index.ts new file mode 100644 index 00000000000..788f9416bfe --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/primitives/index.ts @@ -0,0 +1,5 @@ +export { any } from "./any"; +export { boolean } from "./boolean"; +export { number } from "./number"; +export { string } from "./string"; +export { unknown } from "./unknown"; diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/primitives/number.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/primitives/number.ts new file mode 100644 index 00000000000..c2689456936 --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/primitives/number.ts @@ -0,0 +1,25 @@ +import { SchemaType } from "../../Schema"; +import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; +import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; + +export const number = createIdentitySchemaCreator( + SchemaType.NUMBER, + (value, { breadcrumbsPrefix = [] } = {}) => { + if (typeof value === "number") { + return { + ok: true, + value, + }; + } else { + return { + ok: false, + errors: [ + { + path: breadcrumbsPrefix, + message: getErrorMessageForIncorrectType(value, "number"), + }, + ], + }; + } + } +); diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/primitives/string.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/primitives/string.ts new file mode 100644 index 00000000000..949f1f2a630 --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/primitives/string.ts @@ -0,0 +1,25 @@ +import { SchemaType } from "../../Schema"; +import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; +import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; + +export const string = createIdentitySchemaCreator( + SchemaType.STRING, + (value, { breadcrumbsPrefix = [] } = {}) => { + if (typeof value === "string") { + return { + ok: true, + value, + }; + } else { + return { + ok: false, + errors: [ + { + path: breadcrumbsPrefix, + message: getErrorMessageForIncorrectType(value, "string"), + }, + ], + }; + } + } +); diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/primitives/unknown.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/primitives/unknown.ts new file mode 100644 index 00000000000..4d5249571f5 --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/primitives/unknown.ts @@ -0,0 +1,4 @@ +import { SchemaType } from "../../Schema"; +import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; + +export const unknown = createIdentitySchemaCreator(SchemaType.UNKNOWN, (value) => ({ ok: true, value })); diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/record/index.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/record/index.ts new file mode 100644 index 00000000000..82e25c5c2af --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/record/index.ts @@ -0,0 +1,2 @@ +export { record } from "./record"; +export type { BaseRecordSchema, RecordSchema } from "./types"; diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/record/record.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/record/record.ts new file mode 100644 index 00000000000..ac1cd22ade0 --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/record/record.ts @@ -0,0 +1,131 @@ +import { MaybeValid, Schema, SchemaType, ValidationError } from "../../Schema"; +import { entries } from "../../utils/entries"; +import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; +import { isPlainObject } from "../../utils/isPlainObject"; +import { MaybePromise } from "../../utils/MaybePromise"; +import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; +import { getSchemaUtils } from "../schema-utils"; +import { BaseRecordSchema, RecordSchema } from "./types"; + +export function record( + keySchema: Schema, + valueSchema: Schema +): RecordSchema { + const baseSchema: BaseRecordSchema = { + parse: async (raw, opts) => { + return validateAndTransformRecord({ + value: raw, + isKeyNumeric: (await keySchema.getType()) === SchemaType.NUMBER, + transformKey: (key) => + keySchema.parse(key, { + ...opts, + breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key} (key)`], + }), + transformValue: (value, key) => + valueSchema.parse(value, { + ...opts, + breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key}`], + }), + breadcrumbsPrefix: opts?.breadcrumbsPrefix, + }); + }, + json: async (parsed, opts) => { + return validateAndTransformRecord({ + value: parsed, + isKeyNumeric: (await keySchema.getType()) === SchemaType.NUMBER, + transformKey: (key) => + keySchema.json(key, { + ...opts, + breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key} (key)`], + }), + transformValue: (value, key) => + valueSchema.json(value, { + ...opts, + breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key}`], + }), + breadcrumbsPrefix: opts?.breadcrumbsPrefix, + }); + }, + getType: () => SchemaType.RECORD, + }; + + return { + ...maybeSkipValidation(baseSchema), + ...getSchemaUtils(baseSchema), + }; +} + +async function validateAndTransformRecord({ + value, + isKeyNumeric, + transformKey, + transformValue, + breadcrumbsPrefix = [], +}: { + value: unknown; + isKeyNumeric: boolean; + transformKey: (key: string | number) => MaybePromise>; + transformValue: (value: unknown, key: string | number) => MaybePromise>; + breadcrumbsPrefix: string[] | undefined; +}): Promise>> { + if (!isPlainObject(value)) { + return { + ok: false, + errors: [ + { + path: breadcrumbsPrefix, + message: getErrorMessageForIncorrectType(value, "object"), + }, + ], + }; + } + + return entries(value).reduce>>>( + async (accPromise, [stringKey, value]) => { + // skip nullish keys + if (value == null) { + return accPromise; + } + + const acc = await accPromise; + + let key: string | number = stringKey; + if (isKeyNumeric) { + const numberKey = stringKey.length > 0 ? Number(stringKey) : NaN; + if (!isNaN(numberKey)) { + key = numberKey; + } + } + const transformedKey = await transformKey(key); + + const transformedValue = await transformValue(value, key); + + if (acc.ok && transformedKey.ok && transformedValue.ok) { + return { + ok: true, + value: { + ...acc.value, + [transformedKey.value]: transformedValue.value, + }, + }; + } + + const errors: ValidationError[] = []; + if (!acc.ok) { + errors.push(...acc.errors); + } + if (!transformedKey.ok) { + errors.push(...transformedKey.errors); + } + if (!transformedValue.ok) { + errors.push(...transformedValue.errors); + } + + return { + ok: false, + errors, + }; + }, + Promise.resolve({ ok: true, value: {} as Record }) + ); +} diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/record/types.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/record/types.ts new file mode 100644 index 00000000000..eb82cc7f65c --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/record/types.ts @@ -0,0 +1,17 @@ +import { BaseSchema } from "../../Schema"; +import { SchemaUtils } from "../schema-utils"; + +export type RecordSchema< + RawKey extends string | number, + RawValue, + ParsedKey extends string | number, + ParsedValue +> = BaseRecordSchema & + SchemaUtils, Record>; + +export type BaseRecordSchema< + RawKey extends string | number, + RawValue, + ParsedKey extends string | number, + ParsedValue +> = BaseSchema, Record>; diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/schema-utils/JsonError.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/schema-utils/JsonError.ts new file mode 100644 index 00000000000..2b89ca0e7ad --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/schema-utils/JsonError.ts @@ -0,0 +1,9 @@ +import { ValidationError } from "../../Schema"; +import { stringifyValidationError } from "./stringifyValidationErrors"; + +export class JsonError extends Error { + constructor(public readonly errors: ValidationError[]) { + super(errors.map(stringifyValidationError).join("; ")); + Object.setPrototypeOf(this, JsonError.prototype); + } +} diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/schema-utils/ParseError.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/schema-utils/ParseError.ts new file mode 100644 index 00000000000..d056eb45cf7 --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/schema-utils/ParseError.ts @@ -0,0 +1,9 @@ +import { ValidationError } from "../../Schema"; +import { stringifyValidationError } from "./stringifyValidationErrors"; + +export class ParseError extends Error { + constructor(public readonly errors: ValidationError[]) { + super(errors.map(stringifyValidationError).join("; ")); + Object.setPrototypeOf(this, ParseError.prototype); + } +} diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/schema-utils/getSchemaUtils.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/schema-utils/getSchemaUtils.ts new file mode 100644 index 00000000000..0c0d379d800 --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/schema-utils/getSchemaUtils.ts @@ -0,0 +1,99 @@ +import { BaseSchema, Schema, SchemaOptions, SchemaType } from "../../Schema"; +import { JsonError } from "./JsonError"; +import { ParseError } from "./ParseError"; + +export interface SchemaUtils { + optional: () => Schema; + transform: (transformer: SchemaTransformer) => Schema; + parseOrThrow: (raw: unknown, opts?: SchemaOptions) => Promise; + jsonOrThrow: (raw: unknown, opts?: SchemaOptions) => Promise; +} + +export interface SchemaTransformer { + transform: (parsed: Parsed) => Transformed; + untransform: (transformed: any) => Parsed; +} + +export function getSchemaUtils(schema: BaseSchema): SchemaUtils { + return { + optional: () => optional(schema), + transform: (transformer) => transform(schema, transformer), + parseOrThrow: async (raw, opts) => { + const parsed = await schema.parse(raw, opts); + if (parsed.ok) { + return parsed.value; + } + throw new ParseError(parsed.errors); + }, + jsonOrThrow: async (parsed, opts) => { + const raw = await schema.json(parsed, opts); + if (raw.ok) { + return raw.value; + } + throw new JsonError(raw.errors); + }, + }; +} + +/** + * schema utils are defined in one file to resolve issues with circular imports + */ + +export function optional( + schema: BaseSchema +): Schema { + const baseSchema: BaseSchema = { + parse: (raw, opts) => { + if (raw == null) { + return { + ok: true, + value: undefined, + }; + } + return schema.parse(raw, opts); + }, + json: (parsed, opts) => { + if (parsed == null) { + return { + ok: true, + value: null, + }; + } + return schema.json(parsed, opts); + }, + getType: () => SchemaType.OPTIONAL, + }; + + return { + ...baseSchema, + ...getSchemaUtils(baseSchema), + }; +} + +export function transform( + schema: BaseSchema, + transformer: SchemaTransformer +): Schema { + const baseSchema: BaseSchema = { + parse: async (raw, opts) => { + const parsed = await schema.parse(raw, opts); + if (!parsed.ok) { + return parsed; + } + return { + ok: true, + value: transformer.transform(parsed.value), + }; + }, + json: async (transformed, opts) => { + const parsed = await transformer.untransform(transformed); + return schema.json(parsed, opts); + }, + getType: () => schema.getType(), + }; + + return { + ...baseSchema, + ...getSchemaUtils(baseSchema), + }; +} diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/schema-utils/index.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/schema-utils/index.ts new file mode 100644 index 00000000000..aa04e051dfa --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/schema-utils/index.ts @@ -0,0 +1,4 @@ +export { getSchemaUtils, optional, transform } from "./getSchemaUtils"; +export type { SchemaUtils } from "./getSchemaUtils"; +export { JsonError } from "./JsonError"; +export { ParseError } from "./ParseError"; diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/schema-utils/stringifyValidationErrors.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/schema-utils/stringifyValidationErrors.ts new file mode 100644 index 00000000000..4160f0a2617 --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/schema-utils/stringifyValidationErrors.ts @@ -0,0 +1,8 @@ +import { ValidationError } from "../../Schema"; + +export function stringifyValidationError(error: ValidationError): string { + if (error.path.length === 0) { + return error.message; + } + return `${error.path.join(" -> ")}: ${error.message}`; +} diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/set/index.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/set/index.ts new file mode 100644 index 00000000000..f3310e8bdad --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/set/index.ts @@ -0,0 +1 @@ +export { set } from "./set"; diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/set/set.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/set/set.ts new file mode 100644 index 00000000000..3113bcba307 --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/set/set.ts @@ -0,0 +1,43 @@ +import { BaseSchema, Schema, SchemaType } from "../../Schema"; +import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; +import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; +import { list } from "../list"; +import { getSchemaUtils } from "../schema-utils"; + +export function set(schema: Schema): Schema> { + const listSchema = list(schema); + const baseSchema: BaseSchema> = { + parse: async (raw, opts) => { + const parsedList = await listSchema.parse(raw, opts); + if (parsedList.ok) { + return { + ok: true, + value: new Set(parsedList.value), + }; + } else { + return parsedList; + } + }, + json: async (parsed, opts) => { + if (!(parsed instanceof Set)) { + return { + ok: false, + errors: [ + { + path: opts?.breadcrumbsPrefix ?? [], + message: getErrorMessageForIncorrectType(parsed, "Set"), + }, + ], + }; + } + const jsonList = await listSchema.json([...parsed], opts); + return jsonList; + }, + getType: () => SchemaType.SET, + }; + + return { + ...maybeSkipValidation(baseSchema), + ...getSchemaUtils(baseSchema), + }; +} diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/undiscriminated-union/index.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/undiscriminated-union/index.ts new file mode 100644 index 00000000000..75b71cb3565 --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/undiscriminated-union/index.ts @@ -0,0 +1,6 @@ +export type { + inferParsedUnidiscriminatedUnionSchema, + inferRawUnidiscriminatedUnionSchema, + UndiscriminatedUnionSchema, +} from "./types"; +export { undiscriminatedUnion } from "./undiscriminatedUnion"; diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/undiscriminated-union/types.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/undiscriminated-union/types.ts new file mode 100644 index 00000000000..43e7108a060 --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/undiscriminated-union/types.ts @@ -0,0 +1,10 @@ +import { inferParsed, inferRaw, Schema } from "../../Schema"; + +export type UndiscriminatedUnionSchema = Schema< + inferRawUnidiscriminatedUnionSchema, + inferParsedUnidiscriminatedUnionSchema +>; + +export type inferRawUnidiscriminatedUnionSchema = inferRaw; + +export type inferParsedUnidiscriminatedUnionSchema = inferParsed; diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts new file mode 100644 index 00000000000..771dc6a7efa --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts @@ -0,0 +1,61 @@ +import { BaseSchema, MaybeValid, Schema, SchemaOptions, SchemaType, ValidationError } from "../../Schema"; +import { MaybePromise } from "../../utils/MaybePromise"; +import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; +import { getSchemaUtils } from "../schema-utils"; +import { inferParsedUnidiscriminatedUnionSchema, inferRawUnidiscriminatedUnionSchema } from "./types"; + +export function undiscriminatedUnion, ...Schema[]]>( + schemas: Schemas +): Schema, inferParsedUnidiscriminatedUnionSchema> { + const baseSchema: BaseSchema< + inferRawUnidiscriminatedUnionSchema, + inferParsedUnidiscriminatedUnionSchema + > = { + parse: async (raw, opts) => { + return validateAndTransformUndiscriminatedUnion>( + (schema, opts) => schema.parse(raw, opts), + schemas, + opts + ); + }, + json: async (parsed, opts) => { + return validateAndTransformUndiscriminatedUnion>( + (schema, opts) => schema.json(parsed, opts), + schemas, + opts + ); + }, + getType: () => SchemaType.UNDISCRIMINATED_UNION, + }; + + return { + ...maybeSkipValidation(baseSchema), + ...getSchemaUtils(baseSchema), + }; +} + +async function validateAndTransformUndiscriminatedUnion( + transform: (schema: Schema, opts: SchemaOptions) => MaybePromise>, + schemas: Schema[], + opts: SchemaOptions | undefined +): Promise> { + const errors: ValidationError[] = []; + for (const [index, schema] of schemas.entries()) { + const transformed = await transform(schema, { ...opts, skipValidation: false }); + if (transformed.ok) { + return transformed; + } else { + for (const error of transformed.errors) { + errors.push({ + path: error.path, + message: `[Variant ${index}] ${error.message}`, + }); + } + } + } + + return { + ok: false, + errors, + }; +} diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/union/discriminant.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/union/discriminant.ts new file mode 100644 index 00000000000..55065bc8946 --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/union/discriminant.ts @@ -0,0 +1,14 @@ +export function discriminant( + parsedDiscriminant: ParsedDiscriminant, + rawDiscriminant: RawDiscriminant +): Discriminant { + return { + parsedDiscriminant, + rawDiscriminant, + }; +} + +export interface Discriminant { + parsedDiscriminant: ParsedDiscriminant; + rawDiscriminant: RawDiscriminant; +} diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/union/index.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/union/index.ts new file mode 100644 index 00000000000..85fc008a2d8 --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/union/index.ts @@ -0,0 +1,10 @@ +export { discriminant } from "./discriminant"; +export type { Discriminant } from "./discriminant"; +export type { + inferParsedDiscriminant, + inferParsedUnion, + inferRawDiscriminant, + inferRawUnion, + UnionSubtypes, +} from "./types"; +export { union } from "./union"; diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/union/types.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/union/types.ts new file mode 100644 index 00000000000..6f82c868b2d --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/union/types.ts @@ -0,0 +1,26 @@ +import { inferParsedObject, inferRawObject, ObjectSchema } from "../object"; +import { Discriminant } from "./discriminant"; + +export type UnionSubtypes = { + [K in DiscriminantValues]: ObjectSchema; +}; + +export type inferRawUnion, U extends UnionSubtypes> = { + [K in keyof U]: Record, K> & inferRawObject; +}[keyof U]; + +export type inferParsedUnion, U extends UnionSubtypes> = { + [K in keyof U]: Record, K> & inferParsedObject; +}[keyof U]; + +export type inferRawDiscriminant> = D extends string + ? D + : D extends Discriminant + ? Raw + : never; + +export type inferParsedDiscriminant> = D extends string + ? D + : D extends Discriminant + ? Parsed + : never; diff --git a/packages/ir-sdk/src/sdk/core/schemas/builders/union/union.ts b/packages/ir-sdk/src/sdk/core/schemas/builders/union/union.ts new file mode 100644 index 00000000000..ed659beb62d --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/builders/union/union.ts @@ -0,0 +1,173 @@ +import { BaseSchema, MaybeValid, SchemaType } from "../../Schema"; +import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; +import { isPlainObject } from "../../utils/isPlainObject"; +import { keys } from "../../utils/keys"; +import { MaybePromise } from "../../utils/MaybePromise"; +import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; +import { enum_ } from "../enum"; +import { ObjectSchema } from "../object"; +import { getObjectLikeUtils, ObjectLikeSchema } from "../object-like"; +import { getSchemaUtils } from "../schema-utils"; +import { Discriminant } from "./discriminant"; +import { inferParsedDiscriminant, inferParsedUnion, inferRawDiscriminant, inferRawUnion, UnionSubtypes } from "./types"; + +export function union, U extends UnionSubtypes>( + discriminant: D, + union: U +): ObjectLikeSchema, inferParsedUnion> { + const rawDiscriminant = + typeof discriminant === "string" ? discriminant : (discriminant.rawDiscriminant as inferRawDiscriminant); + const parsedDiscriminant = + typeof discriminant === "string" + ? discriminant + : (discriminant.parsedDiscriminant as inferParsedDiscriminant); + + const discriminantValueSchema = enum_(keys(union) as string[]); + + const baseSchema: BaseSchema, inferParsedUnion> = { + parse: async (raw, opts) => { + return transformAndValidateUnion({ + value: raw, + discriminant: rawDiscriminant, + transformedDiscriminant: parsedDiscriminant, + transformDiscriminantValue: (discriminantValue) => + discriminantValueSchema.parse(discriminantValue, { + allowUnrecognizedEnumValues: opts?.allowUnrecognizedUnionMembers, + breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), rawDiscriminant], + }), + getAdditionalPropertiesSchema: (discriminantValue) => union[discriminantValue], + allowUnrecognizedUnionMembers: opts?.allowUnrecognizedUnionMembers, + transformAdditionalProperties: (additionalProperties, additionalPropertiesSchema) => + additionalPropertiesSchema.parse(additionalProperties, opts), + breadcrumbsPrefix: opts?.breadcrumbsPrefix, + }); + }, + json: async (parsed, opts) => { + return transformAndValidateUnion({ + value: parsed, + discriminant: parsedDiscriminant, + transformedDiscriminant: rawDiscriminant, + transformDiscriminantValue: (discriminantValue) => + discriminantValueSchema.json(discriminantValue, { + allowUnrecognizedEnumValues: opts?.allowUnrecognizedUnionMembers, + breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), parsedDiscriminant], + }), + getAdditionalPropertiesSchema: (discriminantValue) => union[discriminantValue], + allowUnrecognizedUnionMembers: opts?.allowUnrecognizedUnionMembers, + transformAdditionalProperties: (additionalProperties, additionalPropertiesSchema) => + additionalPropertiesSchema.json(additionalProperties, opts), + breadcrumbsPrefix: opts?.breadcrumbsPrefix, + }); + }, + getType: () => SchemaType.UNION, + }; + + return { + ...maybeSkipValidation(baseSchema), + ...getSchemaUtils(baseSchema), + ...getObjectLikeUtils(baseSchema), + }; +} + +async function transformAndValidateUnion< + TransformedDiscriminant extends string, + TransformedDiscriminantValue extends string, + TransformedAdditionalProperties +>({ + value, + discriminant, + transformedDiscriminant, + transformDiscriminantValue, + getAdditionalPropertiesSchema, + allowUnrecognizedUnionMembers = false, + transformAdditionalProperties, + breadcrumbsPrefix = [], +}: { + value: unknown; + discriminant: string; + transformedDiscriminant: TransformedDiscriminant; + transformDiscriminantValue: (discriminantValue: unknown) => MaybePromise>; + getAdditionalPropertiesSchema: (discriminantValue: string) => ObjectSchema | undefined; + allowUnrecognizedUnionMembers: boolean | undefined; + transformAdditionalProperties: ( + additionalProperties: unknown, + additionalPropertiesSchema: ObjectSchema + ) => MaybePromise>; + breadcrumbsPrefix: string[] | undefined; +}): Promise< + MaybeValid & TransformedAdditionalProperties> +> { + if (!isPlainObject(value)) { + return { + ok: false, + errors: [ + { + path: breadcrumbsPrefix, + message: getErrorMessageForIncorrectType(value, "object"), + }, + ], + }; + } + + const { [discriminant]: discriminantValue, ...additionalProperties } = value; + + if (discriminantValue == null) { + return { + ok: false, + errors: [ + { + path: breadcrumbsPrefix, + message: `Missing discriminant ("${discriminant}")`, + }, + ], + }; + } + + const transformedDiscriminantValue = await transformDiscriminantValue(discriminantValue); + if (!transformedDiscriminantValue.ok) { + return { + ok: false, + errors: transformedDiscriminantValue.errors, + }; + } + + const additionalPropertiesSchema = getAdditionalPropertiesSchema(transformedDiscriminantValue.value); + + if (additionalPropertiesSchema == null) { + if (allowUnrecognizedUnionMembers) { + return { + ok: true, + value: { + [transformedDiscriminant]: transformedDiscriminantValue.value, + ...additionalProperties, + } as Record & TransformedAdditionalProperties, + }; + } else { + return { + ok: false, + errors: [ + { + path: [...breadcrumbsPrefix, discriminant], + message: "Unexpected discriminant value", + }, + ], + }; + } + } + + const transformedAdditionalProperties = await transformAdditionalProperties( + additionalProperties, + additionalPropertiesSchema + ); + if (!transformedAdditionalProperties.ok) { + return transformedAdditionalProperties; + } + + return { + ok: true, + value: { + [transformedDiscriminant]: discriminantValue, + ...transformedAdditionalProperties.value, + } as Record & TransformedAdditionalProperties, + }; +} diff --git a/packages/ir-sdk/src/sdk/core/schemas/index.ts b/packages/ir-sdk/src/sdk/core/schemas/index.ts new file mode 100644 index 00000000000..5429d8b43eb --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/index.ts @@ -0,0 +1,2 @@ +export * from "./builders"; +export type { inferParsed, inferRaw, Schema, SchemaOptions } from "./Schema"; diff --git a/packages/ir-sdk/src/sdk/core/schemas/utils/MaybePromise.ts b/packages/ir-sdk/src/sdk/core/schemas/utils/MaybePromise.ts new file mode 100644 index 00000000000..9cd354b3418 --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/utils/MaybePromise.ts @@ -0,0 +1 @@ +export type MaybePromise = T | Promise; diff --git a/packages/ir-sdk/src/sdk/core/schemas/utils/addQuestionMarksToNullableProperties.ts b/packages/ir-sdk/src/sdk/core/schemas/utils/addQuestionMarksToNullableProperties.ts new file mode 100644 index 00000000000..4111d703cd0 --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/utils/addQuestionMarksToNullableProperties.ts @@ -0,0 +1,15 @@ +export type addQuestionMarksToNullableProperties = { + [K in OptionalKeys]?: T[K]; +} & Pick>; + +export type OptionalKeys = { + [K in keyof T]-?: undefined extends T[K] + ? K + : null extends T[K] + ? K + : 1 extends (any extends T[K] ? 0 : 1) + ? never + : K; +}[keyof T]; + +export type RequiredKeys = Exclude>; diff --git a/packages/ir-sdk/src/sdk/core/schemas/utils/createIdentitySchemaCreator.ts b/packages/ir-sdk/src/sdk/core/schemas/utils/createIdentitySchemaCreator.ts new file mode 100644 index 00000000000..de107cf5ee1 --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/utils/createIdentitySchemaCreator.ts @@ -0,0 +1,21 @@ +import { getSchemaUtils } from "../builders/schema-utils"; +import { BaseSchema, MaybeValid, Schema, SchemaOptions, SchemaType } from "../Schema"; +import { maybeSkipValidation } from "./maybeSkipValidation"; + +export function createIdentitySchemaCreator( + schemaType: SchemaType, + validate: (value: unknown, opts?: SchemaOptions) => MaybeValid +): () => Schema { + return () => { + const baseSchema: BaseSchema = { + parse: validate, + json: validate, + getType: () => schemaType, + }; + + return { + ...maybeSkipValidation(baseSchema), + ...getSchemaUtils(baseSchema), + }; + }; +} diff --git a/packages/ir-sdk/src/sdk/core/schemas/utils/entries.ts b/packages/ir-sdk/src/sdk/core/schemas/utils/entries.ts new file mode 100644 index 00000000000..e122952137d --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/utils/entries.ts @@ -0,0 +1,3 @@ +export function entries(object: T): [keyof T, T[keyof T]][] { + return Object.entries(object) as [keyof T, T[keyof T]][]; +} diff --git a/packages/ir-sdk/src/sdk/core/schemas/utils/filterObject.ts b/packages/ir-sdk/src/sdk/core/schemas/utils/filterObject.ts new file mode 100644 index 00000000000..2c25a3455bc --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/utils/filterObject.ts @@ -0,0 +1,10 @@ +export function filterObject(obj: T, keysToInclude: K[]): Pick { + const keysToIncludeSet = new Set(keysToInclude); + return Object.entries(obj).reduce((acc, [key, value]) => { + if (keysToIncludeSet.has(key as K)) { + acc[key as K] = value; + } + return acc; + // eslint-disable-next-line @typescript-eslint/prefer-reduce-type-parameter + }, {} as Pick); +} diff --git a/packages/ir-sdk/src/sdk/core/schemas/utils/getErrorMessageForIncorrectType.ts b/packages/ir-sdk/src/sdk/core/schemas/utils/getErrorMessageForIncorrectType.ts new file mode 100644 index 00000000000..438012df418 --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/utils/getErrorMessageForIncorrectType.ts @@ -0,0 +1,21 @@ +export function getErrorMessageForIncorrectType(value: unknown, expectedType: string): string { + return `Expected ${expectedType}. Received ${getTypeAsString(value)}.`; +} + +function getTypeAsString(value: unknown): string { + if (Array.isArray(value)) { + return "list"; + } + if (value === null) { + return "null"; + } + switch (typeof value) { + case "string": + return `"${value}"`; + case "number": + case "boolean": + case "undefined": + return `${value}`; + } + return typeof value; +} diff --git a/packages/ir-sdk/src/sdk/core/schemas/utils/isPlainObject.ts b/packages/ir-sdk/src/sdk/core/schemas/utils/isPlainObject.ts new file mode 100644 index 00000000000..db82a722c35 --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/utils/isPlainObject.ts @@ -0,0 +1,17 @@ +// borrowed from https://github.com/lodash/lodash/blob/master/isPlainObject.js +export function isPlainObject(value: unknown): value is Record { + if (typeof value !== "object" || value === null) { + return false; + } + + if (Object.getPrototypeOf(value) === null) { + return true; + } + + let proto = value; + while (Object.getPrototypeOf(proto) !== null) { + proto = Object.getPrototypeOf(proto); + } + + return Object.getPrototypeOf(value) === proto; +} diff --git a/packages/ir-sdk/src/sdk/core/schemas/utils/keys.ts b/packages/ir-sdk/src/sdk/core/schemas/utils/keys.ts new file mode 100644 index 00000000000..01867098287 --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/utils/keys.ts @@ -0,0 +1,3 @@ +export function keys(object: T): (keyof T)[] { + return Object.keys(object) as (keyof T)[]; +} diff --git a/packages/ir-sdk/src/sdk/core/schemas/utils/maybeSkipValidation.ts b/packages/ir-sdk/src/sdk/core/schemas/utils/maybeSkipValidation.ts new file mode 100644 index 00000000000..99c02c32bda --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/utils/maybeSkipValidation.ts @@ -0,0 +1,39 @@ +import { BaseSchema, MaybeValid, SchemaOptions } from "../Schema"; +import { MaybePromise } from "./MaybePromise"; + +export function maybeSkipValidation, Raw, Parsed>(schema: S): S { + return { + ...schema, + json: transformAndMaybeSkipValidation(schema.json), + parse: transformAndMaybeSkipValidation(schema.parse), + }; +} + +function transformAndMaybeSkipValidation( + transform: (value: unknown, opts?: SchemaOptions) => MaybePromise> +): (value: unknown, opts?: SchemaOptions) => MaybePromise> { + return async (value, opts): Promise> => { + const transformed = await transform(value, opts); + const { skipValidation = false } = opts ?? {}; + if (!transformed.ok && skipValidation) { + // eslint-disable-next-line no-console + console.warn( + [ + "Failed to validate.", + ...transformed.errors.map( + (error) => + " - " + + (error.path.length > 0 ? `${error.path.join(".")}: ${error.message}` : error.message) + ), + ].join("\n") + ); + + return { + ok: true, + value: value as T, + }; + } else { + return transformed; + } + }; +} diff --git a/packages/ir-sdk/src/sdk/core/schemas/utils/partition.ts b/packages/ir-sdk/src/sdk/core/schemas/utils/partition.ts new file mode 100644 index 00000000000..f58d6f3d35f --- /dev/null +++ b/packages/ir-sdk/src/sdk/core/schemas/utils/partition.ts @@ -0,0 +1,12 @@ +export function partition(items: readonly T[], predicate: (item: T) => boolean): [T[], T[]] { + const trueItems: T[] = [], + falseItems: T[] = []; + for (const item of items) { + if (predicate(item)) { + trueItems.push(item); + } else { + falseItems.push(item); + } + } + return [trueItems, falseItems]; +} diff --git a/packages/ir-sdk/src/sdk/errors/FernIrError.ts b/packages/ir-sdk/src/sdk/errors/FernIrError.ts new file mode 100644 index 00000000000..d599fad8d3a --- /dev/null +++ b/packages/ir-sdk/src/sdk/errors/FernIrError.ts @@ -0,0 +1,45 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export class FernIrError extends Error { + readonly statusCode?: number; + readonly body?: unknown; + + constructor({ message, statusCode, body }: { message?: string; statusCode?: number; body?: unknown }) { + super(buildMessage({ message, statusCode, body })); + Object.setPrototypeOf(this, FernIrError.prototype); + if (statusCode != null) { + this.statusCode = statusCode; + } + + if (body !== undefined) { + this.body = body; + } + } +} + +function buildMessage({ + message, + statusCode, + body, +}: { + message: string | undefined; + statusCode: number | undefined; + body: unknown | undefined; +}): string { + let lines: string[] = []; + if (message != null) { + lines.push(message); + } + + if (statusCode != null) { + lines.push(`Status code: ${statusCode.toString()}`); + } + + if (body != null) { + lines.push(`Body: ${JSON.stringify(body, undefined, 2)}`); + } + + return lines.join("\n"); +} diff --git a/packages/ir-sdk/src/sdk/errors/FernIrTimeoutError.ts b/packages/ir-sdk/src/sdk/errors/FernIrTimeoutError.ts new file mode 100644 index 00000000000..3144e6ed55b --- /dev/null +++ b/packages/ir-sdk/src/sdk/errors/FernIrTimeoutError.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export class FernIrTimeoutError extends Error { + constructor() { + super("Timeout"); + Object.setPrototypeOf(this, FernIrTimeoutError.prototype); + } +} diff --git a/packages/ir-sdk/src/sdk/errors/index.ts b/packages/ir-sdk/src/sdk/errors/index.ts new file mode 100644 index 00000000000..d9d996113b4 --- /dev/null +++ b/packages/ir-sdk/src/sdk/errors/index.ts @@ -0,0 +1,2 @@ +export { FernIrError } from "./FernIrError"; +export { FernIrTimeoutError } from "./FernIrTimeoutError"; diff --git a/packages/ir-sdk/src/sdk/index.ts b/packages/ir-sdk/src/sdk/index.ts new file mode 100644 index 00000000000..41526fb679a --- /dev/null +++ b/packages/ir-sdk/src/sdk/index.ts @@ -0,0 +1,2 @@ +export * as FernIr from "./api"; +export { FernIrError, FernIrTimeoutError } from "./errors"; diff --git a/packages/ir-sdk/src/sdk/serialization/index.ts b/packages/ir-sdk/src/sdk/serialization/index.ts new file mode 100644 index 00000000000..3e5335fe421 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/index.ts @@ -0,0 +1 @@ +export * from "./resources"; diff --git a/packages/ir-sdk/src/sdk/serialization/resources/auth/index.ts b/packages/ir-sdk/src/sdk/serialization/resources/auth/index.ts new file mode 100644 index 00000000000..eea524d6557 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/auth/index.ts @@ -0,0 +1 @@ +export * from "./types"; diff --git a/packages/ir-sdk/src/sdk/serialization/resources/auth/types/ApiAuth.ts b/packages/ir-sdk/src/sdk/serialization/resources/auth/types/ApiAuth.ts new file mode 100644 index 00000000000..18930267661 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/auth/types/ApiAuth.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ApiAuth: core.serialization.ObjectSchema = core.serialization + .objectWithoutOptionalProperties({ + requirement: core.serialization.lazy(async () => (await import("../../..")).AuthSchemesRequirement), + schemes: core.serialization.list(core.serialization.lazy(async () => (await import("../../..")).AuthScheme)), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).WithDocs)); + +export declare namespace ApiAuth { + interface Raw extends serializers.WithDocs.Raw { + requirement: serializers.AuthSchemesRequirement.Raw; + schemes: serializers.AuthScheme.Raw[]; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/auth/types/AuthScheme.ts b/packages/ir-sdk/src/sdk/serialization/resources/auth/types/AuthScheme.ts new file mode 100644 index 00000000000..9abf5e0dec2 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/auth/types/AuthScheme.ts @@ -0,0 +1,45 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const AuthScheme: core.serialization.Schema = core.serialization + .union(core.serialization.discriminant("type", "_type"), { + bearer: core.serialization.lazyObject(async () => (await import("../../..")).BearerAuthScheme), + basic: core.serialization.lazyObject(async () => (await import("../../..")).BasicAuthScheme), + header: core.serialization.lazyObject(async () => (await import("../../..")).HeaderAuthScheme), + }) + .transform({ + transform: (value) => { + switch (value.type) { + case "bearer": + return FernIr.AuthScheme.bearer(value); + case "basic": + return FernIr.AuthScheme.basic(value); + case "header": + return FernIr.AuthScheme.header(value); + default: + return value as FernIr.AuthScheme; + } + }, + untransform: ({ _visit, ...value }) => value as any, + }); + +export declare namespace AuthScheme { + type Raw = AuthScheme.Bearer | AuthScheme.Basic | AuthScheme.Header; + + interface Bearer extends serializers.BearerAuthScheme.Raw { + _type: "bearer"; + } + + interface Basic extends serializers.BasicAuthScheme.Raw { + _type: "basic"; + } + + interface Header extends serializers.HeaderAuthScheme.Raw { + _type: "header"; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/auth/types/AuthSchemesRequirement.ts b/packages/ir-sdk/src/sdk/serialization/resources/auth/types/AuthSchemesRequirement.ts new file mode 100644 index 00000000000..be88ca9e0fa --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/auth/types/AuthSchemesRequirement.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const AuthSchemesRequirement: core.serialization.Schema< + serializers.AuthSchemesRequirement.Raw, + FernIr.AuthSchemesRequirement +> = core.serialization.enum_(["ALL", "ANY"]); + +export declare namespace AuthSchemesRequirement { + type Raw = "ALL" | "ANY"; +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/auth/types/BasicAuthScheme.ts b/packages/ir-sdk/src/sdk/serialization/resources/auth/types/BasicAuthScheme.ts new file mode 100644 index 00000000000..32abdd68458 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/auth/types/BasicAuthScheme.ts @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const BasicAuthScheme: core.serialization.ObjectSchema = + core.serialization + .objectWithoutOptionalProperties({ + username: core.serialization.lazyObject(async () => (await import("../../..")).Name), + usernameEnvVar: core.serialization + .lazy(async () => (await import("../../..")).EnvironmentVariable) + .optional(), + password: core.serialization.lazyObject(async () => (await import("../../..")).Name), + passwordEnvVar: core.serialization + .lazy(async () => (await import("../../..")).EnvironmentVariable) + .optional(), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).WithDocs)); + +export declare namespace BasicAuthScheme { + interface Raw extends serializers.WithDocs.Raw { + username: serializers.Name.Raw; + usernameEnvVar?: serializers.EnvironmentVariable.Raw | null; + password: serializers.Name.Raw; + passwordEnvVar?: serializers.EnvironmentVariable.Raw | null; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/auth/types/BearerAuthScheme.ts b/packages/ir-sdk/src/sdk/serialization/resources/auth/types/BearerAuthScheme.ts new file mode 100644 index 00000000000..4b0dd44e4fa --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/auth/types/BearerAuthScheme.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const BearerAuthScheme: core.serialization.ObjectSchema< + serializers.BearerAuthScheme.Raw, + FernIr.BearerAuthScheme +> = core.serialization + .objectWithoutOptionalProperties({ + token: core.serialization.lazyObject(async () => (await import("../../..")).Name), + tokenEnvVar: core.serialization.lazy(async () => (await import("../../..")).EnvironmentVariable).optional(), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).WithDocs)); + +export declare namespace BearerAuthScheme { + interface Raw extends serializers.WithDocs.Raw { + token: serializers.Name.Raw; + tokenEnvVar?: serializers.EnvironmentVariable.Raw | null; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/auth/types/EnvironmentVariable.ts b/packages/ir-sdk/src/sdk/serialization/resources/auth/types/EnvironmentVariable.ts new file mode 100644 index 00000000000..929f9263c22 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/auth/types/EnvironmentVariable.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const EnvironmentVariable: core.serialization.Schema< + serializers.EnvironmentVariable.Raw, + FernIr.EnvironmentVariable +> = core.serialization.string(); + +export declare namespace EnvironmentVariable { + type Raw = string; +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/auth/types/HeaderAuthScheme.ts b/packages/ir-sdk/src/sdk/serialization/resources/auth/types/HeaderAuthScheme.ts new file mode 100644 index 00000000000..e574ed9b228 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/auth/types/HeaderAuthScheme.ts @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const HeaderAuthScheme: core.serialization.ObjectSchema< + serializers.HeaderAuthScheme.Raw, + FernIr.HeaderAuthScheme +> = core.serialization + .objectWithoutOptionalProperties({ + name: core.serialization.lazyObject(async () => (await import("../../..")).NameAndWireValue), + valueType: core.serialization.lazy(async () => (await import("../../..")).TypeReference), + prefix: core.serialization.string().optional(), + headerEnvVar: core.serialization.lazy(async () => (await import("../../..")).EnvironmentVariable).optional(), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).WithDocs)); + +export declare namespace HeaderAuthScheme { + interface Raw extends serializers.WithDocs.Raw { + name: serializers.NameAndWireValue.Raw; + valueType: serializers.TypeReference.Raw; + prefix?: string | null; + headerEnvVar?: serializers.EnvironmentVariable.Raw | null; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/auth/types/index.ts b/packages/ir-sdk/src/sdk/serialization/resources/auth/types/index.ts new file mode 100644 index 00000000000..a6a3e4914f6 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/auth/types/index.ts @@ -0,0 +1,7 @@ +export * from "./EnvironmentVariable"; +export * from "./ApiAuth"; +export * from "./AuthSchemesRequirement"; +export * from "./AuthScheme"; +export * from "./BearerAuthScheme"; +export * from "./BasicAuthScheme"; +export * from "./HeaderAuthScheme"; diff --git a/packages/ir-sdk/src/sdk/serialization/resources/commons/index.ts b/packages/ir-sdk/src/sdk/serialization/resources/commons/index.ts new file mode 100644 index 00000000000..eea524d6557 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/commons/index.ts @@ -0,0 +1 @@ +export * from "./types"; diff --git a/packages/ir-sdk/src/sdk/serialization/resources/commons/types/Availability.ts b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/Availability.ts new file mode 100644 index 00000000000..27507eadbb2 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/Availability.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const Availability: core.serialization.ObjectSchema = + core.serialization.objectWithoutOptionalProperties({ + status: core.serialization.lazy(async () => (await import("../../..")).AvailabilityStatus), + message: core.serialization.string().optional(), + }); + +export declare namespace Availability { + interface Raw { + status: serializers.AvailabilityStatus.Raw; + message?: string | null; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/commons/types/AvailabilityStatus.ts b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/AvailabilityStatus.ts new file mode 100644 index 00000000000..066f51c14e4 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/AvailabilityStatus.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const AvailabilityStatus: core.serialization.Schema< + serializers.AvailabilityStatus.Raw, + FernIr.AvailabilityStatus +> = core.serialization.enum_(["IN_DEVELOPMENT", "PRE_RELEASE", "GENERAL_AVAILABILITY", "DEPRECATED"]); + +export declare namespace AvailabilityStatus { + type Raw = "IN_DEVELOPMENT" | "PRE_RELEASE" | "GENERAL_AVAILABILITY" | "DEPRECATED"; +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/commons/types/Declaration.ts b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/Declaration.ts new file mode 100644 index 00000000000..42fe5816546 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/Declaration.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const Declaration: core.serialization.ObjectSchema = + core.serialization + .objectWithoutOptionalProperties({ + availability: core.serialization.lazyObject(async () => (await import("../../..")).Availability).optional(), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).WithDocs)); + +export declare namespace Declaration { + interface Raw extends serializers.WithDocs.Raw { + availability?: serializers.Availability.Raw | null; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/commons/types/EndpointId.ts b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/EndpointId.ts new file mode 100644 index 00000000000..2616edb7d70 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/EndpointId.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const EndpointId: core.serialization.Schema = + core.serialization.string(); + +export declare namespace EndpointId { + type Raw = string; +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/commons/types/ErrorId.ts b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/ErrorId.ts new file mode 100644 index 00000000000..ed0b544313b --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/ErrorId.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ErrorId: core.serialization.Schema = core.serialization.string(); + +export declare namespace ErrorId { + type Raw = string; +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/commons/types/EscapedString.ts b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/EscapedString.ts new file mode 100644 index 00000000000..2218014b127 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/EscapedString.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const EscapedString: core.serialization.ObjectSchema = + core.serialization.objectWithoutOptionalProperties({ + original: core.serialization.string(), + }); + +export declare namespace EscapedString { + interface Raw { + original: string; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/commons/types/FernFilepath.ts b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/FernFilepath.ts new file mode 100644 index 00000000000..2d781bf0e42 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/FernFilepath.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const FernFilepath: core.serialization.ObjectSchema = + core.serialization.objectWithoutOptionalProperties({ + allParts: core.serialization.list(core.serialization.lazyObject(async () => (await import("../../..")).Name)), + packagePath: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).Name) + ), + file: core.serialization.lazyObject(async () => (await import("../../..")).Name).optional(), + }); + +export declare namespace FernFilepath { + interface Raw { + allParts: serializers.Name.Raw[]; + packagePath: serializers.Name.Raw[]; + file?: serializers.Name.Raw | null; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/commons/types/Name.ts b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/Name.ts new file mode 100644 index 00000000000..47a3f1368e3 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/Name.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const Name: core.serialization.ObjectSchema = + core.serialization.objectWithoutOptionalProperties({ + originalName: core.serialization.string(), + camelCase: core.serialization.lazyObject(async () => (await import("../../..")).SafeAndUnsafeString), + pascalCase: core.serialization.lazyObject(async () => (await import("../../..")).SafeAndUnsafeString), + snakeCase: core.serialization.lazyObject(async () => (await import("../../..")).SafeAndUnsafeString), + screamingSnakeCase: core.serialization.lazyObject(async () => (await import("../../..")).SafeAndUnsafeString), + }); + +export declare namespace Name { + interface Raw { + originalName: string; + camelCase: serializers.SafeAndUnsafeString.Raw; + pascalCase: serializers.SafeAndUnsafeString.Raw; + snakeCase: serializers.SafeAndUnsafeString.Raw; + screamingSnakeCase: serializers.SafeAndUnsafeString.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/commons/types/NameAndWireValue.ts b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/NameAndWireValue.ts new file mode 100644 index 00000000000..3c04fcaddf6 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/NameAndWireValue.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const NameAndWireValue: core.serialization.ObjectSchema< + serializers.NameAndWireValue.Raw, + FernIr.NameAndWireValue +> = core.serialization.objectWithoutOptionalProperties({ + wireValue: core.serialization.string(), + name: core.serialization.lazyObject(async () => (await import("../../..")).Name), +}); + +export declare namespace NameAndWireValue { + interface Raw { + wireValue: string; + name: serializers.Name.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/commons/types/SafeAndUnsafeString.ts b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/SafeAndUnsafeString.ts new file mode 100644 index 00000000000..315ab0d14bb --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/SafeAndUnsafeString.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const SafeAndUnsafeString: core.serialization.ObjectSchema< + serializers.SafeAndUnsafeString.Raw, + FernIr.SafeAndUnsafeString +> = core.serialization.objectWithoutOptionalProperties({ + unsafeName: core.serialization.string(), + safeName: core.serialization.string(), +}); + +export declare namespace SafeAndUnsafeString { + interface Raw { + unsafeName: string; + safeName: string; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/commons/types/ServiceId.ts b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/ServiceId.ts new file mode 100644 index 00000000000..5ecf54d1e9c --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/ServiceId.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ServiceId: core.serialization.Schema = + core.serialization.string(); + +export declare namespace ServiceId { + type Raw = string; +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/commons/types/SubpackageId.ts b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/SubpackageId.ts new file mode 100644 index 00000000000..152f227adc4 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/SubpackageId.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const SubpackageId: core.serialization.Schema = + core.serialization.string(); + +export declare namespace SubpackageId { + type Raw = string; +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/commons/types/TypeId.ts b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/TypeId.ts new file mode 100644 index 00000000000..b007a9777ce --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/TypeId.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const TypeId: core.serialization.Schema = core.serialization.string(); + +export declare namespace TypeId { + type Raw = string; +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/commons/types/WebhookGroupId.ts b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/WebhookGroupId.ts new file mode 100644 index 00000000000..00b8a71f58b --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/WebhookGroupId.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const WebhookGroupId: core.serialization.Schema = + core.serialization.string(); + +export declare namespace WebhookGroupId { + type Raw = string; +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/commons/types/WithDocs.ts b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/WithDocs.ts new file mode 100644 index 00000000000..18f125d1e68 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/WithDocs.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const WithDocs: core.serialization.ObjectSchema = + core.serialization.objectWithoutOptionalProperties({ + docs: core.serialization.string().optional(), + }); + +export declare namespace WithDocs { + interface Raw { + docs?: string | null; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/commons/types/WithJsonExample.ts b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/WithJsonExample.ts new file mode 100644 index 00000000000..871896e13a0 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/WithJsonExample.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const WithJsonExample: core.serialization.ObjectSchema = + core.serialization.objectWithoutOptionalProperties({ + jsonExample: core.serialization.unknown(), + }); + +export declare namespace WithJsonExample { + interface Raw { + jsonExample?: unknown; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/commons/types/index.ts b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/index.ts new file mode 100644 index 00000000000..02b5a2bf676 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/index.ts @@ -0,0 +1,16 @@ +export * from "./WithDocs"; +export * from "./FernFilepath"; +export * from "./Name"; +export * from "./NameAndWireValue"; +export * from "./SafeAndUnsafeString"; +export * from "./EscapedString"; +export * from "./WithJsonExample"; +export * from "./SubpackageId"; +export * from "./ServiceId"; +export * from "./EndpointId"; +export * from "./TypeId"; +export * from "./ErrorId"; +export * from "./WebhookGroupId"; +export * from "./Declaration"; +export * from "./Availability"; +export * from "./AvailabilityStatus"; diff --git a/packages/ir-sdk/src/sdk/serialization/resources/constants/index.ts b/packages/ir-sdk/src/sdk/serialization/resources/constants/index.ts new file mode 100644 index 00000000000..eea524d6557 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/constants/index.ts @@ -0,0 +1 @@ +export * from "./types"; diff --git a/packages/ir-sdk/src/sdk/serialization/resources/constants/types/Constants.ts b/packages/ir-sdk/src/sdk/serialization/resources/constants/types/Constants.ts new file mode 100644 index 00000000000..44f9bcefbfd --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/constants/types/Constants.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const Constants: core.serialization.ObjectSchema = + core.serialization.objectWithoutOptionalProperties({ + errorInstanceIdKey: core.serialization.lazyObject(async () => (await import("../../..")).NameAndWireValue), + }); + +export declare namespace Constants { + interface Raw { + errorInstanceIdKey: serializers.NameAndWireValue.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/constants/types/index.ts b/packages/ir-sdk/src/sdk/serialization/resources/constants/types/index.ts new file mode 100644 index 00000000000..86ad2cf489d --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/constants/types/index.ts @@ -0,0 +1 @@ +export * from "./Constants"; diff --git a/packages/ir-sdk/src/sdk/serialization/resources/environment/index.ts b/packages/ir-sdk/src/sdk/serialization/resources/environment/index.ts new file mode 100644 index 00000000000..eea524d6557 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/environment/index.ts @@ -0,0 +1 @@ +export * from "./types"; diff --git a/packages/ir-sdk/src/sdk/serialization/resources/environment/types/EnvironmentBaseUrlId.ts b/packages/ir-sdk/src/sdk/serialization/resources/environment/types/EnvironmentBaseUrlId.ts new file mode 100644 index 00000000000..a0e7e3d0dda --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/environment/types/EnvironmentBaseUrlId.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const EnvironmentBaseUrlId: core.serialization.Schema< + serializers.EnvironmentBaseUrlId.Raw, + FernIr.EnvironmentBaseUrlId +> = core.serialization.string(); + +export declare namespace EnvironmentBaseUrlId { + type Raw = string; +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/environment/types/EnvironmentBaseUrlWithId.ts b/packages/ir-sdk/src/sdk/serialization/resources/environment/types/EnvironmentBaseUrlWithId.ts new file mode 100644 index 00000000000..3a93ceaacf0 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/environment/types/EnvironmentBaseUrlWithId.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const EnvironmentBaseUrlWithId: core.serialization.ObjectSchema< + serializers.EnvironmentBaseUrlWithId.Raw, + FernIr.EnvironmentBaseUrlWithId +> = core.serialization.objectWithoutOptionalProperties({ + id: core.serialization.lazy(async () => (await import("../../..")).EnvironmentBaseUrlId), + name: core.serialization.lazyObject(async () => (await import("../../..")).Name), +}); + +export declare namespace EnvironmentBaseUrlWithId { + interface Raw { + id: serializers.EnvironmentBaseUrlId.Raw; + name: serializers.Name.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/environment/types/EnvironmentId.ts b/packages/ir-sdk/src/sdk/serialization/resources/environment/types/EnvironmentId.ts new file mode 100644 index 00000000000..31d5299c77d --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/environment/types/EnvironmentId.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const EnvironmentId: core.serialization.Schema = + core.serialization.string(); + +export declare namespace EnvironmentId { + type Raw = string; +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/environment/types/EnvironmentUrl.ts b/packages/ir-sdk/src/sdk/serialization/resources/environment/types/EnvironmentUrl.ts new file mode 100644 index 00000000000..c9f5b342b91 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/environment/types/EnvironmentUrl.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const EnvironmentUrl: core.serialization.Schema = + core.serialization.string(); + +export declare namespace EnvironmentUrl { + type Raw = string; +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/environment/types/Environments.ts b/packages/ir-sdk/src/sdk/serialization/resources/environment/types/Environments.ts new file mode 100644 index 00000000000..3ced49d5e17 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/environment/types/Environments.ts @@ -0,0 +1,43 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const Environments: core.serialization.Schema = + core.serialization + .union("type", { + singleBaseUrl: core.serialization.lazyObject( + async () => (await import("../../..")).SingleBaseUrlEnvironments + ), + multipleBaseUrls: core.serialization.lazyObject( + async () => (await import("../../..")).MultipleBaseUrlsEnvironments + ), + }) + .transform({ + transform: (value) => { + switch (value.type) { + case "singleBaseUrl": + return FernIr.Environments.singleBaseUrl(value); + case "multipleBaseUrls": + return FernIr.Environments.multipleBaseUrls(value); + default: + return value as FernIr.Environments; + } + }, + untransform: ({ _visit, ...value }) => value as any, + }); + +export declare namespace Environments { + type Raw = Environments.SingleBaseUrl | Environments.MultipleBaseUrls; + + interface SingleBaseUrl extends serializers.SingleBaseUrlEnvironments.Raw { + type: "singleBaseUrl"; + } + + interface MultipleBaseUrls extends serializers.MultipleBaseUrlsEnvironments.Raw { + type: "multipleBaseUrls"; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/environment/types/EnvironmentsConfig.ts b/packages/ir-sdk/src/sdk/serialization/resources/environment/types/EnvironmentsConfig.ts new file mode 100644 index 00000000000..926874089d3 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/environment/types/EnvironmentsConfig.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const EnvironmentsConfig: core.serialization.ObjectSchema< + serializers.EnvironmentsConfig.Raw, + FernIr.EnvironmentsConfig +> = core.serialization.objectWithoutOptionalProperties({ + defaultEnvironment: core.serialization.lazy(async () => (await import("../../..")).EnvironmentId).optional(), + environments: core.serialization.lazy(async () => (await import("../../..")).Environments), +}); + +export declare namespace EnvironmentsConfig { + interface Raw { + defaultEnvironment?: serializers.EnvironmentId.Raw | null; + environments: serializers.Environments.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/environment/types/MultipleBaseUrlsEnvironment.ts b/packages/ir-sdk/src/sdk/serialization/resources/environment/types/MultipleBaseUrlsEnvironment.ts new file mode 100644 index 00000000000..be97d16432c --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/environment/types/MultipleBaseUrlsEnvironment.ts @@ -0,0 +1,29 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const MultipleBaseUrlsEnvironment: core.serialization.ObjectSchema< + serializers.MultipleBaseUrlsEnvironment.Raw, + FernIr.MultipleBaseUrlsEnvironment +> = core.serialization + .objectWithoutOptionalProperties({ + id: core.serialization.lazy(async () => (await import("../../..")).EnvironmentId), + name: core.serialization.lazyObject(async () => (await import("../../..")).Name), + urls: core.serialization.record( + core.serialization.lazy(async () => (await import("../../..")).EnvironmentBaseUrlId), + core.serialization.lazy(async () => (await import("../../..")).EnvironmentUrl) + ), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).WithDocs)); + +export declare namespace MultipleBaseUrlsEnvironment { + interface Raw extends serializers.WithDocs.Raw { + id: serializers.EnvironmentId.Raw; + name: serializers.Name.Raw; + urls: Record; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/environment/types/MultipleBaseUrlsEnvironments.ts b/packages/ir-sdk/src/sdk/serialization/resources/environment/types/MultipleBaseUrlsEnvironments.ts new file mode 100644 index 00000000000..ba00b9ceb90 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/environment/types/MultipleBaseUrlsEnvironments.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const MultipleBaseUrlsEnvironments: core.serialization.ObjectSchema< + serializers.MultipleBaseUrlsEnvironments.Raw, + FernIr.MultipleBaseUrlsEnvironments +> = core.serialization.objectWithoutOptionalProperties({ + baseUrls: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).EnvironmentBaseUrlWithId) + ), + environments: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).MultipleBaseUrlsEnvironment) + ), +}); + +export declare namespace MultipleBaseUrlsEnvironments { + interface Raw { + baseUrls: serializers.EnvironmentBaseUrlWithId.Raw[]; + environments: serializers.MultipleBaseUrlsEnvironment.Raw[]; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/environment/types/SingleBaseUrlEnvironment.ts b/packages/ir-sdk/src/sdk/serialization/resources/environment/types/SingleBaseUrlEnvironment.ts new file mode 100644 index 00000000000..efef863c667 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/environment/types/SingleBaseUrlEnvironment.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const SingleBaseUrlEnvironment: core.serialization.ObjectSchema< + serializers.SingleBaseUrlEnvironment.Raw, + FernIr.SingleBaseUrlEnvironment +> = core.serialization + .objectWithoutOptionalProperties({ + id: core.serialization.lazy(async () => (await import("../../..")).EnvironmentId), + name: core.serialization.lazyObject(async () => (await import("../../..")).Name), + url: core.serialization.lazy(async () => (await import("../../..")).EnvironmentUrl), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).WithDocs)); + +export declare namespace SingleBaseUrlEnvironment { + interface Raw extends serializers.WithDocs.Raw { + id: serializers.EnvironmentId.Raw; + name: serializers.Name.Raw; + url: serializers.EnvironmentUrl.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/environment/types/SingleBaseUrlEnvironments.ts b/packages/ir-sdk/src/sdk/serialization/resources/environment/types/SingleBaseUrlEnvironments.ts new file mode 100644 index 00000000000..6c564d4782b --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/environment/types/SingleBaseUrlEnvironments.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const SingleBaseUrlEnvironments: core.serialization.ObjectSchema< + serializers.SingleBaseUrlEnvironments.Raw, + FernIr.SingleBaseUrlEnvironments +> = core.serialization.objectWithoutOptionalProperties({ + environments: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).SingleBaseUrlEnvironment) + ), +}); + +export declare namespace SingleBaseUrlEnvironments { + interface Raw { + environments: serializers.SingleBaseUrlEnvironment.Raw[]; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/environment/types/index.ts b/packages/ir-sdk/src/sdk/serialization/resources/environment/types/index.ts new file mode 100644 index 00000000000..4342806fe4b --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/environment/types/index.ts @@ -0,0 +1,10 @@ +export * from "./EnvironmentId"; +export * from "./EnvironmentBaseUrlId"; +export * from "./EnvironmentUrl"; +export * from "./EnvironmentsConfig"; +export * from "./Environments"; +export * from "./SingleBaseUrlEnvironments"; +export * from "./SingleBaseUrlEnvironment"; +export * from "./MultipleBaseUrlsEnvironments"; +export * from "./MultipleBaseUrlsEnvironment"; +export * from "./EnvironmentBaseUrlWithId"; diff --git a/packages/ir-sdk/src/sdk/serialization/resources/errors/index.ts b/packages/ir-sdk/src/sdk/serialization/resources/errors/index.ts new file mode 100644 index 00000000000..eea524d6557 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/errors/index.ts @@ -0,0 +1 @@ +export * from "./types"; diff --git a/packages/ir-sdk/src/sdk/serialization/resources/errors/types/DeclaredErrorName.ts b/packages/ir-sdk/src/sdk/serialization/resources/errors/types/DeclaredErrorName.ts new file mode 100644 index 00000000000..5a53a84ed21 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/errors/types/DeclaredErrorName.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const DeclaredErrorName: core.serialization.ObjectSchema< + serializers.DeclaredErrorName.Raw, + FernIr.DeclaredErrorName +> = core.serialization.objectWithoutOptionalProperties({ + errorId: core.serialization.lazy(async () => (await import("../../..")).ErrorId), + fernFilepath: core.serialization.lazyObject(async () => (await import("../../..")).FernFilepath), + name: core.serialization.lazyObject(async () => (await import("../../..")).Name), +}); + +export declare namespace DeclaredErrorName { + interface Raw { + errorId: serializers.ErrorId.Raw; + fernFilepath: serializers.FernFilepath.Raw; + name: serializers.Name.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/errors/types/ErrorDeclaration.ts b/packages/ir-sdk/src/sdk/serialization/resources/errors/types/ErrorDeclaration.ts new file mode 100644 index 00000000000..9678c552254 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/errors/types/ErrorDeclaration.ts @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ErrorDeclaration: core.serialization.ObjectSchema< + serializers.ErrorDeclaration.Raw, + FernIr.ErrorDeclaration +> = core.serialization + .objectWithoutOptionalProperties({ + name: core.serialization.lazyObject(async () => (await import("../../..")).DeclaredErrorName), + discriminantValue: core.serialization.lazyObject(async () => (await import("../../..")).NameAndWireValue), + type: core.serialization.lazy(async () => (await import("../../..")).TypeReference).optional(), + statusCode: core.serialization.number(), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).WithDocs)); + +export declare namespace ErrorDeclaration { + interface Raw extends serializers.WithDocs.Raw { + name: serializers.DeclaredErrorName.Raw; + discriminantValue: serializers.NameAndWireValue.Raw; + type?: serializers.TypeReference.Raw | null; + statusCode: number; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/errors/types/ErrorDeclarationDiscriminantValue.ts b/packages/ir-sdk/src/sdk/serialization/resources/errors/types/ErrorDeclarationDiscriminantValue.ts new file mode 100644 index 00000000000..edae38e4f5f --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/errors/types/ErrorDeclarationDiscriminantValue.ts @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ErrorDeclarationDiscriminantValue: core.serialization.Schema< + serializers.ErrorDeclarationDiscriminantValue.Raw, + FernIr.ErrorDeclarationDiscriminantValue +> = core.serialization + .union("type", { + property: core.serialization.lazyObject(async () => (await import("../../..")).NameAndWireValue), + statusCode: core.serialization.object({}), + }) + .transform({ + transform: (value) => { + switch (value.type) { + case "property": + return FernIr.ErrorDeclarationDiscriminantValue.property(value); + case "statusCode": + return FernIr.ErrorDeclarationDiscriminantValue.statusCode(); + default: + return value as FernIr.ErrorDeclarationDiscriminantValue; + } + }, + untransform: ({ _visit, ...value }) => value as any, + }); + +export declare namespace ErrorDeclarationDiscriminantValue { + type Raw = ErrorDeclarationDiscriminantValue.Property | ErrorDeclarationDiscriminantValue.StatusCode; + + interface Property extends serializers.NameAndWireValue.Raw { + type: "property"; + } + + interface StatusCode { + type: "statusCode"; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/errors/types/index.ts b/packages/ir-sdk/src/sdk/serialization/resources/errors/types/index.ts new file mode 100644 index 00000000000..00c0d87ca97 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/errors/types/index.ts @@ -0,0 +1,3 @@ +export * from "./ErrorDeclaration"; +export * from "./ErrorDeclarationDiscriminantValue"; +export * from "./DeclaredErrorName"; diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/index.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/index.ts new file mode 100644 index 00000000000..eea524d6557 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/index.ts @@ -0,0 +1 @@ +export * from "./types"; diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/BytesRequest.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/BytesRequest.ts new file mode 100644 index 00000000000..21058767cec --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/BytesRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const BytesRequest: core.serialization.ObjectSchema = + core.serialization.objectWithoutOptionalProperties({ + isOptional: core.serialization.boolean(), + contentType: core.serialization.string().optional(), + }); + +export declare namespace BytesRequest { + interface Raw { + isOptional: boolean; + contentType?: string | null; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/DeclaredServiceName.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/DeclaredServiceName.ts new file mode 100644 index 00000000000..8492775ca56 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/DeclaredServiceName.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const DeclaredServiceName: core.serialization.ObjectSchema< + serializers.DeclaredServiceName.Raw, + FernIr.DeclaredServiceName +> = core.serialization.objectWithoutOptionalProperties({ + fernFilepath: core.serialization.lazyObject(async () => (await import("../../..")).FernFilepath), +}); + +export declare namespace DeclaredServiceName { + interface Raw { + fernFilepath: serializers.FernFilepath.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/EndpointName.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/EndpointName.ts new file mode 100644 index 00000000000..7ee8e9292af --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/EndpointName.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const EndpointName: core.serialization.ObjectSchema = + core.serialization.lazyObject(async () => (await import("../../..")).Name); + +export declare namespace EndpointName { + type Raw = serializers.Name.Raw; +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExampleCodeSample.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExampleCodeSample.ts new file mode 100644 index 00000000000..b3116c55807 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExampleCodeSample.ts @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ExampleCodeSample: core.serialization.ObjectSchema< + serializers.ExampleCodeSample.Raw, + FernIr.ExampleCodeSample +> = core.serialization + .objectWithoutOptionalProperties({ + name: core.serialization.lazyObject(async () => (await import("../../..")).Name).optional(), + language: core.serialization.string(), + code: core.serialization.string(), + install: core.serialization.string().optional(), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).WithDocs)); + +export declare namespace ExampleCodeSample { + interface Raw extends serializers.WithDocs.Raw { + name?: serializers.Name.Raw | null; + language: string; + code: string; + install?: string | null; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExampleEndpointCall.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExampleEndpointCall.ts new file mode 100644 index 00000000000..7f46eb6f869 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExampleEndpointCall.ts @@ -0,0 +1,56 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ExampleEndpointCall: core.serialization.ObjectSchema< + serializers.ExampleEndpointCall.Raw, + FernIr.ExampleEndpointCall +> = core.serialization + .objectWithoutOptionalProperties({ + name: core.serialization.lazyObject(async () => (await import("../../..")).Name).optional(), + url: core.serialization.string(), + rootPathParameters: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).ExamplePathParameter) + ), + servicePathParameters: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).ExamplePathParameter) + ), + endpointPathParameters: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).ExamplePathParameter) + ), + serviceHeaders: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).ExampleHeader) + ), + endpointHeaders: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).ExampleHeader) + ), + queryParameters: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).ExampleQueryParameter) + ), + request: core.serialization.lazy(async () => (await import("../../..")).ExampleRequestBody).optional(), + response: core.serialization.lazy(async () => (await import("../../..")).ExampleResponse), + codeSamples: core.serialization + .list(core.serialization.lazyObject(async () => (await import("../../..")).ExampleCodeSample)) + .optional(), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).WithDocs)); + +export declare namespace ExampleEndpointCall { + interface Raw extends serializers.WithDocs.Raw { + name?: serializers.Name.Raw | null; + url: string; + rootPathParameters: serializers.ExamplePathParameter.Raw[]; + servicePathParameters: serializers.ExamplePathParameter.Raw[]; + endpointPathParameters: serializers.ExamplePathParameter.Raw[]; + serviceHeaders: serializers.ExampleHeader.Raw[]; + endpointHeaders: serializers.ExampleHeader.Raw[]; + queryParameters: serializers.ExampleQueryParameter.Raw[]; + request?: serializers.ExampleRequestBody.Raw | null; + response: serializers.ExampleResponse.Raw; + codeSamples?: serializers.ExampleCodeSample.Raw[] | null; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExampleEndpointErrorResponse.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExampleEndpointErrorResponse.ts new file mode 100644 index 00000000000..35bc9e395e0 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExampleEndpointErrorResponse.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ExampleEndpointErrorResponse: core.serialization.ObjectSchema< + serializers.ExampleEndpointErrorResponse.Raw, + FernIr.ExampleEndpointErrorResponse +> = core.serialization.objectWithoutOptionalProperties({ + error: core.serialization.lazyObject(async () => (await import("../../..")).DeclaredErrorName), + body: core.serialization.lazyObject(async () => (await import("../../..")).ExampleTypeReference).optional(), +}); + +export declare namespace ExampleEndpointErrorResponse { + interface Raw { + error: serializers.DeclaredErrorName.Raw; + body?: serializers.ExampleTypeReference.Raw | null; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExampleEndpointSuccessResponse.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExampleEndpointSuccessResponse.ts new file mode 100644 index 00000000000..b68fc00c4e1 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExampleEndpointSuccessResponse.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ExampleEndpointSuccessResponse: core.serialization.ObjectSchema< + serializers.ExampleEndpointSuccessResponse.Raw, + FernIr.ExampleEndpointSuccessResponse +> = core.serialization.objectWithoutOptionalProperties({ + body: core.serialization.lazyObject(async () => (await import("../../..")).ExampleTypeReference).optional(), +}); + +export declare namespace ExampleEndpointSuccessResponse { + interface Raw { + body?: serializers.ExampleTypeReference.Raw | null; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExampleHeader.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExampleHeader.ts new file mode 100644 index 00000000000..ab0650c242e --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExampleHeader.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ExampleHeader: core.serialization.ObjectSchema = + core.serialization.objectWithoutOptionalProperties({ + name: core.serialization.lazyObject(async () => (await import("../../..")).NameAndWireValue), + value: core.serialization.lazyObject(async () => (await import("../../..")).ExampleTypeReference), + }); + +export declare namespace ExampleHeader { + interface Raw { + name: serializers.NameAndWireValue.Raw; + value: serializers.ExampleTypeReference.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExampleInlinedRequestBody.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExampleInlinedRequestBody.ts new file mode 100644 index 00000000000..2b32bb4c934 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExampleInlinedRequestBody.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ExampleInlinedRequestBody: core.serialization.ObjectSchema< + serializers.ExampleInlinedRequestBody.Raw, + FernIr.ExampleInlinedRequestBody +> = core.serialization + .objectWithoutOptionalProperties({ + properties: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).ExampleInlinedRequestBodyProperty) + ), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).WithJsonExample)); + +export declare namespace ExampleInlinedRequestBody { + interface Raw extends serializers.WithJsonExample.Raw { + properties: serializers.ExampleInlinedRequestBodyProperty.Raw[]; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExampleInlinedRequestBodyProperty.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExampleInlinedRequestBodyProperty.ts new file mode 100644 index 00000000000..5b23bf9c1e5 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExampleInlinedRequestBodyProperty.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ExampleInlinedRequestBodyProperty: core.serialization.ObjectSchema< + serializers.ExampleInlinedRequestBodyProperty.Raw, + FernIr.ExampleInlinedRequestBodyProperty +> = core.serialization.objectWithoutOptionalProperties({ + name: core.serialization.lazyObject(async () => (await import("../../..")).NameAndWireValue), + value: core.serialization.lazyObject(async () => (await import("../../..")).ExampleTypeReference), + originalTypeDeclaration: core.serialization + .lazyObject(async () => (await import("../../..")).DeclaredTypeName) + .optional(), +}); + +export declare namespace ExampleInlinedRequestBodyProperty { + interface Raw { + name: serializers.NameAndWireValue.Raw; + value: serializers.ExampleTypeReference.Raw; + originalTypeDeclaration?: serializers.DeclaredTypeName.Raw | null; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExamplePathParameter.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExamplePathParameter.ts new file mode 100644 index 00000000000..afb0f1827a4 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExamplePathParameter.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ExamplePathParameter: core.serialization.ObjectSchema< + serializers.ExamplePathParameter.Raw, + FernIr.ExamplePathParameter +> = core.serialization.objectWithoutOptionalProperties({ + name: core.serialization.lazyObject(async () => (await import("../../..")).Name), + value: core.serialization.lazyObject(async () => (await import("../../..")).ExampleTypeReference), +}); + +export declare namespace ExamplePathParameter { + interface Raw { + name: serializers.Name.Raw; + value: serializers.ExampleTypeReference.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExampleQueryParameter.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExampleQueryParameter.ts new file mode 100644 index 00000000000..eeac86110d8 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExampleQueryParameter.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ExampleQueryParameter: core.serialization.ObjectSchema< + serializers.ExampleQueryParameter.Raw, + FernIr.ExampleQueryParameter +> = core.serialization.objectWithoutOptionalProperties({ + name: core.serialization.lazyObject(async () => (await import("../../..")).NameAndWireValue), + value: core.serialization.lazyObject(async () => (await import("../../..")).ExampleTypeReference), +}); + +export declare namespace ExampleQueryParameter { + interface Raw { + name: serializers.NameAndWireValue.Raw; + value: serializers.ExampleTypeReference.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExampleRequestBody.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExampleRequestBody.ts new file mode 100644 index 00000000000..af26d446546 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExampleRequestBody.ts @@ -0,0 +1,43 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ExampleRequestBody: core.serialization.Schema< + serializers.ExampleRequestBody.Raw, + FernIr.ExampleRequestBody +> = core.serialization + .union("type", { + inlinedRequestBody: core.serialization.lazyObject( + async () => (await import("../../..")).ExampleInlinedRequestBody + ), + reference: core.serialization.lazyObject(async () => (await import("../../..")).ExampleTypeReference), + }) + .transform({ + transform: (value) => { + switch (value.type) { + case "inlinedRequestBody": + return FernIr.ExampleRequestBody.inlinedRequestBody(value); + case "reference": + return FernIr.ExampleRequestBody.reference(value); + default: + return value as FernIr.ExampleRequestBody; + } + }, + untransform: ({ _visit, ...value }) => value as any, + }); + +export declare namespace ExampleRequestBody { + type Raw = ExampleRequestBody.InlinedRequestBody | ExampleRequestBody.Reference; + + interface InlinedRequestBody extends serializers.ExampleInlinedRequestBody.Raw { + type: "inlinedRequestBody"; + } + + interface Reference extends serializers.ExampleTypeReference.Raw { + type: "reference"; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExampleResponse.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExampleResponse.ts new file mode 100644 index 00000000000..2664031fa1c --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/ExampleResponse.ts @@ -0,0 +1,39 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ExampleResponse: core.serialization.Schema = + core.serialization + .union("type", { + ok: core.serialization.lazyObject(async () => (await import("../../..")).ExampleEndpointSuccessResponse), + error: core.serialization.lazyObject(async () => (await import("../../..")).ExampleEndpointErrorResponse), + }) + .transform({ + transform: (value) => { + switch (value.type) { + case "ok": + return FernIr.ExampleResponse.ok(value); + case "error": + return FernIr.ExampleResponse.error(value); + default: + return value as FernIr.ExampleResponse; + } + }, + untransform: ({ _visit, ...value }) => value as any, + }); + +export declare namespace ExampleResponse { + type Raw = ExampleResponse.Ok | ExampleResponse.Error; + + interface Ok extends serializers.ExampleEndpointSuccessResponse.Raw { + type: "ok"; + } + + interface Error extends serializers.ExampleEndpointErrorResponse.Raw { + type: "error"; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/FileDownloadResponse.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/FileDownloadResponse.ts new file mode 100644 index 00000000000..33ee5a56bc2 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/FileDownloadResponse.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const FileDownloadResponse: core.serialization.ObjectSchema< + serializers.FileDownloadResponse.Raw, + FernIr.FileDownloadResponse +> = core.serialization + .objectWithoutOptionalProperties({}) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).WithDocs)); + +export declare namespace FileDownloadResponse { + interface Raw extends serializers.WithDocs.Raw {} +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/FileProperty.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/FileProperty.ts new file mode 100644 index 00000000000..9f2143d76c7 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/FileProperty.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const FileProperty: core.serialization.ObjectSchema = + core.serialization.objectWithoutOptionalProperties({ + key: core.serialization.lazyObject(async () => (await import("../../..")).NameAndWireValue), + isOptional: core.serialization.boolean(), + }); + +export declare namespace FileProperty { + interface Raw { + key: serializers.NameAndWireValue.Raw; + isOptional: boolean; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/FileUploadRequest.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/FileUploadRequest.ts new file mode 100644 index 00000000000..11bdbfd47a8 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/FileUploadRequest.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const FileUploadRequest: core.serialization.ObjectSchema< + serializers.FileUploadRequest.Raw, + FernIr.FileUploadRequest +> = core.serialization.objectWithoutOptionalProperties({ + name: core.serialization.lazyObject(async () => (await import("../../..")).Name), + properties: core.serialization.list( + core.serialization.lazy(async () => (await import("../../..")).FileUploadRequestProperty) + ), +}); + +export declare namespace FileUploadRequest { + interface Raw { + name: serializers.Name.Raw; + properties: serializers.FileUploadRequestProperty.Raw[]; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/FileUploadRequestProperty.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/FileUploadRequestProperty.ts new file mode 100644 index 00000000000..685a2c75458 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/FileUploadRequestProperty.ts @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const FileUploadRequestProperty: core.serialization.Schema< + serializers.FileUploadRequestProperty.Raw, + FernIr.FileUploadRequestProperty +> = core.serialization + .union("type", { + file: core.serialization.lazyObject(async () => (await import("../../..")).FileProperty), + bodyProperty: core.serialization.lazyObject(async () => (await import("../../..")).InlinedRequestBodyProperty), + }) + .transform({ + transform: (value) => { + switch (value.type) { + case "file": + return FernIr.FileUploadRequestProperty.file(value); + case "bodyProperty": + return FernIr.FileUploadRequestProperty.bodyProperty(value); + default: + return value as FernIr.FileUploadRequestProperty; + } + }, + untransform: ({ _visit, ...value }) => value as any, + }); + +export declare namespace FileUploadRequestProperty { + type Raw = FileUploadRequestProperty.File | FileUploadRequestProperty.BodyProperty; + + interface File extends serializers.FileProperty.Raw { + type: "file"; + } + + interface BodyProperty extends serializers.InlinedRequestBodyProperty.Raw { + type: "bodyProperty"; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/HttpEndpoint.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/HttpEndpoint.ts new file mode 100644 index 00000000000..d4a730be8bd --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/HttpEndpoint.ts @@ -0,0 +1,64 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const HttpEndpoint: core.serialization.ObjectSchema = + core.serialization + .objectWithoutOptionalProperties({ + id: core.serialization.lazy(async () => (await import("../../..")).EndpointId), + name: core.serialization.lazyObject(async () => (await import("../../..")).EndpointName), + displayName: core.serialization.string().optional(), + method: core.serialization.lazy(async () => (await import("../../..")).HttpMethod), + headers: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).HttpHeader) + ), + baseUrl: core.serialization.lazy(async () => (await import("../../..")).EnvironmentBaseUrlId).optional(), + path: core.serialization.lazyObject(async () => (await import("../../..")).HttpPath), + fullPath: core.serialization.lazyObject(async () => (await import("../../..")).HttpPath), + pathParameters: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).PathParameter) + ), + allPathParameters: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).PathParameter) + ), + queryParameters: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).QueryParameter) + ), + requestBody: core.serialization.lazy(async () => (await import("../../..")).HttpRequestBody).optional(), + sdkRequest: core.serialization.lazyObject(async () => (await import("../../..")).SdkRequest).optional(), + response: core.serialization.lazy(async () => (await import("../../..")).HttpResponse).optional(), + errors: core.serialization.lazy(async () => (await import("../../..")).ResponseErrors), + auth: core.serialization.boolean(), + idempotent: core.serialization.boolean(), + examples: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).ExampleEndpointCall) + ), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).Declaration)); + +export declare namespace HttpEndpoint { + interface Raw extends serializers.Declaration.Raw { + id: serializers.EndpointId.Raw; + name: serializers.EndpointName.Raw; + displayName?: string | null; + method: serializers.HttpMethod.Raw; + headers: serializers.HttpHeader.Raw[]; + baseUrl?: serializers.EnvironmentBaseUrlId.Raw | null; + path: serializers.HttpPath.Raw; + fullPath: serializers.HttpPath.Raw; + pathParameters: serializers.PathParameter.Raw[]; + allPathParameters: serializers.PathParameter.Raw[]; + queryParameters: serializers.QueryParameter.Raw[]; + requestBody?: serializers.HttpRequestBody.Raw | null; + sdkRequest?: serializers.SdkRequest.Raw | null; + response?: serializers.HttpResponse.Raw | null; + errors: serializers.ResponseErrors.Raw; + auth: boolean; + idempotent: boolean; + examples: serializers.ExampleEndpointCall.Raw[]; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/HttpHeader.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/HttpHeader.ts new file mode 100644 index 00000000000..f898c7c8c3d --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/HttpHeader.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const HttpHeader: core.serialization.ObjectSchema = + core.serialization + .objectWithoutOptionalProperties({ + name: core.serialization.lazyObject(async () => (await import("../../..")).NameAndWireValue), + valueType: core.serialization.lazy(async () => (await import("../../..")).TypeReference), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).Declaration)); + +export declare namespace HttpHeader { + interface Raw extends serializers.Declaration.Raw { + name: serializers.NameAndWireValue.Raw; + valueType: serializers.TypeReference.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/HttpMethod.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/HttpMethod.ts new file mode 100644 index 00000000000..278a0352adf --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/HttpMethod.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const HttpMethod: core.serialization.Schema = + core.serialization.enum_(["GET", "POST", "PUT", "PATCH", "DELETE"]); + +export declare namespace HttpMethod { + type Raw = "GET" | "POST" | "PUT" | "PATCH" | "DELETE"; +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/HttpPath.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/HttpPath.ts new file mode 100644 index 00000000000..7b1a6182044 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/HttpPath.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const HttpPath: core.serialization.ObjectSchema = + core.serialization.objectWithoutOptionalProperties({ + head: core.serialization.string(), + parts: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).HttpPathPart) + ), + }); + +export declare namespace HttpPath { + interface Raw { + head: string; + parts: serializers.HttpPathPart.Raw[]; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/HttpPathPart.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/HttpPathPart.ts new file mode 100644 index 00000000000..7425bcd2983 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/HttpPathPart.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const HttpPathPart: core.serialization.ObjectSchema = + core.serialization.objectWithoutOptionalProperties({ + pathParameter: core.serialization.string(), + tail: core.serialization.string(), + }); + +export declare namespace HttpPathPart { + interface Raw { + pathParameter: string; + tail: string; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/HttpRequestBody.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/HttpRequestBody.ts new file mode 100644 index 00000000000..ae88b82af7b --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/HttpRequestBody.ts @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const HttpRequestBody: core.serialization.Schema = + core.serialization + .union("type", { + inlinedRequestBody: core.serialization.lazyObject( + async () => (await import("../../..")).InlinedRequestBody + ), + reference: core.serialization.lazyObject(async () => (await import("../../..")).HttpRequestBodyReference), + fileUpload: core.serialization.lazyObject(async () => (await import("../../..")).FileUploadRequest), + bytes: core.serialization.lazyObject(async () => (await import("../../..")).BytesRequest), + }) + .transform({ + transform: (value) => { + switch (value.type) { + case "inlinedRequestBody": + return FernIr.HttpRequestBody.inlinedRequestBody(value); + case "reference": + return FernIr.HttpRequestBody.reference(value); + case "fileUpload": + return FernIr.HttpRequestBody.fileUpload(value); + case "bytes": + return FernIr.HttpRequestBody.bytes(value); + default: + return value as FernIr.HttpRequestBody; + } + }, + untransform: ({ _visit, ...value }) => value as any, + }); + +export declare namespace HttpRequestBody { + type Raw = + | HttpRequestBody.InlinedRequestBody + | HttpRequestBody.Reference + | HttpRequestBody.FileUpload + | HttpRequestBody.Bytes; + + interface InlinedRequestBody extends serializers.InlinedRequestBody.Raw { + type: "inlinedRequestBody"; + } + + interface Reference extends serializers.HttpRequestBodyReference.Raw { + type: "reference"; + } + + interface FileUpload extends serializers.FileUploadRequest.Raw { + type: "fileUpload"; + } + + interface Bytes extends serializers.BytesRequest.Raw { + type: "bytes"; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/HttpRequestBodyReference.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/HttpRequestBodyReference.ts new file mode 100644 index 00000000000..65859909f00 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/HttpRequestBodyReference.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const HttpRequestBodyReference: core.serialization.ObjectSchema< + serializers.HttpRequestBodyReference.Raw, + FernIr.HttpRequestBodyReference +> = core.serialization + .objectWithoutOptionalProperties({ + requestBodyType: core.serialization.lazy(async () => (await import("../../..")).TypeReference), + contentType: core.serialization.string().optional(), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).WithDocs)); + +export declare namespace HttpRequestBodyReference { + interface Raw extends serializers.WithDocs.Raw { + requestBodyType: serializers.TypeReference.Raw; + contentType?: string | null; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/HttpResponse.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/HttpResponse.ts new file mode 100644 index 00000000000..0840491a598 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/HttpResponse.ts @@ -0,0 +1,56 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const HttpResponse: core.serialization.Schema = + core.serialization + .union("type", { + json: core.serialization.object({ + value: core.serialization.lazy(async () => (await import("../../..")).JsonResponse), + }), + fileDownload: core.serialization.lazyObject(async () => (await import("../../..")).FileDownloadResponse), + text: core.serialization.lazyObject(async () => (await import("../../..")).TextResponse), + streaming: core.serialization.lazyObject(async () => (await import("../../..")).StreamingResponse), + }) + .transform({ + transform: (value) => { + switch (value.type) { + case "json": + return FernIr.HttpResponse.json(value.value); + case "fileDownload": + return FernIr.HttpResponse.fileDownload(value); + case "text": + return FernIr.HttpResponse.text(value); + case "streaming": + return FernIr.HttpResponse.streaming(value); + default: + return value as FernIr.HttpResponse; + } + }, + untransform: ({ _visit, ...value }) => value as any, + }); + +export declare namespace HttpResponse { + type Raw = HttpResponse.Json | HttpResponse.FileDownload | HttpResponse.Text | HttpResponse.Streaming; + + interface Json { + type: "json"; + value: serializers.JsonResponse.Raw; + } + + interface FileDownload extends serializers.FileDownloadResponse.Raw { + type: "fileDownload"; + } + + interface Text extends serializers.TextResponse.Raw { + type: "text"; + } + + interface Streaming extends serializers.StreamingResponse.Raw { + type: "streaming"; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/HttpService.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/HttpService.ts new file mode 100644 index 00000000000..e4b77a7f881 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/HttpService.ts @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const HttpService: core.serialization.ObjectSchema = + core.serialization.objectWithoutOptionalProperties({ + availability: core.serialization.lazyObject(async () => (await import("../../..")).Availability).optional(), + name: core.serialization.lazyObject(async () => (await import("../../..")).DeclaredServiceName), + displayName: core.serialization.string().optional(), + basePath: core.serialization.lazyObject(async () => (await import("../../..")).HttpPath), + endpoints: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).HttpEndpoint) + ), + headers: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).HttpHeader) + ), + pathParameters: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).PathParameter) + ), + }); + +export declare namespace HttpService { + interface Raw { + availability?: serializers.Availability.Raw | null; + name: serializers.DeclaredServiceName.Raw; + displayName?: string | null; + basePath: serializers.HttpPath.Raw; + endpoints: serializers.HttpEndpoint.Raw[]; + headers: serializers.HttpHeader.Raw[]; + pathParameters: serializers.PathParameter.Raw[]; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/InlinedRequestBody.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/InlinedRequestBody.ts new file mode 100644 index 00000000000..2ce777b5a1a --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/InlinedRequestBody.ts @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const InlinedRequestBody: core.serialization.ObjectSchema< + serializers.InlinedRequestBody.Raw, + FernIr.InlinedRequestBody +> = core.serialization.objectWithoutOptionalProperties({ + name: core.serialization.lazyObject(async () => (await import("../../..")).Name), + extends: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).DeclaredTypeName) + ), + properties: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).InlinedRequestBodyProperty) + ), + contentType: core.serialization.string().optional(), +}); + +export declare namespace InlinedRequestBody { + interface Raw { + name: serializers.Name.Raw; + extends: serializers.DeclaredTypeName.Raw[]; + properties: serializers.InlinedRequestBodyProperty.Raw[]; + contentType?: string | null; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/InlinedRequestBodyProperty.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/InlinedRequestBodyProperty.ts new file mode 100644 index 00000000000..4a75951a8e0 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/InlinedRequestBodyProperty.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const InlinedRequestBodyProperty: core.serialization.ObjectSchema< + serializers.InlinedRequestBodyProperty.Raw, + FernIr.InlinedRequestBodyProperty +> = core.serialization + .objectWithoutOptionalProperties({ + name: core.serialization.lazyObject(async () => (await import("../../..")).NameAndWireValue), + valueType: core.serialization.lazy(async () => (await import("../../..")).TypeReference), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).WithDocs)); + +export declare namespace InlinedRequestBodyProperty { + interface Raw extends serializers.WithDocs.Raw { + name: serializers.NameAndWireValue.Raw; + valueType: serializers.TypeReference.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/JsonResponse.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/JsonResponse.ts new file mode 100644 index 00000000000..d2a3b7b9993 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/JsonResponse.ts @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const JsonResponse: core.serialization.Schema = + core.serialization + .union("type", { + response: core.serialization.lazyObject(async () => (await import("../../..")).JsonResponseBody), + nestedPropertyAsResponse: core.serialization.lazyObject( + async () => (await import("../../..")).JsonResponseBodyWithProperty + ), + }) + .transform({ + transform: (value) => { + switch (value.type) { + case "response": + return FernIr.JsonResponse.response(value); + case "nestedPropertyAsResponse": + return FernIr.JsonResponse.nestedPropertyAsResponse(value); + default: + return value as FernIr.JsonResponse; + } + }, + untransform: ({ _visit, ...value }) => value as any, + }); + +export declare namespace JsonResponse { + type Raw = JsonResponse.Response | JsonResponse.NestedPropertyAsResponse; + + interface Response extends serializers.JsonResponseBody.Raw { + type: "response"; + } + + interface NestedPropertyAsResponse extends serializers.JsonResponseBodyWithProperty.Raw { + type: "nestedPropertyAsResponse"; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/JsonResponseBody.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/JsonResponseBody.ts new file mode 100644 index 00000000000..c965f7ac6ed --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/JsonResponseBody.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const JsonResponseBody: core.serialization.ObjectSchema< + serializers.JsonResponseBody.Raw, + FernIr.JsonResponseBody +> = core.serialization + .objectWithoutOptionalProperties({ + responseBodyType: core.serialization.lazy(async () => (await import("../../..")).TypeReference), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).WithDocs)); + +export declare namespace JsonResponseBody { + interface Raw extends serializers.WithDocs.Raw { + responseBodyType: serializers.TypeReference.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/JsonResponseBodyWithProperty.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/JsonResponseBodyWithProperty.ts new file mode 100644 index 00000000000..fc765eab192 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/JsonResponseBodyWithProperty.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const JsonResponseBodyWithProperty: core.serialization.ObjectSchema< + serializers.JsonResponseBodyWithProperty.Raw, + FernIr.JsonResponseBodyWithProperty +> = core.serialization + .objectWithoutOptionalProperties({ + responseBodyType: core.serialization.lazy(async () => (await import("../../..")).TypeReference), + responseProperty: core.serialization + .lazyObject(async () => (await import("../../..")).ObjectProperty) + .optional(), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).WithDocs)); + +export declare namespace JsonResponseBodyWithProperty { + interface Raw extends serializers.WithDocs.Raw { + responseBodyType: serializers.TypeReference.Raw; + responseProperty?: serializers.ObjectProperty.Raw | null; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/PathParameter.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/PathParameter.ts new file mode 100644 index 00000000000..9a34bfc1673 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/PathParameter.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const PathParameter: core.serialization.ObjectSchema = + core.serialization + .objectWithoutOptionalProperties({ + name: core.serialization.lazyObject(async () => (await import("../../..")).Name), + valueType: core.serialization.lazy(async () => (await import("../../..")).TypeReference), + location: core.serialization.lazy(async () => (await import("../../..")).PathParameterLocation), + variable: core.serialization.lazy(async () => (await import("../../..")).VariableId).optional(), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).WithDocs)); + +export declare namespace PathParameter { + interface Raw extends serializers.WithDocs.Raw { + name: serializers.Name.Raw; + valueType: serializers.TypeReference.Raw; + location: serializers.PathParameterLocation.Raw; + variable?: serializers.VariableId.Raw | null; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/PathParameterLocation.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/PathParameterLocation.ts new file mode 100644 index 00000000000..2110980aace --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/PathParameterLocation.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const PathParameterLocation: core.serialization.Schema< + serializers.PathParameterLocation.Raw, + FernIr.PathParameterLocation +> = core.serialization.enum_(["ROOT", "SERVICE", "ENDPOINT"]); + +export declare namespace PathParameterLocation { + type Raw = "ROOT" | "SERVICE" | "ENDPOINT"; +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/QueryParameter.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/QueryParameter.ts new file mode 100644 index 00000000000..1dcaaa23512 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/QueryParameter.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const QueryParameter: core.serialization.ObjectSchema = + core.serialization + .objectWithoutOptionalProperties({ + name: core.serialization.lazyObject(async () => (await import("../../..")).NameAndWireValue), + valueType: core.serialization.lazy(async () => (await import("../../..")).TypeReference), + allowMultiple: core.serialization.boolean(), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).Declaration)); + +export declare namespace QueryParameter { + interface Raw extends serializers.Declaration.Raw { + name: serializers.NameAndWireValue.Raw; + valueType: serializers.TypeReference.Raw; + allowMultiple: boolean; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/ResponseError.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/ResponseError.ts new file mode 100644 index 00000000000..91a5a33fa1c --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/ResponseError.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ResponseError: core.serialization.ObjectSchema = + core.serialization + .objectWithoutOptionalProperties({ + error: core.serialization.lazyObject(async () => (await import("../../..")).DeclaredErrorName), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).WithDocs)); + +export declare namespace ResponseError { + interface Raw extends serializers.WithDocs.Raw { + error: serializers.DeclaredErrorName.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/ResponseErrors.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/ResponseErrors.ts new file mode 100644 index 00000000000..a95d13781a4 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/ResponseErrors.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ResponseErrors: core.serialization.Schema = + core.serialization.list(core.serialization.lazyObject(async () => (await import("../../..")).ResponseError)); + +export declare namespace ResponseErrors { + type Raw = serializers.ResponseError.Raw[]; +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/SdkRequest.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/SdkRequest.ts new file mode 100644 index 00000000000..7ea6171df27 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/SdkRequest.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const SdkRequest: core.serialization.ObjectSchema = + core.serialization.objectWithoutOptionalProperties({ + requestParameterName: core.serialization.lazyObject(async () => (await import("../../..")).Name), + shape: core.serialization.lazy(async () => (await import("../../..")).SdkRequestShape), + }); + +export declare namespace SdkRequest { + interface Raw { + requestParameterName: serializers.Name.Raw; + shape: serializers.SdkRequestShape.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/SdkRequestBodyType.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/SdkRequestBodyType.ts new file mode 100644 index 00000000000..efd0478f5ab --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/SdkRequestBodyType.ts @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const SdkRequestBodyType: core.serialization.Schema< + serializers.SdkRequestBodyType.Raw, + FernIr.SdkRequestBodyType +> = core.serialization + .union("type", { + typeReference: core.serialization.lazyObject(async () => (await import("../../..")).HttpRequestBodyReference), + bytes: core.serialization.lazyObject(async () => (await import("../../..")).BytesRequest), + }) + .transform({ + transform: (value) => { + switch (value.type) { + case "typeReference": + return FernIr.SdkRequestBodyType.typeReference(value); + case "bytes": + return FernIr.SdkRequestBodyType.bytes(value); + default: + return value as FernIr.SdkRequestBodyType; + } + }, + untransform: ({ _visit, ...value }) => value as any, + }); + +export declare namespace SdkRequestBodyType { + type Raw = SdkRequestBodyType.TypeReference | SdkRequestBodyType.Bytes; + + interface TypeReference extends serializers.HttpRequestBodyReference.Raw { + type: "typeReference"; + } + + interface Bytes extends serializers.BytesRequest.Raw { + type: "bytes"; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/SdkRequestShape.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/SdkRequestShape.ts new file mode 100644 index 00000000000..5ca3c84078c --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/SdkRequestShape.ts @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const SdkRequestShape: core.serialization.Schema = + core.serialization + .union("type", { + justRequestBody: core.serialization.object({ + value: core.serialization.lazy(async () => (await import("../../..")).SdkRequestBodyType), + }), + wrapper: core.serialization.lazyObject(async () => (await import("../../..")).SdkRequestWrapper), + }) + .transform({ + transform: (value) => { + switch (value.type) { + case "justRequestBody": + return FernIr.SdkRequestShape.justRequestBody(value.value); + case "wrapper": + return FernIr.SdkRequestShape.wrapper(value); + default: + return value as FernIr.SdkRequestShape; + } + }, + untransform: ({ _visit, ...value }) => value as any, + }); + +export declare namespace SdkRequestShape { + type Raw = SdkRequestShape.JustRequestBody | SdkRequestShape.Wrapper; + + interface JustRequestBody { + type: "justRequestBody"; + value: serializers.SdkRequestBodyType.Raw; + } + + interface Wrapper extends serializers.SdkRequestWrapper.Raw { + type: "wrapper"; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/SdkRequestWrapper.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/SdkRequestWrapper.ts new file mode 100644 index 00000000000..046d8a842d2 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/SdkRequestWrapper.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const SdkRequestWrapper: core.serialization.ObjectSchema< + serializers.SdkRequestWrapper.Raw, + FernIr.SdkRequestWrapper +> = core.serialization.objectWithoutOptionalProperties({ + wrapperName: core.serialization.lazyObject(async () => (await import("../../..")).Name), + bodyKey: core.serialization.lazyObject(async () => (await import("../../..")).Name), +}); + +export declare namespace SdkRequestWrapper { + interface Raw { + wrapperName: serializers.Name.Raw; + bodyKey: serializers.Name.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/StreamingResponse.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/StreamingResponse.ts new file mode 100644 index 00000000000..fdde1def8f4 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/StreamingResponse.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const StreamingResponse: core.serialization.ObjectSchema< + serializers.StreamingResponse.Raw, + FernIr.StreamingResponse +> = core.serialization + .objectWithoutOptionalProperties({ + dataEventType: core.serialization.lazy(async () => (await import("../../..")).StreamingResponseChunkType), + terminator: core.serialization.string().optional(), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).WithDocs)); + +export declare namespace StreamingResponse { + interface Raw extends serializers.WithDocs.Raw { + dataEventType: serializers.StreamingResponseChunkType.Raw; + terminator?: string | null; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/StreamingResponseChunkType.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/StreamingResponseChunkType.ts new file mode 100644 index 00000000000..d5b69d19df2 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/StreamingResponseChunkType.ts @@ -0,0 +1,44 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const StreamingResponseChunkType: core.serialization.Schema< + serializers.StreamingResponseChunkType.Raw, + FernIr.StreamingResponseChunkType +> = core.serialization + .union("type", { + json: core.serialization.object({ + json: core.serialization.lazy(async () => (await import("../../..")).TypeReference), + }), + text: core.serialization.object({}), + }) + .transform({ + transform: (value) => { + switch (value.type) { + case "json": + return FernIr.StreamingResponseChunkType.json(value.json); + case "text": + return FernIr.StreamingResponseChunkType.text(); + default: + return value as FernIr.StreamingResponseChunkType; + } + }, + untransform: ({ _visit, ...value }) => value as any, + }); + +export declare namespace StreamingResponseChunkType { + type Raw = StreamingResponseChunkType.Json | StreamingResponseChunkType.Text; + + interface Json { + type: "json"; + json: serializers.TypeReference.Raw; + } + + interface Text { + type: "text"; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/TextResponse.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/TextResponse.ts new file mode 100644 index 00000000000..827a582f7c8 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/TextResponse.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const TextResponse: core.serialization.ObjectSchema = + core.serialization + .objectWithoutOptionalProperties({}) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).WithDocs)); + +export declare namespace TextResponse { + interface Raw extends serializers.WithDocs.Raw {} +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/http/types/index.ts b/packages/ir-sdk/src/sdk/serialization/resources/http/types/index.ts new file mode 100644 index 00000000000..ab6bfac2a2a --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/index.ts @@ -0,0 +1,44 @@ +export * from "./HttpService"; +export * from "./DeclaredServiceName"; +export * from "./HttpEndpoint"; +export * from "./EndpointName"; +export * from "./HttpPath"; +export * from "./HttpPathPart"; +export * from "./HttpMethod"; +export * from "./HttpHeader"; +export * from "./PathParameter"; +export * from "./PathParameterLocation"; +export * from "./QueryParameter"; +export * from "./HttpRequestBody"; +export * from "./InlinedRequestBody"; +export * from "./InlinedRequestBodyProperty"; +export * from "./FileUploadRequest"; +export * from "./BytesRequest"; +export * from "./FileUploadRequestProperty"; +export * from "./FileProperty"; +export * from "./HttpRequestBodyReference"; +export * from "./SdkRequestBodyType"; +export * from "./SdkRequest"; +export * from "./SdkRequestShape"; +export * from "./SdkRequestWrapper"; +export * from "./HttpResponse"; +export * from "./JsonResponse"; +export * from "./JsonResponseBody"; +export * from "./JsonResponseBodyWithProperty"; +export * from "./FileDownloadResponse"; +export * from "./TextResponse"; +export * from "./StreamingResponse"; +export * from "./StreamingResponseChunkType"; +export * from "./ResponseErrors"; +export * from "./ResponseError"; +export * from "./ExampleEndpointCall"; +export * from "./ExampleCodeSample"; +export * from "./ExamplePathParameter"; +export * from "./ExampleQueryParameter"; +export * from "./ExampleHeader"; +export * from "./ExampleRequestBody"; +export * from "./ExampleInlinedRequestBody"; +export * from "./ExampleInlinedRequestBodyProperty"; +export * from "./ExampleResponse"; +export * from "./ExampleEndpointSuccessResponse"; +export * from "./ExampleEndpointErrorResponse"; diff --git a/packages/ir-sdk/src/sdk/serialization/resources/index.ts b/packages/ir-sdk/src/sdk/serialization/resources/index.ts new file mode 100644 index 00000000000..0dd12b05bcd --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/index.ts @@ -0,0 +1,20 @@ +export * as auth from "./auth"; +export * from "./auth/types"; +export * as commons from "./commons"; +export * from "./commons/types"; +export * as constants from "./constants"; +export * from "./constants/types"; +export * as environment from "./environment"; +export * from "./environment/types"; +export * as errors from "./errors"; +export * from "./errors/types"; +export * as http from "./http"; +export * from "./http/types"; +export * as ir from "./ir"; +export * from "./ir/types"; +export * as types from "./types"; +export * from "./types/types"; +export * as variables from "./variables"; +export * from "./variables/types"; +export * as webhooks from "./webhooks"; +export * from "./webhooks/types"; diff --git a/packages/ir-sdk/src/sdk/serialization/resources/ir/index.ts b/packages/ir-sdk/src/sdk/serialization/resources/ir/index.ts new file mode 100644 index 00000000000..eea524d6557 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/ir/index.ts @@ -0,0 +1 @@ +export * from "./types"; diff --git a/packages/ir-sdk/src/sdk/serialization/resources/ir/types/ErrorDiscriminationByPropertyStrategy.ts b/packages/ir-sdk/src/sdk/serialization/resources/ir/types/ErrorDiscriminationByPropertyStrategy.ts new file mode 100644 index 00000000000..710a95e67de --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/ir/types/ErrorDiscriminationByPropertyStrategy.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ErrorDiscriminationByPropertyStrategy: core.serialization.ObjectSchema< + serializers.ErrorDiscriminationByPropertyStrategy.Raw, + FernIr.ErrorDiscriminationByPropertyStrategy +> = core.serialization.objectWithoutOptionalProperties({ + discriminant: core.serialization.lazyObject(async () => (await import("../../..")).NameAndWireValue), + contentProperty: core.serialization.lazyObject(async () => (await import("../../..")).NameAndWireValue), +}); + +export declare namespace ErrorDiscriminationByPropertyStrategy { + interface Raw { + discriminant: serializers.NameAndWireValue.Raw; + contentProperty: serializers.NameAndWireValue.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/ir/types/ErrorDiscriminationStrategy.ts b/packages/ir-sdk/src/sdk/serialization/resources/ir/types/ErrorDiscriminationStrategy.ts new file mode 100644 index 00000000000..a668c0bd0ef --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/ir/types/ErrorDiscriminationStrategy.ts @@ -0,0 +1,43 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ErrorDiscriminationStrategy: core.serialization.Schema< + serializers.ErrorDiscriminationStrategy.Raw, + FernIr.ErrorDiscriminationStrategy +> = core.serialization + .union("type", { + statusCode: core.serialization.object({}), + property: core.serialization.lazyObject( + async () => (await import("../../..")).ErrorDiscriminationByPropertyStrategy + ), + }) + .transform({ + transform: (value) => { + switch (value.type) { + case "statusCode": + return FernIr.ErrorDiscriminationStrategy.statusCode(); + case "property": + return FernIr.ErrorDiscriminationStrategy.property(value); + default: + return value as FernIr.ErrorDiscriminationStrategy; + } + }, + untransform: ({ _visit, ...value }) => value as any, + }); + +export declare namespace ErrorDiscriminationStrategy { + type Raw = ErrorDiscriminationStrategy.StatusCode | ErrorDiscriminationStrategy.Property; + + interface StatusCode { + type: "statusCode"; + } + + interface Property extends serializers.ErrorDiscriminationByPropertyStrategy.Raw { + type: "property"; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/ir/types/IntermediateRepresentation.ts b/packages/ir-sdk/src/sdk/serialization/resources/ir/types/IntermediateRepresentation.ts new file mode 100644 index 00000000000..7c5ab95fdc0 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/ir/types/IntermediateRepresentation.ts @@ -0,0 +1,83 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const IntermediateRepresentation: core.serialization.ObjectSchema< + serializers.IntermediateRepresentation.Raw, + FernIr.IntermediateRepresentation +> = core.serialization.objectWithoutOptionalProperties({ + apiName: core.serialization.lazyObject(async () => (await import("../../..")).Name), + apiDisplayName: core.serialization.string().optional(), + apiDocs: core.serialization.string().optional(), + auth: core.serialization.lazyObject(async () => (await import("../../..")).ApiAuth), + headers: core.serialization.list(core.serialization.lazyObject(async () => (await import("../../..")).HttpHeader)), + idempotencyHeaders: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).HttpHeader) + ), + types: core.serialization.record( + core.serialization.lazy(async () => (await import("../../..")).TypeId), + core.serialization.lazyObject(async () => (await import("../../..")).TypeDeclaration) + ), + services: core.serialization.record( + core.serialization.lazy(async () => (await import("../../..")).ServiceId), + core.serialization.lazyObject(async () => (await import("../../..")).HttpService) + ), + webhookGroups: core.serialization.record( + core.serialization.lazy(async () => (await import("../../..")).WebhookGroupId), + core.serialization.lazy(async () => (await import("../../..")).WebhookGroup) + ), + errors: core.serialization.record( + core.serialization.lazy(async () => (await import("../../..")).ErrorId), + core.serialization.lazyObject(async () => (await import("../../..")).ErrorDeclaration) + ), + subpackages: core.serialization.record( + core.serialization.lazy(async () => (await import("../../..")).SubpackageId), + core.serialization.lazyObject(async () => (await import("../../..")).Subpackage) + ), + rootPackage: core.serialization.lazyObject(async () => (await import("../../..")).Package), + constants: core.serialization.lazyObject(async () => (await import("../../..")).Constants), + environments: core.serialization.lazyObject(async () => (await import("../../..")).EnvironmentsConfig).optional(), + basePath: core.serialization.lazyObject(async () => (await import("../../..")).HttpPath).optional(), + pathParameters: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).PathParameter) + ), + errorDiscriminationStrategy: core.serialization.lazy( + async () => (await import("../../..")).ErrorDiscriminationStrategy + ), + sdkConfig: core.serialization.lazyObject(async () => (await import("../../..")).SdkConfig), + variables: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).VariableDeclaration) + ), + serviceTypeReferenceInfo: core.serialization.lazyObject( + async () => (await import("../../..")).ServiceTypeReferenceInfo + ), +}); + +export declare namespace IntermediateRepresentation { + interface Raw { + apiName: serializers.Name.Raw; + apiDisplayName?: string | null; + apiDocs?: string | null; + auth: serializers.ApiAuth.Raw; + headers: serializers.HttpHeader.Raw[]; + idempotencyHeaders: serializers.HttpHeader.Raw[]; + types: Record; + services: Record; + webhookGroups: Record; + errors: Record; + subpackages: Record; + rootPackage: serializers.Package.Raw; + constants: serializers.Constants.Raw; + environments?: serializers.EnvironmentsConfig.Raw | null; + basePath?: serializers.HttpPath.Raw | null; + pathParameters: serializers.PathParameter.Raw[]; + errorDiscriminationStrategy: serializers.ErrorDiscriminationStrategy.Raw; + sdkConfig: serializers.SdkConfig.Raw; + variables: serializers.VariableDeclaration.Raw[]; + serviceTypeReferenceInfo: serializers.ServiceTypeReferenceInfo.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/ir/types/Package.ts b/packages/ir-sdk/src/sdk/serialization/resources/ir/types/Package.ts new file mode 100644 index 00000000000..535ea6f680b --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/ir/types/Package.ts @@ -0,0 +1,37 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const Package: core.serialization.ObjectSchema = core.serialization + .objectWithoutOptionalProperties({ + fernFilepath: core.serialization.lazyObject(async () => (await import("../../..")).FernFilepath), + service: core.serialization.lazy(async () => (await import("../../..")).ServiceId).optional(), + types: core.serialization.list(core.serialization.lazy(async () => (await import("../../..")).TypeId)), + errors: core.serialization.list(core.serialization.lazy(async () => (await import("../../..")).ErrorId)), + webhooks: core.serialization.lazy(async () => (await import("../../..")).WebhookGroupId).optional(), + subpackages: core.serialization.list( + core.serialization.lazy(async () => (await import("../../..")).SubpackageId) + ), + hasEndpointsInTree: core.serialization.boolean(), + navigationConfig: core.serialization + .lazyObject(async () => (await import("../../..")).PackageNavigationConfig) + .optional(), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).WithDocs)); + +export declare namespace Package { + interface Raw extends serializers.WithDocs.Raw { + fernFilepath: serializers.FernFilepath.Raw; + service?: serializers.ServiceId.Raw | null; + types: serializers.TypeId.Raw[]; + errors: serializers.ErrorId.Raw[]; + webhooks?: serializers.WebhookGroupId.Raw | null; + subpackages: serializers.SubpackageId.Raw[]; + hasEndpointsInTree: boolean; + navigationConfig?: serializers.PackageNavigationConfig.Raw | null; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/ir/types/PackageNavigationConfig.ts b/packages/ir-sdk/src/sdk/serialization/resources/ir/types/PackageNavigationConfig.ts new file mode 100644 index 00000000000..421ca9fde76 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/ir/types/PackageNavigationConfig.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const PackageNavigationConfig: core.serialization.ObjectSchema< + serializers.PackageNavigationConfig.Raw, + FernIr.PackageNavigationConfig +> = core.serialization.objectWithoutOptionalProperties({ + pointsTo: core.serialization.lazy(async () => (await import("../../..")).SubpackageId), +}); + +export declare namespace PackageNavigationConfig { + interface Raw { + pointsTo: serializers.SubpackageId.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/ir/types/PlatformHeaders.ts b/packages/ir-sdk/src/sdk/serialization/resources/ir/types/PlatformHeaders.ts new file mode 100644 index 00000000000..e32a5b3f1d4 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/ir/types/PlatformHeaders.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const PlatformHeaders: core.serialization.ObjectSchema = + core.serialization.objectWithoutOptionalProperties({ + language: core.serialization.string(), + sdkName: core.serialization.string(), + sdkVersion: core.serialization.string(), + }); + +export declare namespace PlatformHeaders { + interface Raw { + language: string; + sdkName: string; + sdkVersion: string; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/ir/types/SdkConfig.ts b/packages/ir-sdk/src/sdk/serialization/resources/ir/types/SdkConfig.ts new file mode 100644 index 00000000000..eb6b4a36b5d --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/ir/types/SdkConfig.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const SdkConfig: core.serialization.ObjectSchema = + core.serialization.objectWithoutOptionalProperties({ + isAuthMandatory: core.serialization.boolean(), + hasStreamingEndpoints: core.serialization.boolean(), + hasFileDownloadEndpoints: core.serialization.boolean(), + platformHeaders: core.serialization.lazyObject(async () => (await import("../../..")).PlatformHeaders), + }); + +export declare namespace SdkConfig { + interface Raw { + isAuthMandatory: boolean; + hasStreamingEndpoints: boolean; + hasFileDownloadEndpoints: boolean; + platformHeaders: serializers.PlatformHeaders.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/ir/types/ServiceTypeReferenceInfo.ts b/packages/ir-sdk/src/sdk/serialization/resources/ir/types/ServiceTypeReferenceInfo.ts new file mode 100644 index 00000000000..d1605c04cc8 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/ir/types/ServiceTypeReferenceInfo.ts @@ -0,0 +1,25 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ServiceTypeReferenceInfo: core.serialization.ObjectSchema< + serializers.ServiceTypeReferenceInfo.Raw, + FernIr.ServiceTypeReferenceInfo +> = core.serialization.objectWithoutOptionalProperties({ + typesReferencedOnlyByService: core.serialization.record( + core.serialization.lazy(async () => (await import("../../..")).ServiceId), + core.serialization.list(core.serialization.lazy(async () => (await import("../../..")).TypeId)) + ), + sharedTypes: core.serialization.list(core.serialization.lazy(async () => (await import("../../..")).TypeId)), +}); + +export declare namespace ServiceTypeReferenceInfo { + interface Raw { + typesReferencedOnlyByService: Record; + sharedTypes: serializers.TypeId.Raw[]; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/ir/types/Subpackage.ts b/packages/ir-sdk/src/sdk/serialization/resources/ir/types/Subpackage.ts new file mode 100644 index 00000000000..4e3d1564b0c --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/ir/types/Subpackage.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const Subpackage: core.serialization.ObjectSchema = + core.serialization + .objectWithoutOptionalProperties({ + name: core.serialization.lazyObject(async () => (await import("../../..")).Name), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).Package)); + +export declare namespace Subpackage { + interface Raw extends serializers.Package.Raw { + name: serializers.Name.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/ir/types/index.ts b/packages/ir-sdk/src/sdk/serialization/resources/ir/types/index.ts new file mode 100644 index 00000000000..5a21b5d1b96 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/ir/types/index.ts @@ -0,0 +1,9 @@ +export * from "./IntermediateRepresentation"; +export * from "./SdkConfig"; +export * from "./PlatformHeaders"; +export * from "./ErrorDiscriminationStrategy"; +export * from "./ErrorDiscriminationByPropertyStrategy"; +export * from "./Package"; +export * from "./Subpackage"; +export * from "./PackageNavigationConfig"; +export * from "./ServiceTypeReferenceInfo"; diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/index.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/index.ts new file mode 100644 index 00000000000..eea524d6557 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/index.ts @@ -0,0 +1 @@ +export * from "./types"; diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/AliasTypeDeclaration.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/AliasTypeDeclaration.ts new file mode 100644 index 00000000000..2d8f8a6eef8 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/AliasTypeDeclaration.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const AliasTypeDeclaration: core.serialization.ObjectSchema< + serializers.AliasTypeDeclaration.Raw, + FernIr.AliasTypeDeclaration +> = core.serialization.objectWithoutOptionalProperties({ + aliasOf: core.serialization.lazy(async () => (await import("../../..")).TypeReference), + resolvedType: core.serialization.lazy(async () => (await import("../../..")).ResolvedTypeReference), +}); + +export declare namespace AliasTypeDeclaration { + interface Raw { + aliasOf: serializers.TypeReference.Raw; + resolvedType: serializers.ResolvedTypeReference.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/ContainerType.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ContainerType.ts new file mode 100644 index 00000000000..95ec9796b08 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ContainerType.ts @@ -0,0 +1,77 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ContainerType: core.serialization.Schema = + core.serialization + .union(core.serialization.discriminant("type", "_type"), { + list: core.serialization.object({ + list: core.serialization.lazy(async () => (await import("../../..")).TypeReference), + }), + map: core.serialization.lazyObject(async () => (await import("../../..")).MapType), + optional: core.serialization.object({ + optional: core.serialization.lazy(async () => (await import("../../..")).TypeReference), + }), + set: core.serialization.object({ + set: core.serialization.lazy(async () => (await import("../../..")).TypeReference), + }), + literal: core.serialization.object({ + literal: core.serialization.lazy(async () => (await import("../../..")).Literal), + }), + }) + .transform({ + transform: (value) => { + switch (value.type) { + case "list": + return FernIr.ContainerType.list(value.list); + case "map": + return FernIr.ContainerType.map(value); + case "optional": + return FernIr.ContainerType.optional(value.optional); + case "set": + return FernIr.ContainerType.set(value.set); + case "literal": + return FernIr.ContainerType.literal(value.literal); + default: + return value as FernIr.ContainerType; + } + }, + untransform: ({ _visit, ...value }) => value as any, + }); + +export declare namespace ContainerType { + type Raw = + | ContainerType.List + | ContainerType.Map + | ContainerType.Optional + | ContainerType.Set + | ContainerType.Literal; + + interface List { + _type: "list"; + list: serializers.TypeReference.Raw; + } + + interface Map extends serializers.MapType.Raw { + _type: "map"; + } + + interface Optional { + _type: "optional"; + optional: serializers.TypeReference.Raw; + } + + interface Set { + _type: "set"; + set: serializers.TypeReference.Raw; + } + + interface Literal { + _type: "literal"; + literal: serializers.Literal.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/DeclaredTypeName.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/DeclaredTypeName.ts new file mode 100644 index 00000000000..d530650a90c --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/DeclaredTypeName.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const DeclaredTypeName: core.serialization.ObjectSchema< + serializers.DeclaredTypeName.Raw, + FernIr.DeclaredTypeName +> = core.serialization.objectWithoutOptionalProperties({ + typeId: core.serialization.lazy(async () => (await import("../../..")).TypeId), + fernFilepath: core.serialization.lazyObject(async () => (await import("../../..")).FernFilepath), + name: core.serialization.lazyObject(async () => (await import("../../..")).Name), +}); + +export declare namespace DeclaredTypeName { + interface Raw { + typeId: serializers.TypeId.Raw; + fernFilepath: serializers.FernFilepath.Raw; + name: serializers.Name.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/EnumTypeDeclaration.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/EnumTypeDeclaration.ts new file mode 100644 index 00000000000..3d20df81c18 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/EnumTypeDeclaration.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const EnumTypeDeclaration: core.serialization.ObjectSchema< + serializers.EnumTypeDeclaration.Raw, + FernIr.EnumTypeDeclaration +> = core.serialization.objectWithoutOptionalProperties({ + values: core.serialization.list(core.serialization.lazyObject(async () => (await import("../../..")).EnumValue)), +}); + +export declare namespace EnumTypeDeclaration { + interface Raw { + values: serializers.EnumValue.Raw[]; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/EnumValue.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/EnumValue.ts new file mode 100644 index 00000000000..3e4365db146 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/EnumValue.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const EnumValue: core.serialization.ObjectSchema = + core.serialization + .objectWithoutOptionalProperties({ + name: core.serialization.lazyObject(async () => (await import("../../..")).NameAndWireValue), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).Declaration)); + +export declare namespace EnumValue { + interface Raw extends serializers.Declaration.Raw { + name: serializers.NameAndWireValue.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleAliasType.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleAliasType.ts new file mode 100644 index 00000000000..fbb57fc2ca9 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleAliasType.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ExampleAliasType: core.serialization.ObjectSchema< + serializers.ExampleAliasType.Raw, + FernIr.ExampleAliasType +> = core.serialization.objectWithoutOptionalProperties({ + value: core.serialization.lazyObject(async () => (await import("../../..")).ExampleTypeReference), +}); + +export declare namespace ExampleAliasType { + interface Raw { + value: serializers.ExampleTypeReference.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleContainer.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleContainer.ts new file mode 100644 index 00000000000..097f50abb13 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleContainer.ts @@ -0,0 +1,73 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ExampleContainer: core.serialization.Schema = + core.serialization + .union("type", { + list: core.serialization.object({ + list: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).ExampleTypeReference) + ), + }), + set: core.serialization.object({ + set: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).ExampleTypeReference) + ), + }), + optional: core.serialization.object({ + optional: core.serialization + .lazyObject(async () => (await import("../../..")).ExampleTypeReference) + .optional(), + }), + map: core.serialization.object({ + map: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).ExampleKeyValuePair) + ), + }), + }) + .transform({ + transform: (value) => { + switch (value.type) { + case "list": + return FernIr.ExampleContainer.list(value.list); + case "set": + return FernIr.ExampleContainer.set(value.set); + case "optional": + return FernIr.ExampleContainer.optional(value.optional); + case "map": + return FernIr.ExampleContainer.map(value.map); + default: + return value as FernIr.ExampleContainer; + } + }, + untransform: ({ _visit, ...value }) => value as any, + }); + +export declare namespace ExampleContainer { + type Raw = ExampleContainer.List | ExampleContainer.Set | ExampleContainer.Optional | ExampleContainer.Map; + + interface List { + type: "list"; + list: serializers.ExampleTypeReference.Raw[]; + } + + interface Set { + type: "set"; + set: serializers.ExampleTypeReference.Raw[]; + } + + interface Optional { + type: "optional"; + optional?: serializers.ExampleTypeReference.Raw | null; + } + + interface Map { + type: "map"; + map: serializers.ExampleKeyValuePair.Raw[]; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleEnumType.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleEnumType.ts new file mode 100644 index 00000000000..bc9d9613ee4 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleEnumType.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ExampleEnumType: core.serialization.ObjectSchema = + core.serialization.objectWithoutOptionalProperties({ + value: core.serialization.lazyObject(async () => (await import("../../..")).NameAndWireValue), + }); + +export declare namespace ExampleEnumType { + interface Raw { + value: serializers.NameAndWireValue.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleKeyValuePair.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleKeyValuePair.ts new file mode 100644 index 00000000000..49f8c89d408 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleKeyValuePair.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ExampleKeyValuePair: core.serialization.ObjectSchema< + serializers.ExampleKeyValuePair.Raw, + FernIr.ExampleKeyValuePair +> = core.serialization.objectWithoutOptionalProperties({ + key: core.serialization.lazyObject(async () => (await import("../../..")).ExampleTypeReference), + value: core.serialization.lazyObject(async () => (await import("../../..")).ExampleTypeReference), +}); + +export declare namespace ExampleKeyValuePair { + interface Raw { + key: serializers.ExampleTypeReference.Raw; + value: serializers.ExampleTypeReference.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleNamedType.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleNamedType.ts new file mode 100644 index 00000000000..8bb86c99d25 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleNamedType.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ExampleNamedType: core.serialization.ObjectSchema< + serializers.ExampleNamedType.Raw, + FernIr.ExampleNamedType +> = core.serialization.objectWithoutOptionalProperties({ + typeName: core.serialization.lazyObject(async () => (await import("../../..")).DeclaredTypeName), + shape: core.serialization.lazy(async () => (await import("../../..")).ExampleTypeShape), +}); + +export declare namespace ExampleNamedType { + interface Raw { + typeName: serializers.DeclaredTypeName.Raw; + shape: serializers.ExampleTypeShape.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleObjectProperty.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleObjectProperty.ts new file mode 100644 index 00000000000..0abe3fef4d5 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleObjectProperty.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ExampleObjectProperty: core.serialization.ObjectSchema< + serializers.ExampleObjectProperty.Raw, + FernIr.ExampleObjectProperty +> = core.serialization.objectWithoutOptionalProperties({ + name: core.serialization.lazyObject(async () => (await import("../../..")).NameAndWireValue), + value: core.serialization.lazyObject(async () => (await import("../../..")).ExampleTypeReference), + originalTypeDeclaration: core.serialization.lazyObject(async () => (await import("../../..")).DeclaredTypeName), +}); + +export declare namespace ExampleObjectProperty { + interface Raw { + name: serializers.NameAndWireValue.Raw; + value: serializers.ExampleTypeReference.Raw; + originalTypeDeclaration: serializers.DeclaredTypeName.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleObjectType.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleObjectType.ts new file mode 100644 index 00000000000..de4605e906a --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleObjectType.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ExampleObjectType: core.serialization.ObjectSchema< + serializers.ExampleObjectType.Raw, + FernIr.ExampleObjectType +> = core.serialization.objectWithoutOptionalProperties({ + properties: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).ExampleObjectProperty) + ), +}); + +export declare namespace ExampleObjectType { + interface Raw { + properties: serializers.ExampleObjectProperty.Raw[]; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleObjectTypeWithTypeId.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleObjectTypeWithTypeId.ts new file mode 100644 index 00000000000..d03218f08ef --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleObjectTypeWithTypeId.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ExampleObjectTypeWithTypeId: core.serialization.ObjectSchema< + serializers.ExampleObjectTypeWithTypeId.Raw, + FernIr.ExampleObjectTypeWithTypeId +> = core.serialization.objectWithoutOptionalProperties({ + typeId: core.serialization.lazy(async () => (await import("../../..")).TypeId), + object: core.serialization.lazyObject(async () => (await import("../../..")).ExampleObjectType), +}); + +export declare namespace ExampleObjectTypeWithTypeId { + interface Raw { + typeId: serializers.TypeId.Raw; + object: serializers.ExampleObjectType.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExamplePrimitive.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExamplePrimitive.ts new file mode 100644 index 00000000000..37f97afc2b1 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExamplePrimitive.ts @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ExamplePrimitive: core.serialization.Schema = + core.serialization + .union("type", { + integer: core.serialization.object({ + integer: core.serialization.number(), + }), + double: core.serialization.object({ + double: core.serialization.number(), + }), + string: core.serialization.object({ + string: core.serialization.lazyObject(async () => (await import("../../..")).EscapedString), + }), + boolean: core.serialization.object({ + boolean: core.serialization.boolean(), + }), + long: core.serialization.object({ + long: core.serialization.number(), + }), + datetime: core.serialization.object({ + datetime: core.serialization.date(), + }), + date: core.serialization.object({ + date: core.serialization.string(), + }), + uuid: core.serialization.object({ + uuid: core.serialization.string(), + }), + }) + .transform({ + transform: (value) => { + switch (value.type) { + case "integer": + return FernIr.ExamplePrimitive.integer(value.integer); + case "double": + return FernIr.ExamplePrimitive.double(value.double); + case "string": + return FernIr.ExamplePrimitive.string(value.string); + case "boolean": + return FernIr.ExamplePrimitive.boolean(value.boolean); + case "long": + return FernIr.ExamplePrimitive.long(value.long); + case "datetime": + return FernIr.ExamplePrimitive.datetime(value.datetime); + case "date": + return FernIr.ExamplePrimitive.date(value.date); + case "uuid": + return FernIr.ExamplePrimitive.uuid(value.uuid); + default: + return value as FernIr.ExamplePrimitive; + } + }, + untransform: ({ _visit, ...value }) => value as any, + }); + +export declare namespace ExamplePrimitive { + type Raw = + | ExamplePrimitive.Integer + | ExamplePrimitive.Double + | ExamplePrimitive.String + | ExamplePrimitive.Boolean + | ExamplePrimitive.Long + | ExamplePrimitive.Datetime + | ExamplePrimitive.Date + | ExamplePrimitive.Uuid; + + interface Integer { + type: "integer"; + integer: number; + } + + interface Double { + type: "double"; + double: number; + } + + interface String { + type: "string"; + string: serializers.EscapedString.Raw; + } + + interface Boolean { + type: "boolean"; + boolean: boolean; + } + + interface Long { + type: "long"; + long: number; + } + + interface Datetime { + type: "datetime"; + datetime: string; + } + + interface Date { + type: "date"; + date: string; + } + + interface Uuid { + type: "uuid"; + uuid: string; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleSingleUnionType.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleSingleUnionType.ts new file mode 100644 index 00000000000..e6fcb6a82ea --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleSingleUnionType.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ExampleSingleUnionType: core.serialization.ObjectSchema< + serializers.ExampleSingleUnionType.Raw, + FernIr.ExampleSingleUnionType +> = core.serialization.objectWithoutOptionalProperties({ + wireDiscriminantValue: core.serialization.lazyObject(async () => (await import("../../..")).NameAndWireValue), + shape: core.serialization.lazy(async () => (await import("../../..")).ExampleSingleUnionTypeProperties), +}); + +export declare namespace ExampleSingleUnionType { + interface Raw { + wireDiscriminantValue: serializers.NameAndWireValue.Raw; + shape: serializers.ExampleSingleUnionTypeProperties.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleSingleUnionTypeProperties.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleSingleUnionTypeProperties.ts new file mode 100644 index 00000000000..96d42c3823c --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleSingleUnionTypeProperties.ts @@ -0,0 +1,53 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ExampleSingleUnionTypeProperties: core.serialization.Schema< + serializers.ExampleSingleUnionTypeProperties.Raw, + FernIr.ExampleSingleUnionTypeProperties +> = core.serialization + .union("type", { + samePropertiesAsObject: core.serialization.lazyObject( + async () => (await import("../../..")).ExampleObjectTypeWithTypeId + ), + singleProperty: core.serialization.lazyObject(async () => (await import("../../..")).ExampleTypeReference), + noProperties: core.serialization.object({}), + }) + .transform({ + transform: (value) => { + switch (value.type) { + case "samePropertiesAsObject": + return FernIr.ExampleSingleUnionTypeProperties.samePropertiesAsObject(value); + case "singleProperty": + return FernIr.ExampleSingleUnionTypeProperties.singleProperty(value); + case "noProperties": + return FernIr.ExampleSingleUnionTypeProperties.noProperties(); + default: + return value as FernIr.ExampleSingleUnionTypeProperties; + } + }, + untransform: ({ _visit, ...value }) => value as any, + }); + +export declare namespace ExampleSingleUnionTypeProperties { + type Raw = + | ExampleSingleUnionTypeProperties.SamePropertiesAsObject + | ExampleSingleUnionTypeProperties.SingleProperty + | ExampleSingleUnionTypeProperties.NoProperties; + + interface SamePropertiesAsObject extends serializers.ExampleObjectTypeWithTypeId.Raw { + type: "samePropertiesAsObject"; + } + + interface SingleProperty extends serializers.ExampleTypeReference.Raw { + type: "singleProperty"; + } + + interface NoProperties { + type: "noProperties"; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleType.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleType.ts new file mode 100644 index 00000000000..4f3f980a2f2 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleType.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ExampleType: core.serialization.ObjectSchema = + core.serialization + .objectWithoutOptionalProperties({ + name: core.serialization.lazyObject(async () => (await import("../../..")).Name).optional(), + shape: core.serialization.lazy(async () => (await import("../../..")).ExampleTypeShape), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).WithJsonExample)) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).WithDocs)); + +export declare namespace ExampleType { + interface Raw extends serializers.WithJsonExample.Raw, serializers.WithDocs.Raw { + name?: serializers.Name.Raw | null; + shape: serializers.ExampleTypeShape.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleTypeReference.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleTypeReference.ts new file mode 100644 index 00000000000..d8aba2d9035 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleTypeReference.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ExampleTypeReference: core.serialization.ObjectSchema< + serializers.ExampleTypeReference.Raw, + FernIr.ExampleTypeReference +> = core.serialization + .objectWithoutOptionalProperties({ + shape: core.serialization.lazy(async () => (await import("../../..")).ExampleTypeReferenceShape), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).WithJsonExample)); + +export declare namespace ExampleTypeReference { + interface Raw extends serializers.WithJsonExample.Raw { + shape: serializers.ExampleTypeReferenceShape.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleTypeReferenceShape.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleTypeReferenceShape.ts new file mode 100644 index 00000000000..8416264baec --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleTypeReferenceShape.ts @@ -0,0 +1,68 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ExampleTypeReferenceShape: core.serialization.Schema< + serializers.ExampleTypeReferenceShape.Raw, + FernIr.ExampleTypeReferenceShape +> = core.serialization + .union("type", { + primitive: core.serialization.object({ + primitive: core.serialization.lazy(async () => (await import("../../..")).ExamplePrimitive), + }), + container: core.serialization.object({ + container: core.serialization.lazy(async () => (await import("../../..")).ExampleContainer), + }), + unknown: core.serialization.object({ + unknown: core.serialization.unknown(), + }), + named: core.serialization.lazyObject(async () => (await import("../../..")).ExampleNamedType), + }) + .transform({ + transform: (value) => { + switch (value.type) { + case "primitive": + return FernIr.ExampleTypeReferenceShape.primitive(value.primitive); + case "container": + return FernIr.ExampleTypeReferenceShape.container(value.container); + case "unknown": + return FernIr.ExampleTypeReferenceShape.unknown(value.unknown); + case "named": + return FernIr.ExampleTypeReferenceShape.named(value); + default: + return value as FernIr.ExampleTypeReferenceShape; + } + }, + untransform: ({ _visit, ...value }) => value as any, + }); + +export declare namespace ExampleTypeReferenceShape { + type Raw = + | ExampleTypeReferenceShape.Primitive + | ExampleTypeReferenceShape.Container + | ExampleTypeReferenceShape.Unknown + | ExampleTypeReferenceShape.Named; + + interface Primitive { + type: "primitive"; + primitive: serializers.ExamplePrimitive.Raw; + } + + interface Container { + type: "container"; + container: serializers.ExampleContainer.Raw; + } + + interface Unknown { + type: "unknown"; + unknown?: unknown; + } + + interface Named extends serializers.ExampleNamedType.Raw { + type: "named"; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleTypeShape.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleTypeShape.ts new file mode 100644 index 00000000000..686df50e857 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleTypeShape.ts @@ -0,0 +1,67 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ExampleTypeShape: core.serialization.Schema = + core.serialization + .union("type", { + alias: core.serialization.lazyObject(async () => (await import("../../..")).ExampleAliasType), + enum: core.serialization.lazyObject(async () => (await import("../../..")).ExampleEnumType), + object: core.serialization.lazyObject(async () => (await import("../../..")).ExampleObjectType), + union: core.serialization.lazyObject(async () => (await import("../../..")).ExampleUnionType), + undiscriminatedUnion: core.serialization.lazyObject( + async () => (await import("../../..")).ExampleUndiscriminatedUnionType + ), + }) + .transform({ + transform: (value) => { + switch (value.type) { + case "alias": + return FernIr.ExampleTypeShape.alias(value); + case "enum": + return FernIr.ExampleTypeShape.enum(value); + case "object": + return FernIr.ExampleTypeShape.object(value); + case "union": + return FernIr.ExampleTypeShape.union(value); + case "undiscriminatedUnion": + return FernIr.ExampleTypeShape.undiscriminatedUnion(value); + default: + return value as FernIr.ExampleTypeShape; + } + }, + untransform: ({ _visit, ...value }) => value as any, + }); + +export declare namespace ExampleTypeShape { + type Raw = + | ExampleTypeShape.Alias + | ExampleTypeShape.Enum + | ExampleTypeShape.Object + | ExampleTypeShape.Union + | ExampleTypeShape.UndiscriminatedUnion; + + interface Alias extends serializers.ExampleAliasType.Raw { + type: "alias"; + } + + interface Enum extends serializers.ExampleEnumType.Raw { + type: "enum"; + } + + interface Object extends serializers.ExampleObjectType.Raw { + type: "object"; + } + + interface Union extends serializers.ExampleUnionType.Raw { + type: "union"; + } + + interface UndiscriminatedUnion extends serializers.ExampleUndiscriminatedUnionType.Raw { + type: "undiscriminatedUnion"; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleUndiscriminatedUnionType.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleUndiscriminatedUnionType.ts new file mode 100644 index 00000000000..40f15c1de41 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleUndiscriminatedUnionType.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ExampleUndiscriminatedUnionType: core.serialization.ObjectSchema< + serializers.ExampleUndiscriminatedUnionType.Raw, + FernIr.ExampleUndiscriminatedUnionType +> = core.serialization.objectWithoutOptionalProperties({ + index: core.serialization.number(), + singleUnionType: core.serialization.lazyObject(async () => (await import("../../..")).ExampleTypeReference), +}); + +export declare namespace ExampleUndiscriminatedUnionType { + interface Raw { + index: number; + singleUnionType: serializers.ExampleTypeReference.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleUnionType.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleUnionType.ts new file mode 100644 index 00000000000..a27047220c4 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ExampleUnionType.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ExampleUnionType: core.serialization.ObjectSchema< + serializers.ExampleUnionType.Raw, + FernIr.ExampleUnionType +> = core.serialization.objectWithoutOptionalProperties({ + discriminant: core.serialization.lazyObject(async () => (await import("../../..")).NameAndWireValue), + singleUnionType: core.serialization.lazyObject(async () => (await import("../../..")).ExampleSingleUnionType), +}); + +export declare namespace ExampleUnionType { + interface Raw { + discriminant: serializers.NameAndWireValue.Raw; + singleUnionType: serializers.ExampleSingleUnionType.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/Literal.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/Literal.ts new file mode 100644 index 00000000000..e1b41d41dc9 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/Literal.ts @@ -0,0 +1,44 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const Literal: core.serialization.Schema = core.serialization + .union("type", { + string: core.serialization.object({ + string: core.serialization.string(), + }), + boolean: core.serialization.object({ + boolean: core.serialization.boolean(), + }), + }) + .transform({ + transform: (value) => { + switch (value.type) { + case "string": + return FernIr.Literal.string(value.string); + case "boolean": + return FernIr.Literal.boolean(value.boolean); + default: + return value as FernIr.Literal; + } + }, + untransform: ({ _visit, ...value }) => value as any, + }); + +export declare namespace Literal { + type Raw = Literal.String | Literal.Boolean; + + interface String { + type: "string"; + string: string; + } + + interface Boolean { + type: "boolean"; + boolean: boolean; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/MapType.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/MapType.ts new file mode 100644 index 00000000000..67fe1691e77 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/MapType.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const MapType: core.serialization.ObjectSchema = + core.serialization.objectWithoutOptionalProperties({ + keyType: core.serialization.lazy(async () => (await import("../../..")).TypeReference), + valueType: core.serialization.lazy(async () => (await import("../../..")).TypeReference), + }); + +export declare namespace MapType { + interface Raw { + keyType: serializers.TypeReference.Raw; + valueType: serializers.TypeReference.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/ObjectProperty.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ObjectProperty.ts new file mode 100644 index 00000000000..ec189e7ae52 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ObjectProperty.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ObjectProperty: core.serialization.ObjectSchema = + core.serialization + .objectWithoutOptionalProperties({ + name: core.serialization.lazyObject(async () => (await import("../../..")).NameAndWireValue), + valueType: core.serialization.lazy(async () => (await import("../../..")).TypeReference), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).Declaration)); + +export declare namespace ObjectProperty { + interface Raw extends serializers.Declaration.Raw { + name: serializers.NameAndWireValue.Raw; + valueType: serializers.TypeReference.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/ObjectTypeDeclaration.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ObjectTypeDeclaration.ts new file mode 100644 index 00000000000..5978bcd9783 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ObjectTypeDeclaration.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ObjectTypeDeclaration: core.serialization.ObjectSchema< + serializers.ObjectTypeDeclaration.Raw, + FernIr.ObjectTypeDeclaration +> = core.serialization.objectWithoutOptionalProperties({ + extends: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).DeclaredTypeName) + ), + properties: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).ObjectProperty) + ), +}); + +export declare namespace ObjectTypeDeclaration { + interface Raw { + extends: serializers.DeclaredTypeName.Raw[]; + properties: serializers.ObjectProperty.Raw[]; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/PrimitiveType.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/PrimitiveType.ts new file mode 100644 index 00000000000..26b95d2c604 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/PrimitiveType.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const PrimitiveType: core.serialization.Schema = + core.serialization.enum_([ + "INTEGER", + "DOUBLE", + "STRING", + "BOOLEAN", + "LONG", + "DATE_TIME", + "DATE", + "UUID", + "BASE_64", + ]); + +export declare namespace PrimitiveType { + type Raw = "INTEGER" | "DOUBLE" | "STRING" | "BOOLEAN" | "LONG" | "DATE_TIME" | "DATE" | "UUID" | "BASE_64"; +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/ResolvedNamedType.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ResolvedNamedType.ts new file mode 100644 index 00000000000..cfb4eb0e95f --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ResolvedNamedType.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ResolvedNamedType: core.serialization.ObjectSchema< + serializers.ResolvedNamedType.Raw, + FernIr.ResolvedNamedType +> = core.serialization.objectWithoutOptionalProperties({ + name: core.serialization.lazyObject(async () => (await import("../../..")).DeclaredTypeName), + shape: core.serialization.lazy(async () => (await import("../../..")).ShapeType), +}); + +export declare namespace ResolvedNamedType { + interface Raw { + name: serializers.DeclaredTypeName.Raw; + shape: serializers.ShapeType.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/ResolvedTypeReference.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ResolvedTypeReference.ts new file mode 100644 index 00000000000..a9736235733 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ResolvedTypeReference.ts @@ -0,0 +1,65 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ResolvedTypeReference: core.serialization.Schema< + serializers.ResolvedTypeReference.Raw, + FernIr.ResolvedTypeReference +> = core.serialization + .union(core.serialization.discriminant("type", "_type"), { + container: core.serialization.object({ + container: core.serialization.lazy(async () => (await import("../../..")).ContainerType), + }), + named: core.serialization.lazyObject(async () => (await import("../../..")).ResolvedNamedType), + primitive: core.serialization.object({ + primitive: core.serialization.lazy(async () => (await import("../../..")).PrimitiveType), + }), + unknown: core.serialization.object({}), + }) + .transform({ + transform: (value) => { + switch (value.type) { + case "container": + return FernIr.ResolvedTypeReference.container(value.container); + case "named": + return FernIr.ResolvedTypeReference.named(value); + case "primitive": + return FernIr.ResolvedTypeReference.primitive(value.primitive); + case "unknown": + return FernIr.ResolvedTypeReference.unknown(); + default: + return value as FernIr.ResolvedTypeReference; + } + }, + untransform: ({ _visit, ...value }) => value as any, + }); + +export declare namespace ResolvedTypeReference { + type Raw = + | ResolvedTypeReference.Container + | ResolvedTypeReference.Named + | ResolvedTypeReference.Primitive + | ResolvedTypeReference.Unknown; + + interface Container { + _type: "container"; + container: serializers.ContainerType.Raw; + } + + interface Named extends serializers.ResolvedNamedType.Raw { + _type: "named"; + } + + interface Primitive { + _type: "primitive"; + primitive: serializers.PrimitiveType.Raw; + } + + interface Unknown { + _type: "unknown"; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/ShapeType.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ShapeType.ts new file mode 100644 index 00000000000..06e7108859c --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/ShapeType.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const ShapeType: core.serialization.Schema = + core.serialization.enum_(["ENUM", "OBJECT", "UNION", "UNDISCRIMINATED_UNION"]); + +export declare namespace ShapeType { + type Raw = "ENUM" | "OBJECT" | "UNION" | "UNDISCRIMINATED_UNION"; +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/SingleUnionType.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/SingleUnionType.ts new file mode 100644 index 00000000000..38d16b05807 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/SingleUnionType.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const SingleUnionType: core.serialization.ObjectSchema = + core.serialization + .objectWithoutOptionalProperties({ + discriminantValue: core.serialization.lazyObject(async () => (await import("../../..")).NameAndWireValue), + shape: core.serialization.lazy(async () => (await import("../../..")).SingleUnionTypeProperties), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).WithDocs)); + +export declare namespace SingleUnionType { + interface Raw extends serializers.WithDocs.Raw { + discriminantValue: serializers.NameAndWireValue.Raw; + shape: serializers.SingleUnionTypeProperties.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/SingleUnionTypeProperties.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/SingleUnionTypeProperties.ts new file mode 100644 index 00000000000..3dccb30ea50 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/SingleUnionTypeProperties.ts @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const SingleUnionTypeProperties: core.serialization.Schema< + serializers.SingleUnionTypeProperties.Raw, + FernIr.SingleUnionTypeProperties +> = core.serialization + .union(core.serialization.discriminant("propertiesType", "_type"), { + samePropertiesAsObject: core.serialization.lazyObject(async () => (await import("../../..")).DeclaredTypeName), + singleProperty: core.serialization.lazyObject(async () => (await import("../../..")).SingleUnionTypeProperty), + noProperties: core.serialization.object({}), + }) + .transform({ + transform: (value) => { + switch (value.propertiesType) { + case "samePropertiesAsObject": + return FernIr.SingleUnionTypeProperties.samePropertiesAsObject(value); + case "singleProperty": + return FernIr.SingleUnionTypeProperties.singleProperty(value); + case "noProperties": + return FernIr.SingleUnionTypeProperties.noProperties(); + default: + return value as FernIr.SingleUnionTypeProperties; + } + }, + untransform: ({ _visit, ...value }) => value as any, + }); + +export declare namespace SingleUnionTypeProperties { + type Raw = + | SingleUnionTypeProperties.SamePropertiesAsObject + | SingleUnionTypeProperties.SingleProperty + | SingleUnionTypeProperties.NoProperties; + + interface SamePropertiesAsObject extends serializers.DeclaredTypeName.Raw { + _type: "samePropertiesAsObject"; + } + + interface SingleProperty extends serializers.SingleUnionTypeProperty.Raw { + _type: "singleProperty"; + } + + interface NoProperties { + _type: "noProperties"; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/SingleUnionTypeProperty.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/SingleUnionTypeProperty.ts new file mode 100644 index 00000000000..99414075493 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/SingleUnionTypeProperty.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const SingleUnionTypeProperty: core.serialization.ObjectSchema< + serializers.SingleUnionTypeProperty.Raw, + FernIr.SingleUnionTypeProperty +> = core.serialization.objectWithoutOptionalProperties({ + name: core.serialization.lazyObject(async () => (await import("../../..")).NameAndWireValue), + type: core.serialization.lazy(async () => (await import("../../..")).TypeReference), +}); + +export declare namespace SingleUnionTypeProperty { + interface Raw { + name: serializers.NameAndWireValue.Raw; + type: serializers.TypeReference.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/Type.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/Type.ts new file mode 100644 index 00000000000..915dc74fe0f --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/Type.ts @@ -0,0 +1,61 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const Type: core.serialization.Schema = core.serialization + .union(core.serialization.discriminant("type", "_type"), { + alias: core.serialization.lazyObject(async () => (await import("../../..")).AliasTypeDeclaration), + enum: core.serialization.lazyObject(async () => (await import("../../..")).EnumTypeDeclaration), + object: core.serialization.lazyObject(async () => (await import("../../..")).ObjectTypeDeclaration), + union: core.serialization.lazyObject(async () => (await import("../../..")).UnionTypeDeclaration), + undiscriminatedUnion: core.serialization.lazyObject( + async () => (await import("../../..")).UndiscriminatedUnionTypeDeclaration + ), + }) + .transform({ + transform: (value) => { + switch (value.type) { + case "alias": + return FernIr.Type.alias(value); + case "enum": + return FernIr.Type.enum(value); + case "object": + return FernIr.Type.object(value); + case "union": + return FernIr.Type.union(value); + case "undiscriminatedUnion": + return FernIr.Type.undiscriminatedUnion(value); + default: + return value as FernIr.Type; + } + }, + untransform: ({ _visit, ...value }) => value as any, + }); + +export declare namespace Type { + type Raw = Type.Alias | Type.Enum | Type.Object | Type.Union | Type.UndiscriminatedUnion; + + interface Alias extends serializers.AliasTypeDeclaration.Raw { + _type: "alias"; + } + + interface Enum extends serializers.EnumTypeDeclaration.Raw { + _type: "enum"; + } + + interface Object extends serializers.ObjectTypeDeclaration.Raw { + _type: "object"; + } + + interface Union extends serializers.UnionTypeDeclaration.Raw { + _type: "union"; + } + + interface UndiscriminatedUnion extends serializers.UndiscriminatedUnionTypeDeclaration.Raw { + _type: "undiscriminatedUnion"; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/TypeDeclaration.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/TypeDeclaration.ts new file mode 100644 index 00000000000..67728dd79b5 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/TypeDeclaration.ts @@ -0,0 +1,30 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const TypeDeclaration: core.serialization.ObjectSchema = + core.serialization + .objectWithoutOptionalProperties({ + name: core.serialization.lazyObject(async () => (await import("../../..")).DeclaredTypeName), + shape: core.serialization.lazy(async () => (await import("../../..")).Type), + examples: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).ExampleType) + ), + referencedTypes: core.serialization.set( + core.serialization.lazy(async () => (await import("../../..")).TypeId) + ), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).Declaration)); + +export declare namespace TypeDeclaration { + interface Raw extends serializers.Declaration.Raw { + name: serializers.DeclaredTypeName.Raw; + shape: serializers.Type.Raw; + examples: serializers.ExampleType.Raw[]; + referencedTypes: serializers.TypeId.Raw[]; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/TypeReference.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/TypeReference.ts new file mode 100644 index 00000000000..fb571743664 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/TypeReference.ts @@ -0,0 +1,59 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const TypeReference: core.serialization.Schema = + core.serialization + .union(core.serialization.discriminant("type", "_type"), { + container: core.serialization.object({ + container: core.serialization.lazy(async () => (await import("../../..")).ContainerType), + }), + named: core.serialization.lazyObject(async () => (await import("../../..")).DeclaredTypeName), + primitive: core.serialization.object({ + primitive: core.serialization.lazy(async () => (await import("../../..")).PrimitiveType), + }), + unknown: core.serialization.object({}), + }) + .transform({ + transform: (value) => { + switch (value.type) { + case "container": + return FernIr.TypeReference.container(value.container); + case "named": + return FernIr.TypeReference.named(value); + case "primitive": + return FernIr.TypeReference.primitive(value.primitive); + case "unknown": + return FernIr.TypeReference.unknown(); + default: + return value as FernIr.TypeReference; + } + }, + untransform: ({ _visit, ...value }) => value as any, + }); + +export declare namespace TypeReference { + type Raw = TypeReference.Container | TypeReference.Named | TypeReference.Primitive | TypeReference.Unknown; + + interface Container { + _type: "container"; + container: serializers.ContainerType.Raw; + } + + interface Named extends serializers.DeclaredTypeName.Raw { + _type: "named"; + } + + interface Primitive { + _type: "primitive"; + primitive: serializers.PrimitiveType.Raw; + } + + interface Unknown { + _type: "unknown"; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/UndiscriminatedUnionMember.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/UndiscriminatedUnionMember.ts new file mode 100644 index 00000000000..eae36df4996 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/UndiscriminatedUnionMember.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const UndiscriminatedUnionMember: core.serialization.ObjectSchema< + serializers.UndiscriminatedUnionMember.Raw, + FernIr.UndiscriminatedUnionMember +> = core.serialization + .objectWithoutOptionalProperties({ + type: core.serialization.lazy(async () => (await import("../../..")).TypeReference), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).WithDocs)); + +export declare namespace UndiscriminatedUnionMember { + interface Raw extends serializers.WithDocs.Raw { + type: serializers.TypeReference.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/UndiscriminatedUnionTypeDeclaration.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/UndiscriminatedUnionTypeDeclaration.ts new file mode 100644 index 00000000000..1d24c9db68a --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/UndiscriminatedUnionTypeDeclaration.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const UndiscriminatedUnionTypeDeclaration: core.serialization.ObjectSchema< + serializers.UndiscriminatedUnionTypeDeclaration.Raw, + FernIr.UndiscriminatedUnionTypeDeclaration +> = core.serialization.objectWithoutOptionalProperties({ + members: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).UndiscriminatedUnionMember) + ), +}); + +export declare namespace UndiscriminatedUnionTypeDeclaration { + interface Raw { + members: serializers.UndiscriminatedUnionMember.Raw[]; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/UnionTypeDeclaration.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/UnionTypeDeclaration.ts new file mode 100644 index 00000000000..286f1842e05 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/UnionTypeDeclaration.ts @@ -0,0 +1,32 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const UnionTypeDeclaration: core.serialization.ObjectSchema< + serializers.UnionTypeDeclaration.Raw, + FernIr.UnionTypeDeclaration +> = core.serialization.objectWithoutOptionalProperties({ + discriminant: core.serialization.lazyObject(async () => (await import("../../..")).NameAndWireValue), + extends: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).DeclaredTypeName) + ), + types: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).SingleUnionType) + ), + baseProperties: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).ObjectProperty) + ), +}); + +export declare namespace UnionTypeDeclaration { + interface Raw { + discriminant: serializers.NameAndWireValue.Raw; + extends: serializers.DeclaredTypeName.Raw[]; + types: serializers.SingleUnionType.Raw[]; + baseProperties: serializers.ObjectProperty.Raw[]; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/types/types/index.ts b/packages/ir-sdk/src/sdk/serialization/resources/types/types/index.ts new file mode 100644 index 00000000000..a5a7212d91d --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/types/types/index.ts @@ -0,0 +1,39 @@ +export * from "./TypeDeclaration"; +export * from "./DeclaredTypeName"; +export * from "./Type"; +export * from "./AliasTypeDeclaration"; +export * from "./ResolvedTypeReference"; +export * from "./ResolvedNamedType"; +export * from "./ShapeType"; +export * from "./EnumTypeDeclaration"; +export * from "./EnumValue"; +export * from "./ObjectTypeDeclaration"; +export * from "./ObjectProperty"; +export * from "./UnionTypeDeclaration"; +export * from "./SingleUnionType"; +export * from "./SingleUnionTypeProperties"; +export * from "./SingleUnionTypeProperty"; +export * from "./UndiscriminatedUnionTypeDeclaration"; +export * from "./UndiscriminatedUnionMember"; +export * from "./TypeReference"; +export * from "./ContainerType"; +export * from "./MapType"; +export * from "./PrimitiveType"; +export * from "./Literal"; +export * from "./ExampleType"; +export * from "./ExampleTypeShape"; +export * from "./ExampleAliasType"; +export * from "./ExampleEnumType"; +export * from "./ExampleObjectType"; +export * from "./ExampleObjectProperty"; +export * from "./ExampleUnionType"; +export * from "./ExampleUndiscriminatedUnionType"; +export * from "./ExampleSingleUnionType"; +export * from "./ExampleSingleUnionTypeProperties"; +export * from "./ExampleTypeReference"; +export * from "./ExampleTypeReferenceShape"; +export * from "./ExampleContainer"; +export * from "./ExampleKeyValuePair"; +export * from "./ExamplePrimitive"; +export * from "./ExampleNamedType"; +export * from "./ExampleObjectTypeWithTypeId"; diff --git a/packages/ir-sdk/src/sdk/serialization/resources/variables/index.ts b/packages/ir-sdk/src/sdk/serialization/resources/variables/index.ts new file mode 100644 index 00000000000..eea524d6557 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/variables/index.ts @@ -0,0 +1 @@ +export * from "./types"; diff --git a/packages/ir-sdk/src/sdk/serialization/resources/variables/types/VariableDeclaration.ts b/packages/ir-sdk/src/sdk/serialization/resources/variables/types/VariableDeclaration.ts new file mode 100644 index 00000000000..3cbab910884 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/variables/types/VariableDeclaration.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const VariableDeclaration: core.serialization.ObjectSchema< + serializers.VariableDeclaration.Raw, + FernIr.VariableDeclaration +> = core.serialization + .objectWithoutOptionalProperties({ + id: core.serialization.lazy(async () => (await import("../../..")).VariableId), + name: core.serialization.lazyObject(async () => (await import("../../..")).Name), + type: core.serialization.lazy(async () => (await import("../../..")).TypeReference), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).WithDocs)); + +export declare namespace VariableDeclaration { + interface Raw extends serializers.WithDocs.Raw { + id: serializers.VariableId.Raw; + name: serializers.Name.Raw; + type: serializers.TypeReference.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/variables/types/VariableId.ts b/packages/ir-sdk/src/sdk/serialization/resources/variables/types/VariableId.ts new file mode 100644 index 00000000000..49c18ecaeea --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/variables/types/VariableId.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const VariableId: core.serialization.Schema = + core.serialization.string(); + +export declare namespace VariableId { + type Raw = string; +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/variables/types/index.ts b/packages/ir-sdk/src/sdk/serialization/resources/variables/types/index.ts new file mode 100644 index 00000000000..e16556a7edc --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/variables/types/index.ts @@ -0,0 +1,2 @@ +export * from "./VariableId"; +export * from "./VariableDeclaration"; diff --git a/packages/ir-sdk/src/sdk/serialization/resources/webhooks/index.ts b/packages/ir-sdk/src/sdk/serialization/resources/webhooks/index.ts new file mode 100644 index 00000000000..eea524d6557 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/webhooks/index.ts @@ -0,0 +1 @@ +export * from "./types"; diff --git a/packages/ir-sdk/src/sdk/serialization/resources/webhooks/types/InlinedWebhookPayload.ts b/packages/ir-sdk/src/sdk/serialization/resources/webhooks/types/InlinedWebhookPayload.ts new file mode 100644 index 00000000000..9b2e9f05d0c --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/webhooks/types/InlinedWebhookPayload.ts @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const InlinedWebhookPayload: core.serialization.ObjectSchema< + serializers.InlinedWebhookPayload.Raw, + FernIr.InlinedWebhookPayload +> = core.serialization.objectWithoutOptionalProperties({ + name: core.serialization.lazyObject(async () => (await import("../../..")).Name), + extends: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).DeclaredTypeName) + ), + properties: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).InlinedWebhookPayloadProperty) + ), +}); + +export declare namespace InlinedWebhookPayload { + interface Raw { + name: serializers.Name.Raw; + extends: serializers.DeclaredTypeName.Raw[]; + properties: serializers.InlinedWebhookPayloadProperty.Raw[]; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/webhooks/types/InlinedWebhookPayloadProperty.ts b/packages/ir-sdk/src/sdk/serialization/resources/webhooks/types/InlinedWebhookPayloadProperty.ts new file mode 100644 index 00000000000..f1ce42d9a24 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/webhooks/types/InlinedWebhookPayloadProperty.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const InlinedWebhookPayloadProperty: core.serialization.ObjectSchema< + serializers.InlinedWebhookPayloadProperty.Raw, + FernIr.InlinedWebhookPayloadProperty +> = core.serialization + .objectWithoutOptionalProperties({ + name: core.serialization.lazyObject(async () => (await import("../../..")).NameAndWireValue), + valueType: core.serialization.lazy(async () => (await import("../../..")).TypeReference), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).WithDocs)); + +export declare namespace InlinedWebhookPayloadProperty { + interface Raw extends serializers.WithDocs.Raw { + name: serializers.NameAndWireValue.Raw; + valueType: serializers.TypeReference.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/webhooks/types/Webhook.ts b/packages/ir-sdk/src/sdk/serialization/resources/webhooks/types/Webhook.ts new file mode 100644 index 00000000000..180f3da2180 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/webhooks/types/Webhook.ts @@ -0,0 +1,29 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const Webhook: core.serialization.ObjectSchema = core.serialization + .objectWithoutOptionalProperties({ + name: core.serialization.lazyObject(async () => (await import("../../..")).WebhookName), + displayName: core.serialization.string().optional(), + method: core.serialization.lazy(async () => (await import("../../..")).WebhookHttpMethod), + headers: core.serialization.list( + core.serialization.lazyObject(async () => (await import("../../..")).HttpHeader) + ), + payload: core.serialization.lazy(async () => (await import("../../..")).WebhookPayload), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).Declaration)); + +export declare namespace Webhook { + interface Raw extends serializers.Declaration.Raw { + name: serializers.WebhookName.Raw; + displayName?: string | null; + method: serializers.WebhookHttpMethod.Raw; + headers: serializers.HttpHeader.Raw[]; + payload: serializers.WebhookPayload.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/webhooks/types/WebhookGroup.ts b/packages/ir-sdk/src/sdk/serialization/resources/webhooks/types/WebhookGroup.ts new file mode 100644 index 00000000000..1c014f7c8d4 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/webhooks/types/WebhookGroup.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const WebhookGroup: core.serialization.Schema = + core.serialization.list(core.serialization.lazyObject(async () => (await import("../../..")).Webhook)); + +export declare namespace WebhookGroup { + type Raw = serializers.Webhook.Raw[]; +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/webhooks/types/WebhookHttpMethod.ts b/packages/ir-sdk/src/sdk/serialization/resources/webhooks/types/WebhookHttpMethod.ts new file mode 100644 index 00000000000..818662035e7 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/webhooks/types/WebhookHttpMethod.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const WebhookHttpMethod: core.serialization.Schema = + core.serialization.enum_(["GET", "POST"]); + +export declare namespace WebhookHttpMethod { + type Raw = "GET" | "POST"; +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/webhooks/types/WebhookName.ts b/packages/ir-sdk/src/sdk/serialization/resources/webhooks/types/WebhookName.ts new file mode 100644 index 00000000000..c4db6b59e67 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/webhooks/types/WebhookName.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const WebhookName: core.serialization.ObjectSchema = + core.serialization.lazyObject(async () => (await import("../../..")).Name); + +export declare namespace WebhookName { + type Raw = serializers.Name.Raw; +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/webhooks/types/WebhookPayload.ts b/packages/ir-sdk/src/sdk/serialization/resources/webhooks/types/WebhookPayload.ts new file mode 100644 index 00000000000..c2d5028d73f --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/webhooks/types/WebhookPayload.ts @@ -0,0 +1,39 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const WebhookPayload: core.serialization.Schema = + core.serialization + .union("type", { + inlinedPayload: core.serialization.lazyObject(async () => (await import("../../..")).InlinedWebhookPayload), + reference: core.serialization.lazyObject(async () => (await import("../../..")).WebhookPayloadReference), + }) + .transform({ + transform: (value) => { + switch (value.type) { + case "inlinedPayload": + return FernIr.WebhookPayload.inlinedPayload(value); + case "reference": + return FernIr.WebhookPayload.reference(value); + default: + return value as FernIr.WebhookPayload; + } + }, + untransform: ({ _visit, ...value }) => value as any, + }); + +export declare namespace WebhookPayload { + type Raw = WebhookPayload.InlinedPayload | WebhookPayload.Reference; + + interface InlinedPayload extends serializers.InlinedWebhookPayload.Raw { + type: "inlinedPayload"; + } + + interface Reference extends serializers.WebhookPayloadReference.Raw { + type: "reference"; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/webhooks/types/WebhookPayloadReference.ts b/packages/ir-sdk/src/sdk/serialization/resources/webhooks/types/WebhookPayloadReference.ts new file mode 100644 index 00000000000..b6035801982 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/webhooks/types/WebhookPayloadReference.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../.."; +import * as FernIr from "../../../../api"; +import * as core from "../../../../core"; + +export const WebhookPayloadReference: core.serialization.ObjectSchema< + serializers.WebhookPayloadReference.Raw, + FernIr.WebhookPayloadReference +> = core.serialization + .objectWithoutOptionalProperties({ + payloadType: core.serialization.lazy(async () => (await import("../../..")).TypeReference), + }) + .extend(core.serialization.lazyObject(async () => (await import("../../..")).WithDocs)); + +export declare namespace WebhookPayloadReference { + interface Raw extends serializers.WithDocs.Raw { + payloadType: serializers.TypeReference.Raw; + } +} diff --git a/packages/ir-sdk/src/sdk/serialization/resources/webhooks/types/index.ts b/packages/ir-sdk/src/sdk/serialization/resources/webhooks/types/index.ts new file mode 100644 index 00000000000..2c43a9cd9bf --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/webhooks/types/index.ts @@ -0,0 +1,8 @@ +export * from "./WebhookGroup"; +export * from "./Webhook"; +export * from "./WebhookName"; +export * from "./WebhookPayload"; +export * from "./WebhookPayloadReference"; +export * from "./InlinedWebhookPayload"; +export * from "./InlinedWebhookPayloadProperty"; +export * from "./WebhookHttpMethod"; diff --git a/packages/ir-sdk/tsconfig.json b/packages/ir-sdk/tsconfig.json new file mode 100644 index 00000000000..eb37bb4f427 --- /dev/null +++ b/packages/ir-sdk/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "../../shared/tsconfig.shared.json", + "compilerOptions": { "composite": true, "outDir": "lib", "rootDir": "src" }, + "include": ["./src"] +} diff --git a/seed/ruby-model/enum/lib/seed_enum_client/types/one.rb b/seed/ruby-model/enum/lib/seed_enum_client/types/one.rb deleted file mode 100644 index 3b51f91057b..00000000000 --- a/seed/ruby-model/enum/lib/seed_enum_client/types/one.rb +++ /dev/null @@ -1,6 +0,0 @@ -# frozen_string_literal: true - -module SeedEnumClient - # @type [Hash{String => String}] - ONE = { one: "ONE", o_ne: "ONe" }.frozen -end diff --git a/seed/ruby-model/enum/lib/seed_enum_client/types/enum.rb b/seed/ruby-model/enum/lib/seed_enum_client/types/operand.rb similarity index 53% rename from seed/ruby-model/enum/lib/seed_enum_client/types/enum.rb rename to seed/ruby-model/enum/lib/seed_enum_client/types/operand.rb index 1b18f0f59e3..5045ea714d6 100644 --- a/seed/ruby-model/enum/lib/seed_enum_client/types/enum.rb +++ b/seed/ruby-model/enum/lib/seed_enum_client/types/operand.rb @@ -2,5 +2,5 @@ module SeedEnumClient # @type [Hash{String => String}] - ENUM = { one: "ONE", two: "TWO", three: "THREE" }.frozen + OPERAND = { greater_than: ">", equal_to: "=", less_than: "less_than" }.frozen end diff --git a/shared/.prettierignore b/shared/.prettierignore index 916ba1b323a..d544de664f2 100644 --- a/shared/.prettierignore +++ b/shared/.prettierignore @@ -1,11 +1,23 @@ -# Ignore everything recursively -* +../packages/ir-sdk/** +../scripts/** -# But not the .ts files -!*.ts - -# Ignore .d.ts files +**/*.yaml +**/*.yml +**/*.mdx +**/*.md +**/*.json +**/*.py +**/*.rb +**/*.java +**/*.js +**/*.zip +**/*.cjs +**/*.mjs +**/*.snap *.d.ts -# Check subdirectories too -!*/ \ No newline at end of file +.yarn +.github +fern + + diff --git a/yarn.lock b/yarn.lock index 3a87bc459fe..16b8ecd571b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2015,6 +2015,7 @@ __metadata: "@fern-api/init": "workspace:*" "@fern-api/ir-generator": "workspace:*" "@fern-api/ir-migrations": "workspace:*" + "@fern-api/ir-sdk": "workspace:*" "@fern-api/local-workspace-runner": "workspace:*" "@fern-api/logger": "workspace:*" "@fern-api/logging-execa": "workspace:*" @@ -2036,7 +2037,6 @@ __metadata: "@fern-api/yaml-migrations": "workspace:*" "@fern-api/yaml-schema": "workspace:*" "@fern-fern/fiddle-sdk": ^0.0.386 - "@fern-fern/ir-sdk": 0.0.3294 "@types/axios": ^0.14.0 "@types/boxen": ^3.0.1 "@types/is-ci": ^3.0.2 @@ -2425,10 +2425,10 @@ __metadata: dependencies: "@fern-api/fs-utils": "workspace:*" "@fern-api/generator-commons": "workspace:*" + "@fern-api/ir-sdk": "workspace:*" "@fern-api/logger": "workspace:*" "@fern-api/logging-execa": "workspace:*" "@fern-fern/generator-exec-sdk": ^0.0.472 - "@fern-fern/ir-sdk": 0.0.3294 "@types/jest": ^29.0.3 "@types/node": ^18.7.18 depcheck: ^1.4.6 @@ -2446,10 +2446,10 @@ __metadata: resolution: "@fern-api/generator-commons@workspace:packages/generators/commons" dependencies: "@fern-api/fs-utils": "workspace:*" + "@fern-api/ir-sdk": "workspace:*" "@fern-api/logger": "workspace:*" "@fern-api/logging-execa": "workspace:*" "@fern-fern/generator-exec-sdk": ^0.0.472 - "@fern-fern/ir-sdk": 0.0.3294 "@types/jest": ^29.0.3 "@types/node": ^18.7.18 depcheck: ^1.4.6 @@ -2530,12 +2530,12 @@ __metadata: "@fern-api/core-utils": "workspace:*" "@fern-api/fs-utils": "workspace:*" "@fern-api/generators-configuration": "workspace:*" + "@fern-api/ir-sdk": "workspace:*" "@fern-api/project-configuration": "workspace:*" "@fern-api/project-loader": "workspace:*" "@fern-api/task-context": "workspace:*" "@fern-api/workspace-loader": "workspace:*" "@fern-api/yaml-schema": "workspace:*" - "@fern-fern/ir-sdk": 0.0.3294 "@types/jest": ^29.0.3 "@types/jest-specific-snapshot": ^0.5.7 "@types/lodash-es": ^4.17.7 @@ -2562,11 +2562,11 @@ __metadata: "@fern-api/fs-utils": "workspace:*" "@fern-api/generators-configuration": "workspace:*" "@fern-api/ir-generator": "workspace:*" + "@fern-api/ir-sdk": "workspace:*" "@fern-api/logger": "workspace:*" "@fern-api/semver-utils": "workspace:*" "@fern-api/task-context": "workspace:*" "@fern-api/workspace-loader": "workspace:*" - "@fern-fern/ir-sdk": 0.0.3294 "@fern-fern/ir-v1-model": 0.0.1 "@fern-fern/ir-v10-model": 0.0.1 "@fern-fern/ir-v11-model": 0.0.2 @@ -2611,6 +2611,21 @@ __metadata: languageName: unknown linkType: soft +"@fern-api/ir-sdk@workspace:*, @fern-api/ir-sdk@workspace:packages/ir-sdk": + version: 0.0.0-use.local + resolution: "@fern-api/ir-sdk@workspace:packages/ir-sdk" + dependencies: + "@types/jest": ^29.0.3 + "@types/node": ^18.7.18 + depcheck: ^1.4.6 + eslint: ^8.56.0 + jest: ^29.7.0 + organize-imports-cli: ^0.10.0 + prettier: ^2.7.1 + typescript: 4.6.4 + languageName: unknown + linkType: soft + "@fern-api/json-schema@workspace:*, @fern-api/json-schema@workspace:packages/cli/yaml/json-schema": version: 0.0.0-use.local resolution: "@fern-api/json-schema@workspace:packages/cli/yaml/json-schema" @@ -2764,8 +2779,8 @@ __metadata: resolution: "@fern-api/mock@workspace:packages/cli/mock" dependencies: "@fern-api/core-utils": "workspace:*" + "@fern-api/ir-sdk": "workspace:*" "@fern-api/task-context": "workspace:*" - "@fern-fern/ir-sdk": 0.0.3294 "@types/express": ^4.17.20 "@types/jest": ^29.0.3 "@types/lodash-es": ^4.17.7 @@ -2974,9 +2989,9 @@ __metadata: "@fern-api/core-utils": "workspace:*" "@fern-api/fdr-sdk": 0.46.1-18-g26596cb "@fern-api/ir-generator": "workspace:*" + "@fern-api/ir-sdk": "workspace:*" "@fern-api/task-context": "workspace:*" "@fern-api/workspace-loader": "workspace:*" - "@fern-fern/ir-sdk": 0.0.3294 "@types/jest": ^29.0.3 "@types/lodash-es": ^4.17.7 "@types/node": ^18.7.18 @@ -3004,13 +3019,13 @@ __metadata: "@fern-api/generators-configuration": "workspace:*" "@fern-api/ir-generator": "workspace:*" "@fern-api/ir-migrations": "workspace:*" + "@fern-api/ir-sdk": "workspace:*" "@fern-api/logger": "workspace:*" "@fern-api/register": "workspace:*" "@fern-api/task-context": "workspace:*" "@fern-api/workspace-loader": "workspace:*" "@fern-fern/docs-config": 0.0.53 "@fern-fern/fiddle-sdk": ^0.0.386 - "@fern-fern/ir-sdk": 0.0.3294 "@types/decompress": ^4.2.7 "@types/jest": ^29.0.3 "@types/lodash-es": ^4.17.7 @@ -3298,8 +3313,8 @@ __metadata: dependencies: "@fern-api/core-utils": "workspace:*" "@fern-api/fs-utils": "workspace:*" + "@fern-api/ir-sdk": "workspace:*" "@fern-fern/docs-config": 0.0.53 - "@fern-fern/ir-sdk": 0.0.3294 "@types/jest": ^29.0.3 "@types/js-yaml": ^4.0.8 "@types/node": ^18.7.18