diff --git a/packages/cli/generation/ir-generator/src/filterExamples.ts b/packages/cli/generation/ir-generator/src/filterExamples.ts index c3631301ca1..a145dcce49b 100644 --- a/packages/cli/generation/ir-generator/src/filterExamples.ts +++ b/packages/cli/generation/ir-generator/src/filterExamples.ts @@ -93,15 +93,18 @@ function filterExampleTypeReference({ ) }), optional: (o) => { - const innerOption = + const filteredOptionalTypReference = o.optional != null ? filterExampleTypeReference({ filteredIr, exampleTypeReference: o.optional }) - : o.optional; - return innerOption != null + : undefined; + return filteredOptionalTypReference != null ? { ...exampleTypeReference, shape: ExampleTypeReferenceShape.container( - ExampleContainer.optional({ ...o, valueType: o.valueType }) + ExampleContainer.optional({ + optional: filteredOptionalTypReference, + valueType: o.valueType + }) ) } : undefined; diff --git a/packages/ir-sdk/fern/apis/ir-types-latest/VERSION b/packages/ir-sdk/fern/apis/ir-types-latest/VERSION index 92837e4d8f0..4ff0fdaa3ed 100644 --- a/packages/ir-sdk/fern/apis/ir-types-latest/VERSION +++ b/packages/ir-sdk/fern/apis/ir-types-latest/VERSION @@ -1 +1 @@ -51.0.0 +50.1.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 00548c6d694..cac78b61c00 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,10 +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). -## [v51.0.0] - 2024-07-10 +## [v50.1.0] - 2024-07-10 **Optionals present** -- Improvement: Add `TypeReference`s to `ExampleContainer` types, especially helpful in the case of empty container - examples. These `TypeReference`s are being added as optional but should be made required in v52. +- Improvement: Add `TypeReference`s to `ExampleContainer` types, especially helpful in the case of empty container + examples. These `TypeReference`s are being added as optional but should be made required in v51. ## [v50.0.0] - 2024-06-20 diff --git a/packages/ir-sdk/fern/apis/ir-types-v50/VERSION b/packages/ir-sdk/fern/apis/ir-types-v50/VERSION deleted file mode 100644 index 819ea47b740..00000000000 --- a/packages/ir-sdk/fern/apis/ir-types-v50/VERSION +++ /dev/null @@ -1 +0,0 @@ -50.0.0 diff --git a/packages/ir-sdk/fern/apis/ir-types-v50/changelog/CHANGELOG.md b/packages/ir-sdk/fern/apis/ir-types-v50/changelog/CHANGELOG.md deleted file mode 100644 index ca15bbde06d..00000000000 --- a/packages/ir-sdk/fern/apis/ir-types-v50/changelog/CHANGELOG.md +++ /dev/null @@ -1,86 +0,0 @@ -# Changelog - -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). - -## [v50.0.0] - 2024-06-20 - -- Improvement: add PrimitiveType V2 for Boolean, Long and Big Int types, allowing for default values to be specified - -## [v49.0.0] - 2024-06-20 - -- Feature: Support generating code with `stream` param for endpoints like chat completion. - -## [v48.1.0] - 2024-06-20 - -- Feature: Add an optional `introduction` field to the `ReadmeConfig`, which is configurable - in the user's `generators.yml`. - -## [v48.0.0] - 2024-06-17 - -- Fix: The unique webhook id is now required. -- Improvement: Pagination endpoints now support request body properties. -- Improvement: Offset pagination now supports a configurable `step` size request property, which - is useful for offset values that represent the element's global index (e.g. the 500th element), - rather than the page number (e.g the 5th page). - -## [v47.1.0] - 2024-06-09 - -- Fix: Introduce a unique id for all generated webhooks. This is being added as optional but should - be made required in v48. - -## [v47.0.0] - 2024-06-09 - -- Feature: Introduce `autogeneratedExamples` and `userProvidedExamples` fields on the HTTPEndpoint. In the - `userProvidedExample` its now possible for the user to only provide code samples and no structured - example with input and output. - - Generators should opt to use the code sample provided from the user if that is the case. - -## [v46.2.0] - 2024-06-09 - -- Feature: Add support for webhook examples. - -## [v46.1.1] - 2024-06-09 - -- Fix: Generate the Python SDK for IR using just pydantic v1 - -## [v46] - 2024-06-04 - -- Feature: Add support for README.md configuration. - -## [v45] - 2024-05-15 - -- Feature: Support `bigint` primitive types. -- Feature: Add support for default values and validation rules. - -## [v44] - 2024-05-10 - -- Improvement: Support stream and server-sent event response examples. - -## [v43] - 2024-05-08 - -- Improvement: Support custom status codes for success respones. - -## [v42] - 2024-05-07 - -- Improvement: Update OAuth customizability (e.g. configurable `clientId` property). - -## [v41] - 2024-05-07 - -- Feature: Add error examples. - -## [v40] - 2024-04-23 - -- Feature: Add support for extra properties on objects and in-lined requests. - -## [v39] - 2024-04-19 - -- Feature: Add support for OAuth client credentials flow. - -## [v38] - 2024-04-17 - -- Feature: Add support for Server-Sent-Events to Streaming HTTP Responses - Read more about SSE here: https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events. diff --git a/packages/ir-sdk/fern/apis/ir-types-v50/definition/api.yml b/packages/ir-sdk/fern/apis/ir-types-v50/definition/api.yml deleted file mode 100644 index dc5015903ad..00000000000 --- a/packages/ir-sdk/fern/apis/ir-types-v50/definition/api.yml +++ /dev/null @@ -1,3 +0,0 @@ -name: ir -docs: | - - Add primitive type v2 (with defaults) to booleans, longs and big ints \ No newline at end of file diff --git a/packages/ir-sdk/fern/apis/ir-types-v50/definition/auth.yml b/packages/ir-sdk/fern/apis/ir-types-v50/definition/auth.yml deleted file mode 100644 index fecc35bb54c..00000000000 --- a/packages/ir-sdk/fern/apis/ir-types-v50/definition/auth.yml +++ /dev/null @@ -1,98 +0,0 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json - -imports: - http: http.yml - types: types.yml - commons: commons.yml -types: - EnvironmentVariable: string - ApiAuth: - extends: commons.WithDocs - properties: - requirement: AuthSchemesRequirement - schemes: list - AuthSchemesRequirement: - enum: - - ALL - - ANY - AuthScheme: - discriminant: - value: _type - name: type - union: - bearer: BearerAuthScheme - basic: BasicAuthScheme - header: HeaderAuthScheme - oauth: OAuthScheme - BearerAuthScheme: - extends: commons.WithDocs - properties: - token: commons.Name - tokenEnvVar: - type: optional - docs: The environment variable the SDK should use to read the token. - - OAuthScheme: - extends: commons.WithDocs - docs: | - We currently assume the resultant token is leveraged as a bearer token, e.g. "Authorization Bearer" - properties: - configuration: OAuthConfiguration - OAuthConfiguration: - union: - clientCredentials: OAuthClientCredentials - OAuthClientCredentials: - properties: - clientIdEnvVar: optional - clientSecretEnvVar: optional - tokenPrefix: optional - scopes: optional> - tokenEndpoint: OAuthTokenEndpoint - refreshEndpoint: optional - OAuthTokenEndpoint: - properties: - endpointReference: commons.EndpointReference - requestProperties: OAuthAccessTokenRequestProperties - responseProperties: OAuthAccessTokenResponseProperties - OAuthRefreshEndpoint: - properties: - endpointReference: commons.EndpointReference - requestProperties: OAuthRefreshTokenRequestProperties - responseProperties: OAuthAccessTokenResponseProperties - OAuthAccessTokenRequestProperties: - docs: The properties required to retrieve an OAuth token. - properties: - clientId: http.RequestProperty - clientSecret: http.RequestProperty - scopes: optional - OAuthAccessTokenResponseProperties: - docs: The properties to map to the corresponding OAuth token primitive. - properties: - accessToken: http.ResponseProperty - expiresIn: optional - refreshToken: optional - OAuthRefreshTokenRequestProperties: - docs: The properties required to retrieve an OAuth refresh token. - properties: - refreshToken: http.RequestProperty - - BasicAuthScheme: - extends: commons.WithDocs - properties: - username: commons.Name - usernameEnvVar: - type: optional - docs: The environment variable the SDK should use to read the username. - password: commons.Name - passwordEnvVar: - type: optional - docs: The environment variable the SDK should use to read the password. - HeaderAuthScheme: - extends: commons.WithDocs - properties: - name: commons.NameAndWireValue - valueType: types.TypeReference - prefix: optional - headerEnvVar: - type: optional - docs: The environment variable the SDK should use to read the header. diff --git a/packages/ir-sdk/fern/apis/ir-types-v50/definition/commons.yml b/packages/ir-sdk/fern/apis/ir-types-v50/definition/commons.yml deleted file mode 100644 index 7b1e00c73f1..00000000000 --- a/packages/ir-sdk/fern/apis/ir-types-v50/definition/commons.yml +++ /dev/null @@ -1,89 +0,0 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json - -types: - WithDocs: - properties: - docs: optional - FernFilepath: - properties: - allParts: list - packagePath: list - file: optional - - # names - - Name: - properties: - originalName: string - camelCase: SafeAndUnsafeString - pascalCase: SafeAndUnsafeString - snakeCase: SafeAndUnsafeString - screamingSnakeCase: SafeAndUnsafeString - NameAndWireValue: - properties: - wireValue: string - name: Name - SafeAndUnsafeString: - properties: - unsafeName: - docs: this name might overlap with reserved keywords of the language being - generated - type: string - safeName: - docs: this name will NOT overlap with reserved keywords of the language being - generated - type: string - EscapedString: - docs: | - Defines the original string, and its escaped-equivalent (depending on the target programming language). - This is paricularly relevant to example string literals. - - For example, in Python we escape strings that contain single or double quotes by using triple quotes, - in Go we use backticks, etc. - properties: - original: string - - WithJsonExample: - properties: - jsonExample: unknown - - # ids - - SubpackageId: string - ServiceId: string - EndpointId: string - TypeId: string - ErrorId: string - WebhookGroupId: string - WebhookId: string - WebSocketChannelId: string - FeatureId: string - - # declarations - - Declaration: - extends: WithDocs - properties: - availability: optional - Availability: - properties: - status: AvailabilityStatus - message: optional - AvailabilityStatus: - enum: - - IN_DEVELOPMENT - - PRE_RELEASE - - GENERAL_AVAILABILITY - - DEPRECATED - - # references - - EndpointReference: - properties: - endpointId: EndpointId - serviceId: ServiceId - subpackageId: - type: optional - docs: | - The subpackage that defines the endpoint. If empty, the endpoint is - defined in the root package. \ No newline at end of file diff --git a/packages/ir-sdk/fern/apis/ir-types-v50/definition/constants.yml b/packages/ir-sdk/fern/apis/ir-types-v50/definition/constants.yml deleted file mode 100644 index 8ceb53bb12b..00000000000 --- a/packages/ir-sdk/fern/apis/ir-types-v50/definition/constants.yml +++ /dev/null @@ -1,7 +0,0 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json -imports: - commons: commons.yml -types: - Constants: - properties: - errorInstanceIdKey: commons.NameAndWireValue diff --git a/packages/ir-sdk/fern/apis/ir-types-v50/definition/environment.yml b/packages/ir-sdk/fern/apis/ir-types-v50/definition/environment.yml deleted file mode 100644 index 3f076c5a466..00000000000 --- a/packages/ir-sdk/fern/apis/ir-types-v50/definition/environment.yml +++ /dev/null @@ -1,39 +0,0 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json - -imports: - commons: commons.yml -types: - EnvironmentId: string - EnvironmentBaseUrlId: string - EnvironmentUrl: string - EnvironmentsConfig: - properties: - defaultEnvironment: optional - environments: Environments - Environments: - union: - singleBaseUrl: SingleBaseUrlEnvironments - multipleBaseUrls: MultipleBaseUrlsEnvironments - SingleBaseUrlEnvironments: - properties: - environments: list - SingleBaseUrlEnvironment: - extends: commons.WithDocs - properties: - id: EnvironmentId - name: commons.Name - url: EnvironmentUrl - MultipleBaseUrlsEnvironments: - properties: - baseUrls: list - environments: list - MultipleBaseUrlsEnvironment: - extends: commons.WithDocs - properties: - id: EnvironmentId - name: commons.Name - urls: map - EnvironmentBaseUrlWithId: - properties: - id: EnvironmentBaseUrlId - name: commons.Name diff --git a/packages/ir-sdk/fern/apis/ir-types-v50/definition/errors.yml b/packages/ir-sdk/fern/apis/ir-types-v50/definition/errors.yml deleted file mode 100644 index 3888562cbc0..00000000000 --- a/packages/ir-sdk/fern/apis/ir-types-v50/definition/errors.yml +++ /dev/null @@ -1,34 +0,0 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json - -imports: - commons: commons.yml - types: types.yml - -types: - ErrorDeclaration: - extends: commons.WithDocs - properties: - name: DeclaredErrorName - discriminantValue: commons.NameAndWireValue - type: optional - statusCode: integer - examples: list - ErrorDeclarationDiscriminantValue: - union: - property: commons.NameAndWireValue - statusCode: {} - DeclaredErrorName: - properties: - errorId: commons.ErrorId - fernFilepath: commons.FernFilepath - name: commons.Name - - # examples - - ExampleError: - extends: - - commons.WithJsonExample - - commons.WithDocs - properties: - name: optional - shape: types.ExampleTypeReference diff --git a/packages/ir-sdk/fern/apis/ir-types-v50/definition/http.yml b/packages/ir-sdk/fern/apis/ir-types-v50/definition/http.yml deleted file mode 100644 index 103c64692fb..00000000000 --- a/packages/ir-sdk/fern/apis/ir-types-v50/definition/http.yml +++ /dev/null @@ -1,432 +0,0 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json - -imports: - commons: commons.yml - types: types.yml - errors: errors.yml - environment: environment.yml - variables: variables.yml -types: - HttpService: - properties: - availability: optional - name: DeclaredServiceName - displayName: optional - basePath: HttpPath - endpoints: list - headers: list - pathParameters: list - DeclaredServiceName: - properties: - fernFilepath: commons.FernFilepath - - HttpEndpoint: - extends: commons.Declaration - properties: - id: commons.EndpointId - name: EndpointName - displayName: optional - method: HttpMethod - headers: list - baseUrl: optional - path: HttpPath - fullPath: HttpPath - pathParameters: list - allPathParameters: list - queryParameters: list - requestBody: optional - sdkRequest: optional - response: optional - errors: ResponseErrors - auth: boolean - idempotent: boolean - pagination: optional - userSpecifiedExamples: list - autogeneratedExamples: list - EndpointName: commons.Name - HttpPath: - properties: - head: string - parts: list - HttpPathPart: - properties: - pathParameter: string - tail: string - HttpMethod: - enum: - - GET - - POST - - PUT - - PATCH - - DELETE - HttpHeader: - extends: commons.Declaration - properties: - name: commons.NameAndWireValue - valueType: types.TypeReference - env: optional - PathParameter: - extends: commons.WithDocs - properties: - name: commons.Name - valueType: types.TypeReference - location: PathParameterLocation - variable: optional - PathParameterLocation: - enum: - - ROOT - - SERVICE - - ENDPOINT - QueryParameter: - extends: commons.Declaration - properties: - name: commons.NameAndWireValue - valueType: types.TypeReference - allowMultiple: boolean - HttpRequestBody: - union: - inlinedRequestBody: InlinedRequestBody - reference: HttpRequestBodyReference - fileUpload: FileUploadRequest - bytes: BytesRequest - InlinedRequestBody: - properties: - name: commons.Name - extends: list - properties: list - contentType: optional - extra-properties: - docs: Whether to allow extra properties on the request. - type: boolean - InlinedRequestBodyProperty: - extends: commons.WithDocs - properties: - name: commons.NameAndWireValue - valueType: types.TypeReference - FileUploadRequest: - properties: - name: commons.Name - properties: list - BytesRequest: - properties: - isOptional: boolean - contentType: optional - FileUploadRequestProperty: - union: - file: FileProperty - bodyProperty: InlinedRequestBodyProperty - FileProperty: - union: - file: FilePropertySingle - fileArray: FilePropertyArray - FilePropertySingle: - properties: - key: commons.NameAndWireValue - isOptional: boolean - FilePropertyArray: - properties: - key: commons.NameAndWireValue - isOptional: boolean - HttpRequestBodyReference: - extends: commons.WithDocs - properties: - requestBodyType: types.TypeReference - contentType: optional - SdkRequestBodyType: - union: - typeReference: HttpRequestBodyReference - bytes: BytesRequest - SdkRequest: - properties: - streamParameter: - type: optional - docs: | - The request property that controls whether or not the response is streamed. - requestParameterName: commons.Name - shape: SdkRequestShape - SdkRequestShape: - union: - justRequestBody: SdkRequestBodyType - wrapper: SdkRequestWrapper - SdkRequestWrapper: - properties: - wrapperName: commons.Name - bodyKey: commons.Name - - HttpResponse: - properties: - status-code: optional - body: optional - - NonStreamHttpResponseBody: - union: - json: JsonResponse - fileDownload: FileDownloadResponse - text: TextResponse - - HttpResponseBody: - union: - json: JsonResponse - fileDownload: FileDownloadResponse - text: TextResponse - streaming: StreamingResponse - streamParameter: - type: StreamParameterResponse - docs: | - If there is a parameter that controls whether the response is streaming or not. Note - that if this is the response then `sdkRequest.streamParameter` will always be populated. - - JsonResponse: - union: - response: JsonResponseBody - nestedPropertyAsResponse: JsonResponseBodyWithProperty - - JsonResponseBody: - extends: commons.WithDocs - properties: - responseBodyType: types.TypeReference - - JsonResponseBodyWithProperty: - extends: commons.WithDocs - properties: - responseBodyType: types.TypeReference - responseProperty: - docs: | - If set, the SDK will return this property from - the response, rather than the response itself. - - This is particularly useful for JSON API structures - (e.g. configure 'data' to return 'response.data'). - type: optional - - FileDownloadResponse: - extends: commons.WithDocs - - TextResponse: - extends: commons.WithDocs - - StreamParameterResponse: - properties: - nonStreamResponse: NonStreamHttpResponseBody - streamResponse: StreamingResponse - - StreamingResponse: - union: - json: JsonStreamChunk - text: TextStreamChunk - sse: SseStreamChunk - - TextStreamChunk: - extends: commons.WithDocs - properties: {} - - JsonStreamChunk: - extends: commons.WithDocs - properties: - payload: types.TypeReference - terminator: optional - - SseStreamChunk: - extends: commons.WithDocs - properties: - payload: types.TypeReference - terminator: optional - - ResponseErrors: list - ResponseError: - extends: commons.WithDocs - properties: - error: errors.DeclaredErrorName - - Pagination: - docs: | - If set, the endpoint will be generated with auto-pagination features. - union: - cursor: CursorPagination - offset: OffsetPagination - - CursorPagination: - docs: | - If set, the endpoint will be generated with auto-pagination features. - - The page must be defined as a property defined on the request, whereas - the next page and results are resolved from properties defined on the - response. - properties: - page: RequestProperty - next: ResponseProperty - results: ResponseProperty - - OffsetPagination: - docs: | - The page must be defined as a query parameter included in the request, - whereas the results are resolved from properties defined on the response. - - The page index is auto-incremented between every additional page request. - properties: - page: RequestProperty - results: ResponseProperty - step: - docs: | - The step size used to increment the page offset between every new page. - type: optional - - # shared properties - RequestPropertyValue: - union: - query: QueryParameter - body: types.ObjectProperty - - RequestProperty: - docs: | - A property associated with an endpoint's request. - properties: - propertyPath: - docs: | - If empty, the property is defined at the top-level. - Otherwise, the property is defined on the nested object identified - by the path. - type: optional> - property: RequestPropertyValue - - ResponseProperty: - docs: | - A property associated with a paginated endpoint's request or response. - properties: - propertyPath: - docs: | - If empty, the property is defined at the top-level. - Otherwise, the property is defined on the nested object identified - by the path. - type: optional> - property: types.ObjectProperty - - # examples - AutogeneratedEndpointExample: - properties: - example: ExampleEndpointCall - - UserSpecifiedEndpointExample: - properties: - codeSamples: - type: optional> - docs: Manually written code samples specified by the user - example: - type: optional - docs: Manually written example specified by the user - - ExampleEndpointCall: - extends: commons.WithDocs - properties: - id: optional - name: optional - url: string - rootPathParameters: list - servicePathParameters: list - endpointPathParameters: list - serviceHeaders: list - endpointHeaders: list - queryParameters: list - request: optional - response: ExampleResponse - - ExampleCodeSample: - availability: in-development - union: - language: ExampleCodeSampleLanguage - sdk: ExampleCodeSampleSdk - - ExampleCodeSampleLanguage: - docs: | - This is intended to co-exist with the auto-generated code samples. - extends: commons.WithDocs - properties: - name: - type: optional - docs: Override the example name. - language: string - code: string - install: - type: optional - docs: | - The command to install the dependencies for the code sample. - For example, `npm install` or `pip install -r requirements.txt`. - - ExampleCodeSampleSdk: - docs: | - This will be used to replace the auto-generated code samples. - extends: commons.WithDocs - properties: - name: - type: optional - docs: Override the example name. - sdk: SupportedSdkLanguage - code: string - - # be sure to keep this in sync with the list of supported Fern SDK languages - SupportedSdkLanguage: - enum: - - curl - - python - - javascript - - typescript - - go - - ruby - - csharp - - java - - ExamplePathParameter: - properties: - name: commons.Name - value: types.ExampleTypeReference - - ExampleQueryParameter: - properties: - name: commons.NameAndWireValue - value: types.ExampleTypeReference - - ExampleHeader: - properties: - name: commons.NameAndWireValue - value: types.ExampleTypeReference - - ExampleRequestBody: - union: - inlinedRequestBody: ExampleInlinedRequestBody - reference: types.ExampleTypeReference - - ExampleInlinedRequestBody: - extends: commons.WithJsonExample - properties: - properties: list - - ExampleInlinedRequestBodyProperty: - properties: - name: commons.NameAndWireValue - value: types.ExampleTypeReference - originalTypeDeclaration: - docs: | - This property may have been brought in via extension. originalTypeDeclaration - is the name of the type that contains this property - type: optional - - ExampleResponse: - union: - ok: ExampleEndpointSuccessResponse - error: ExampleEndpointErrorResponse - - ExampleEndpointSuccessResponse: - union: - body: optional - stream: list - sse: list - - ExampleServerSideEvent: - properties: - event: string - data: types.ExampleTypeReference - - ExampleEndpointErrorResponse: - properties: - error: errors.DeclaredErrorName - body: optional diff --git a/packages/ir-sdk/fern/apis/ir-types-v50/definition/ir.yml b/packages/ir-sdk/fern/apis/ir-types-v50/definition/ir.yml deleted file mode 100644 index 6a7784158cc..00000000000 --- a/packages/ir-sdk/fern/apis/ir-types-v50/definition/ir.yml +++ /dev/null @@ -1,119 +0,0 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json - -imports: - types: types.yml - errors: errors.yml - auth: auth.yml - http: http.yml - constants: constants.yml - environment: environment.yml - commons: commons.yml - variables: variables.yml - webhooks: webhooks.yml - websocket: websocket.yml -types: - IntermediateRepresentation: - docs: "Complete representation of the API schema" - properties: - apiName: - type: commons.Name - docs: This is the human readable unique id for the API. - apiDisplayName: optional - apiDocs: optional - auth: auth.ApiAuth - headers: - docs: API Wide headers that are sent on every request - type: list - idempotencyHeaders: - docs: Headers that are sent for idempotent endpoints - type: list - types: - docs: "The types described by this API" - type: map - services: - docs: "The services exposed by this API" - type: map - webhookGroups: - docs: "The webhooks sent by this API" - type: map - websocketChannels: - docs: "The websocket channels served by this API" - type: optional> - errors: map - subpackages: map - rootPackage: Package - constants: constants.Constants - environments: optional - basePath: optional - pathParameters: list - errorDiscriminationStrategy: ErrorDiscriminationStrategy - sdkConfig: SdkConfig - variables: list - serviceTypeReferenceInfo: ServiceTypeReferenceInfo - readmeConfig: optional - ReadmeConfig: - docs: | - The configuration used to generate a README.md file. If present, the generator - should call the generator-cli to produce a README.md. - properties: - defaultEndpoint: - docs: | - If specified, this enpdoint should be used in every snippet (if possible). - Note that some endpoints aren't suitable for every feature (e.g. a non-list - endpoint for pagination), so the default is a no-op in those cases. - type: optional - bannerLink: optional - introduction: optional - apiReferenceLink: optional - features: - docs: | - If specified, configures the list of endpoints to associate - with each feature. - type: optional>> - SdkConfig: - properties: - isAuthMandatory: boolean - hasStreamingEndpoints: boolean - hasPaginatedEndpoints: boolean - hasFileDownloadEndpoints: boolean - platformHeaders: PlatformHeaders - PlatformHeaders: - properties: - language: string - sdkName: string - sdkVersion: string - ErrorDiscriminationStrategy: - union: - statusCode: {} - property: ErrorDiscriminationByPropertyStrategy - ErrorDiscriminationByPropertyStrategy: - properties: - discriminant: commons.NameAndWireValue - contentProperty: commons.NameAndWireValue - Package: - extends: commons.WithDocs - properties: - fernFilepath: commons.FernFilepath - service: optional - types: list - errors: list - webhooks: optional - websocket: optional - subpackages: list - hasEndpointsInTree: boolean - navigationConfig: optional - Subpackage: - extends: Package - properties: - name: commons.Name - PackageNavigationConfig: - properties: - pointsTo: commons.SubpackageId - ServiceTypeReferenceInfo: - properties: - typesReferencedOnlyByService: - docs: "Types referenced by exactly one service." - type: map> - sharedTypes: - docs: "Types referenced by either zero or multiple services." - type: list diff --git a/packages/ir-sdk/fern/apis/ir-types-v50/definition/types.yml b/packages/ir-sdk/fern/apis/ir-types-v50/definition/types.yml deleted file mode 100644 index fa2b4ba395c..00000000000 --- a/packages/ir-sdk/fern/apis/ir-types-v50/definition/types.yml +++ /dev/null @@ -1,382 +0,0 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json - -imports: - commons: commons.yml -types: - TypeDeclaration: - docs: "A type, which is a name and a shape" - extends: commons.Declaration - properties: - name: DeclaredTypeName - shape: Type - examples: list - referencedTypes: - docs: All other named types that this type references (directly or indirectly) - type: set - - DeclaredTypeName: - properties: - typeId: commons.TypeId - fernFilepath: commons.FernFilepath - name: commons.Name - - Type: - discriminant: - value: _type - name: type - union: - alias: AliasTypeDeclaration - enum: EnumTypeDeclaration - object: ObjectTypeDeclaration - union: UnionTypeDeclaration - undiscriminatedUnion: UndiscriminatedUnionTypeDeclaration - - AliasTypeDeclaration: - properties: - aliasOf: TypeReference - resolvedType: ResolvedTypeReference - ResolvedTypeReference: - discriminant: - value: _type - name: type - union: - container: - type: ContainerType - key: container - named: ResolvedNamedType - primitive: - type: PrimitiveType - key: primitive - unknown: {} - ResolvedNamedType: - properties: - name: DeclaredTypeName - shape: ShapeType - ShapeType: - enum: - - ENUM - - OBJECT - - UNION - - UNDISCRIMINATED_UNION - - EnumTypeDeclaration: - properties: - values: list - EnumValue: - extends: commons.Declaration - properties: - name: commons.NameAndWireValue - - ObjectTypeDeclaration: - properties: - extends: - docs: A list of other types to inherit from - type: list - properties: list - extra-properties: - docs: Whether to allow extra properties on the object. - type: boolean - ObjectProperty: - extends: commons.Declaration - properties: - name: commons.NameAndWireValue - valueType: TypeReference - - UnionTypeDeclaration: - properties: - discriminant: commons.NameAndWireValue - extends: - docs: "A list of other types to inherit from" - type: list - types: list - baseProperties: list - SingleUnionType: - extends: commons.WithDocs - properties: - discriminantValue: commons.NameAndWireValue - shape: SingleUnionTypeProperties - SingleUnionTypeProperties: - discriminant: - value: _type - name: propertiesType - union: - samePropertiesAsObject: DeclaredTypeName - singleProperty: SingleUnionTypeProperty - noProperties: {} - SingleUnionTypeProperty: - properties: - name: commons.NameAndWireValue - type: TypeReference - - UndiscriminatedUnionTypeDeclaration: - properties: - members: list - UndiscriminatedUnionMember: - extends: commons.WithDocs - properties: - type: TypeReference - - TypeReference: - discriminant: - value: _type - name: type - union: - container: - type: ContainerType - key: container - named: DeclaredTypeName - primitive: - type: PrimitiveType - key: primitive - unknown: {} - ContainerType: - discriminant: - value: _type - name: type - union: - list: - type: TypeReference - key: list - map: MapType - optional: - type: TypeReference - key: optional - set: - type: TypeReference - key: set - literal: - type: Literal - key: literal - MapType: - properties: - keyType: TypeReference - valueType: TypeReference - - PrimitiveType: - properties: - v1: PrimitiveTypeV1 - v2: optional - PrimitiveTypeV1: - enum: - - INTEGER - - DOUBLE - - STRING - - BOOLEAN - - value: LONG - docs: "Within the range -2^53 to 2^53" - - DATE_TIME - - DATE - - UUID - - BASE_64 - - BIG_INTEGER - PrimitiveTypeV2: - union: - integer: IntegerType - double: DoubleType - string: StringType - boolean: BooleanType - long: LongType - bigInteger: BigIntegerType - - IntegerType: - properties: - default: optional - validation: optional - IntegerValidationRules: - properties: - min: optional - max: optional - exclusiveMin: optional - exclusiveMax: optional - multipleOf: optional - DoubleType: - properties: - default: optional - validation: optional - DoubleValidationRules: - properties: - min: optional - max: optional - exclusiveMin: optional - exclusiveMax: optional - multipleOf: optional - StringType: - properties: - default: optional - validation: optional - StringValidationRules: - properties: - format: optional - pattern: optional - minLength: optional - maxLength: optional - BooleanType: - properties: - default: optional - LongType: - properties: - default: optional - BigIntegerType: - properties: - default: optional - - Literal: - union: - string: - type: string - key: string - boolean: - type: boolean - key: boolean - - # examples - - ExampleType: - extends: - - commons.WithJsonExample - - commons.WithDocs - properties: - name: optional - shape: ExampleTypeShape - - ExampleTypeShape: - union: - alias: ExampleAliasType - enum: ExampleEnumType - object: ExampleObjectType - union: ExampleUnionType - undiscriminatedUnion: ExampleUndiscriminatedUnionType - - ExampleAliasType: - properties: - value: ExampleTypeReference - - ExampleEnumType: - properties: - value: commons.NameAndWireValue - - ExampleObjectType: - properties: - properties: list - - ExampleObjectProperty: - properties: - name: commons.NameAndWireValue - value: ExampleTypeReference - originalTypeDeclaration: - docs: | - This property may have been brought in via extension. originalTypeDeclaration - is the name of the type that contains this property. - type: DeclaredTypeName - - ExampleUnionType: - properties: - discriminant: commons.NameAndWireValue - singleUnionType: ExampleSingleUnionType - - ExampleUndiscriminatedUnionType: - properties: - index: - type: integer - docs: | - The zero-based index of the undiscriminated union variant. - For the following undiscriminated union - ``` - MyUnion: - discriminated: false - union: - - string - - integer - ``` - a string example would have an index 0 and an integer example - would have an index 1. - singleUnionType: ExampleTypeReference - - ExampleSingleUnionType: - properties: - wireDiscriminantValue: commons.NameAndWireValue - shape: ExampleSingleUnionTypeProperties - - ExampleSingleUnionTypeProperties: - union: - samePropertiesAsObject: ExampleObjectTypeWithTypeId - singleProperty: ExampleTypeReference - noProperties: {} - - ExampleTypeReference: - extends: commons.WithJsonExample - properties: - shape: ExampleTypeReferenceShape - - ExampleTypeReferenceShape: - union: - primitive: - type: ExamplePrimitive - key: primitive - container: - type: ExampleContainer - key: container - unknown: - type: unknown - key: unknown - named: ExampleNamedType - - ExampleContainer: - union: - list: - type: list - key: list - set: - type: list - key: set - optional: - type: optional - key: optional - map: - type: list - key: map - literal: - type: ExamplePrimitive - key: literal - - ExampleKeyValuePair: - properties: - key: ExampleTypeReference - value: ExampleTypeReference - - ExamplePrimitive: - union: - integer: - type: integer - key: integer - double: - type: double - key: double - string: - type: commons.EscapedString - key: string - boolean: - type: boolean - key: boolean - long: - type: long - key: long - datetime: - type: datetime - key: datetime - date: - type: date - key: date - uuid: - type: uuid - key: uuid - - ExampleNamedType: - properties: - typeName: DeclaredTypeName - shape: ExampleTypeShape - - ExampleObjectTypeWithTypeId: - properties: - typeId: commons.TypeId - object: ExampleObjectType diff --git a/packages/ir-sdk/fern/apis/ir-types-v50/definition/variables.yml b/packages/ir-sdk/fern/apis/ir-types-v50/definition/variables.yml deleted file mode 100644 index 2c196becb01..00000000000 --- a/packages/ir-sdk/fern/apis/ir-types-v50/definition/variables.yml +++ /dev/null @@ -1,13 +0,0 @@ -imports: - commons: commons.yml - types: types.yml - -types: - VariableId: string - - VariableDeclaration: - extends: commons.WithDocs - properties: - id: VariableId - name: commons.Name - type: types.TypeReference diff --git a/packages/ir-sdk/fern/apis/ir-types-v50/definition/webhooks.yml b/packages/ir-sdk/fern/apis/ir-types-v50/definition/webhooks.yml deleted file mode 100644 index 97397a76767..00000000000 --- a/packages/ir-sdk/fern/apis/ir-types-v50/definition/webhooks.yml +++ /dev/null @@ -1,56 +0,0 @@ -imports: - commons: commons.yml - types: types.yml - http: http.yml -types: - WebhookGroup: list - - Webhook: - extends: commons.Declaration - properties: - id: commons.WebhookId - name: WebhookName - displayName: optional - method: WebhookHttpMethod - headers: list - payload: WebhookPayload - examples: optional> - - WebhookName: commons.Name - - WebhookPayload: - union: - inlinedPayload: InlinedWebhookPayload - reference: WebhookPayloadReference - - WebhookPayloadReference: - extends: commons.WithDocs - properties: - payloadType: types.TypeReference - - InlinedWebhookPayload: - properties: - name: commons.Name - extends: list - properties: list - - InlinedWebhookPayloadProperty: - extends: commons.WithDocs - properties: - name: commons.NameAndWireValue - valueType: types.TypeReference - - WebhookHttpMethod: - enum: - - GET - - POST - - ExampleWebhookCall: - docs: | - An example webhook call. For now, this only includes the payload, - but it can be easily extended to support other endpoint properties - (e.g. headers). - extends: commons.WithDocs - properties: - name: optional - payload: types.ExampleTypeReference diff --git a/packages/ir-sdk/fern/apis/ir-types-v50/definition/websocket.yml b/packages/ir-sdk/fern/apis/ir-types-v50/definition/websocket.yml deleted file mode 100644 index 18482877ba3..00000000000 --- a/packages/ir-sdk/fern/apis/ir-types-v50/definition/websocket.yml +++ /dev/null @@ -1,79 +0,0 @@ -imports: - commons: commons.yml - types: types.yml - http: http.yml - -types: - WebSocketMessageId: string - - WebSocketChannel: - extends: commons.Declaration - properties: - name: WebSocketName - displayName: optional - path: http.HttpPath - auth: boolean - headers: list - queryParameters: list - pathParameters: list - messages: - docs: "The messages that can be sent and received on this channel" - type: list - examples: list - - WebSocketName: commons.Name - - WebSocketMessage: - extends: commons.Declaration - properties: - type: WebSocketMessageId - displayName: optional - origin: WebSocketMessageOrigin - body: WebSocketMessageBody - - WebSocketMessageOrigin: - enum: - - client - - server - - WebSocketMessageBody: - union: - inlinedBody: InlinedWebSocketMessageBody - reference: WebSocketMessageBodyReference - - InlinedWebSocketMessageBody: - properties: - name: commons.Name - extends: list - properties: list - - InlinedWebSocketMessageBodyProperty: - extends: commons.WithDocs - properties: - name: commons.NameAndWireValue - valueType: types.TypeReference - - WebSocketMessageBodyReference: - extends: commons.WithDocs - properties: - bodyType: types.TypeReference - - ExampleWebSocketSession: - extends: commons.WithDocs - properties: - name: optional - url: string - pathParameters: list - headers: list - queryParameters: list - messages: list - - ExampleWebSocketMessage: - properties: - type: WebSocketMessageId - body: ExampleWebSocketMessageBody - - ExampleWebSocketMessageBody: - union: - inlinedBody: http.ExampleInlinedRequestBody - reference: types.ExampleTypeReference diff --git a/packages/ir-sdk/fern/apis/ir-types-v50/generators.yml b/packages/ir-sdk/fern/apis/ir-types-v50/generators.yml deleted file mode 100644 index 138df051095..00000000000 --- a/packages/ir-sdk/fern/apis/ir-types-v50/generators.yml +++ /dev/null @@ -1,54 +0,0 @@ -default-group: local -groups: - local: - generators: - - name: fernapi/fern-typescript-node-sdk - version: 0.8.13 - output: - location: local-file-system - path: ../../../src/sdk - config: - outputSourceFiles: true - includeUtilsOnUnionMembers: true - noOptionalProperties: true - node: - generators: - - name: fernapi/fern-typescript-node-sdk - version: 0.8.13 - output: - location: npm - url: npm.buildwithfern.com - package-name: "@fern-fern/ir-sdk" - config: - includeUtilsOnUnionMembers: true - noOptionalProperties: true - java: - generators: - - name: fernapi/java-model - version: 0.5.20 - output: - location: maven - url: maven.buildwithfern.com - coordinate: com.fern.fern:irV50 - config: - wrapped-aliases: true - enable-forward-compatible-enums: true - python: - generators: - - name: fernapi/fern-pydantic-model - version: 0.8.1-rc0 - output: - location: pypi - url: pypi.buildwithfern.com - package-name: fern_fern_ir_v50 - config: - wrapped_aliases: true - include_union_utils: true - frozen: true - version: v1 - go: - generators: - - name: fernapi/fern-go-model - version: 0.9.3 - github: - repository: fern-api/ir-go