diff --git a/packages/cli/cli/versions.yml b/packages/cli/cli/versions.yml index f4529e4b6dd..2266dd71481 100644 --- a/packages/cli/cli/versions.yml +++ b/packages/cli/cli/versions.yml @@ -1,3 +1,58 @@ +- changelogEntry: + - summary: | + Adds availability to inlined properties for HTTP Requests, Webhooks, and WebSockets for Fern Definition and OpenAPI. + You can add availability like so: + + Fern Definition: + + ```yml + Request: + name: InlineRequest + properties: + random: + type: string + availability: pre-release + ``` + + OpenAPI: + + ```yml + requestBody: + content: + application/json: + schema: + type: object + properties: + random: + type: string + x-fern-availability: beta + ``` + type: feat + irVersion: 53 + version: 0.41.12 + +- changelogEntry: + - summary: | + Adds availability and display-names to discriminated union values. Now, in your docs, you can mark your union values + with custom names and show their availability. You can do so by adding the following to your API definition: + ```yml + MyUnionType: + union: + UnionValue1: + docs: The first union value + type: string + display-name: Union Value One + availability: beta + UnionValue2: + docs: The second union value + type: integer + display-name: Union Value Two + availability: deprecated + ``` + type: feat + irVersion: 53 + version: 0.41.11 + - changelogEntry: - summary: | Adds availability and display-names to discriminated union values. Now, in your docs, you can mark your union values diff --git a/packages/cli/ete-tests/src/tests/dependencies/__snapshots__/dependencies.test.ts.snap b/packages/cli/ete-tests/src/tests/dependencies/__snapshots__/dependencies.test.ts.snap index abd865102cb..2c586b4e406 100644 --- a/packages/cli/ete-tests/src/tests/dependencies/__snapshots__/dependencies.test.ts.snap +++ b/packages/cli/ete-tests/src/tests/dependencies/__snapshots__/dependencies.test.ts.snap @@ -872,4 +872,4 @@ exports[`dependencies > correctly incorporates dependencies 1`] = ` }" `; -exports[`dependencies > file dependencies 1`] = `3086104`; +exports[`dependencies > file dependencies 1`] = `3086374`; diff --git a/packages/cli/ete-tests/src/tests/ir/__snapshots__/ir.test.ts.snap b/packages/cli/ete-tests/src/tests/ir/__snapshots__/ir.test.ts.snap index 36a2379dc03..c20e47747fe 100644 --- a/packages/cli/ete-tests/src/tests/ir/__snapshots__/ir.test.ts.snap +++ b/packages/cli/ete-tests/src/tests/ir/__snapshots__/ir.test.ts.snap @@ -1547,6 +1547,7 @@ exports[`ir > {"name":"file-upload"} 1`] = ` } } }, + "availability": null, "docs": null }, { @@ -1642,6 +1643,7 @@ exports[`ir > {"name":"file-upload"} 1`] = ` } } }, + "availability": null, "docs": null } ] @@ -35094,6 +35096,7 @@ exports[`ir > {"name":"streaming"} 1`] = ` "v2": null } }, + "availability": null, "docs": null } ], @@ -36792,6 +36795,7 @@ exports[`ir > {"name":"webhooks"} 1`] = ` } } }, + "availability": null, "docs": null }, { @@ -36824,6 +36828,7 @@ exports[`ir > {"name":"webhooks"} 1`] = ` "v2": null } }, + "availability": null, "docs": "Some docs about urgency" } ] diff --git a/packages/cli/fern-definition/schema/src/utils/parseFileUploadRequest.ts b/packages/cli/fern-definition/schema/src/utils/parseFileUploadRequest.ts index da1b6bf009c..6a1a880de21 100644 --- a/packages/cli/fern-definition/schema/src/utils/parseFileUploadRequest.ts +++ b/packages/cli/fern-definition/schema/src/utils/parseFileUploadRequest.ts @@ -1,5 +1,10 @@ import { MediaType } from "@fern-api/core-utils"; -import { HttpInlineRequestBodySchema, HttpRequestSchema, ObjectPropertySchema } from "../schemas"; +import { + AvailabilityUnionSchema, + HttpInlineRequestBodySchema, + HttpRequestSchema, + ObjectPropertySchema +} from "../schemas"; import { isInlineRequestBody } from "./isInlineRequestBody"; import { parseRawFileType } from "./parseRawFileType"; @@ -25,6 +30,7 @@ export declare namespace RawFileUploadRequest { export interface BaseProperty { docs: string | undefined; + availability?: AvailabilityUnionSchema | undefined; key: string; } } diff --git a/packages/cli/generation/ir-generator/src/__test__/fixtures/availability/fern/definition/api.yml b/packages/cli/generation/ir-generator/src/__test__/fixtures/availability/fern/definition/api.yml new file mode 100644 index 00000000000..54fb10864e1 --- /dev/null +++ b/packages/cli/generation/ir-generator/src/__test__/fixtures/availability/fern/definition/api.yml @@ -0,0 +1 @@ +name: availability \ No newline at end of file diff --git a/packages/cli/generation/ir-generator/src/__test__/fixtures/availability/fern/definition/service.yml b/packages/cli/generation/ir-generator/src/__test__/fixtures/availability/fern/definition/service.yml new file mode 100644 index 00000000000..f82b7fded95 --- /dev/null +++ b/packages/cli/generation/ir-generator/src/__test__/fixtures/availability/fern/definition/service.yml @@ -0,0 +1,24 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json + +service: + auth: false + base-path: "" + endpoints: + test-availability: + path: /test-availability + method: POST + request: + name: RequestObject + body: + properties: + random: + type: string + availability: pre-release + response: string + +types: + Object: + properties: + id: + type: string + availability: pre-release diff --git a/packages/cli/generation/ir-generator/src/__test__/fixtures/availability/fern/generators.yml b/packages/cli/generation/ir-generator/src/__test__/fixtures/availability/fern/generators.yml new file mode 100644 index 00000000000..0967ef424bc --- /dev/null +++ b/packages/cli/generation/ir-generator/src/__test__/fixtures/availability/fern/generators.yml @@ -0,0 +1 @@ +{} 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 a1f07c58fcb..01cfb9556b6 100644 --- a/packages/cli/generation/ir-generator/src/__test__/generateIntermediateRepresentation.test.ts +++ b/packages/cli/generation/ir-generator/src/__test__/generateIntermediateRepresentation.test.ts @@ -121,3 +121,13 @@ it("generics", async () => { workspaceName: "generics" }); }, 200_000); + +it("availability", async () => { + const AVAILABILITY_DIR = path.join(__dirname, "fixtures/availability/fern"); + await generateAndSnapshotIRFromPath({ + absolutePathToIr: AbsoluteFilePath.of(IR_DIR), + absolutePathToWorkspace: AbsoluteFilePath.of(AVAILABILITY_DIR), + audiences: { type: "all" }, + workspaceName: "availability" + }); +}, 200_000); diff --git a/packages/cli/generation/ir-generator/src/__test__/irs/availability.json b/packages/cli/generation/ir-generator/src/__test__/irs/availability.json new file mode 100644 index 00000000000..c5bd878e36d --- /dev/null +++ b/packages/cli/generation/ir-generator/src/__test__/irs/availability.json @@ -0,0 +1,650 @@ +{ + "fdrApiDefinitionId": null, + "apiVersion": null, + "apiName": { + "originalName": "availability", + "camelCase": { + "unsafeName": "availability", + "safeName": "availability" + }, + "snakeCase": { + "unsafeName": "availability", + "safeName": "availability" + }, + "screamingSnakeCase": { + "unsafeName": "AVAILABILITY", + "safeName": "AVAILABILITY" + }, + "pascalCase": { + "unsafeName": "Availability", + "safeName": "Availability" + } + }, + "apiDisplayName": null, + "apiDocs": null, + "auth": { + "requirement": "ALL", + "schemes": [], + "docs": null + }, + "headers": [], + "idempotencyHeaders": [], + "types": { + "type_service:Object": { + "name": { + "name": { + "originalName": "Object", + "camelCase": { + "unsafeName": "object", + "safeName": "object" + }, + "snakeCase": { + "unsafeName": "object", + "safeName": "object" + }, + "screamingSnakeCase": { + "unsafeName": "OBJECT", + "safeName": "OBJECT" + }, + "pascalCase": { + "unsafeName": "Object", + "safeName": "Object" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + ], + "packagePath": [], + "file": { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + }, + "typeId": "type_service:Object" + }, + "shape": { + "_type": "object", + "extends": [], + "properties": [ + { + "name": { + "name": { + "originalName": "id", + "camelCase": { + "unsafeName": "id", + "safeName": "id" + }, + "snakeCase": { + "unsafeName": "id", + "safeName": "id" + }, + "screamingSnakeCase": { + "unsafeName": "ID", + "safeName": "ID" + }, + "pascalCase": { + "unsafeName": "ID", + "safeName": "ID" + } + }, + "wireValue": "id" + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + }, + "availability": { + "status": "PRE_RELEASE", + "message": null + }, + "docs": null + } + ], + "extra-properties": false, + "extendedProperties": [] + }, + "referencedTypes": [], + "encoding": { + "json": {}, + "proto": null + }, + "source": null, + "userProvidedExamples": [], + "autogeneratedExamples": [], + "availability": null, + "docs": null + } + }, + "errors": {}, + "services": { + "service_service": { + "availability": null, + "name": { + "fernFilepath": { + "allParts": [ + { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + ], + "packagePath": [], + "file": { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + } + }, + "displayName": null, + "basePath": { + "head": "", + "parts": [] + }, + "headers": [], + "pathParameters": [], + "encoding": { + "json": {}, + "proto": null + }, + "transport": { + "type": "http" + }, + "endpoints": [ + { + "id": "endpoint_service.test-availability", + "name": { + "originalName": "test-availability", + "camelCase": { + "unsafeName": "testAvailability", + "safeName": "testAvailability" + }, + "snakeCase": { + "unsafeName": "test_availability", + "safeName": "test_availability" + }, + "screamingSnakeCase": { + "unsafeName": "TEST_AVAILABILITY", + "safeName": "TEST_AVAILABILITY" + }, + "pascalCase": { + "unsafeName": "TestAvailability", + "safeName": "TestAvailability" + } + }, + "displayName": null, + "auth": false, + "idempotent": false, + "baseUrl": null, + "method": "POST", + "path": { + "head": "/test-availability", + "parts": [] + }, + "fullPath": { + "head": "test-availability", + "parts": [] + }, + "pathParameters": [], + "allPathParameters": [], + "queryParameters": [], + "headers": [], + "requestBody": { + "type": "inlinedRequestBody", + "name": { + "originalName": "RequestObject", + "camelCase": { + "unsafeName": "requestObject", + "safeName": "requestObject" + }, + "snakeCase": { + "unsafeName": "request_object", + "safeName": "request_object" + }, + "screamingSnakeCase": { + "unsafeName": "REQUEST_OBJECT", + "safeName": "REQUEST_OBJECT" + }, + "pascalCase": { + "unsafeName": "RequestObject", + "safeName": "RequestObject" + } + }, + "extends": [], + "contentType": null, + "properties": [ + { + "name": { + "name": { + "originalName": "random", + "camelCase": { + "unsafeName": "random", + "safeName": "random" + }, + "snakeCase": { + "unsafeName": "random", + "safeName": "random" + }, + "screamingSnakeCase": { + "unsafeName": "RANDOM", + "safeName": "RANDOM" + }, + "pascalCase": { + "unsafeName": "Random", + "safeName": "Random" + } + }, + "wireValue": "random" + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + }, + "availability": { + "status": "PRE_RELEASE", + "message": null + }, + "docs": null + } + ], + "extra-properties": false, + "extendedProperties": [] + }, + "sdkRequest": { + "shape": { + "type": "wrapper", + "wrapperName": { + "originalName": "RequestObject", + "camelCase": { + "unsafeName": "requestObject", + "safeName": "requestObject" + }, + "snakeCase": { + "unsafeName": "request_object", + "safeName": "request_object" + }, + "screamingSnakeCase": { + "unsafeName": "REQUEST_OBJECT", + "safeName": "REQUEST_OBJECT" + }, + "pascalCase": { + "unsafeName": "RequestObject", + "safeName": "RequestObject" + } + }, + "bodyKey": { + "originalName": "body", + "camelCase": { + "unsafeName": "body", + "safeName": "body" + }, + "snakeCase": { + "unsafeName": "body", + "safeName": "body" + }, + "screamingSnakeCase": { + "unsafeName": "BODY", + "safeName": "BODY" + }, + "pascalCase": { + "unsafeName": "Body", + "safeName": "Body" + } + } + }, + "requestParameterName": { + "originalName": "request", + "camelCase": { + "unsafeName": "request", + "safeName": "request" + }, + "snakeCase": { + "unsafeName": "request", + "safeName": "request" + }, + "screamingSnakeCase": { + "unsafeName": "REQUEST", + "safeName": "REQUEST" + }, + "pascalCase": { + "unsafeName": "Request", + "safeName": "Request" + } + }, + "streamParameter": null + }, + "response": { + "body": { + "type": "json", + "value": { + "type": "response", + "responseBodyType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + }, + "docs": null + } + }, + "status-code": null + }, + "errors": [], + "userSpecifiedExamples": [], + "autogeneratedExamples": [ + { + "example": { + "url": "/test-availability", + "rootPathParameters": [], + "servicePathParameters": [], + "endpointPathParameters": [], + "serviceHeaders": [], + "endpointHeaders": [], + "queryParameters": [], + "request": { + "type": "inlinedRequestBody", + "properties": [ + { + "name": { + "name": { + "originalName": "random", + "camelCase": { + "unsafeName": "random", + "safeName": "random" + }, + "snakeCase": { + "unsafeName": "random", + "safeName": "random" + }, + "screamingSnakeCase": { + "unsafeName": "RANDOM", + "safeName": "RANDOM" + }, + "pascalCase": { + "unsafeName": "Random", + "safeName": "Random" + } + }, + "wireValue": "random" + }, + "value": { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "string" + } + } + }, + "jsonExample": "string" + }, + "originalTypeDeclaration": null + } + ], + "jsonExample": { + "random": "string" + } + }, + "name": null, + "response": { + "type": "ok", + "value": { + "type": "body", + "value": { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "string" + } + } + }, + "jsonExample": "string" + } + } + }, + "id": "36fa4882356ab91b377f40dd400bcc40ea721106", + "docs": null + } + } + ], + "pagination": null, + "availability": null, + "docs": null + } + ] + } + }, + "constants": { + "errorInstanceIdKey": { + "name": { + "originalName": "errorInstanceId", + "camelCase": { + "unsafeName": "errorInstanceID", + "safeName": "errorInstanceID" + }, + "snakeCase": { + "unsafeName": "error_instance_id", + "safeName": "error_instance_id" + }, + "screamingSnakeCase": { + "unsafeName": "ERROR_INSTANCE_ID", + "safeName": "ERROR_INSTANCE_ID" + }, + "pascalCase": { + "unsafeName": "ErrorInstanceID", + "safeName": "ErrorInstanceID" + } + }, + "wireValue": "errorInstanceId" + } + }, + "environments": null, + "errorDiscriminationStrategy": { + "type": "statusCode" + }, + "basePath": null, + "pathParameters": [], + "variables": [], + "serviceTypeReferenceInfo": { + "typesReferencedOnlyByService": {}, + "sharedTypes": [ + "type_service:Object" + ] + }, + "webhookGroups": {}, + "websocketChannels": {}, + "readmeConfig": null, + "sourceConfig": null, + "publishConfig": null, + "subpackages": { + "subpackage_service": { + "name": { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + ], + "packagePath": [], + "file": { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + }, + "service": "service_service", + "types": [ + "type_service:Object" + ], + "errors": [], + "subpackages": [], + "navigationConfig": null, + "webhooks": null, + "websocket": null, + "hasEndpointsInTree": true, + "docs": null + } + }, + "rootPackage": { + "fernFilepath": { + "allParts": [], + "packagePath": [], + "file": null + }, + "websocket": null, + "service": null, + "types": [], + "errors": [], + "subpackages": [ + "subpackage_service" + ], + "webhooks": null, + "navigationConfig": null, + "hasEndpointsInTree": true, + "docs": null + }, + "sdkConfig": { + "isAuthMandatory": false, + "hasStreamingEndpoints": false, + "hasPaginatedEndpoints": false, + "hasFileDownloadEndpoints": false, + "platformHeaders": { + "language": "X-Fern-Language", + "sdkName": "X-Fern-SDK-Name", + "sdkVersion": "X-Fern-SDK-Version", + "userAgent": null + } + } +} \ No newline at end of file diff --git a/packages/cli/generation/ir-generator/src/__test__/test-definitions/alias-extends.json b/packages/cli/generation/ir-generator/src/__test__/test-definitions/alias-extends.json index cff163b0220..a84036e41e7 100644 --- a/packages/cli/generation/ir-generator/src/__test__/test-definitions/alias-extends.json +++ b/packages/cli/generation/ir-generator/src/__test__/test-definitions/alias-extends.json @@ -906,6 +906,7 @@ } } }, + "availability": null, "docs": null } ], diff --git a/packages/cli/generation/ir-generator/src/__test__/test-definitions/any-auth.json b/packages/cli/generation/ir-generator/src/__test__/test-definitions/any-auth.json index e694e951792..a6163f03884 100644 --- a/packages/cli/generation/ir-generator/src/__test__/test-definitions/any-auth.json +++ b/packages/cli/generation/ir-generator/src/__test__/test-definitions/any-auth.json @@ -803,6 +803,7 @@ } } }, + "availability": null, "docs": null }, { @@ -839,6 +840,7 @@ } } }, + "availability": null, "docs": null }, { @@ -874,6 +876,7 @@ } } }, + "availability": null, "docs": null }, { @@ -909,6 +912,7 @@ } } }, + "availability": null, "docs": null }, { @@ -951,6 +955,7 @@ } } }, + "availability": null, "docs": null } ], diff --git a/packages/cli/generation/ir-generator/src/__test__/test-definitions/audiences.json b/packages/cli/generation/ir-generator/src/__test__/test-definitions/audiences.json index 5ea8f3c1658..24f165daaad 100644 --- a/packages/cli/generation/ir-generator/src/__test__/test-definitions/audiences.json +++ b/packages/cli/generation/ir-generator/src/__test__/test-definitions/audiences.json @@ -3528,6 +3528,7 @@ } } }, + "availability": null, "docs": null }, { @@ -3570,6 +3571,7 @@ } } }, + "availability": null, "docs": null } ], diff --git a/packages/cli/generation/ir-generator/src/__test__/test-definitions/availability.json b/packages/cli/generation/ir-generator/src/__test__/test-definitions/availability.json new file mode 100644 index 00000000000..c5bd878e36d --- /dev/null +++ b/packages/cli/generation/ir-generator/src/__test__/test-definitions/availability.json @@ -0,0 +1,650 @@ +{ + "fdrApiDefinitionId": null, + "apiVersion": null, + "apiName": { + "originalName": "availability", + "camelCase": { + "unsafeName": "availability", + "safeName": "availability" + }, + "snakeCase": { + "unsafeName": "availability", + "safeName": "availability" + }, + "screamingSnakeCase": { + "unsafeName": "AVAILABILITY", + "safeName": "AVAILABILITY" + }, + "pascalCase": { + "unsafeName": "Availability", + "safeName": "Availability" + } + }, + "apiDisplayName": null, + "apiDocs": null, + "auth": { + "requirement": "ALL", + "schemes": [], + "docs": null + }, + "headers": [], + "idempotencyHeaders": [], + "types": { + "type_service:Object": { + "name": { + "name": { + "originalName": "Object", + "camelCase": { + "unsafeName": "object", + "safeName": "object" + }, + "snakeCase": { + "unsafeName": "object", + "safeName": "object" + }, + "screamingSnakeCase": { + "unsafeName": "OBJECT", + "safeName": "OBJECT" + }, + "pascalCase": { + "unsafeName": "Object", + "safeName": "Object" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + ], + "packagePath": [], + "file": { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + }, + "typeId": "type_service:Object" + }, + "shape": { + "_type": "object", + "extends": [], + "properties": [ + { + "name": { + "name": { + "originalName": "id", + "camelCase": { + "unsafeName": "id", + "safeName": "id" + }, + "snakeCase": { + "unsafeName": "id", + "safeName": "id" + }, + "screamingSnakeCase": { + "unsafeName": "ID", + "safeName": "ID" + }, + "pascalCase": { + "unsafeName": "ID", + "safeName": "ID" + } + }, + "wireValue": "id" + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + }, + "availability": { + "status": "PRE_RELEASE", + "message": null + }, + "docs": null + } + ], + "extra-properties": false, + "extendedProperties": [] + }, + "referencedTypes": [], + "encoding": { + "json": {}, + "proto": null + }, + "source": null, + "userProvidedExamples": [], + "autogeneratedExamples": [], + "availability": null, + "docs": null + } + }, + "errors": {}, + "services": { + "service_service": { + "availability": null, + "name": { + "fernFilepath": { + "allParts": [ + { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + ], + "packagePath": [], + "file": { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + } + }, + "displayName": null, + "basePath": { + "head": "", + "parts": [] + }, + "headers": [], + "pathParameters": [], + "encoding": { + "json": {}, + "proto": null + }, + "transport": { + "type": "http" + }, + "endpoints": [ + { + "id": "endpoint_service.test-availability", + "name": { + "originalName": "test-availability", + "camelCase": { + "unsafeName": "testAvailability", + "safeName": "testAvailability" + }, + "snakeCase": { + "unsafeName": "test_availability", + "safeName": "test_availability" + }, + "screamingSnakeCase": { + "unsafeName": "TEST_AVAILABILITY", + "safeName": "TEST_AVAILABILITY" + }, + "pascalCase": { + "unsafeName": "TestAvailability", + "safeName": "TestAvailability" + } + }, + "displayName": null, + "auth": false, + "idempotent": false, + "baseUrl": null, + "method": "POST", + "path": { + "head": "/test-availability", + "parts": [] + }, + "fullPath": { + "head": "test-availability", + "parts": [] + }, + "pathParameters": [], + "allPathParameters": [], + "queryParameters": [], + "headers": [], + "requestBody": { + "type": "inlinedRequestBody", + "name": { + "originalName": "RequestObject", + "camelCase": { + "unsafeName": "requestObject", + "safeName": "requestObject" + }, + "snakeCase": { + "unsafeName": "request_object", + "safeName": "request_object" + }, + "screamingSnakeCase": { + "unsafeName": "REQUEST_OBJECT", + "safeName": "REQUEST_OBJECT" + }, + "pascalCase": { + "unsafeName": "RequestObject", + "safeName": "RequestObject" + } + }, + "extends": [], + "contentType": null, + "properties": [ + { + "name": { + "name": { + "originalName": "random", + "camelCase": { + "unsafeName": "random", + "safeName": "random" + }, + "snakeCase": { + "unsafeName": "random", + "safeName": "random" + }, + "screamingSnakeCase": { + "unsafeName": "RANDOM", + "safeName": "RANDOM" + }, + "pascalCase": { + "unsafeName": "Random", + "safeName": "Random" + } + }, + "wireValue": "random" + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + }, + "availability": { + "status": "PRE_RELEASE", + "message": null + }, + "docs": null + } + ], + "extra-properties": false, + "extendedProperties": [] + }, + "sdkRequest": { + "shape": { + "type": "wrapper", + "wrapperName": { + "originalName": "RequestObject", + "camelCase": { + "unsafeName": "requestObject", + "safeName": "requestObject" + }, + "snakeCase": { + "unsafeName": "request_object", + "safeName": "request_object" + }, + "screamingSnakeCase": { + "unsafeName": "REQUEST_OBJECT", + "safeName": "REQUEST_OBJECT" + }, + "pascalCase": { + "unsafeName": "RequestObject", + "safeName": "RequestObject" + } + }, + "bodyKey": { + "originalName": "body", + "camelCase": { + "unsafeName": "body", + "safeName": "body" + }, + "snakeCase": { + "unsafeName": "body", + "safeName": "body" + }, + "screamingSnakeCase": { + "unsafeName": "BODY", + "safeName": "BODY" + }, + "pascalCase": { + "unsafeName": "Body", + "safeName": "Body" + } + } + }, + "requestParameterName": { + "originalName": "request", + "camelCase": { + "unsafeName": "request", + "safeName": "request" + }, + "snakeCase": { + "unsafeName": "request", + "safeName": "request" + }, + "screamingSnakeCase": { + "unsafeName": "REQUEST", + "safeName": "REQUEST" + }, + "pascalCase": { + "unsafeName": "Request", + "safeName": "Request" + } + }, + "streamParameter": null + }, + "response": { + "body": { + "type": "json", + "value": { + "type": "response", + "responseBodyType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + }, + "docs": null + } + }, + "status-code": null + }, + "errors": [], + "userSpecifiedExamples": [], + "autogeneratedExamples": [ + { + "example": { + "url": "/test-availability", + "rootPathParameters": [], + "servicePathParameters": [], + "endpointPathParameters": [], + "serviceHeaders": [], + "endpointHeaders": [], + "queryParameters": [], + "request": { + "type": "inlinedRequestBody", + "properties": [ + { + "name": { + "name": { + "originalName": "random", + "camelCase": { + "unsafeName": "random", + "safeName": "random" + }, + "snakeCase": { + "unsafeName": "random", + "safeName": "random" + }, + "screamingSnakeCase": { + "unsafeName": "RANDOM", + "safeName": "RANDOM" + }, + "pascalCase": { + "unsafeName": "Random", + "safeName": "Random" + } + }, + "wireValue": "random" + }, + "value": { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "string" + } + } + }, + "jsonExample": "string" + }, + "originalTypeDeclaration": null + } + ], + "jsonExample": { + "random": "string" + } + }, + "name": null, + "response": { + "type": "ok", + "value": { + "type": "body", + "value": { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "string" + } + } + }, + "jsonExample": "string" + } + } + }, + "id": "36fa4882356ab91b377f40dd400bcc40ea721106", + "docs": null + } + } + ], + "pagination": null, + "availability": null, + "docs": null + } + ] + } + }, + "constants": { + "errorInstanceIdKey": { + "name": { + "originalName": "errorInstanceId", + "camelCase": { + "unsafeName": "errorInstanceID", + "safeName": "errorInstanceID" + }, + "snakeCase": { + "unsafeName": "error_instance_id", + "safeName": "error_instance_id" + }, + "screamingSnakeCase": { + "unsafeName": "ERROR_INSTANCE_ID", + "safeName": "ERROR_INSTANCE_ID" + }, + "pascalCase": { + "unsafeName": "ErrorInstanceID", + "safeName": "ErrorInstanceID" + } + }, + "wireValue": "errorInstanceId" + } + }, + "environments": null, + "errorDiscriminationStrategy": { + "type": "statusCode" + }, + "basePath": null, + "pathParameters": [], + "variables": [], + "serviceTypeReferenceInfo": { + "typesReferencedOnlyByService": {}, + "sharedTypes": [ + "type_service:Object" + ] + }, + "webhookGroups": {}, + "websocketChannels": {}, + "readmeConfig": null, + "sourceConfig": null, + "publishConfig": null, + "subpackages": { + "subpackage_service": { + "name": { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + ], + "packagePath": [], + "file": { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + }, + "service": "service_service", + "types": [ + "type_service:Object" + ], + "errors": [], + "subpackages": [], + "navigationConfig": null, + "webhooks": null, + "websocket": null, + "hasEndpointsInTree": true, + "docs": null + } + }, + "rootPackage": { + "fernFilepath": { + "allParts": [], + "packagePath": [], + "file": null + }, + "websocket": null, + "service": null, + "types": [], + "errors": [], + "subpackages": [ + "subpackage_service" + ], + "webhooks": null, + "navigationConfig": null, + "hasEndpointsInTree": true, + "docs": null + }, + "sdkConfig": { + "isAuthMandatory": false, + "hasStreamingEndpoints": false, + "hasPaginatedEndpoints": false, + "hasFileDownloadEndpoints": false, + "platformHeaders": { + "language": "X-Fern-Language", + "sdkName": "X-Fern-SDK-Name", + "sdkVersion": "X-Fern-SDK-Version", + "userAgent": null + } + } +} \ No newline at end of file diff --git a/packages/cli/generation/ir-generator/src/__test__/test-definitions/cross-package-type-names.json b/packages/cli/generation/ir-generator/src/__test__/test-definitions/cross-package-type-names.json index a63390f4754..b7867b3d341 100644 --- a/packages/cli/generation/ir-generator/src/__test__/test-definitions/cross-package-type-names.json +++ b/packages/cli/generation/ir-generator/src/__test__/test-definitions/cross-package-type-names.json @@ -4200,6 +4200,7 @@ } } }, + "availability": null, "docs": null }, { @@ -4242,6 +4243,7 @@ } } }, + "availability": null, "docs": null } ], diff --git a/packages/cli/generation/ir-generator/src/__test__/test-definitions/enum.json b/packages/cli/generation/ir-generator/src/__test__/test-definitions/enum.json index a56bad5d209..5828fd297d9 100644 --- a/packages/cli/generation/ir-generator/src/__test__/test-definitions/enum.json +++ b/packages/cli/generation/ir-generator/src/__test__/test-definitions/enum.json @@ -775,6 +775,7 @@ "default": null, "inline": null }, + "availability": null, "docs": null }, { @@ -836,6 +837,7 @@ } } }, + "availability": null, "docs": null }, { @@ -891,6 +893,7 @@ "default": null, "inline": null }, + "availability": null, "docs": null }, { @@ -952,6 +955,7 @@ } } }, + "availability": null, "docs": null } ], diff --git a/packages/cli/generation/ir-generator/src/__test__/test-definitions/exhaustive.json b/packages/cli/generation/ir-generator/src/__test__/test-definitions/exhaustive.json index 17b45605421..6c833db7b47 100644 --- a/packages/cli/generation/ir-generator/src/__test__/test-definitions/exhaustive.json +++ b/packages/cli/generation/ir-generator/src/__test__/test-definitions/exhaustive.json @@ -53316,6 +53316,7 @@ } } }, + "availability": null, "docs": null }, { @@ -53352,6 +53353,7 @@ } } }, + "availability": null, "docs": null }, { @@ -53484,6 +53486,7 @@ "default": null, "inline": null }, + "availability": null, "docs": null } ], diff --git a/packages/cli/generation/ir-generator/src/__test__/test-definitions/extends.json b/packages/cli/generation/ir-generator/src/__test__/test-definitions/extends.json index 4b1ae11ed12..738faf0b7c7 100644 --- a/packages/cli/generation/ir-generator/src/__test__/test-definitions/extends.json +++ b/packages/cli/generation/ir-generator/src/__test__/test-definitions/extends.json @@ -1391,6 +1391,7 @@ } } }, + "availability": null, "docs": null } ], diff --git a/packages/cli/generation/ir-generator/src/__test__/test-definitions/extra-properties.json b/packages/cli/generation/ir-generator/src/__test__/test-definitions/extra-properties.json index 04fc9c511e0..5e40be65384 100644 --- a/packages/cli/generation/ir-generator/src/__test__/test-definitions/extra-properties.json +++ b/packages/cli/generation/ir-generator/src/__test__/test-definitions/extra-properties.json @@ -395,6 +395,7 @@ } } }, + "availability": null, "docs": null }, { @@ -430,6 +431,7 @@ } } }, + "availability": null, "docs": null }, { @@ -466,6 +468,7 @@ } } }, + "availability": null, "docs": null } ], diff --git a/packages/cli/generation/ir-generator/src/__test__/test-definitions/file-upload.json b/packages/cli/generation/ir-generator/src/__test__/test-definitions/file-upload.json index dd02580fb9b..5d12e4a69db 100644 --- a/packages/cli/generation/ir-generator/src/__test__/test-definitions/file-upload.json +++ b/packages/cli/generation/ir-generator/src/__test__/test-definitions/file-upload.json @@ -555,6 +555,7 @@ } } }, + "availability": null, "docs": null }, { @@ -592,6 +593,7 @@ } } }, + "availability": null, "docs": null }, { @@ -751,6 +753,7 @@ } } }, + "availability": null, "docs": null }, { @@ -800,6 +803,7 @@ } } }, + "availability": null, "docs": null }, { @@ -900,6 +904,7 @@ } } }, + "availability": null, "docs": null }, { @@ -935,6 +940,7 @@ } } }, + "availability": null, "docs": null }, { @@ -1035,6 +1041,7 @@ } } }, + "availability": null, "docs": null }, { @@ -1135,6 +1142,7 @@ } } }, + "availability": null, "docs": null } ] diff --git a/packages/cli/generation/ir-generator/src/__test__/test-definitions/grpc-proto-exhaustive.json b/packages/cli/generation/ir-generator/src/__test__/test-definitions/grpc-proto-exhaustive.json index d4db35eac2e..47cfef3b98c 100644 --- a/packages/cli/generation/ir-generator/src/__test__/test-definitions/grpc-proto-exhaustive.json +++ b/packages/cli/generation/ir-generator/src/__test__/test-definitions/grpc-proto-exhaustive.json @@ -3715,6 +3715,7 @@ } } }, + "availability": null, "docs": null }, { @@ -3757,6 +3758,7 @@ } } }, + "availability": null, "docs": null } ], @@ -4808,6 +4810,7 @@ } } }, + "availability": null, "docs": null }, { @@ -4846,6 +4849,7 @@ } } }, + "availability": null, "docs": null }, { @@ -4888,6 +4892,7 @@ } } }, + "availability": null, "docs": null }, { @@ -4949,6 +4954,7 @@ } } }, + "availability": null, "docs": null } ], @@ -5313,6 +5319,7 @@ } } }, + "availability": null, "docs": null } ], @@ -12010,6 +12017,7 @@ } } }, + "availability": null, "docs": null }, { @@ -12042,6 +12050,7 @@ "v2": null } }, + "availability": null, "docs": null }, { @@ -12103,6 +12112,7 @@ } } }, + "availability": null, "docs": null }, { @@ -12141,6 +12151,7 @@ } } }, + "availability": null, "docs": null }, { @@ -12179,6 +12190,7 @@ } } }, + "availability": null, "docs": null }, { @@ -12246,6 +12258,7 @@ } } }, + "availability": null, "docs": null }, { @@ -12290,6 +12303,7 @@ } } }, + "availability": null, "docs": null }, { @@ -12332,6 +12346,7 @@ } } }, + "availability": null, "docs": null }, { @@ -12393,6 +12408,7 @@ } } }, + "availability": null, "docs": null } ], @@ -16576,6 +16592,7 @@ } } }, + "availability": null, "docs": null }, { @@ -16620,6 +16637,7 @@ } } }, + "availability": null, "docs": null }, { @@ -16681,6 +16699,7 @@ } } }, + "availability": null, "docs": null }, { @@ -16723,6 +16742,7 @@ } } }, + "availability": null, "docs": null }, { @@ -16784,6 +16804,7 @@ } } }, + "availability": null, "docs": null } ], diff --git a/packages/cli/generation/ir-generator/src/__test__/test-definitions/grpc-proto.json b/packages/cli/generation/ir-generator/src/__test__/test-definitions/grpc-proto.json index 0beaf2e3462..15e4a5b6b9b 100644 --- a/packages/cli/generation/ir-generator/src/__test__/test-definitions/grpc-proto.json +++ b/packages/cli/generation/ir-generator/src/__test__/test-definitions/grpc-proto.json @@ -899,6 +899,7 @@ } } }, + "availability": null, "docs": null }, { @@ -941,6 +942,7 @@ } } }, + "availability": null, "docs": null }, { @@ -979,6 +981,7 @@ } } }, + "availability": null, "docs": null }, { @@ -1017,6 +1020,7 @@ } } }, + "availability": null, "docs": null }, { @@ -1078,6 +1082,7 @@ } } }, + "availability": null, "docs": null } ], diff --git a/packages/cli/generation/ir-generator/src/__test__/test-definitions/idempotency-headers.json b/packages/cli/generation/ir-generator/src/__test__/test-definitions/idempotency-headers.json index 631a55184f9..b094d0f12a5 100644 --- a/packages/cli/generation/ir-generator/src/__test__/test-definitions/idempotency-headers.json +++ b/packages/cli/generation/ir-generator/src/__test__/test-definitions/idempotency-headers.json @@ -428,6 +428,7 @@ } } }, + "availability": null, "docs": null }, { @@ -521,6 +522,7 @@ "default": null, "inline": null }, + "availability": null, "docs": null } ], diff --git a/packages/cli/generation/ir-generator/src/__test__/test-definitions/literal.json b/packages/cli/generation/ir-generator/src/__test__/test-definitions/literal.json index b3c6e9e8521..b90a039cae6 100644 --- a/packages/cli/generation/ir-generator/src/__test__/test-definitions/literal.json +++ b/packages/cli/generation/ir-generator/src/__test__/test-definitions/literal.json @@ -1390,6 +1390,7 @@ } } }, + "availability": null, "docs": null } ], @@ -2412,6 +2413,7 @@ } } }, + "availability": null, "docs": null }, { @@ -2453,6 +2455,7 @@ } } }, + "availability": null, "docs": null }, { @@ -2489,6 +2492,7 @@ } } }, + "availability": null, "docs": null }, { @@ -2531,6 +2535,7 @@ } } }, + "availability": null, "docs": null }, { @@ -2566,6 +2571,7 @@ } } }, + "availability": null, "docs": null }, { @@ -2659,6 +2665,7 @@ "default": null, "inline": null }, + "availability": null, "docs": null }, { @@ -2758,6 +2765,7 @@ } } }, + "availability": null, "docs": null }, { @@ -2851,6 +2859,7 @@ "default": null, "inline": null }, + "availability": null, "docs": null } ], diff --git a/packages/cli/generation/ir-generator/src/__test__/test-definitions/multi-line-docs.json b/packages/cli/generation/ir-generator/src/__test__/test-definitions/multi-line-docs.json index 38cedabc3bb..71bc079032b 100644 --- a/packages/cli/generation/ir-generator/src/__test__/test-definitions/multi-line-docs.json +++ b/packages/cli/generation/ir-generator/src/__test__/test-definitions/multi-line-docs.json @@ -803,6 +803,7 @@ } } }, + "availability": null, "docs": "The name of the user to create.\nThis name is unique to each user.\n" }, { @@ -845,6 +846,7 @@ } } }, + "availability": null, "docs": "The age of the user.\nThis propery is not required.\n" } ], diff --git a/packages/cli/generation/ir-generator/src/__test__/test-definitions/multi-url-environment-no-default.json b/packages/cli/generation/ir-generator/src/__test__/test-definitions/multi-url-environment-no-default.json index deb5a4c9b48..64dffbfe4d4 100644 --- a/packages/cli/generation/ir-generator/src/__test__/test-definitions/multi-url-environment-no-default.json +++ b/packages/cli/generation/ir-generator/src/__test__/test-definitions/multi-url-environment-no-default.json @@ -215,6 +215,7 @@ } } }, + "availability": null, "docs": null } ], @@ -522,6 +523,7 @@ } } }, + "availability": null, "docs": null } ], diff --git a/packages/cli/generation/ir-generator/src/__test__/test-definitions/multi-url-environment.json b/packages/cli/generation/ir-generator/src/__test__/test-definitions/multi-url-environment.json index ef7f8723636..749407c19d2 100644 --- a/packages/cli/generation/ir-generator/src/__test__/test-definitions/multi-url-environment.json +++ b/packages/cli/generation/ir-generator/src/__test__/test-definitions/multi-url-environment.json @@ -215,6 +215,7 @@ } } }, + "availability": null, "docs": null } ], @@ -522,6 +523,7 @@ } } }, + "availability": null, "docs": null } ], diff --git a/packages/cli/generation/ir-generator/src/__test__/test-definitions/oauth-client-credentials-default.json b/packages/cli/generation/ir-generator/src/__test__/test-definitions/oauth-client-credentials-default.json index 285a91a0095..4ae38a3ad15 100644 --- a/packages/cli/generation/ir-generator/src/__test__/test-definitions/oauth-client-credentials-default.json +++ b/packages/cli/generation/ir-generator/src/__test__/test-definitions/oauth-client-credentials-default.json @@ -499,6 +499,7 @@ } } }, + "availability": null, "docs": null }, { @@ -535,6 +536,7 @@ } } }, + "availability": null, "docs": null }, { @@ -570,6 +572,7 @@ } } }, + "availability": null, "docs": null } ], diff --git a/packages/cli/generation/ir-generator/src/__test__/test-definitions/oauth-client-credentials-environment-variables.json b/packages/cli/generation/ir-generator/src/__test__/test-definitions/oauth-client-credentials-environment-variables.json index f6055b378c9..e72476fb1e0 100644 --- a/packages/cli/generation/ir-generator/src/__test__/test-definitions/oauth-client-credentials-environment-variables.json +++ b/packages/cli/generation/ir-generator/src/__test__/test-definitions/oauth-client-credentials-environment-variables.json @@ -581,6 +581,7 @@ } } }, + "availability": null, "docs": null }, { @@ -617,6 +618,7 @@ } } }, + "availability": null, "docs": null }, { @@ -652,6 +654,7 @@ } } }, + "availability": null, "docs": null }, { @@ -687,6 +690,7 @@ } } }, + "availability": null, "docs": null }, { @@ -729,6 +733,7 @@ } } }, + "availability": null, "docs": null } ], @@ -1624,6 +1629,7 @@ } } }, + "availability": null, "docs": null }, { @@ -1660,6 +1666,7 @@ } } }, + "availability": null, "docs": null }, { @@ -1696,6 +1703,7 @@ } } }, + "availability": null, "docs": null }, { @@ -1731,6 +1739,7 @@ } } }, + "availability": null, "docs": null }, { @@ -1766,6 +1775,7 @@ } } }, + "availability": null, "docs": null }, { @@ -1808,6 +1818,7 @@ } } }, + "availability": null, "docs": null } ], diff --git a/packages/cli/generation/ir-generator/src/__test__/test-definitions/oauth-client-credentials-nested-root.json b/packages/cli/generation/ir-generator/src/__test__/test-definitions/oauth-client-credentials-nested-root.json index a74307c6a6e..7ef0f457aef 100644 --- a/packages/cli/generation/ir-generator/src/__test__/test-definitions/oauth-client-credentials-nested-root.json +++ b/packages/cli/generation/ir-generator/src/__test__/test-definitions/oauth-client-credentials-nested-root.json @@ -585,6 +585,7 @@ } } }, + "availability": null, "docs": null }, { @@ -621,6 +622,7 @@ } } }, + "availability": null, "docs": null }, { @@ -656,6 +658,7 @@ } } }, + "availability": null, "docs": null }, { @@ -691,6 +694,7 @@ } } }, + "availability": null, "docs": null }, { @@ -733,6 +737,7 @@ } } }, + "availability": null, "docs": null } ], diff --git a/packages/cli/generation/ir-generator/src/__test__/test-definitions/oauth-client-credentials.json b/packages/cli/generation/ir-generator/src/__test__/test-definitions/oauth-client-credentials.json index 497e39f012d..b104eb3728f 100644 --- a/packages/cli/generation/ir-generator/src/__test__/test-definitions/oauth-client-credentials.json +++ b/packages/cli/generation/ir-generator/src/__test__/test-definitions/oauth-client-credentials.json @@ -581,6 +581,7 @@ } } }, + "availability": null, "docs": null }, { @@ -617,6 +618,7 @@ } } }, + "availability": null, "docs": null }, { @@ -652,6 +654,7 @@ } } }, + "availability": null, "docs": null }, { @@ -687,6 +690,7 @@ } } }, + "availability": null, "docs": null }, { @@ -729,6 +733,7 @@ } } }, + "availability": null, "docs": null } ], @@ -1624,6 +1629,7 @@ } } }, + "availability": null, "docs": null }, { @@ -1660,6 +1666,7 @@ } } }, + "availability": null, "docs": null }, { @@ -1696,6 +1703,7 @@ } } }, + "availability": null, "docs": null }, { @@ -1731,6 +1739,7 @@ } } }, + "availability": null, "docs": null }, { @@ -1766,6 +1775,7 @@ } } }, + "availability": null, "docs": null }, { @@ -1808,6 +1818,7 @@ } } }, + "availability": null, "docs": null } ], diff --git a/packages/cli/generation/ir-generator/src/__test__/test-definitions/pagination.json b/packages/cli/generation/ir-generator/src/__test__/test-definitions/pagination.json index 6483dcaccfe..e2c659a76ef 100644 --- a/packages/cli/generation/ir-generator/src/__test__/test-definitions/pagination.json +++ b/packages/cli/generation/ir-generator/src/__test__/test-definitions/pagination.json @@ -6303,6 +6303,7 @@ } } }, + "availability": null, "docs": "The object that contains the cursor used for pagination\nin order to fetch the next page of results.\n" } ], @@ -11699,6 +11700,7 @@ } } }, + "availability": null, "docs": "The object that contains the offset used for pagination\nin order to fetch the next page of results.\n" } ], diff --git a/packages/cli/generation/ir-generator/src/__test__/test-definitions/server-sent-event-examples.json b/packages/cli/generation/ir-generator/src/__test__/test-definitions/server-sent-event-examples.json index 14d42e17d73..ad94da20ff3 100644 --- a/packages/cli/generation/ir-generator/src/__test__/test-definitions/server-sent-event-examples.json +++ b/packages/cli/generation/ir-generator/src/__test__/test-definitions/server-sent-event-examples.json @@ -356,6 +356,7 @@ } } }, + "availability": null, "docs": null } ], diff --git a/packages/cli/generation/ir-generator/src/__test__/test-definitions/server-sent-events.json b/packages/cli/generation/ir-generator/src/__test__/test-definitions/server-sent-events.json index 457794f9dc4..6690e2de066 100644 --- a/packages/cli/generation/ir-generator/src/__test__/test-definitions/server-sent-events.json +++ b/packages/cli/generation/ir-generator/src/__test__/test-definitions/server-sent-events.json @@ -356,6 +356,7 @@ } } }, + "availability": null, "docs": null } ], diff --git a/packages/cli/generation/ir-generator/src/__test__/test-definitions/streaming-parameter.json b/packages/cli/generation/ir-generator/src/__test__/test-definitions/streaming-parameter.json index 2827683df6f..f72a75086d6 100644 --- a/packages/cli/generation/ir-generator/src/__test__/test-definitions/streaming-parameter.json +++ b/packages/cli/generation/ir-generator/src/__test__/test-definitions/streaming-parameter.json @@ -517,6 +517,7 @@ "v2": null } }, + "availability": null, "docs": null }, { @@ -553,6 +554,7 @@ } } }, + "availability": null, "docs": null } ], diff --git a/packages/cli/generation/ir-generator/src/__test__/test-definitions/streaming.json b/packages/cli/generation/ir-generator/src/__test__/test-definitions/streaming.json index 4978b3aeb6f..2cbe1231c37 100644 --- a/packages/cli/generation/ir-generator/src/__test__/test-definitions/streaming.json +++ b/packages/cli/generation/ir-generator/src/__test__/test-definitions/streaming.json @@ -355,6 +355,7 @@ } } }, + "availability": null, "docs": null }, { @@ -391,6 +392,7 @@ } } }, + "availability": null, "docs": null } ], @@ -1348,6 +1350,7 @@ } } }, + "availability": null, "docs": null }, { @@ -1384,6 +1387,7 @@ } } }, + "availability": null, "docs": null } ], diff --git a/packages/cli/generation/ir-generator/src/__test__/test-definitions/trace.json b/packages/cli/generation/ir-generator/src/__test__/test-definitions/trace.json index 130cead7449..fb62d9e5f80 100644 --- a/packages/cli/generation/ir-generator/src/__test__/test-definitions/trace.json +++ b/packages/cli/generation/ir-generator/src/__test__/test-definitions/trace.json @@ -80286,6 +80286,7 @@ "default": null, "inline": null }, + "availability": null, "docs": null }, { @@ -80385,6 +80386,7 @@ } } }, + "availability": null, "docs": null } ], @@ -88582,6 +88584,7 @@ "default": null, "inline": null }, + "availability": null, "docs": null }, { @@ -88681,6 +88684,7 @@ } } }, + "availability": null, "docs": null } ], @@ -116544,6 +116548,7 @@ } } }, + "availability": null, "docs": null }, { @@ -116637,6 +116642,7 @@ "default": null, "inline": null }, + "availability": null, "docs": null }, { @@ -116673,6 +116679,7 @@ } } }, + "availability": null, "docs": "The name of the `method` that the student has to complete.\nThe method name cannot include the following characters:\n - Greater Than `>`\n - Less Than `<``\n - Equals `=`\n - Period `.`\n" } ], diff --git a/packages/cli/generation/ir-generator/src/__test__/test-definitions/ts-express-casing.json b/packages/cli/generation/ir-generator/src/__test__/test-definitions/ts-express-casing.json index 73c13587748..7afcef7ea96 100644 --- a/packages/cli/generation/ir-generator/src/__test__/test-definitions/ts-express-casing.json +++ b/packages/cli/generation/ir-generator/src/__test__/test-definitions/ts-express-casing.json @@ -791,6 +791,7 @@ "default": null, "inline": null }, + "availability": null, "docs": null }, { @@ -827,6 +828,7 @@ } } }, + "availability": null, "docs": null }, { @@ -863,6 +865,7 @@ } } }, + "availability": null, "docs": "The rating scale is one to five stars" } ], diff --git a/packages/cli/generation/ir-generator/src/__test__/test-definitions/validation.json b/packages/cli/generation/ir-generator/src/__test__/test-definitions/validation.json index 25c60e54049..8158a1ba0ae 100644 --- a/packages/cli/generation/ir-generator/src/__test__/test-definitions/validation.json +++ b/packages/cli/generation/ir-generator/src/__test__/test-definitions/validation.json @@ -1216,6 +1216,7 @@ } } }, + "availability": null, "docs": null }, { @@ -1258,6 +1259,7 @@ } } }, + "availability": null, "docs": null }, { @@ -1299,6 +1301,7 @@ } } }, + "availability": null, "docs": null }, { @@ -1354,6 +1357,7 @@ "default": null, "inline": null }, + "availability": null, "docs": null } ], diff --git a/packages/cli/generation/ir-generator/src/converters/convertWebhookGroup.ts b/packages/cli/generation/ir-generator/src/converters/convertWebhookGroup.ts index 936222ea026..bab902fb0b5 100644 --- a/packages/cli/generation/ir-generator/src/converters/convertWebhookGroup.ts +++ b/packages/cli/generation/ir-generator/src/converters/convertWebhookGroup.ts @@ -1,5 +1,6 @@ import { isPlainObject } from "@fern-api/core-utils"; import { + Availability, ExampleWebhookCall, InlinedWebhookPayloadProperty, Webhook, @@ -95,6 +96,10 @@ function convertWebhookPayloadSchema({ propertyKey, propertyDefinition, docs: typeof propertyDefinition !== "string" ? propertyDefinition.docs : undefined, + availability: + typeof propertyDefinition !== "string" + ? convertAvailability(propertyDefinition.availability) + : undefined, file }) ) @@ -107,15 +112,18 @@ function convertInlinedRequestProperty({ propertyKey, propertyDefinition, docs, + availability, file }: { propertyKey: string; propertyDefinition: RawSchemas.ObjectPropertySchema; docs: string | undefined; + availability: Availability | undefined; file: FernFileContext; }): InlinedWebhookPayloadProperty { return { docs, + availability, name: file.casingsGenerator.generateNameAndWireValue({ wireValue: propertyKey, name: getPropertyName({ propertyKey, property: propertyDefinition }).name 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 6078ba60ffd..59e9003a0db 100644 --- a/packages/cli/generation/ir-generator/src/converters/services/convertHttpRequestBody.ts +++ b/packages/cli/generation/ir-generator/src/converters/services/convertHttpRequestBody.ts @@ -3,7 +3,8 @@ import { FileUploadRequestProperty, HttpRequestBody, HttpRequestBodyReference, - InlinedRequestBodyProperty + InlinedRequestBodyProperty, + Availability } from "@fern-api/ir-sdk"; import { isInlineRequestBody, @@ -14,6 +15,7 @@ import { import { FernFileContext } from "../../FernFileContext"; import { parseTypeName } from "../../utils/parseTypeName"; import { getExtensionsAsList, getPropertyName } from "../type-declarations/convertObjectTypeDeclaration"; +import { convertAvailability } from "../convertDeclaration"; export function convertHttpRequestBody({ request, @@ -76,6 +78,7 @@ export function convertHttpRequestBody({ propertyKey: property.key, propertyDefinition: property.propertyType, docs: property.docs, + availability: convertAvailability(property.availability), file }) ); @@ -102,6 +105,10 @@ export function convertHttpRequestBody({ propertyKey, propertyDefinition, docs: typeof propertyDefinition !== "string" ? propertyDefinition.docs : undefined, + availability: + typeof propertyDefinition !== "string" + ? convertAvailability(propertyDefinition.availability) + : undefined, file }) ) @@ -140,15 +147,18 @@ function convertInlinedRequestProperty({ propertyKey, propertyDefinition, docs, + availability, file }: { propertyKey: string; propertyDefinition: RawSchemas.ObjectPropertySchema; docs: string | undefined; + availability: Availability | undefined; file: FernFileContext; }): InlinedRequestBodyProperty { return { docs, + availability, name: file.casingsGenerator.generateNameAndWireValue({ wireValue: propertyKey, name: getPropertyName({ propertyKey, property: propertyDefinition }).name diff --git a/packages/cli/generation/ir-migrations/src/migrations/v23-to-v22/__test__/__snapshots__/migrateFromV23ToV22.test.ts.snap b/packages/cli/generation/ir-migrations/src/migrations/v23-to-v22/__test__/__snapshots__/migrateFromV23ToV22.test.ts.snap index 6d3e15c557d..fdbd243383d 100644 --- a/packages/cli/generation/ir-migrations/src/migrations/v23-to-v22/__test__/__snapshots__/migrateFromV23ToV22.test.ts.snap +++ b/packages/cli/generation/ir-migrations/src/migrations/v23-to-v22/__test__/__snapshots__/migrateFromV23ToV22.test.ts.snap @@ -10027,6 +10027,7 @@ exports[`migrateFromV23ToV22 > migrates extensive 1`] = ` }, "properties": [ { + "availability": undefined, "docs": undefined, "name": { "name": { @@ -10056,6 +10057,7 @@ exports[`migrateFromV23ToV22 > migrates extensive 1`] = ` }, }, { + "availability": undefined, "docs": undefined, "name": { "name": { @@ -10085,6 +10087,7 @@ exports[`migrateFromV23ToV22 > migrates extensive 1`] = ` }, }, { + "availability": undefined, "docs": undefined, "name": { "name": { diff --git a/packages/cli/openapi-ir-to-fern/src/buildTypeReference.ts b/packages/cli/openapi-ir-to-fern/src/buildTypeReference.ts index 73556b59683..3b95c5a8cae 100644 --- a/packages/cli/openapi-ir-to-fern/src/buildTypeReference.ts +++ b/packages/cli/openapi-ir-to-fern/src/buildTypeReference.ts @@ -35,6 +35,7 @@ import { getValidationFromTypeReference } from "./utils/getTypeFromTypeReference"; import { convertSdkGroupNameToFile } from "./utils/convertSdkGroupName"; +import { convertAvailability } from "./utils/convertAvailability"; const MIN_INT_32 = -2147483648; const MAX_INT_32 = 2147483647; @@ -140,7 +141,10 @@ export function buildPrimitiveTypeReference( return { ...(primitiveSchema.title != null ? { "display-name": primitiveSchema.title } : {}), type: typeReference, - ...(primitiveSchema.description != null ? { docs: primitiveSchema.description } : {}) + ...(primitiveSchema.description != null ? { docs: primitiveSchema.description } : {}), + ...(primitiveSchema.availability != null + ? { availability: convertAvailability(primitiveSchema.availability) } + : {}) }; } @@ -411,7 +415,8 @@ export function buildReferenceTypeReference({ return { ...(displayName != null ? { "display-name": displayName } : {}), type: resolvedSchema.type === "nullable" ? `optional<${typeWithPrefix}>` : typeWithPrefix, - ...(schema.description != null ? { docs: schema.description } : {}) + ...(schema.description != null ? { docs: schema.description } : {}), + ...(schema.availability != null ? { availability: convertAvailability(schema.availability) } : {}) }; } @@ -434,6 +439,7 @@ export function buildArrayTypeReference({ return { ...(schema.title != null ? { "display-name": schema.title } : {}), ...(schema.description != null ? { docs: schema.description } : {}), + ...(schema.availability != null ? { availability: convertAvailability(schema.availability) } : {}), type }; } @@ -473,6 +479,9 @@ export function buildMapTypeReference({ if (schema.title != null) { result["display-name"] = schema.title; } + if (schema.availability != null) { + result.availability = convertAvailability(schema.availability); + } return result; } @@ -499,6 +508,7 @@ export function buildOptionalTypeReference({ const itemValidation = getValidationFromTypeReference(itemTypeReference); const type = itemType.startsWith("optional<") ? itemType : `optional<${itemType}>`; if ( + schema.availability == null && schema.description == null && itemDocs == null && itemDefault == null && @@ -522,6 +532,9 @@ export function buildOptionalTypeReference({ if (schema.title != null) { result["display-name"] = schema.title; } + if (schema.availability != null) { + result.availability = convertAvailability(schema.availability); + } return result; } @@ -551,7 +564,8 @@ export function buildLiteralTypeReference( return { ...(schema.title != null ? { "display-name": schema.title } : {}), type: value, - ...(schema.description != null ? { docs: schema.description } : {}) + ...(schema.description != null ? { docs: schema.description } : {}), + ...(schema.availability != null ? { availability: convertAvailability(schema.availability) } : {}) }; } @@ -588,6 +602,10 @@ export function buildEnumTypeReference({ if (schema.title != null) { result["display-name"] = schema.title; } + if (schema.availability != null) { + result.availability = convertAvailability(schema.availability); + } + return result; } @@ -619,7 +637,8 @@ export function buildObjectTypeReference({ return { ...(schema.title != null ? { "display-name": schema.title } : {}), type: prefixedType, - ...(schema.description != null ? { docs: schema.description } : {}) + ...(schema.description != null ? { docs: schema.description } : {}), + ...(schema.availability != null ? { availability: convertAvailability(schema.availability) } : {}) }; } @@ -651,7 +670,8 @@ export function buildOneOfTypeReference({ return { ...(schema.title != null ? { "display-name": schema.title } : {}), type: prefixedType, - ...(schema.description != null ? { docs: schema.description } : {}) + ...(schema.description != null ? { docs: schema.description } : {}), + ...(schema.availability != null ? { availability: convertAvailability(schema.availability) } : {}) }; } diff --git a/packages/cli/openapi-parser/src/schema/convertArray.ts b/packages/cli/openapi-parser/src/schema/convertArray.ts index cd7b04a3905..7cebf894564 100644 --- a/packages/cli/openapi-parser/src/schema/convertArray.ts +++ b/packages/cli/openapi-parser/src/schema/convertArray.ts @@ -89,7 +89,6 @@ export function wrapArray({ title, value: itemSchema, description, - // TODO: maybe undefined? availability, groupName, example diff --git a/packages/cli/openapi-parser/src/schema/convertEnum.ts b/packages/cli/openapi-parser/src/schema/convertEnum.ts index 560930416ad..370c5c96641 100644 --- a/packages/cli/openapi-parser/src/schema/convertEnum.ts +++ b/packages/cli/openapi-parser/src/schema/convertEnum.ts @@ -56,8 +56,7 @@ export function convertEnum({ generatedName, value, description: fernEnumValue?.description, - // not supported as of now, due to lack of support from openapi - availability: undefined, + availability, casing: { snake: fernEnumValue?.casing?.snake ?? undefined, pascal: fernEnumValue?.casing?.pascal ?? undefined, @@ -116,7 +115,7 @@ export function wrapEnum({ values, description, default: _default, - availability: undefined, + availability, example: undefined, groupName, source diff --git a/packages/cli/openapi-parser/src/schema/convertSchemas.ts b/packages/cli/openapi-parser/src/schema/convertSchemas.ts index 645fad5cb79..c4612d4c6f2 100644 --- a/packages/cli/openapi-parser/src/schema/convertSchemas.ts +++ b/packages/cli/openapi-parser/src/schema/convertSchemas.ts @@ -169,7 +169,6 @@ export function convertSchemaObject( const title = schema.title; const description = schema.description; const availability = convertAvailability(schema); - const examples = getExtension>(schema, OpenAPIExtension.EXAMPLES); const fullExamples: NamedFullExample[] = []; @@ -976,6 +975,7 @@ function maybeInjectDescriptionOrGroupName( return SchemaWithExample.reference({ ...schema, description, + availability: schema.availability, groupName }); } else if (schema.type === "optional") { diff --git a/packages/cli/register/src/ir-to-fdr-converter/__test__/__snapshots__/convertIrToFdrApi.test.ts.snap b/packages/cli/register/src/ir-to-fdr-converter/__test__/__snapshots__/convertIrToFdrApi.test.ts.snap index 888878a7470..31b10dfb2c4 100644 --- a/packages/cli/register/src/ir-to-fdr-converter/__test__/__snapshots__/convertIrToFdrApi.test.ts.snap +++ b/packages/cli/register/src/ir-to-fdr-converter/__test__/__snapshots__/convertIrToFdrApi.test.ts.snap @@ -180,6 +180,7 @@ exports[`fdr test definitions > alias-extends 1`] = ` ], "properties": [ { + "availability": undefined, "description": undefined, "key": "child", "valueType": { @@ -341,6 +342,7 @@ exports[`fdr test definitions > any-auth 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "client_id", "valueType": { @@ -355,6 +357,7 @@ exports[`fdr test definitions > any-auth 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "client_secret", "valueType": { @@ -369,6 +372,7 @@ exports[`fdr test definitions > any-auth 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "audience", "valueType": { @@ -380,6 +384,7 @@ exports[`fdr test definitions > any-auth 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "grant_type", "valueType": { @@ -391,6 +396,7 @@ exports[`fdr test definitions > any-auth 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "scope", "valueType": { @@ -1060,6 +1066,7 @@ exports[`fdr test definitions > audiences 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "publicProperty", "valueType": { @@ -1077,6 +1084,7 @@ exports[`fdr test definitions > audiences 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "privateProperty", "valueType": { @@ -1497,6 +1505,141 @@ exports[`fdr test definitions > auth-environment-variables 1`] = ` } `; +exports[`fdr test definitions > availability 1`] = ` +{ + "auth": undefined, + "globalHeaders": [], + "rootPackage": { + "endpoints": [], + "pointsTo": undefined, + "subpackages": [ + "subpackage_service", + ], + "types": [], + "webhooks": [], + "websockets": [], + }, + "snippetsConfiguration": {}, + "subpackages": { + "subpackage_service": { + "description": undefined, + "displayName": undefined, + "endpoints": [ + { + "auth": false, + "availability": undefined, + "defaultEnvironment": undefined, + "description": undefined, + "environments": undefined, + "errors": undefined, + "errorsV2": [], + "examples": [], + "headers": [], + "id": "test-availability", + "method": "POST", + "name": "Test Availability", + "originalEndpointId": "endpoint_service.test-availability", + "path": { + "parts": [ + { + "type": "literal", + "value": "", + }, + { + "type": "literal", + "value": "/test-availability", + }, + ], + "pathParameters": [], + }, + "queryParameters": [], + "request": { + "type": { + "contentType": "application/json", + "shape": { + "extends": [], + "properties": [ + { + "availability": "Beta", + "description": undefined, + "key": "random", + "valueType": { + "type": "primitive", + "value": { + "default": undefined, + "maxLength": undefined, + "minLength": undefined, + "regex": undefined, + "type": "string", + }, + }, + }, + ], + "type": "object", + }, + "type": "json", + }, + }, + "response": { + "statusCode": undefined, + "type": { + "type": "reference", + "value": { + "type": "primitive", + "value": { + "default": undefined, + "maxLength": undefined, + "minLength": undefined, + "regex": undefined, + "type": "string", + }, + }, + }, + }, + }, + ], + "name": "service", + "pointsTo": undefined, + "subpackageId": "subpackage_service", + "subpackages": [], + "types": [ + "type_service:Object", + ], + "webhooks": [], + "websockets": [], + }, + }, + "types": { + "type_service:Object": { + "availability": undefined, + "description": undefined, + "name": "Object", + "shape": { + "extends": [], + "properties": [ + { + "availability": "Beta", + "description": undefined, + "key": "id", + "valueType": { + "type": "primitive", + "value": { + "default": undefined, + "maxLength": undefined, + "minLength": undefined, + "regex": undefined, + "type": "string", + }, + }, + }, + ], + "type": "object", + }, + }, + }, +} +`; + exports[`fdr test definitions > basic-auth 1`] = ` { "auth": { @@ -2996,6 +3139,7 @@ exports[`fdr test definitions > cross-package-type-names 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "publicProperty", "valueType": { @@ -3013,6 +3157,7 @@ exports[`fdr test definitions > cross-package-type-names 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "privateProperty", "valueType": { @@ -3724,6 +3869,7 @@ exports[`fdr test definitions > enum 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "operand", "valueType": { @@ -3732,6 +3878,7 @@ exports[`fdr test definitions > enum 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "maybeOperand", "valueType": { @@ -3743,6 +3890,7 @@ exports[`fdr test definitions > enum 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "operandOrColor", "valueType": { @@ -3751,6 +3899,7 @@ exports[`fdr test definitions > enum 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "maybeOperandOrColor", "valueType": { @@ -9199,6 +9348,7 @@ exports[`fdr test definitions > exhaustive 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "string", "valueType": { @@ -9213,6 +9363,7 @@ exports[`fdr test definitions > exhaustive 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "integer", "valueType": { @@ -9226,6 +9377,7 @@ exports[`fdr test definitions > exhaustive 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "NestedObject", "valueType": { @@ -10242,6 +10394,7 @@ exports[`fdr test definitions > extends 1`] = ` ], "properties": [ { + "availability": undefined, "description": undefined, "key": "unique", "valueType": { @@ -10449,6 +10602,7 @@ exports[`fdr test definitions > extra-properties 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "_type", "valueType": { @@ -10460,6 +10614,7 @@ exports[`fdr test definitions > extra-properties 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "_version", "valueType": { @@ -10471,6 +10626,7 @@ exports[`fdr test definitions > extra-properties 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "name", "valueType": { @@ -10694,6 +10850,7 @@ exports[`fdr test definitions > file-upload 1`] = ` "name": "MyRequest", "properties": [ { + "availability": undefined, "description": undefined, "key": "maybeString", "type": "bodyProperty", @@ -10712,6 +10869,7 @@ exports[`fdr test definitions > file-upload 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "integer", "type": "bodyProperty", @@ -10758,6 +10916,7 @@ exports[`fdr test definitions > file-upload 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "maybeInteger", "type": "bodyProperty", @@ -10775,6 +10934,7 @@ exports[`fdr test definitions > file-upload 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "optionalListOfStrings", "type": "bodyProperty", @@ -10796,6 +10956,7 @@ exports[`fdr test definitions > file-upload 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "listOfObjects", "type": "bodyProperty", @@ -10808,6 +10969,7 @@ exports[`fdr test definitions > file-upload 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "optionalMetadata", "type": "bodyProperty", @@ -10819,6 +10981,7 @@ exports[`fdr test definitions > file-upload 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "optionalObjectType", "type": "bodyProperty", @@ -10831,6 +10994,7 @@ exports[`fdr test definitions > file-upload 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "optionalId", "type": "bodyProperty", @@ -11572,6 +11736,7 @@ exports[`fdr test definitions > grpc-proto 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "username", "valueType": { @@ -11589,6 +11754,7 @@ exports[`fdr test definitions > grpc-proto 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "email", "valueType": { @@ -11606,6 +11772,7 @@ exports[`fdr test definitions > grpc-proto 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "age", "valueType": { @@ -11619,6 +11786,7 @@ exports[`fdr test definitions > grpc-proto 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "weight", "valueType": { @@ -11632,6 +11800,7 @@ exports[`fdr test definitions > grpc-proto 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "metadata", "valueType": { @@ -11999,6 +12168,7 @@ exports[`fdr test definitions > grpc-proto-exhaustive 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "columns", "valueType": { @@ -12010,6 +12180,7 @@ exports[`fdr test definitions > grpc-proto-exhaustive 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "namespace", "valueType": { @@ -12099,6 +12270,7 @@ exports[`fdr test definitions > grpc-proto-exhaustive 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "ids", "valueType": { @@ -12119,6 +12291,7 @@ exports[`fdr test definitions > grpc-proto-exhaustive 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "deleteAll", "valueType": { @@ -12132,6 +12305,7 @@ exports[`fdr test definitions > grpc-proto-exhaustive 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "namespace", "valueType": { @@ -12149,6 +12323,7 @@ exports[`fdr test definitions > grpc-proto-exhaustive 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "filter", "valueType": { @@ -12250,6 +12425,7 @@ exports[`fdr test definitions > grpc-proto-exhaustive 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "filter", "valueType": { @@ -12703,6 +12879,7 @@ exports[`fdr test definitions > grpc-proto-exhaustive 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "namespace", "valueType": { @@ -12720,6 +12897,7 @@ exports[`fdr test definitions > grpc-proto-exhaustive 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "topK", "valueType": { @@ -12730,6 +12908,7 @@ exports[`fdr test definitions > grpc-proto-exhaustive 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "filter", "valueType": { @@ -12741,6 +12920,7 @@ exports[`fdr test definitions > grpc-proto-exhaustive 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "includeValues", "valueType": { @@ -12754,6 +12934,7 @@ exports[`fdr test definitions > grpc-proto-exhaustive 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "includeMetadata", "valueType": { @@ -12767,6 +12948,7 @@ exports[`fdr test definitions > grpc-proto-exhaustive 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "queries", "valueType": { @@ -12781,6 +12963,7 @@ exports[`fdr test definitions > grpc-proto-exhaustive 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "column", "valueType": { @@ -12797,6 +12980,7 @@ exports[`fdr test definitions > grpc-proto-exhaustive 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "id", "valueType": { @@ -12814,6 +12998,7 @@ exports[`fdr test definitions > grpc-proto-exhaustive 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "indexedData", "valueType": { @@ -12901,6 +13086,7 @@ exports[`fdr test definitions > grpc-proto-exhaustive 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "id", "valueType": { @@ -12915,6 +13101,7 @@ exports[`fdr test definitions > grpc-proto-exhaustive 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "values", "valueType": { @@ -12931,6 +13118,7 @@ exports[`fdr test definitions > grpc-proto-exhaustive 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "setMetadata", "valueType": { @@ -12942,6 +13130,7 @@ exports[`fdr test definitions > grpc-proto-exhaustive 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "namespace", "valueType": { @@ -12959,6 +13148,7 @@ exports[`fdr test definitions > grpc-proto-exhaustive 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "indexedData", "valueType": { @@ -13902,6 +14092,7 @@ exports[`fdr test definitions > idempotency-headers 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "amount", "valueType": { @@ -13915,6 +14106,7 @@ exports[`fdr test definitions > idempotency-headers 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "currency", "valueType": { @@ -14451,6 +14643,7 @@ exports[`fdr test definitions > literal 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "query", "valueType": { @@ -14587,6 +14780,7 @@ exports[`fdr test definitions > literal 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "prompt", "valueType": { @@ -14598,6 +14792,7 @@ exports[`fdr test definitions > literal 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "context", "valueType": { @@ -14612,6 +14807,7 @@ exports[`fdr test definitions > literal 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "query", "valueType": { @@ -14626,6 +14822,7 @@ exports[`fdr test definitions > literal 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "temperature", "valueType": { @@ -14642,6 +14839,7 @@ exports[`fdr test definitions > literal 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "stream", "valueType": { @@ -14653,6 +14851,7 @@ exports[`fdr test definitions > literal 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "aliasedContext", "valueType": { @@ -14661,6 +14860,7 @@ exports[`fdr test definitions > literal 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "maybeContext", "valueType": { @@ -14672,6 +14872,7 @@ exports[`fdr test definitions > literal 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "objectWithLiteral", "valueType": { @@ -16353,6 +16554,7 @@ This endpoint is used to create a new user.", "extends": [], "properties": [ { + "availability": undefined, "description": "The name of the user to create. This name is unique to each user. ", @@ -16369,6 +16571,7 @@ This name is unique to each user. }, }, { + "availability": undefined, "description": "The age of the user. This propery is not required. ", @@ -16581,6 +16784,7 @@ exports[`fdr test definitions > multi-url-environment 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "size", "valueType": { @@ -16659,6 +16863,7 @@ exports[`fdr test definitions > multi-url-environment 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "s3Key", "valueType": { @@ -16777,6 +16982,7 @@ exports[`fdr test definitions > multi-url-environment-no-default 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "size", "valueType": { @@ -16855,6 +17061,7 @@ exports[`fdr test definitions > multi-url-environment-no-default 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "s3Key", "valueType": { @@ -17046,6 +17253,7 @@ exports[`fdr test definitions > oauth-client-credentials 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "client_id", "valueType": { @@ -17060,6 +17268,7 @@ exports[`fdr test definitions > oauth-client-credentials 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "client_secret", "valueType": { @@ -17074,6 +17283,7 @@ exports[`fdr test definitions > oauth-client-credentials 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "audience", "valueType": { @@ -17085,6 +17295,7 @@ exports[`fdr test definitions > oauth-client-credentials 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "grant_type", "valueType": { @@ -17096,6 +17307,7 @@ exports[`fdr test definitions > oauth-client-credentials 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "scope", "valueType": { @@ -17164,6 +17376,7 @@ exports[`fdr test definitions > oauth-client-credentials 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "client_id", "valueType": { @@ -17178,6 +17391,7 @@ exports[`fdr test definitions > oauth-client-credentials 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "client_secret", "valueType": { @@ -17192,6 +17406,7 @@ exports[`fdr test definitions > oauth-client-credentials 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "refresh_token", "valueType": { @@ -17206,6 +17421,7 @@ exports[`fdr test definitions > oauth-client-credentials 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "audience", "valueType": { @@ -17217,6 +17433,7 @@ exports[`fdr test definitions > oauth-client-credentials 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "grant_type", "valueType": { @@ -17228,6 +17445,7 @@ exports[`fdr test definitions > oauth-client-credentials 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "scope", "valueType": { @@ -17394,6 +17612,7 @@ exports[`fdr test definitions > oauth-client-credentials-default 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "client_id", "valueType": { @@ -17408,6 +17627,7 @@ exports[`fdr test definitions > oauth-client-credentials-default 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "client_secret", "valueType": { @@ -17422,6 +17642,7 @@ exports[`fdr test definitions > oauth-client-credentials-default 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "grant_type", "valueType": { @@ -17564,6 +17785,7 @@ exports[`fdr test definitions > oauth-client-credentials-environment-variables 1 "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "client_id", "valueType": { @@ -17578,6 +17800,7 @@ exports[`fdr test definitions > oauth-client-credentials-environment-variables 1 }, }, { + "availability": undefined, "description": undefined, "key": "client_secret", "valueType": { @@ -17592,6 +17815,7 @@ exports[`fdr test definitions > oauth-client-credentials-environment-variables 1 }, }, { + "availability": undefined, "description": undefined, "key": "audience", "valueType": { @@ -17603,6 +17827,7 @@ exports[`fdr test definitions > oauth-client-credentials-environment-variables 1 }, }, { + "availability": undefined, "description": undefined, "key": "grant_type", "valueType": { @@ -17614,6 +17839,7 @@ exports[`fdr test definitions > oauth-client-credentials-environment-variables 1 }, }, { + "availability": undefined, "description": undefined, "key": "scope", "valueType": { @@ -17682,6 +17908,7 @@ exports[`fdr test definitions > oauth-client-credentials-environment-variables 1 "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "client_id", "valueType": { @@ -17696,6 +17923,7 @@ exports[`fdr test definitions > oauth-client-credentials-environment-variables 1 }, }, { + "availability": undefined, "description": undefined, "key": "client_secret", "valueType": { @@ -17710,6 +17938,7 @@ exports[`fdr test definitions > oauth-client-credentials-environment-variables 1 }, }, { + "availability": undefined, "description": undefined, "key": "refresh_token", "valueType": { @@ -17724,6 +17953,7 @@ exports[`fdr test definitions > oauth-client-credentials-environment-variables 1 }, }, { + "availability": undefined, "description": undefined, "key": "audience", "valueType": { @@ -17735,6 +17965,7 @@ exports[`fdr test definitions > oauth-client-credentials-environment-variables 1 }, }, { + "availability": undefined, "description": undefined, "key": "grant_type", "valueType": { @@ -17746,6 +17977,7 @@ exports[`fdr test definitions > oauth-client-credentials-environment-variables 1 }, }, { + "availability": undefined, "description": undefined, "key": "scope", "valueType": { @@ -17912,6 +18144,7 @@ exports[`fdr test definitions > oauth-client-credentials-nested-root 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "client_id", "valueType": { @@ -17926,6 +18159,7 @@ exports[`fdr test definitions > oauth-client-credentials-nested-root 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "client_secret", "valueType": { @@ -17940,6 +18174,7 @@ exports[`fdr test definitions > oauth-client-credentials-nested-root 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "audience", "valueType": { @@ -17951,6 +18186,7 @@ exports[`fdr test definitions > oauth-client-credentials-nested-root 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "grant_type", "valueType": { @@ -17962,6 +18198,7 @@ exports[`fdr test definitions > oauth-client-credentials-nested-root 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "scope", "valueType": { @@ -19380,6 +19617,7 @@ the next page of results.", "extends": [], "properties": [ { + "availability": undefined, "description": "The object that contains the cursor used for pagination in order to fetch the next page of results. ", @@ -19550,6 +19788,7 @@ the next page of results.", "extends": [], "properties": [ { + "availability": undefined, "description": "The object that contains the offset used for pagination in order to fetch the next page of results. ", @@ -21872,6 +22111,7 @@ exports[`fdr test definitions > server-sent-event-examples 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "query", "valueType": { @@ -22020,6 +22260,7 @@ exports[`fdr test definitions > server-sent-events 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "query", "valueType": { @@ -22766,6 +23007,7 @@ exports[`fdr test definitions > streaming 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "stream", "valueType": { @@ -22777,6 +23019,7 @@ exports[`fdr test definitions > streaming 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "num_events", "valueType": { @@ -22877,6 +23120,7 @@ exports[`fdr test definitions > streaming 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "stream", "valueType": { @@ -22888,6 +23132,7 @@ exports[`fdr test definitions > streaming 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "num_events", "valueType": { @@ -23066,6 +23311,7 @@ exports[`fdr test definitions > streaming-parameter 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "stream", "valueType": { @@ -23076,6 +23322,7 @@ exports[`fdr test definitions > streaming-parameter 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "num_events", "valueType": { @@ -23591,6 +23838,7 @@ exports[`fdr test definitions > trace 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "result", "valueType": { @@ -23599,6 +23847,7 @@ exports[`fdr test definitions > trace 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "traceResponses", "valueType": { @@ -23758,6 +24007,7 @@ exports[`fdr test definitions > trace 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "workspaceRunDetails", "valueType": { @@ -23766,6 +24016,7 @@ exports[`fdr test definitions > trace 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "traceResponses", "valueType": { @@ -24936,6 +25187,7 @@ description", "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "inputParams", "valueType": { @@ -24947,6 +25199,7 @@ description", }, }, { + "availability": undefined, "description": undefined, "key": "outputType", "valueType": { @@ -24955,6 +25208,7 @@ description", }, }, { + "availability": undefined, "description": "The name of the \`method\` that the student has to complete. The method name cannot include the following characters: - Greater Than \`>\` @@ -35188,6 +35442,7 @@ exports[`fdr test definitions > ts-express-casing 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "id", "valueType": { @@ -35196,6 +35451,7 @@ exports[`fdr test definitions > ts-express-casing 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "movie_title", "valueType": { @@ -35210,6 +35466,7 @@ exports[`fdr test definitions > ts-express-casing 1`] = ` }, }, { + "availability": undefined, "description": "The rating scale is one to five stars", "key": "movie_rating", "valueType": { @@ -36863,6 +37120,7 @@ exports[`fdr test definitions > validation 1`] = ` "extends": [], "properties": [ { + "availability": undefined, "description": undefined, "key": "decimal", "valueType": { @@ -36876,6 +37134,7 @@ exports[`fdr test definitions > validation 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "even", "valueType": { @@ -36889,6 +37148,7 @@ exports[`fdr test definitions > validation 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "name", "valueType": { @@ -36903,6 +37163,7 @@ exports[`fdr test definitions > validation 1`] = ` }, }, { + "availability": undefined, "description": undefined, "key": "shape", "valueType": { diff --git a/packages/cli/register/src/ir-to-fdr-converter/__test__/__snapshots__/convertIrToFdrApiAvailability.test.ts.snap b/packages/cli/register/src/ir-to-fdr-converter/__test__/__snapshots__/convertIrToFdrApiAvailability.test.ts.snap new file mode 100644 index 00000000000..842b4e2779f --- /dev/null +++ b/packages/cli/register/src/ir-to-fdr-converter/__test__/__snapshots__/convertIrToFdrApiAvailability.test.ts.snap @@ -0,0 +1,136 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`fdr test definition availability > 1`] = ` +{ + "auth": undefined, + "globalHeaders": [], + "rootPackage": { + "endpoints": [], + "pointsTo": undefined, + "subpackages": [ + "subpackage_service", + ], + "types": [], + "webhooks": [], + "websockets": [], + }, + "snippetsConfiguration": {}, + "subpackages": { + "subpackage_service": { + "description": undefined, + "displayName": undefined, + "endpoints": [ + { + "auth": false, + "availability": undefined, + "defaultEnvironment": undefined, + "description": undefined, + "environments": undefined, + "errors": undefined, + "errorsV2": [], + "examples": [], + "headers": [], + "id": "test-availability", + "method": "POST", + "name": "Test Availability", + "originalEndpointId": "endpoint_service.test-availability", + "path": { + "parts": [ + { + "type": "literal", + "value": "", + }, + { + "type": "literal", + "value": "/test-availability", + }, + ], + "pathParameters": [], + }, + "queryParameters": [], + "request": { + "type": { + "contentType": "application/json", + "shape": { + "extends": [], + "properties": [ + { + "availability": "Beta", + "description": undefined, + "key": "random", + "valueType": { + "type": "primitive", + "value": { + "default": undefined, + "maxLength": undefined, + "minLength": undefined, + "regex": undefined, + "type": "string", + }, + }, + }, + ], + "type": "object", + }, + "type": "json", + }, + }, + "response": { + "statusCode": undefined, + "type": { + "type": "reference", + "value": { + "type": "primitive", + "value": { + "default": undefined, + "maxLength": undefined, + "minLength": undefined, + "regex": undefined, + "type": "string", + }, + }, + }, + }, + }, + ], + "name": "service", + "pointsTo": undefined, + "subpackageId": "subpackage_service", + "subpackages": [], + "types": [ + "type_service:Object", + ], + "webhooks": [], + "websockets": [], + }, + }, + "types": { + "type_service:Object": { + "availability": undefined, + "description": undefined, + "name": "Object", + "shape": { + "extends": [], + "properties": [ + { + "availability": "Beta", + "description": undefined, + "key": "id", + "valueType": { + "type": "primitive", + "value": { + "default": undefined, + "maxLength": undefined, + "minLength": undefined, + "regex": undefined, + "type": "string", + }, + }, + }, + ], + "type": "object", + }, + }, + }, +} +`; diff --git a/packages/cli/register/src/ir-to-fdr-converter/__test__/convertIrToFdrApiAvailability.test.ts b/packages/cli/register/src/ir-to-fdr-converter/__test__/convertIrToFdrApiAvailability.test.ts new file mode 100644 index 00000000000..04eae7bc2e7 --- /dev/null +++ b/packages/cli/register/src/ir-to-fdr-converter/__test__/convertIrToFdrApiAvailability.test.ts @@ -0,0 +1,50 @@ +/* eslint-disable jest/valid-describe-callback */ +/* eslint-disable jest/valid-title */ +/* eslint-disable @typescript-eslint/no-misused-promises */ + +import { AbsoluteFilePath } from "@fern-api/fs-utils"; +import { generateIntermediateRepresentation } from "@fern-api/ir-generator"; +import { loadApis } from "@fern-api/project-loader"; +import { createMockTaskContext } from "@fern-api/task-context"; +import path from "path"; +import { convertIrToFdrApi } from "../convertIrToFdrApi"; + +describe("fdr test definition availability", async () => { + const TEST_DEFINITIONS_DIR = path.join(__dirname, "./fixtures/availability"); + const apiWorkspaces = await loadApis({ + fernDirectory: AbsoluteFilePath.of(TEST_DEFINITIONS_DIR), + context: createMockTaskContext(), + cliVersion: "0.0.0", + cliName: "fern", + commandLineApiWorkspace: undefined, + defaultToAllApiWorkspaces: true + }); + + await Promise.all( + apiWorkspaces.map(async (workspace) => { + const context = createMockTaskContext(); + const fernWorkspace = await workspace.toFernWorkspace({ + context + }); + + const ir = await generateIntermediateRepresentation({ + workspace: fernWorkspace, + generationLanguage: undefined, + audiences: { type: "all" }, + keywords: undefined, + smartCasing: true, + disableExamples: false, + readme: undefined, + version: undefined, + packageName: undefined, + context + }); + + const fdr = convertIrToFdrApi({ ir, snippetsConfig: {} }); + + it(workspace.workspaceName ?? "", () => { + expect(fdr).toMatchSnapshot(); + }); + }) + ); +}); diff --git a/packages/cli/register/src/ir-to-fdr-converter/__test__/fixtures/availability/definition/api.yml b/packages/cli/register/src/ir-to-fdr-converter/__test__/fixtures/availability/definition/api.yml new file mode 100644 index 00000000000..54fb10864e1 --- /dev/null +++ b/packages/cli/register/src/ir-to-fdr-converter/__test__/fixtures/availability/definition/api.yml @@ -0,0 +1 @@ +name: availability \ No newline at end of file diff --git a/packages/cli/register/src/ir-to-fdr-converter/__test__/fixtures/availability/definition/service.yml b/packages/cli/register/src/ir-to-fdr-converter/__test__/fixtures/availability/definition/service.yml new file mode 100644 index 00000000000..f82b7fded95 --- /dev/null +++ b/packages/cli/register/src/ir-to-fdr-converter/__test__/fixtures/availability/definition/service.yml @@ -0,0 +1,24 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json + +service: + auth: false + base-path: "" + endpoints: + test-availability: + path: /test-availability + method: POST + request: + name: RequestObject + body: + properties: + random: + type: string + availability: pre-release + response: string + +types: + Object: + properties: + id: + type: string + availability: pre-release diff --git a/packages/cli/register/src/ir-to-fdr-converter/__test__/fixtures/availability/generators.yml b/packages/cli/register/src/ir-to-fdr-converter/__test__/fixtures/availability/generators.yml new file mode 100644 index 00000000000..0967ef424bc --- /dev/null +++ b/packages/cli/register/src/ir-to-fdr-converter/__test__/fixtures/availability/generators.yml @@ -0,0 +1 @@ +{} 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 5e8621c081c..02264ee1b14 100644 --- a/packages/cli/register/src/ir-to-fdr-converter/convertPackage.ts +++ b/packages/cli/register/src/ir-to-fdr-converter/convertPackage.ts @@ -345,7 +345,8 @@ function convertRequestBody(irRequest: Ir.http.HttpRequestBody): FdrCjsSdk.api.v (property): FdrCjsSdk.api.v1.register.ObjectProperty => ({ description: property.docs ?? undefined, key: property.name.wireValue, - valueType: convertTypeReference(property.valueType) + valueType: convertTypeReference(property.valueType), + availability: convertIrAvailability(property.availability) }) ) } @@ -396,7 +397,8 @@ function convertRequestBody(irRequest: Ir.http.HttpRequestBody): FdrCjsSdk.api.v type: "bodyProperty", key: bodyProperty.name.wireValue, valueType: convertTypeReference(bodyProperty.valueType), - description: bodyProperty.docs + description: bodyProperty.docs, + availability: convertIrAvailability(bodyProperty.availability) }), _other: () => undefined }); @@ -747,7 +749,8 @@ function convertWebhookPayload(irWebhookPayload: Ir.webhooks.WebhookPayload): Fd (property): FdrCjsSdk.api.v1.register.ObjectProperty => ({ description: property.docs ?? undefined, key: property.name.wireValue, - valueType: convertTypeReference(property.valueType) + valueType: convertTypeReference(property.valueType), + availability: convertIrAvailability(property.availability) }) ) } @@ -776,7 +779,8 @@ function convertMessageBody( (property): FdrCjsSdk.api.v1.register.ObjectProperty => ({ description: property.docs ?? undefined, key: property.name.wireValue, - valueType: convertTypeReference(property.valueType) + valueType: convertTypeReference(property.valueType), + availability: convertIrAvailability(property.availability) }) ) }; diff --git a/packages/ir-sdk/fern/apis/ir-types-latest/VERSION b/packages/ir-sdk/fern/apis/ir-types-latest/VERSION index 7778730f79c..a8ef2225ca0 100644 --- a/packages/ir-sdk/fern/apis/ir-types-latest/VERSION +++ b/packages/ir-sdk/fern/apis/ir-types-latest/VERSION @@ -1 +1 @@ -53.10.0 +53.11.0 diff --git a/packages/ir-sdk/fern/apis/ir-types-latest/changelog/CHANGELOG.md b/packages/ir-sdk/fern/apis/ir-types-latest/changelog/CHANGELOG.md index f5f5ce13888..4a09cd84699 100644 --- a/packages/ir-sdk/fern/apis/ir-types-latest/changelog/CHANGELOG.md +++ b/packages/ir-sdk/fern/apis/ir-types-latest/changelog/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [v53.11.0] - 2024-08-13 + +- Fix: Add availability to inline websocket, webhook, and http body parameter properties. + ## [v53.10.0] - 2024-08-12 - Feature: Add `display-name` to discriminated union values for use with displaying docs. diff --git a/packages/ir-sdk/fern/apis/ir-types-latest/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-latest/definition/commons.yml index 7b1e00c73f1..bd77aeaa828 100644 --- a/packages/ir-sdk/fern/apis/ir-types-latest/definition/commons.yml +++ b/packages/ir-sdk/fern/apis/ir-types-latest/definition/commons.yml @@ -4,6 +4,10 @@ types: WithDocs: properties: docs: optional + WithDocsAndAvailability: + extends: WithDocs + properties: + availability: optional FernFilepath: properties: allParts: list diff --git a/packages/ir-sdk/fern/apis/ir-types-latest/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-latest/definition/http.yml index 490c1efa093..cc1cb4f2537 100644 --- a/packages/ir-sdk/fern/apis/ir-types-latest/definition/http.yml +++ b/packages/ir-sdk/fern/apis/ir-types-latest/definition/http.yml @@ -114,7 +114,7 @@ types: docs: Whether to allow extra properties on the request. type: boolean InlinedRequestBodyProperty: - extends: commons.WithDocs + extends: commons.WithDocsAndAvailability properties: name: commons.NameAndWireValue valueType: types.TypeReference diff --git a/packages/ir-sdk/fern/apis/ir-types-latest/definition/webhooks.yml b/packages/ir-sdk/fern/apis/ir-types-latest/definition/webhooks.yml index 97397a76767..13d33bd6883 100644 --- a/packages/ir-sdk/fern/apis/ir-types-latest/definition/webhooks.yml +++ b/packages/ir-sdk/fern/apis/ir-types-latest/definition/webhooks.yml @@ -35,7 +35,7 @@ types: properties: list InlinedWebhookPayloadProperty: - extends: commons.WithDocs + extends: commons.WithDocsAndAvailability properties: name: commons.NameAndWireValue valueType: types.TypeReference diff --git a/packages/ir-sdk/fern/apis/ir-types-latest/definition/websocket.yml b/packages/ir-sdk/fern/apis/ir-types-latest/definition/websocket.yml index 18482877ba3..98b427e60f5 100644 --- a/packages/ir-sdk/fern/apis/ir-types-latest/definition/websocket.yml +++ b/packages/ir-sdk/fern/apis/ir-types-latest/definition/websocket.yml @@ -48,7 +48,7 @@ types: properties: list InlinedWebSocketMessageBodyProperty: - extends: commons.WithDocs + extends: commons.WithDocsAndAvailability properties: name: commons.NameAndWireValue valueType: types.TypeReference diff --git a/packages/ir-sdk/src/sdk/api/resources/commons/types/WithDocsAndAvailability.ts b/packages/ir-sdk/src/sdk/api/resources/commons/types/WithDocsAndAvailability.ts new file mode 100644 index 00000000000..ab6ffbd8b17 --- /dev/null +++ b/packages/ir-sdk/src/sdk/api/resources/commons/types/WithDocsAndAvailability.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as FernIr from "../../../index"; + +export interface WithDocsAndAvailability extends FernIr.WithDocs { + availability: FernIr.Availability | undefined; +} 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 index 310d13268bb..95eab3d7a65 100644 --- a/packages/ir-sdk/src/sdk/api/resources/commons/types/index.ts +++ b/packages/ir-sdk/src/sdk/api/resources/commons/types/index.ts @@ -1,4 +1,5 @@ export * from "./WithDocs"; +export * from "./WithDocsAndAvailability"; export * from "./FernFilepath"; export * from "./Name"; export * from "./NameAndWireValue"; 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 index f1f53ce1b42..91fb5352526 100644 --- a/packages/ir-sdk/src/sdk/api/resources/http/types/InlinedRequestBodyProperty.ts +++ b/packages/ir-sdk/src/sdk/api/resources/http/types/InlinedRequestBodyProperty.ts @@ -4,7 +4,7 @@ import * as FernIr from "../../../index"; -export interface InlinedRequestBodyProperty extends FernIr.WithDocs { +export interface InlinedRequestBodyProperty extends FernIr.WithDocsAndAvailability { name: FernIr.NameAndWireValue; valueType: FernIr.TypeReference; } 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 index d9cb6767f75..93826e1d190 100644 --- a/packages/ir-sdk/src/sdk/api/resources/webhooks/types/InlinedWebhookPayloadProperty.ts +++ b/packages/ir-sdk/src/sdk/api/resources/webhooks/types/InlinedWebhookPayloadProperty.ts @@ -4,7 +4,7 @@ import * as FernIr from "../../../index"; -export interface InlinedWebhookPayloadProperty extends FernIr.WithDocs { +export interface InlinedWebhookPayloadProperty extends FernIr.WithDocsAndAvailability { name: FernIr.NameAndWireValue; valueType: FernIr.TypeReference; } diff --git a/packages/ir-sdk/src/sdk/api/resources/websocket/types/InlinedWebSocketMessageBodyProperty.ts b/packages/ir-sdk/src/sdk/api/resources/websocket/types/InlinedWebSocketMessageBodyProperty.ts index 0c6137d872f..a93319dfc8a 100644 --- a/packages/ir-sdk/src/sdk/api/resources/websocket/types/InlinedWebSocketMessageBodyProperty.ts +++ b/packages/ir-sdk/src/sdk/api/resources/websocket/types/InlinedWebSocketMessageBodyProperty.ts @@ -4,7 +4,7 @@ import * as FernIr from "../../../index"; -export interface InlinedWebSocketMessageBodyProperty extends FernIr.WithDocs { +export interface InlinedWebSocketMessageBodyProperty extends FernIr.WithDocsAndAvailability { name: FernIr.NameAndWireValue; valueType: FernIr.TypeReference; } diff --git a/packages/ir-sdk/src/sdk/serialization/resources/commons/types/WithDocsAndAvailability.ts b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/WithDocsAndAvailability.ts new file mode 100644 index 00000000000..720882bb0b4 --- /dev/null +++ b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/WithDocsAndAvailability.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../index"; +import * as FernIr from "../../../../api/index"; +import * as core from "../../../../core"; +import { Availability } from "./Availability"; +import { WithDocs } from "./WithDocs"; + +export const WithDocsAndAvailability: core.serialization.ObjectSchema< + serializers.WithDocsAndAvailability.Raw, + FernIr.WithDocsAndAvailability +> = core.serialization + .objectWithoutOptionalProperties({ + availability: Availability.optional(), + }) + .extend(WithDocs); + +export declare namespace WithDocsAndAvailability { + interface Raw extends WithDocs.Raw { + availability?: Availability.Raw | null; + } +} 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 index 310d13268bb..95eab3d7a65 100644 --- a/packages/ir-sdk/src/sdk/serialization/resources/commons/types/index.ts +++ b/packages/ir-sdk/src/sdk/serialization/resources/commons/types/index.ts @@ -1,4 +1,5 @@ export * from "./WithDocs"; +export * from "./WithDocsAndAvailability"; export * from "./FernFilepath"; export * from "./Name"; export * from "./NameAndWireValue"; 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 index 0a226624917..84b99df2add 100644 --- a/packages/ir-sdk/src/sdk/serialization/resources/http/types/InlinedRequestBodyProperty.ts +++ b/packages/ir-sdk/src/sdk/serialization/resources/http/types/InlinedRequestBodyProperty.ts @@ -6,7 +6,7 @@ import * as serializers from "../../../index"; import * as FernIr from "../../../../api/index"; import * as core from "../../../../core"; import { NameAndWireValue } from "../../commons/types/NameAndWireValue"; -import { WithDocs } from "../../commons/types/WithDocs"; +import { WithDocsAndAvailability } from "../../commons/types/WithDocsAndAvailability"; export const InlinedRequestBodyProperty: core.serialization.ObjectSchema< serializers.InlinedRequestBodyProperty.Raw, @@ -16,10 +16,10 @@ export const InlinedRequestBodyProperty: core.serialization.ObjectSchema< name: NameAndWireValue, valueType: core.serialization.lazy(() => serializers.TypeReference), }) - .extend(WithDocs); + .extend(WithDocsAndAvailability); export declare namespace InlinedRequestBodyProperty { - interface Raw extends WithDocs.Raw { + interface Raw extends WithDocsAndAvailability.Raw { name: NameAndWireValue.Raw; valueType: serializers.TypeReference.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 index 792cf7fcb6a..a130a07d2b0 100644 --- a/packages/ir-sdk/src/sdk/serialization/resources/webhooks/types/InlinedWebhookPayloadProperty.ts +++ b/packages/ir-sdk/src/sdk/serialization/resources/webhooks/types/InlinedWebhookPayloadProperty.ts @@ -6,7 +6,7 @@ import * as serializers from "../../../index"; import * as FernIr from "../../../../api/index"; import * as core from "../../../../core"; import { NameAndWireValue } from "../../commons/types/NameAndWireValue"; -import { WithDocs } from "../../commons/types/WithDocs"; +import { WithDocsAndAvailability } from "../../commons/types/WithDocsAndAvailability"; export const InlinedWebhookPayloadProperty: core.serialization.ObjectSchema< serializers.InlinedWebhookPayloadProperty.Raw, @@ -16,10 +16,10 @@ export const InlinedWebhookPayloadProperty: core.serialization.ObjectSchema< name: NameAndWireValue, valueType: core.serialization.lazy(() => serializers.TypeReference), }) - .extend(WithDocs); + .extend(WithDocsAndAvailability); export declare namespace InlinedWebhookPayloadProperty { - interface Raw extends WithDocs.Raw { + interface Raw extends WithDocsAndAvailability.Raw { name: NameAndWireValue.Raw; valueType: serializers.TypeReference.Raw; } diff --git a/packages/ir-sdk/src/sdk/serialization/resources/websocket/types/InlinedWebSocketMessageBodyProperty.ts b/packages/ir-sdk/src/sdk/serialization/resources/websocket/types/InlinedWebSocketMessageBodyProperty.ts index b33b8244a49..c5d34b14587 100644 --- a/packages/ir-sdk/src/sdk/serialization/resources/websocket/types/InlinedWebSocketMessageBodyProperty.ts +++ b/packages/ir-sdk/src/sdk/serialization/resources/websocket/types/InlinedWebSocketMessageBodyProperty.ts @@ -6,7 +6,7 @@ import * as serializers from "../../../index"; import * as FernIr from "../../../../api/index"; import * as core from "../../../../core"; import { NameAndWireValue } from "../../commons/types/NameAndWireValue"; -import { WithDocs } from "../../commons/types/WithDocs"; +import { WithDocsAndAvailability } from "../../commons/types/WithDocsAndAvailability"; export const InlinedWebSocketMessageBodyProperty: core.serialization.ObjectSchema< serializers.InlinedWebSocketMessageBodyProperty.Raw, @@ -16,10 +16,10 @@ export const InlinedWebSocketMessageBodyProperty: core.serialization.ObjectSchem name: NameAndWireValue, valueType: core.serialization.lazy(() => serializers.TypeReference), }) - .extend(WithDocs); + .extend(WithDocsAndAvailability); export declare namespace InlinedWebSocketMessageBodyProperty { - interface Raw extends WithDocs.Raw { + interface Raw extends WithDocsAndAvailability.Raw { name: NameAndWireValue.Raw; valueType: serializers.TypeReference.Raw; }