Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions .github/workflows/deploy-fdr-lambda-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ env:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GITHUB_TOKEN: ${{ secrets.FERN_GITHUB_TOKEN }}
DATABASE_URL: ${{ secrets.DEV2_RDS_PROXY_URL }}
VENUS_URL: ${{ secrets.DEV2_VENUS_URL }}
PUBLIC_DOCS_CDN_URL: ${{ secrets.DEV2_PUBLIC_DOCS_CDN_URL }}
PUBLIC_DOCS_S3_BUCKET_NAME: ${{ secrets.DEV2_PUBLIC_DOCS_S3_BUCKET_NAME }}
PUBLIC_DOCS_S3_BUCKET_REGION: ${{ secrets.DEV2_PUBLIC_DOCS_S3_BUCKET_REGION }}
PRIVATE_DOCS_S3_BUCKET_NAME: ${{ secrets.DEV2_PRIVATE_DOCS_S3_BUCKET_NAME }}
PRIVATE_DOCS_S3_BUCKET_REGION: ${{ secrets.DEV2_PRIVATE_DOCS_S3_BUCKET_REGION }}
DB_DOCS_DEFINITION_BUCKET_NAME: ${{ secrets.DEV2_DB_DOCS_DEFINITION_BUCKET_NAME }}
DB_DOCS_DEFINITION_BUCKET_REGION: ${{ secrets.DEV2_DB_DOCS_DEFINITION_BUCKET_REGION }}

jobs:
deploy_dev:
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/deploy-fdr-lambda-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ env:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GITHUB_TOKEN: ${{ secrets.FERN_GITHUB_TOKEN }}
DATABASE_URL: ${{ secrets.PROD_RDS_PROXY_URL }}
VENUS_URL: ${{ secrets.VENUS_URL }}
PUBLIC_DOCS_CDN_URL: ${{ secrets.PUBLIC_DOCS_CDN_URL }}
PUBLIC_DOCS_S3_BUCKET_NAME: ${{ secrets.PUBLIC_DOCS_S3_BUCKET_NAME }}
PUBLIC_DOCS_S3_BUCKET_REGION: ${{ secrets.PUBLIC_DOCS_S3_BUCKET_REGION }}
PRIVATE_DOCS_S3_BUCKET_NAME: ${{ secrets.PRIVATE_DOCS_S3_BUCKET_NAME }}
PRIVATE_DOCS_S3_BUCKET_REGION: ${{ secrets.PRIVATE_DOCS_S3_BUCKET_REGION }}
DB_DOCS_DEFINITION_BUCKET_NAME: ${{ secrets.DB_DOCS_DEFINITION_BUCKET_NAME }}
DB_DOCS_DEFINITION_BUCKET_REGION: ${{ secrets.DB_DOCS_DEFINITION_BUCKET_REGION }}

jobs:
deploy_prod:
Expand All @@ -31,6 +39,11 @@ jobs:
- name: 📥 Install
uses: ./.github/actions/install

- name: 🔨 Build dependencies
run: |
# Build fdr-sdk first so tests can import it
pnpm --filter=@fern-api/fdr-sdk build

- name: 🧪 Run Tests
run: |
cd servers/fdr-lambda
Expand Down
23 changes: 21 additions & 2 deletions .github/workflows/preview-fdr-lambda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ env:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GITHUB_TOKEN: ${{ secrets.FERN_GITHUB_TOKEN }}
DATABASE_URL: ${{ secrets.DEV2_RDS_PROXY_URL }}
VENUS_URL: ${{ secrets.DEV2_VENUS_URL }}
PUBLIC_DOCS_CDN_URL: ${{ secrets.DEV2_PUBLIC_DOCS_CDN_URL }}
PUBLIC_DOCS_S3_BUCKET_NAME: ${{ secrets.DEV2_PUBLIC_DOCS_S3_BUCKET_NAME }}
PUBLIC_DOCS_S3_BUCKET_REGION: ${{ secrets.DEV2_PUBLIC_DOCS_S3_BUCKET_REGION }}
PRIVATE_DOCS_S3_BUCKET_NAME: ${{ secrets.DEV2_PRIVATE_DOCS_S3_BUCKET_NAME }}
PRIVATE_DOCS_S3_BUCKET_REGION: ${{ secrets.DEV2_PRIVATE_DOCS_S3_BUCKET_REGION }}
DB_DOCS_DEFINITION_BUCKET_NAME: ${{ secrets.DEV2_DB_DOCS_DEFINITION_BUCKET_NAME }}
DB_DOCS_DEFINITION_BUCKET_REGION: ${{ secrets.DEV2_DB_DOCS_DEFINITION_BUCKET_REGION }}

jobs:
preview_lambda:
Expand All @@ -35,6 +43,10 @@ jobs:
- name: 📥 Install
uses: ./.github/actions/install

- name: 🔨 Build dependencies
run: |
pnpm compile

- name: 🧪 Run Tests
run: |
cd servers/fdr-lambda
Expand Down Expand Up @@ -104,17 +116,24 @@ jobs:
**📝 Available Endpoints:**
- Base: \`GET ${previewUrl}\`
- Health: \`GET ${previewUrl}/health\`
- Metadata: \`POST ${previewUrl}/metadata-for-url\`
- Metadata (public): \`POST ${previewUrl}/metadata-for-url\`
- Load Docs (requires auth): \`POST ${previewUrl}/load-docs-for-url\`

**📋 Example Usage:**
\`\`\`bash
# Test default endpoint
curl "${previewUrl}"

# Test metadata endpoint
# Test metadata endpoint (public - no auth required)
curl -X POST "${previewUrl}/metadata-for-url" \\
-H "Content-Type: application/json" \\
-d '{"url":"https://docs.buildwithfern.com"}'

# Test load docs endpoint (requires Fern token)
curl -X POST "${previewUrl}/load-docs-for-url" \\
-H "Content-Type: application/json" \\
-H "Authorization: Bearer \$FERN_TOKEN" \\
-d '{"url":"https://docs.buildwithfern.com"}'
\`\`\`

**🏷️ Stack Name:** \`fdr-lambda-preview-${prNumber}\`
Expand Down
2 changes: 2 additions & 0 deletions fern/apis/fdr/definition/docs/v2/read/__package__.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ service:
getDocsForUrl:
method: POST
path: /load-with-url
audiences:
- fdr-lambda
request:
name: LoadDocsForUrlRequest
body:
Expand Down
1 change: 1 addition & 0 deletions packages/fdr-lambda-sdk/src/api/resources/api/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./resources/index.js";
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * as latest from "./latest/index.js";
export * as v1 from "./v1/index.js";
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./resources/index.js";
export * from "./types/index.js";
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./types/index.js";
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import type * as FdrLambda from "../../../../../../../index.js";

export type AuthScheme = FdrLambda.api.v1.read.ApiAuth;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./AuthScheme.js";
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./types/index.js";
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import type * as FdrLambda from "../../../../../../../index.js";

export interface Environment {
id: FdrLambda.EnvironmentId;
baseUrl: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import type * as FdrLambda from "../../../../../../../index.js";

export type PathPart = FdrLambda.api.latest.PathPart.Literal | FdrLambda.api.latest.PathPart.PathParameter;

export namespace PathPart {
export interface Literal {
type: "literal";
value: string;
}

export interface PathParameter {
type: "pathParameter";
value: FdrLambda.PropertyKey;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import type * as FdrLambda from "../../../../../../../index.js";

export type SubpackageId = FdrLambda.api.v1.SubpackageId;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import type * as FdrLambda from "../../../../../../../index.js";

export interface SubpackageMetadata {
id: FdrLambda.api.latest.SubpackageId;
name: string;
displayName?: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import type * as FdrLambda from "../../../../../../../index.js";

export interface WithAvailability {
availability?: FdrLambda.Availability;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

export interface WithDescription {
description?: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import type * as FdrLambda from "../../../../../../../index.js";

export interface WithNamespace {
/** A list of subpackage names based on the order in which values are rendered in the frontend. */
namespace?: FdrLambda.api.latest.SubpackageId[];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export * from "./Environment.js";
export * from "./PathPart.js";
export * from "./SubpackageId.js";
export * from "./SubpackageMetadata.js";
export * from "./WithAvailability.js";
export * from "./WithDescription.js";
export * from "./WithNamespace.js";
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./types/index.js";
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import type * as FdrLambda from "../../../../../../../index.js";

export interface CodeSnippet extends FdrLambda.api.latest.WithDescription {
name?: string;
language: FdrLambda.api.latest.Language;
install?: string;
code: string;
generated: boolean;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import type * as FdrLambda from "../../../../../../../index.js";

export interface EndpointDefinition
extends FdrLambda.api.latest.WithDescription,
FdrLambda.api.latest.WithAvailability,
FdrLambda.api.latest.WithNamespace {
id: FdrLambda.EndpointId;
method: FdrLambda.HttpMethod;
path: FdrLambda.api.latest.PathPart[];
displayName?: string;
operationId?: string;
auth?: FdrLambda.AuthSchemeId[];
defaultEnvironment?: FdrLambda.EnvironmentId;
environments?: FdrLambda.api.latest.Environment[];
pathParameters?: FdrLambda.api.latest.ObjectProperty[];
queryParameters?: FdrLambda.api.latest.ObjectProperty[];
requestHeaders?: FdrLambda.api.latest.ObjectProperty[];
responseHeaders?: FdrLambda.api.latest.ObjectProperty[];
requests?: FdrLambda.api.latest.HttpRequest[];
responses?: FdrLambda.api.latest.HttpResponse[];
errors?: FdrLambda.api.latest.ErrorResponse[];
examples?: FdrLambda.api.latest.ExampleEndpointCall[];
snippetTemplates?: FdrLambda.api.latest.EndpointSnippetTemplates;
protocol?: FdrLambda.api.latest.Protocol;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import type * as FdrLambda from "../../../../../../../index.js";

export interface EndpointSnippetTemplates {
typescript?: FdrLambda.VersionedSnippetTemplate;
python?: FdrLambda.VersionedSnippetTemplate;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import type * as FdrLambda from "../../../../../../../index.js";

export interface ErrorExample extends FdrLambda.api.latest.WithDescription {
name?: string;
responseBody: FdrLambda.api.latest.ExampleErrorResponse;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import type * as FdrLambda from "../../../../../../../index.js";

export interface ErrorResponse extends FdrLambda.api.latest.WithDescription, FdrLambda.api.latest.WithAvailability {
shape?: FdrLambda.api.latest.TypeShape;
statusCode: number;
name: string;
examples?: FdrLambda.api.latest.ErrorExample[];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import type * as FdrLambda from "../../../../../../../index.js";

export interface ExampleEndpointCall extends FdrLambda.api.latest.WithDescription {
path: string;
responseStatusCode: number;
name?: string;
pathParameters?: Record<FdrLambda.PropertyKey, unknown>;
queryParameters?: Record<FdrLambda.PropertyKey, unknown>;
headers?: Record<FdrLambda.PropertyKey, unknown>;
requestBody?: FdrLambda.api.latest.ExampleEndpointRequest;
responseBody?: FdrLambda.api.latest.ExampleEndpointResponse;
snippets?: Record<FdrLambda.api.latest.Language, FdrLambda.api.latest.CodeSnippet[]>;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import type * as FdrLambda from "../../../../../../../index.js";

export type ExampleEndpointRequest = FdrLambda.api.v1.read.ExampleEndpointRequest;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import type * as FdrLambda from "../../../../../../../index.js";

export type ExampleEndpointResponse = FdrLambda.api.v1.read.ExampleEndpointResponse;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import type * as FdrLambda from "../../../../../../../index.js";

export type ExampleErrorResponse = FdrLambda.api.v1.read.ExampleErrorResponse;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

export interface FileDownloadResponseBodyShape {
contentType?: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import type * as FdrLambda from "../../../../../../../index.js";

export interface GrpcProtocol {
methodName: string;
methodType?: FdrLambda.GrpcMethod;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import type * as FdrLambda from "../../../../../../../index.js";

export interface HttpRequest extends FdrLambda.api.latest.WithDescription {
contentType?: string;
body: FdrLambda.api.latest.HttpRequestBodyShape;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import type * as FdrLambda from "../../../../../../../index.js";

export type HttpRequestBodyShape =
| FdrLambda.api.latest.HttpRequestBodyShape.Object_
| FdrLambda.api.latest.HttpRequestBodyShape.Alias
| FdrLambda.api.latest.HttpRequestBodyShape.Bytes
| FdrLambda.api.latest.HttpRequestBodyShape.FormData;

export namespace HttpRequestBodyShape {
export interface Object_ extends FdrLambda.api.latest.ObjectType {
type: "object";
}

export interface Alias {
type: "alias";
value: FdrLambda.api.latest.TypeReference;
}

export interface Bytes extends FdrLambda.api.v1.read.BytesRequest {
type: "bytes";
}

export interface FormData extends FdrLambda.api.latest.FormDataRequest {
type: "formData";
}
}
Loading
Loading