From 8125bd287cd8eae9d5bec3cd6aa2a3c3d4a30c33 Mon Sep 17 00:00:00 2001 From: dsinghvi Date: Thu, 12 Dec 2024 14:35:24 -0500 Subject: [PATCH] fix --- generators/typescript/codegen/package.json | 2 +- .../typescript/express/cli/package.json | 2 +- .../package.json | 2 +- ...GeneratedExpressEndpointTypeSchemasImpl.ts | 3 + .../express-error-generator/package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../express-register-generator/package.json | 2 +- .../express-service-generator/package.json | 2 +- .../src/GeneratedExpressServiceImpl.ts | 3 + .../typescript/express/generator/package.json | 2 +- .../model/type-generator/package.json | 2 +- .../type-reference-converters/package.json | 2 +- .../package.json | 2 +- .../model/type-schema-generator/package.json | 2 +- .../model/union-generator/package.json | 2 +- .../model/union-schema-generator/package.json | 2 +- generators/typescript/sdk/cli/package.json | 2 +- .../sdk/client-class-generator/package.json | 2 +- .../src/GeneratedSdkClientClassImpl.ts | 8 +- .../GeneratedDefaultEndpointImplementation.ts | 4 + .../GeneratedNonThrowingEndpointResponse.ts | 2 + .../GeneratedThrowingEndpointResponse.ts | 2 + .../endpoint-response/getSuccessReturnType.ts | 10 + .../package.json | 2 +- .../sdk/environments-generator/package.json | 2 +- .../typescript/sdk/generator/package.json | 2 +- .../request-wrapper-generator/package.json | 2 +- .../package.json | 2 +- .../GeneratedSdkEndpointTypeSchemasImpl.ts | 4 + .../sdk/sdk-error-generator/package.json | 2 +- .../sdk-error-schema-generator/package.json | 2 +- .../package.json | 2 +- .../utils/abstract-generator-cli/package.json | 2 +- .../typescript/utils/commons/package.json | 2 +- .../src/core-utilities/fetcher/Fetcher.ts | 2 +- .../src/core-utilities/fetcher/FetcherImpl.ts | 2 +- .../typescript/utils/contexts/package.json | 2 +- .../typescript/utils/resolvers/package.json | 2 +- .../no-undefined-type-reference.ts | 2 + .../generators/docker/cache_heavy_deps.sh | 2 +- pnpm-lock.yaml | 125 ++-- .../reports/problems/problems-report.html | 663 ++++++++++++++++++ .../ts-sdk/bytes/.mock/definition/service.yml | 6 + seed/ts-sdk/bytes/package.json | 2 +- seed/ts-sdk/bytes/snippet-templates.json | 55 ++ .../api/resources/service/client/Client.ts | 49 ++ seed/ts-sdk/seed.yml | 2 +- .../fern/apis/bytes/definition/service.yml | 6 + 50 files changed, 916 insertions(+), 96 deletions(-) create mode 100644 seed/java-sdk/inline-types/build/reports/problems/problems-report.html diff --git a/generators/typescript/codegen/package.json b/generators/typescript/codegen/package.json index 8dc1b2687d7..d86233ebd53 100644 --- a/generators/typescript/codegen/package.json +++ b/generators/typescript/codegen/package.json @@ -28,7 +28,7 @@ "devDependencies": { "@fern-api/core-utils": "workspace:*", "@fern-api/base-generator": "workspace:*", - "@fern-fern/ir-sdk": "53.23.0", + "@fern-fern/ir-sdk": "54.0.0", "@types/jest": "^29.5.12", "@types/node": "18.7.18", "depcheck": "^1.4.6", diff --git a/generators/typescript/express/cli/package.json b/generators/typescript/express/cli/package.json index 5a0ebd5b3db..085c9f0d601 100644 --- a/generators/typescript/express/cli/package.json +++ b/generators/typescript/express/cli/package.json @@ -31,7 +31,7 @@ }, "devDependencies": { "@fern-fern/generator-exec-sdk": "^0.0.898", - "@fern-fern/ir-sdk": "53.23.0", + "@fern-fern/ir-sdk": "54.0.0", "@fern-typescript/abstract-generator-cli": "workspace:*", "@fern-typescript/commons": "workspace:*", "@fern-typescript/contexts": "workspace:*", diff --git a/generators/typescript/express/express-endpoint-type-schemas-generator/package.json b/generators/typescript/express/express-endpoint-type-schemas-generator/package.json index 174bb00197b..caac3cd653d 100644 --- a/generators/typescript/express/express-endpoint-type-schemas-generator/package.json +++ b/generators/typescript/express/express-endpoint-type-schemas-generator/package.json @@ -28,7 +28,7 @@ }, "dependencies": { "@fern-api/core-utils": "workspace:*", - "@fern-fern/ir-sdk": "53.23.0", + "@fern-fern/ir-sdk": "54.0.0", "@fern-typescript/abstract-schema-generator": "workspace:*", "@fern-typescript/commons": "workspace:*", "@fern-typescript/contexts": "workspace:*", diff --git a/generators/typescript/express/express-endpoint-type-schemas-generator/src/GeneratedExpressEndpointTypeSchemasImpl.ts b/generators/typescript/express/express-endpoint-type-schemas-generator/src/GeneratedExpressEndpointTypeSchemasImpl.ts index d069462657e..52b2a2e4e65 100644 --- a/generators/typescript/express/express-endpoint-type-schemas-generator/src/GeneratedExpressEndpointTypeSchemasImpl.ts +++ b/generators/typescript/express/express-endpoint-type-schemas-generator/src/GeneratedExpressEndpointTypeSchemasImpl.ts @@ -196,6 +196,9 @@ export class GeneratedExpressEndpointTypeSchemasImpl implements GeneratedExpress if (this.endpoint.response.body?.type === "text") { throw new Error("Text response is not supported"); } + if (this.endpoint.response.body.type === "bytes") { + throw new Error("Bytes response is not supported"); + } if (!this.includeSerdeLayer) { return referenceToParsedResponse; diff --git a/generators/typescript/express/express-error-generator/package.json b/generators/typescript/express/express-error-generator/package.json index 26201502112..be3fa5f6fd4 100644 --- a/generators/typescript/express/express-error-generator/package.json +++ b/generators/typescript/express/express-error-generator/package.json @@ -27,7 +27,7 @@ "depcheck": "depcheck" }, "dependencies": { - "@fern-fern/ir-sdk": "53.23.0", + "@fern-fern/ir-sdk": "54.0.0", "@fern-typescript/abstract-error-class-generator": "workspace:*", "@fern-typescript/commons": "workspace:*", "@fern-typescript/contexts": "workspace:*", diff --git a/generators/typescript/express/express-error-schema-generator/package.json b/generators/typescript/express/express-error-schema-generator/package.json index 47e014c1854..97427d91f33 100644 --- a/generators/typescript/express/express-error-schema-generator/package.json +++ b/generators/typescript/express/express-error-schema-generator/package.json @@ -28,7 +28,7 @@ }, "dependencies": { "@fern-api/core-utils": "workspace:*", - "@fern-fern/ir-sdk": "53.23.0", + "@fern-fern/ir-sdk": "54.0.0", "@fern-typescript/abstract-schema-generator": "workspace:*", "@fern-typescript/commons": "workspace:*", "@fern-typescript/contexts": "workspace:*", diff --git a/generators/typescript/express/express-inlined-request-body-generator/package.json b/generators/typescript/express/express-inlined-request-body-generator/package.json index 823a4233a1a..2a8f8faa43e 100644 --- a/generators/typescript/express/express-inlined-request-body-generator/package.json +++ b/generators/typescript/express/express-inlined-request-body-generator/package.json @@ -27,7 +27,7 @@ "depcheck": "depcheck" }, "dependencies": { - "@fern-fern/ir-sdk": "53.23.0", + "@fern-fern/ir-sdk": "54.0.0", "@fern-typescript/commons": "workspace:*", "@fern-typescript/contexts": "workspace:*" }, diff --git a/generators/typescript/express/express-inlined-request-body-schema-generator/package.json b/generators/typescript/express/express-inlined-request-body-schema-generator/package.json index b28c7704104..0f4cd7d79a2 100644 --- a/generators/typescript/express/express-inlined-request-body-schema-generator/package.json +++ b/generators/typescript/express/express-inlined-request-body-schema-generator/package.json @@ -27,7 +27,7 @@ "depcheck": "depcheck" }, "dependencies": { - "@fern-fern/ir-sdk": "53.23.0", + "@fern-fern/ir-sdk": "54.0.0", "@fern-typescript/abstract-schema-generator": "workspace:*", "@fern-typescript/commons": "workspace:*", "@fern-typescript/contexts": "workspace:*", diff --git a/generators/typescript/express/express-register-generator/package.json b/generators/typescript/express/express-register-generator/package.json index 2d556e0d1e1..ebe5281a4e9 100644 --- a/generators/typescript/express/express-register-generator/package.json +++ b/generators/typescript/express/express-register-generator/package.json @@ -27,7 +27,7 @@ "depcheck": "depcheck" }, "dependencies": { - "@fern-fern/ir-sdk": "53.23.0", + "@fern-fern/ir-sdk": "54.0.0", "@fern-typescript/commons": "workspace:*", "@fern-typescript/contexts": "workspace:*", "@fern-typescript/resolvers": "workspace:*", diff --git a/generators/typescript/express/express-service-generator/package.json b/generators/typescript/express/express-service-generator/package.json index 656f378318c..a940b0a3638 100644 --- a/generators/typescript/express/express-service-generator/package.json +++ b/generators/typescript/express/express-service-generator/package.json @@ -27,7 +27,7 @@ "depcheck": "depcheck" }, "dependencies": { - "@fern-fern/ir-sdk": "53.23.0", + "@fern-fern/ir-sdk": "54.0.0", "@fern-typescript/commons": "workspace:*", "@fern-typescript/contexts": "workspace:*", "@fern-typescript/resolvers": "workspace:*", diff --git a/generators/typescript/express/express-service-generator/src/GeneratedExpressServiceImpl.ts b/generators/typescript/express/express-service-generator/src/GeneratedExpressServiceImpl.ts index 8991adf9530..ccffade8dce 100644 --- a/generators/typescript/express/express-service-generator/src/GeneratedExpressServiceImpl.ts +++ b/generators/typescript/express/express-service-generator/src/GeneratedExpressServiceImpl.ts @@ -936,6 +936,9 @@ export class GeneratedExpressServiceImpl implements GeneratedExpressService { fileDownload: () => { throw new Error("File download is not supported"); }, + bytes: () => { + throw new Error("Bytes is not supported"); + }, text: () => { throw new Error("Text response is not supported"); }, diff --git a/generators/typescript/express/generator/package.json b/generators/typescript/express/generator/package.json index 184d8237dd0..84e8241b39d 100644 --- a/generators/typescript/express/generator/package.json +++ b/generators/typescript/express/generator/package.json @@ -30,7 +30,7 @@ "@fern-api/core-utils": "workspace:*", "@fern-api/fs-utils": "workspace:*", "@fern-api/logger": "workspace:*", - "@fern-fern/ir-sdk": "53.23.0", + "@fern-fern/ir-sdk": "54.0.0", "@fern-typescript/commons": "workspace:*", "@fern-typescript/contexts": "workspace:*", "@fern-typescript/express-endpoint-type-schemas-generator": "workspace:*", diff --git a/generators/typescript/model/type-generator/package.json b/generators/typescript/model/type-generator/package.json index c7b904b8884..65716a36a29 100644 --- a/generators/typescript/model/type-generator/package.json +++ b/generators/typescript/model/type-generator/package.json @@ -27,7 +27,7 @@ "depcheck": "depcheck" }, "dependencies": { - "@fern-fern/ir-sdk": "53.23.0", + "@fern-fern/ir-sdk": "54.0.0", "@fern-typescript/commons": "workspace:*", "@fern-typescript/contexts": "workspace:*", "@fern-typescript/union-generator": "workspace:*", diff --git a/generators/typescript/model/type-reference-converters/package.json b/generators/typescript/model/type-reference-converters/package.json index e5405ede708..e05d738091c 100644 --- a/generators/typescript/model/type-reference-converters/package.json +++ b/generators/typescript/model/type-reference-converters/package.json @@ -27,7 +27,7 @@ "depcheck": "depcheck" }, "dependencies": { - "@fern-fern/ir-sdk": "53.23.0", + "@fern-fern/ir-sdk": "54.0.0", "@fern-api/core-utils": "workspace:*", "@fern-typescript/commons": "workspace:*", "@fern-typescript/resolvers": "workspace:*", diff --git a/generators/typescript/model/type-reference-example-generator/package.json b/generators/typescript/model/type-reference-example-generator/package.json index bb2b78f0016..a3d0d92b2ba 100644 --- a/generators/typescript/model/type-reference-example-generator/package.json +++ b/generators/typescript/model/type-reference-example-generator/package.json @@ -28,7 +28,7 @@ }, "dependencies": { "@fern-api/core-utils": "workspace:*", - "@fern-fern/ir-sdk": "53.23.0", + "@fern-fern/ir-sdk": "54.0.0", "@fern-typescript/commons": "workspace:*", "@fern-typescript/contexts": "workspace:*", "ts-morph": "^15.1.0" diff --git a/generators/typescript/model/type-schema-generator/package.json b/generators/typescript/model/type-schema-generator/package.json index b44d9777503..fa2f1b4847b 100644 --- a/generators/typescript/model/type-schema-generator/package.json +++ b/generators/typescript/model/type-schema-generator/package.json @@ -27,7 +27,7 @@ "depcheck": "depcheck" }, "dependencies": { - "@fern-fern/ir-sdk": "53.23.0", + "@fern-fern/ir-sdk": "54.0.0", "@fern-typescript/abstract-schema-generator": "workspace:*", "@fern-typescript/commons": "workspace:*", "@fern-typescript/contexts": "workspace:*", diff --git a/generators/typescript/model/union-generator/package.json b/generators/typescript/model/union-generator/package.json index 74042f0e321..3879c2abe79 100644 --- a/generators/typescript/model/union-generator/package.json +++ b/generators/typescript/model/union-generator/package.json @@ -28,7 +28,7 @@ }, "dependencies": { "@fern-api/core-utils": "workspace:*", - "@fern-fern/ir-sdk": "53.23.0", + "@fern-fern/ir-sdk": "54.0.0", "@fern-typescript/commons": "workspace:*", "@fern-typescript/contexts": "workspace:*", "ts-morph": "^15.1.0" diff --git a/generators/typescript/model/union-schema-generator/package.json b/generators/typescript/model/union-schema-generator/package.json index ee09125bf07..69b249db33f 100644 --- a/generators/typescript/model/union-schema-generator/package.json +++ b/generators/typescript/model/union-schema-generator/package.json @@ -27,7 +27,7 @@ "depcheck": "depcheck" }, "dependencies": { - "@fern-fern/ir-sdk": "53.23.0", + "@fern-fern/ir-sdk": "54.0.0", "@fern-typescript/abstract-schema-generator": "workspace:*", "@fern-typescript/commons": "workspace:*", "@fern-typescript/contexts": "workspace:*", diff --git a/generators/typescript/sdk/cli/package.json b/generators/typescript/sdk/cli/package.json index f730baa59db..d69bbc216f7 100644 --- a/generators/typescript/sdk/cli/package.json +++ b/generators/typescript/sdk/cli/package.json @@ -35,7 +35,7 @@ "devDependencies": { "@fern-api/fs-utils": "workspace:*", "@fern-api/base-generator": "workspace:*", - "@fern-fern/ir-sdk": "53.23.0", + "@fern-fern/ir-sdk": "54.0.0", "@fern-typescript/abstract-generator-cli": "workspace:*", "@fern-typescript/commons": "workspace:*", "@fern-typescript/contexts": "workspace:*", diff --git a/generators/typescript/sdk/client-class-generator/package.json b/generators/typescript/sdk/client-class-generator/package.json index 52afab49d26..e932efc588c 100644 --- a/generators/typescript/sdk/client-class-generator/package.json +++ b/generators/typescript/sdk/client-class-generator/package.json @@ -28,7 +28,7 @@ }, "dependencies": { "@fern-api/core-utils": "workspace:*", - "@fern-fern/ir-sdk": "53.23.0", + "@fern-fern/ir-sdk": "54.0.0", "@fern-typescript/commons": "workspace:*", "@fern-typescript/contexts": "workspace:*", "@fern-typescript/resolvers": "workspace:*", diff --git a/generators/typescript/sdk/client-class-generator/src/GeneratedSdkClientClassImpl.ts b/generators/typescript/sdk/client-class-generator/src/GeneratedSdkClientClassImpl.ts index 22923cff469..9e646da53f1 100644 --- a/generators/typescript/sdk/client-class-generator/src/GeneratedSdkClientClassImpl.ts +++ b/generators/typescript/sdk/client-class-generator/src/GeneratedSdkClientClassImpl.ts @@ -210,6 +210,7 @@ export class GeneratedSdkClientClassImpl implements GeneratedSdkClientClass { | HttpResponseBody.FileDownload | HttpResponseBody.Text | HttpResponseBody.Streaming + | HttpResponseBody.Bytes | undefined; }) => { if (neverThrowErrors) { @@ -237,7 +238,7 @@ export class GeneratedSdkClientClassImpl implements GeneratedSdkClientClass { const getDefaultEndpointImplementation = ({ response }: { - response: HttpResponseBody.Json | HttpResponseBody.FileDownload | HttpResponseBody.Text | undefined; + response: HttpResponseBody.Json | HttpResponseBody.FileDownload | HttpResponseBody.Text | HttpResponseBody.Bytes | undefined; }) => { return new GeneratedDefaultEndpointImplementation({ endpoint, @@ -307,6 +308,11 @@ export class GeneratedSdkClientClassImpl implements GeneratedSdkClientClass { retainOriginalCasing: this.retainOriginalCasing, omitUndefined: this.omitUndefined }), + bytes: (bytesResponse) => { + return getDefaultEndpointImplementation({ + response: HttpResponseBody.bytes(bytesResponse) + }); + }, text: (textResponse) => { return getDefaultEndpointImplementation({ response: HttpResponseBody.text(textResponse) diff --git a/generators/typescript/sdk/client-class-generator/src/endpoints/default/GeneratedDefaultEndpointImplementation.ts b/generators/typescript/sdk/client-class-generator/src/endpoints/default/GeneratedDefaultEndpointImplementation.ts index 6248dacbfe0..8dbb5ad9ca4 100644 --- a/generators/typescript/sdk/client-class-generator/src/endpoints/default/GeneratedDefaultEndpointImplementation.ts +++ b/generators/typescript/sdk/client-class-generator/src/endpoints/default/GeneratedDefaultEndpointImplementation.ts @@ -429,6 +429,10 @@ export class GeneratedDefaultEndpointImplementation implements GeneratedEndpoint fetcherArgs.responseType = "text"; } + if (this.endpoint.response?.body?.type === "bytes") { + fetcherArgs.responseType = "arrayBuffer"; + } + return [ ts.factory.createVariableStatement( undefined, diff --git a/generators/typescript/sdk/client-class-generator/src/endpoints/default/endpoint-response/GeneratedNonThrowingEndpointResponse.ts b/generators/typescript/sdk/client-class-generator/src/endpoints/default/endpoint-response/GeneratedNonThrowingEndpointResponse.ts index 4a92b45e166..ed3223ffca7 100644 --- a/generators/typescript/sdk/client-class-generator/src/endpoints/default/endpoint-response/GeneratedNonThrowingEndpointResponse.ts +++ b/generators/typescript/sdk/client-class-generator/src/endpoints/default/endpoint-response/GeneratedNonThrowingEndpointResponse.ts @@ -20,6 +20,7 @@ export declare namespace GeneratedNonThrowingEndpointResponse { | HttpResponseBody.FileDownload | HttpResponseBody.Streaming | HttpResponseBody.Text + | HttpResponseBody.Bytes | undefined; errorDiscriminationStrategy: ErrorDiscriminationStrategy; errorResolver: ErrorResolver; @@ -37,6 +38,7 @@ export class GeneratedNonThrowingEndpointResponse implements GeneratedEndpointRe | HttpResponseBody.FileDownload | HttpResponseBody.Streaming | HttpResponseBody.Text + | HttpResponseBody.Bytes | undefined; private errorDiscriminationStrategy: ErrorDiscriminationStrategy; private errorResolver: ErrorResolver; diff --git a/generators/typescript/sdk/client-class-generator/src/endpoints/default/endpoint-response/GeneratedThrowingEndpointResponse.ts b/generators/typescript/sdk/client-class-generator/src/endpoints/default/endpoint-response/GeneratedThrowingEndpointResponse.ts index a080f91270b..182c6cf69b4 100644 --- a/generators/typescript/sdk/client-class-generator/src/endpoints/default/endpoint-response/GeneratedThrowingEndpointResponse.ts +++ b/generators/typescript/sdk/client-class-generator/src/endpoints/default/endpoint-response/GeneratedThrowingEndpointResponse.ts @@ -35,6 +35,7 @@ export declare namespace GeneratedThrowingEndpointResponse { | HttpResponseBody.FileDownload | HttpResponseBody.Streaming | HttpResponseBody.Text + | HttpResponseBody.Bytes | undefined; errorDiscriminationStrategy: ErrorDiscriminationStrategy; errorResolver: ErrorResolver; @@ -53,6 +54,7 @@ export class GeneratedThrowingEndpointResponse implements GeneratedEndpointRespo | HttpResponseBody.FileDownload | HttpResponseBody.Streaming | HttpResponseBody.Text + | HttpResponseBody.Bytes | undefined; private errorDiscriminationStrategy: ErrorDiscriminationStrategy; private errorResolver: ErrorResolver; diff --git a/generators/typescript/sdk/client-class-generator/src/endpoints/default/endpoint-response/getSuccessReturnType.ts b/generators/typescript/sdk/client-class-generator/src/endpoints/default/endpoint-response/getSuccessReturnType.ts index 69f4b741e9e..197ba384be7 100644 --- a/generators/typescript/sdk/client-class-generator/src/endpoints/default/endpoint-response/getSuccessReturnType.ts +++ b/generators/typescript/sdk/client-class-generator/src/endpoints/default/endpoint-response/getSuccessReturnType.ts @@ -10,6 +10,7 @@ export function getSuccessReturnType( | HttpResponseBody.FileDownload | HttpResponseBody.Streaming | HttpResponseBody.Text + | HttpResponseBody.Bytes | undefined, context: SdkContext, opts: { @@ -27,6 +28,15 @@ export function getSuccessReturnType( includeContentHeadersOnResponse: opts.includeContentHeadersOnResponse }); } + case "fileDownload": { + return getFileType({ + targetRuntime: context.targetRuntime, + context, + includeContentHeadersOnResponse: opts.includeContentHeadersOnResponse + }); + } + case "bytes": + return ts.factory.createTypeReferenceNode("ArrayBuffer"); case "json": return context.type.getReferenceToType(response.value.responseBodyType).typeNode; case "text": diff --git a/generators/typescript/sdk/endpoint-error-union-generator/package.json b/generators/typescript/sdk/endpoint-error-union-generator/package.json index 75a75dccf9e..67f8222c840 100644 --- a/generators/typescript/sdk/endpoint-error-union-generator/package.json +++ b/generators/typescript/sdk/endpoint-error-union-generator/package.json @@ -27,7 +27,7 @@ "depcheck": "depcheck" }, "dependencies": { - "@fern-fern/ir-sdk": "53.23.0", + "@fern-fern/ir-sdk": "54.0.0", "@fern-typescript/commons": "workspace:*", "@fern-typescript/contexts": "workspace:*", "@fern-typescript/resolvers": "workspace:*", diff --git a/generators/typescript/sdk/environments-generator/package.json b/generators/typescript/sdk/environments-generator/package.json index 658ecfc5e0a..a8946b3028c 100644 --- a/generators/typescript/sdk/environments-generator/package.json +++ b/generators/typescript/sdk/environments-generator/package.json @@ -27,7 +27,7 @@ "depcheck": "depcheck" }, "dependencies": { - "@fern-fern/ir-sdk": "53.23.0", + "@fern-fern/ir-sdk": "54.0.0", "@fern-typescript/commons": "workspace:*", "@fern-typescript/contexts": "workspace:*", "ts-morph": "^15.1.0" diff --git a/generators/typescript/sdk/generator/package.json b/generators/typescript/sdk/generator/package.json index 99c86f0016d..bb679f614e9 100644 --- a/generators/typescript/sdk/generator/package.json +++ b/generators/typescript/sdk/generator/package.json @@ -34,7 +34,7 @@ "@fern-api/logger": "workspace:*", "@fern-fern/generator-cli-sdk": "0.0.17", "@fern-fern/generator-exec-sdk": "^0.0.898", - "@fern-fern/ir-sdk": "53.23.0", + "@fern-fern/ir-sdk": "54.0.0", "@fern-fern/snippet-sdk": "^0.0.5526", "@fern-typescript/commons": "workspace:*", "@fern-typescript/contexts": "workspace:*", diff --git a/generators/typescript/sdk/request-wrapper-generator/package.json b/generators/typescript/sdk/request-wrapper-generator/package.json index e4c0bd15f9b..3b06837fe2c 100644 --- a/generators/typescript/sdk/request-wrapper-generator/package.json +++ b/generators/typescript/sdk/request-wrapper-generator/package.json @@ -28,7 +28,7 @@ }, "dependencies": { "@fern-api/core-utils": "workspace:*", - "@fern-fern/ir-sdk": "53.23.0", + "@fern-fern/ir-sdk": "54.0.0", "@fern-typescript/commons": "workspace:*", "@fern-typescript/contexts": "workspace:*", "ts-morph": "^15.1.0" diff --git a/generators/typescript/sdk/sdk-endpoint-type-schemas-generator/package.json b/generators/typescript/sdk/sdk-endpoint-type-schemas-generator/package.json index 5a1a40aecd3..ad533deb671 100644 --- a/generators/typescript/sdk/sdk-endpoint-type-schemas-generator/package.json +++ b/generators/typescript/sdk/sdk-endpoint-type-schemas-generator/package.json @@ -28,7 +28,7 @@ }, "dependencies": { "@fern-api/core-utils": "workspace:*", - "@fern-fern/ir-sdk": "53.23.0", + "@fern-fern/ir-sdk": "54.0.0", "@fern-typescript/abstract-schema-generator": "workspace:*", "@fern-typescript/commons": "workspace:*", "@fern-typescript/contexts": "workspace:*", diff --git a/generators/typescript/sdk/sdk-endpoint-type-schemas-generator/src/GeneratedSdkEndpointTypeSchemasImpl.ts b/generators/typescript/sdk/sdk-endpoint-type-schemas-generator/src/GeneratedSdkEndpointTypeSchemasImpl.ts index 833fc5eb8c2..3d01606b898 100644 --- a/generators/typescript/sdk/sdk-endpoint-type-schemas-generator/src/GeneratedSdkEndpointTypeSchemasImpl.ts +++ b/generators/typescript/sdk/sdk-endpoint-type-schemas-generator/src/GeneratedSdkEndpointTypeSchemasImpl.ts @@ -268,6 +268,10 @@ export class GeneratedSdkEndpointTypeSchemasImpl implements GeneratedSdkEndpoint } if (this.endpoint.response.body.type === "text") { + return referenceToRawResponse; + } + + if (this.endpoint.response.body.type === "bytes") { return ts.factory.createAsExpression( referenceToRawResponse, context.type.getReferenceToType(TypeReference.primitive({ v1: PrimitiveTypeV1.String, v2: undefined })) diff --git a/generators/typescript/sdk/sdk-error-generator/package.json b/generators/typescript/sdk/sdk-error-generator/package.json index bb35359c067..9e3104e2041 100644 --- a/generators/typescript/sdk/sdk-error-generator/package.json +++ b/generators/typescript/sdk/sdk-error-generator/package.json @@ -27,7 +27,7 @@ "depcheck": "depcheck" }, "dependencies": { - "@fern-fern/ir-sdk": "53.23.0", + "@fern-fern/ir-sdk": "54.0.0", "@fern-typescript/abstract-error-class-generator": "workspace:*", "@fern-typescript/commons": "workspace:*", "@fern-typescript/contexts": "workspace:*", diff --git a/generators/typescript/sdk/sdk-error-schema-generator/package.json b/generators/typescript/sdk/sdk-error-schema-generator/package.json index bffc0aedcb9..ddba0fc453a 100644 --- a/generators/typescript/sdk/sdk-error-schema-generator/package.json +++ b/generators/typescript/sdk/sdk-error-schema-generator/package.json @@ -28,7 +28,7 @@ }, "dependencies": { "@fern-api/core-utils": "workspace:*", - "@fern-fern/ir-sdk": "53.23.0", + "@fern-fern/ir-sdk": "54.0.0", "@fern-typescript/abstract-schema-generator": "workspace:*", "@fern-typescript/commons": "workspace:*", "@fern-typescript/contexts": "workspace:*", diff --git a/generators/typescript/sdk/sdk-inlined-request-body-schema-generator/package.json b/generators/typescript/sdk/sdk-inlined-request-body-schema-generator/package.json index f82ee155563..ed8de39159f 100644 --- a/generators/typescript/sdk/sdk-inlined-request-body-schema-generator/package.json +++ b/generators/typescript/sdk/sdk-inlined-request-body-schema-generator/package.json @@ -27,7 +27,7 @@ "depcheck": "depcheck" }, "dependencies": { - "@fern-fern/ir-sdk": "53.23.0", + "@fern-fern/ir-sdk": "54.0.0", "@fern-typescript/abstract-schema-generator": "workspace:*", "@fern-typescript/commons": "workspace:*", "@fern-typescript/contexts": "workspace:*", diff --git a/generators/typescript/utils/abstract-generator-cli/package.json b/generators/typescript/utils/abstract-generator-cli/package.json index 1c5701d62ba..e1853277a86 100644 --- a/generators/typescript/utils/abstract-generator-cli/package.json +++ b/generators/typescript/utils/abstract-generator-cli/package.json @@ -31,7 +31,7 @@ "@fern-api/base-generator": "workspace:*", "@fern-api/logger": "workspace:*", "@fern-fern/generator-exec-sdk": "^0.0.898", - "@fern-fern/ir-sdk": "53.23.0", + "@fern-fern/ir-sdk": "54.0.0", "@fern-typescript/commons": "workspace:*", "@fern-typescript/contexts": "workspace:*" }, diff --git a/generators/typescript/utils/commons/package.json b/generators/typescript/utils/commons/package.json index 0532c75b5ba..7b1a8ea9964 100644 --- a/generators/typescript/utils/commons/package.json +++ b/generators/typescript/utils/commons/package.json @@ -31,7 +31,7 @@ "@fern-api/fs-utils": "workspace:*", "@fern-api/logger": "workspace:*", "@fern-api/logging-execa": "workspace:*", - "@fern-fern/ir-sdk": "53.23.0", + "@fern-fern/ir-sdk": "54.0.0", "@fern-typescript/fetcher": "workspace:*", "@fern-typescript/zurg": "workspace:*", "decompress": "^4.2.1", diff --git a/generators/typescript/utils/commons/src/core-utilities/fetcher/Fetcher.ts b/generators/typescript/utils/commons/src/core-utilities/fetcher/Fetcher.ts index 5129834f7ef..11a2d2c4173 100644 --- a/generators/typescript/utils/commons/src/core-utilities/fetcher/Fetcher.ts +++ b/generators/typescript/utils/commons/src/core-utilities/fetcher/Fetcher.ts @@ -95,7 +95,7 @@ export declare namespace Fetcher { timeoutInSeconds: ts.Expression; maxRetries?: ts.Expression; requestType?: "json" | "file" | "bytes" | "other"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: ts.Expression; } } diff --git a/generators/typescript/utils/commons/src/core-utilities/fetcher/FetcherImpl.ts b/generators/typescript/utils/commons/src/core-utilities/fetcher/FetcherImpl.ts index 9e7ff3a0803..75cef4374d3 100644 --- a/generators/typescript/utils/commons/src/core-utilities/fetcher/FetcherImpl.ts +++ b/generators/typescript/utils/commons/src/core-utilities/fetcher/FetcherImpl.ts @@ -40,7 +40,7 @@ export class FetcherImpl extends CoreUtility implements Fetcher { dependencyManager.addDependency("form-data", "^4.0.0"); dependencyManager.addDependency("formdata-node", "^6.0.3"); dependencyManager.addDependency("node-fetch", "2.7.0"); - dependencyManager.addDependency("qs", "6.11.2"); + dependencyManager.addDependency("qs", "6.13.0"); dependencyManager.addDependency("readable-stream", "^4.5.2"); dependencyManager.addDependency("@types/qs", "6.9.8", { type: DependencyType.DEV diff --git a/generators/typescript/utils/contexts/package.json b/generators/typescript/utils/contexts/package.json index 2fc47911eeb..f210f8f42ee 100644 --- a/generators/typescript/utils/contexts/package.json +++ b/generators/typescript/utils/contexts/package.json @@ -30,7 +30,7 @@ "@fern-api/logger": "workspace:*", "@fern-api/base-generator": "workspace:*", "@fern-fern/generator-exec-sdk": "^0.0.898", - "@fern-fern/ir-sdk": "53.23.0", + "@fern-fern/ir-sdk": "54.0.0", "@fern-typescript/commons": "workspace:*", "ts-morph": "^15.1.0" }, diff --git a/generators/typescript/utils/resolvers/package.json b/generators/typescript/utils/resolvers/package.json index a048167788f..d63275f526d 100644 --- a/generators/typescript/utils/resolvers/package.json +++ b/generators/typescript/utils/resolvers/package.json @@ -27,7 +27,7 @@ "depcheck": "depcheck" }, "dependencies": { - "@fern-fern/ir-sdk": "53.23.0", + "@fern-fern/ir-sdk": "54.0.0", "@fern-typescript/commons": "workspace:*" }, "devDependencies": { diff --git a/packages/cli/fern-definition/validator/src/rules/no-undefined-type-reference/no-undefined-type-reference.ts b/packages/cli/fern-definition/validator/src/rules/no-undefined-type-reference/no-undefined-type-reference.ts index 7a3287af76d..996e3ee763e 100644 --- a/packages/cli/fern-definition/validator/src/rules/no-undefined-type-reference/no-undefined-type-reference.ts +++ b/packages/cli/fern-definition/validator/src/rules/no-undefined-type-reference/no-undefined-type-reference.ts @@ -83,6 +83,8 @@ export const NoUndefinedTypeReferenceRule: Rule = { if (parsedBytesType != null) { if (location === TypeReferenceLocation.RequestReference) { return []; + } if (location === TypeReferenceLocation.Response) { + return []; } else { return [ { diff --git a/packages/generators/docker/cache_heavy_deps.sh b/packages/generators/docker/cache_heavy_deps.sh index 408eb591150..2a71388b9ef 100644 --- a/packages/generators/docker/cache_heavy_deps.sh +++ b/packages/generators/docker/cache_heavy_deps.sh @@ -21,7 +21,7 @@ yarn add \ js-base64@3.7.2" node-fetch@2.7.0 \ prettier@2.7.1 \ - qs@6.11.2 \ + qs@6.13.0 \ ts-jest@29.1.1 \ typescript@4.6.4" \ url-join@4.0.1 diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6a7a17c668d..e1208bd7c9a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1399,8 +1399,8 @@ importers: specifier: workspace:* version: link:../../../packages/commons/core-utils '@fern-fern/ir-sdk': - specifier: 53.23.0 - version: 53.23.0 + specifier: 54.0.0 + version: 54.0.0 '@types/jest': specifier: ^29.5.12 version: 29.5.12 @@ -1432,8 +1432,8 @@ importers: specifier: ^0.0.898 version: 0.0.898 '@fern-fern/ir-sdk': - specifier: 53.23.0 - version: 53.23.0 + specifier: 54.0.0 + version: 54.0.0 '@fern-typescript/abstract-generator-cli': specifier: workspace:* version: link:../../utils/abstract-generator-cli @@ -1498,8 +1498,8 @@ importers: specifier: workspace:* version: link:../../../../packages/commons/core-utils '@fern-fern/ir-sdk': - specifier: 53.23.0 - version: 53.23.0 + specifier: 54.0.0 + version: 54.0.0 '@fern-typescript/abstract-schema-generator': specifier: workspace:* version: link:../../utils/abstract-schema-generator @@ -1541,8 +1541,8 @@ importers: generators/typescript/express/express-error-generator: dependencies: '@fern-fern/ir-sdk': - specifier: 53.23.0 - version: 53.23.0 + specifier: 54.0.0 + version: 54.0.0 '@fern-typescript/abstract-error-class-generator': specifier: workspace:* version: link:../../utils/abstract-error-class-generator @@ -1587,8 +1587,8 @@ importers: specifier: workspace:* version: link:../../../../packages/commons/core-utils '@fern-fern/ir-sdk': - specifier: 53.23.0 - version: 53.23.0 + specifier: 54.0.0 + version: 54.0.0 '@fern-typescript/abstract-schema-generator': specifier: workspace:* version: link:../../utils/abstract-schema-generator @@ -1630,8 +1630,8 @@ importers: generators/typescript/express/express-inlined-request-body-generator: dependencies: '@fern-fern/ir-sdk': - specifier: 53.23.0 - version: 53.23.0 + specifier: 54.0.0 + version: 54.0.0 '@fern-typescript/commons': specifier: workspace:* version: link:../../utils/commons @@ -1667,8 +1667,8 @@ importers: generators/typescript/express/express-inlined-request-body-schema-generator: dependencies: '@fern-fern/ir-sdk': - specifier: 53.23.0 - version: 53.23.0 + specifier: 54.0.0 + version: 54.0.0 '@fern-typescript/abstract-schema-generator': specifier: workspace:* version: link:../../utils/abstract-schema-generator @@ -1710,8 +1710,8 @@ importers: generators/typescript/express/express-register-generator: dependencies: '@fern-fern/ir-sdk': - specifier: 53.23.0 - version: 53.23.0 + specifier: 54.0.0 + version: 54.0.0 '@fern-typescript/commons': specifier: workspace:* version: link:../../utils/commons @@ -1759,8 +1759,8 @@ importers: generators/typescript/express/express-service-generator: dependencies: '@fern-fern/ir-sdk': - specifier: 53.23.0 - version: 53.23.0 + specifier: 54.0.0 + version: 54.0.0 '@fern-typescript/commons': specifier: workspace:* version: link:../../utils/commons @@ -1811,8 +1811,8 @@ importers: specifier: workspace:* version: link:../../../../packages/cli/logger '@fern-fern/ir-sdk': - specifier: 53.23.0 - version: 53.23.0 + specifier: 54.0.0 + version: 54.0.0 '@fern-typescript/commons': specifier: workspace:* version: link:../../utils/commons @@ -1930,8 +1930,8 @@ importers: generators/typescript/model/type-generator: dependencies: '@fern-fern/ir-sdk': - specifier: 53.23.0 - version: 53.23.0 + specifier: 54.0.0 + version: 54.0.0 '@fern-typescript/commons': specifier: workspace:* version: link:../../utils/commons @@ -1976,8 +1976,8 @@ importers: specifier: workspace:* version: link:../../../../packages/commons/core-utils '@fern-fern/ir-sdk': - specifier: 53.23.0 - version: 53.23.0 + specifier: 54.0.0 + version: 54.0.0 '@fern-typescript/commons': specifier: workspace:* version: link:../../utils/commons @@ -2019,8 +2019,8 @@ importers: specifier: workspace:* version: link:../../../../packages/commons/core-utils '@fern-fern/ir-sdk': - specifier: 53.23.0 - version: 53.23.0 + specifier: 54.0.0 + version: 54.0.0 '@fern-typescript/commons': specifier: workspace:* version: link:../../utils/commons @@ -2059,8 +2059,8 @@ importers: generators/typescript/model/type-schema-generator: dependencies: '@fern-fern/ir-sdk': - specifier: 53.23.0 - version: 53.23.0 + specifier: 54.0.0 + version: 54.0.0 '@fern-typescript/abstract-schema-generator': specifier: workspace:* version: link:../../utils/abstract-schema-generator @@ -2108,8 +2108,8 @@ importers: specifier: workspace:* version: link:../../../../packages/commons/core-utils '@fern-fern/ir-sdk': - specifier: 53.23.0 - version: 53.23.0 + specifier: 54.0.0 + version: 54.0.0 '@fern-typescript/commons': specifier: workspace:* version: link:../../utils/commons @@ -2148,8 +2148,8 @@ importers: generators/typescript/model/union-schema-generator: dependencies: '@fern-fern/ir-sdk': - specifier: 53.23.0 - version: 53.23.0 + specifier: 54.0.0 + version: 54.0.0 '@fern-typescript/abstract-schema-generator': specifier: workspace:* version: link:../../utils/abstract-schema-generator @@ -2273,8 +2273,8 @@ importers: specifier: workspace:* version: link:../../../../packages/commons/fs-utils '@fern-fern/ir-sdk': - specifier: 53.23.0 - version: 53.23.0 + specifier: 54.0.0 + version: 54.0.0 '@fern-typescript/abstract-generator-cli': specifier: workspace:* version: link:../../utils/abstract-generator-cli @@ -2339,8 +2339,8 @@ importers: specifier: workspace:* version: link:../../../../packages/commons/core-utils '@fern-fern/ir-sdk': - specifier: 53.23.0 - version: 53.23.0 + specifier: 54.0.0 + version: 54.0.0 '@fern-typescript/commons': specifier: workspace:* version: link:../../utils/commons @@ -2385,8 +2385,8 @@ importers: generators/typescript/sdk/endpoint-error-union-generator: dependencies: '@fern-fern/ir-sdk': - specifier: 53.23.0 - version: 53.23.0 + specifier: 54.0.0 + version: 54.0.0 '@fern-typescript/commons': specifier: workspace:* version: link:../../utils/commons @@ -2431,8 +2431,8 @@ importers: generators/typescript/sdk/environments-generator: dependencies: '@fern-fern/ir-sdk': - specifier: 53.23.0 - version: 53.23.0 + specifier: 54.0.0 + version: 54.0.0 '@fern-typescript/commons': specifier: workspace:* version: link:../../utils/commons @@ -2492,8 +2492,8 @@ importers: specifier: ^0.0.898 version: 0.0.898 '@fern-fern/ir-sdk': - specifier: 53.23.0 - version: 53.23.0 + specifier: 54.0.0 + version: 54.0.0 '@fern-fern/snippet-sdk': specifier: ^0.0.5526 version: 0.0.5526 @@ -2641,8 +2641,8 @@ importers: specifier: workspace:* version: link:../../../../packages/commons/core-utils '@fern-fern/ir-sdk': - specifier: 53.23.0 - version: 53.23.0 + specifier: 54.0.0 + version: 54.0.0 '@fern-typescript/commons': specifier: workspace:* version: link:../../utils/commons @@ -2684,8 +2684,8 @@ importers: specifier: workspace:* version: link:../../../../packages/commons/core-utils '@fern-fern/ir-sdk': - specifier: 53.23.0 - version: 53.23.0 + specifier: 54.0.0 + version: 54.0.0 '@fern-typescript/abstract-schema-generator': specifier: workspace:* version: link:../../utils/abstract-schema-generator @@ -2733,8 +2733,8 @@ importers: generators/typescript/sdk/sdk-error-generator: dependencies: '@fern-fern/ir-sdk': - specifier: 53.23.0 - version: 53.23.0 + specifier: 54.0.0 + version: 54.0.0 '@fern-typescript/abstract-error-class-generator': specifier: workspace:* version: link:../../utils/abstract-error-class-generator @@ -2779,8 +2779,8 @@ importers: specifier: workspace:* version: link:../../../../packages/commons/core-utils '@fern-fern/ir-sdk': - specifier: 53.23.0 - version: 53.23.0 + specifier: 54.0.0 + version: 54.0.0 '@fern-typescript/abstract-schema-generator': specifier: workspace:* version: link:../../utils/abstract-schema-generator @@ -2822,8 +2822,8 @@ importers: generators/typescript/sdk/sdk-inlined-request-body-schema-generator: dependencies: '@fern-fern/ir-sdk': - specifier: 53.23.0 - version: 53.23.0 + specifier: 54.0.0 + version: 54.0.0 '@fern-typescript/abstract-schema-generator': specifier: workspace:* version: link:../../utils/abstract-schema-generator @@ -2914,8 +2914,8 @@ importers: specifier: ^0.0.898 version: 0.0.898 '@fern-fern/ir-sdk': - specifier: 53.23.0 - version: 53.23.0 + specifier: 54.0.0 + version: 54.0.0 '@fern-typescript/commons': specifier: workspace:* version: link:../commons @@ -3000,8 +3000,8 @@ importers: specifier: workspace:* version: link:../../../../packages/commons/logging-execa '@fern-fern/ir-sdk': - specifier: 53.23.0 - version: 53.23.0 + specifier: 54.0.0 + version: 54.0.0 '@fern-typescript/fetcher': specifier: workspace:* version: link:../core-utilities/fetcher @@ -3094,8 +3094,8 @@ importers: specifier: ^0.0.898 version: 0.0.898 '@fern-fern/ir-sdk': - specifier: 53.23.0 - version: 53.23.0 + specifier: 54.0.0 + version: 54.0.0 '@fern-typescript/commons': specifier: workspace:* version: link:../commons @@ -3370,8 +3370,8 @@ importers: generators/typescript/utils/resolvers: dependencies: '@fern-fern/ir-sdk': - specifier: 53.23.0 - version: 53.23.0 + specifier: 54.0.0 + version: 54.0.0 '@fern-typescript/commons': specifier: workspace:* version: link:../commons @@ -8095,6 +8095,9 @@ packages: '@fern-fern/ir-sdk@53.9.0': resolution: {integrity: sha512-WAXXL+XVnDO4a3nfZRbRTr0+xz88jIYEZYTbJ7sYWLS7DLjmU780EFMMwO8ySmCdI0R2yRfeSY0qaGvuomXg6g==} + '@fern-fern/ir-sdk@54.0.0': + resolution: {integrity: sha512-omYUHDO0fq75JXnP20BstK7N/mDrtfS1aWeid/AD+dUsuQaPFNxKskTSZ6XAomcpwcIL+OsanZ3UXUiYMXh0HQ==} + '@fern-fern/ir-v1-model@0.0.2': resolution: {integrity: sha512-Rho6qXYfRoB1sAISFS4V7vttVFN0ypoaztmbfKKNFmSTNVOyLN++e2xNZ+Aw9ckE5ZZmfMXK9v4+dnFReWVzvA==} @@ -15320,6 +15323,8 @@ snapshots: '@fern-fern/ir-sdk@53.9.0': {} + '@fern-fern/ir-sdk@54.0.0': {} + '@fern-fern/ir-v1-model@0.0.2': {} '@fern-fern/ir-v10-model@0.0.1': {} diff --git a/seed/java-sdk/inline-types/build/reports/problems/problems-report.html b/seed/java-sdk/inline-types/build/reports/problems/problems-report.html new file mode 100644 index 00000000000..37cf709aaf8 --- /dev/null +++ b/seed/java-sdk/inline-types/build/reports/problems/problems-report.html @@ -0,0 +1,663 @@ + + + + + + + + + + + + + Gradle Configuration Cache + + + +
+ +
+ Loading... +
+ + + + + + diff --git a/seed/ts-sdk/bytes/.mock/definition/service.yml b/seed/ts-sdk/bytes/.mock/definition/service.yml index b0610fa616c..711358d8f3a 100644 --- a/seed/ts-sdk/bytes/.mock/definition/service.yml +++ b/seed/ts-sdk/bytes/.mock/definition/service.yml @@ -8,3 +8,9 @@ service: request: content-type: "application/octet-stream" body: bytes + + download: + path: /download-content + method: GET + response: + type: bytes \ No newline at end of file diff --git a/seed/ts-sdk/bytes/package.json b/seed/ts-sdk/bytes/package.json index 2541c16bae8..7ae58a0efeb 100644 --- a/seed/ts-sdk/bytes/package.json +++ b/seed/ts-sdk/bytes/package.json @@ -16,7 +16,7 @@ "form-data": "^4.0.0", "formdata-node": "^6.0.3", "node-fetch": "2.7.0", - "qs": "6.11.2", + "qs": "6.13.0", "readable-stream": "^4.5.2" }, "devDependencies": { diff --git a/seed/ts-sdk/bytes/snippet-templates.json b/seed/ts-sdk/bytes/snippet-templates.json index 74803250f18..48166f6e2fb 100644 --- a/seed/ts-sdk/bytes/snippet-templates.json +++ b/seed/ts-sdk/bytes/snippet-templates.json @@ -53,5 +53,60 @@ }, "type": "v1" } + }, + { + "sdk": { + "package": "@fern/bytes", + "version": "0.0.1", + "type": "typescript" + }, + "endpointId": { + "path": "/download-content", + "method": "GET", + "identifierOverride": "endpoint_service.download" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "import { SeedBytesClient } from \"@fern/bytes\";" + ], + "templateString": "const client = new SeedBytesClient($FERN_INPUT);", + "isOptional": false, + "inputDelimiter": ",", + "templateInputs": [ + { + "value": { + "imports": [], + "templateString": "{ $FERN_INPUT }", + "isOptional": true, + "templateInputs": [ + { + "value": { + "imports": [], + "templateString": "environment: \"YOUR_BASE_URL\"", + "isOptional": false, + "templateInputs": [], + "type": "generic" + }, + "type": "template" + } + ], + "type": "generic" + }, + "type": "template" + } + ], + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "templateString": "await client.service.download()", + "isOptional": false, + "inputDelimiter": ",\n\t", + "templateInputs": [], + "type": "generic" + }, + "type": "v1" + } } ] \ No newline at end of file diff --git a/seed/ts-sdk/bytes/src/api/resources/service/client/Client.ts b/seed/ts-sdk/bytes/src/api/resources/service/client/Client.ts index cdc74d76137..9e0a5fe9d1f 100644 --- a/seed/ts-sdk/bytes/src/api/resources/service/client/Client.ts +++ b/seed/ts-sdk/bytes/src/api/resources/service/client/Client.ts @@ -78,4 +78,53 @@ export class Service { }); } } + + /** + * @param {Service.RequestOptions} requestOptions - Request-specific configuration. + */ + public async download(requestOptions?: Service.RequestOptions): Promise { + const _response = await core.fetcher({ + url: urlJoin(await core.Supplier.get(this._options.environment), "download-content"), + method: "GET", + headers: { + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "@fern/bytes", + "X-Fern-SDK-Version": "0.0.1", + "User-Agent": "@fern/bytes/0.0.1", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + responseType: "arrayBuffer", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return _response.body as string; + } + + if (_response.error.reason === "status-code") { + throw new errors.SeedBytesError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.SeedBytesError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.SeedBytesTimeoutError("Timeout exceeded when calling GET /download-content."); + case "unknown": + throw new errors.SeedBytesError({ + message: _response.error.errorMessage, + }); + } + } } diff --git a/seed/ts-sdk/seed.yml b/seed/ts-sdk/seed.yml index 81f9d58eb26..4d639d48e32 100644 --- a/seed/ts-sdk/seed.yml +++ b/seed/ts-sdk/seed.yml @@ -1,4 +1,4 @@ -irVersion: v53 +irVersion: v54 displayName: TypeScript SDK image: fernapi/fern-typescript-node-sdk publish: diff --git a/test-definitions/fern/apis/bytes/definition/service.yml b/test-definitions/fern/apis/bytes/definition/service.yml index b0610fa616c..711358d8f3a 100644 --- a/test-definitions/fern/apis/bytes/definition/service.yml +++ b/test-definitions/fern/apis/bytes/definition/service.yml @@ -8,3 +8,9 @@ service: request: content-type: "application/octet-stream" body: bytes + + download: + path: /download-content + method: GET + response: + type: bytes \ No newline at end of file