Skip to content

Commit bdafa29

Browse files
authored
Merge branch 'main' into ask-fern-updates
2 parents 2d02e91 + 6c473ed commit bdafa29

File tree

271 files changed

+3487
-2350
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

271 files changed

+3487
-2350
lines changed

.github/workflows/check-links.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Check Links
2+
3+
on:
4+
# Run monday mornings
5+
schedule:
6+
- cron: '0 12 * * MON'
7+
workflow_dispatch:
8+
jobs:
9+
check-links:
10+
name: Check links
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
site:
16+
- name: Fern Docs
17+
url: "buildwithfern.com/learn"
18+
steps:
19+
- name: Install link checker
20+
run: pip install linkchecker
21+
- name: Create config
22+
run: echo -e "[csv]\nseparator=,\n[filtering]\nignore=\n\texample.com\n\tus.i.posthog.com\n\tdocs.stack-auth.com\n\t/_vercel/(speed-)?insights/\n\tc.vialoops.com/CL0\n[output]\nignoreerrors=\n ^http ^403 Forbidden" > lcconfig
23+
- name: Check ${{ matrix.site.name }} Links
24+
run: |
25+
set +e
26+
cat lcconfig
27+
linkchecker https://${{ matrix.site.url }} --check-extern --no-status --no-warnings --config lcconfig -F csv/utf-8/link_report.csv
28+
29+
if [ $? -ne 0 ]; then
30+
echo "Bad links found. Please see report."
31+
else
32+
echo "Check completed. No issues found."
33+
exit 0
34+
fi
35+
36+
echo "Scan done, generating summary"
37+
38+
started=false
39+
shouldfail=false
40+
while read p; do
41+
# skip comments (top and bottom)
42+
if [[ $p == \#* ]]; then
43+
continue
44+
fi
45+
# make sure first line after comments is skipped
46+
if [[ "$started" = false ]]; then
47+
started=true
48+
continue
49+
fi
50+
51+
IFS=',' read -r -a array <<< "$p"
52+
53+
ret=$(curl -I -s "${array[0]}" -o /dev/null -w "%{http_code}\n")
54+
if [[ $ret == 200 ]]; then
55+
echo "Site now seems to be working, we should continue here"
56+
continue
57+
else
58+
echo "There is still an issue with ${array[0]}"
59+
fi
60+
61+
shouldfail=true
62+
63+
if [[ ${array[10]} == '' ]]; then
64+
echo "::error::URL: ${array[0]} on page: ${array[1]} is returning a ${array[3]}"
65+
else
66+
echo "::error::URL: ${array[0]} linked from '${array[10]}' on page: ${array[1]} is returning a ${array[3]}"
67+
fi
68+
69+
done < link_report.csv
70+
71+
if [[ "$shouldfail" = false ]]; then
72+
exit 0
73+
fi
74+
75+
exit 1
76+
77+
- name: Upload report
78+
if: failure()
79+
uses: actions/upload-artifact@v4
80+
with:
81+
name: Report - ${{ matrix.site.name }}
82+
path: link_report.csv

.github/workflows/update-versions.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ jobs:
2626
run: curl -s "https://registry.hub.docker.com/v2/repositories/fernapi/fern-ruby-sdk/tags" | jq -r -j '[.results[] | select(.name != "latest")] | .[0].name' > fern/snippets/version-number-ruby.mdx
2727
- name: update-ts-version
2828
run: curl -s "https://registry.hub.docker.com/v2/repositories/fernapi/fern-typescript-sdk/tags" | jq -r -j '[.results[] | select(.name != "latest")] | .[0].name' > fern/snippets/version-number-ts.mdx
29+
- name: update-swift-version
30+
run: curl -s "https://registry.hub.docker.com/v2/repositories/fernapi/fern-swift-sdk/tags" | jq -r -j '[.results[] | select(.name != "latest")] | .[0].name' > fern/snippets/version-number-swift.mdx
2931
- name: create PR
3032
id: cpr
3133
uses: peter-evans/create-pull-request@v7

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ Keep the following principles in mind:
5353
- **Write in clear, concise language**, using [active voice](https://developers.google.com/style/voice) whenever possible. Keep sentences and paragraphs short and to the point. Be conversational and friendly tone. Stay away from jargon as much as you can.
5454
- **Use [Fern’s documentation components](https://buildwithfern.com/learn/docs/writing-content/components/overview)** whenever you can.
5555
- **When editing an existing page** - Match the existing heading structure, tone, and level of detail to ensure your changes integrate as seamlessly as possible.
56+
- **Use diagrams when it makes sense** – Show, don't tell! Use [Mermaid](https://buildwithfern.com/learn/docs/writing-content/markdown#diagrams), a Markdown-like diagramming syntax, to illustrate a workflow.
57+
- [**Use sentence case**](https://developers.google.com/style/capitalization) for page and section headings.
5658

5759
> "Break any of these rules sooner than say anything outright barbarous."
5860
>
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
docs: FAI Document API
2+
3+
imports:
4+
commons: ./commons.yml
5+
6+
service:
7+
auth: false
8+
base-path: /document
9+
endpoints:
10+
createDocument:
11+
docs: Index a document for a given domain
12+
path: /{domain}/create
13+
method: POST
14+
audiences:
15+
- customers
16+
path-parameters:
17+
domain: string
18+
request:
19+
name: IndexDocumentRequest
20+
body:
21+
properties:
22+
document:
23+
type: string
24+
docs: The content of the document that will be returned in the tool response
25+
chunk:
26+
type: optional<string>
27+
docs: The chunk of the document that will be indexed as a vector. If not provided, the document will be indexed.
28+
title:
29+
type: optional<string>
30+
docs: The title of the document
31+
url:
32+
type: optional<string>
33+
docs: The url of the document
34+
version:
35+
type: optional<string>
36+
docs: The version of the document
37+
keywords:
38+
type: optional<list<string>>
39+
docs: The keywords of the document
40+
authed:
41+
type: optional<boolean>
42+
docs: Whether the document is authed
43+
response: CreateDocumentResponse
44+
errors:
45+
- commons.BadRequestError
46+
- commons.InternalError
47+
48+
getDocumentById:
49+
docs: Get a document for a given domain
50+
path: /{domain}/{document_id}
51+
method: GET
52+
audiences:
53+
- customers
54+
path-parameters:
55+
domain: string
56+
document_id: string
57+
response: Document
58+
errors:
59+
- commons.BadRequestError
60+
- commons.InternalError
61+
62+
types:
63+
CreateDocumentResponse:
64+
properties:
65+
document_id: string
66+
67+
Document:
68+
properties:
69+
document_id: string
70+
chunk: string
71+
domain: string
72+
document: string
73+
title: optional<string>
74+
url: optional<string>
75+
version: optional<string>
76+
keywords: optional<list<string>>
77+
authed: optional<boolean>
78+
created_at: datetime
79+
updated_at: datetime
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
docs: FAI Guidance API
2+
3+
imports:
4+
commons: ./commons.yml
5+
6+
service:
7+
auth: false
8+
base-path: /guidance
9+
endpoints:
10+
createGuidance:
11+
docs: Index a guidance document for a given domain
12+
path: /{domain}/create
13+
method: POST
14+
audiences:
15+
- customers
16+
path-parameters:
17+
domain: string
18+
request:
19+
name: IndexGuidanceRequest
20+
body:
21+
properties:
22+
context:
23+
type: list<string>
24+
docs: The context of the guidance document, as a list of strings, that will be indexed.
25+
document:
26+
type: string
27+
docs: The content of the guidance document that will be returned in the tool response
28+
errors:
29+
- commons.BadRequestError
30+
- commons.InternalError
31+
32+
updateGuidanceById:
33+
docs: Update a guidance document for a given domain
34+
path: /{domain}/{guidance_id}
35+
method: PATCH
36+
audiences:
37+
- customers
38+
path-parameters:
39+
domain: string
40+
guidance_id: string
41+
request:
42+
name: UpdateGuidanceRequest
43+
body:
44+
properties:
45+
context:
46+
type: list<string>
47+
docs: The context of the document, as a list of strings, that will be indexed.
48+
document:
49+
type: string
50+
docs: The content of the document that will be returned in the tool response. If not provided, the document will be removed from the index.
51+
response: Guidance
52+
errors:
53+
- commons.BadRequestError
54+
- commons.InternalError
55+
56+
deleteGuidanceById:
57+
docs: Delete a guidance document for a given domain
58+
path: /{domain}/{guidance_id}
59+
method: DELETE
60+
audiences:
61+
- customers
62+
path-parameters:
63+
domain: string
64+
guidance_id: string
65+
errors:
66+
- commons.BadRequestError
67+
- commons.InternalError
68+
69+
getGuidanceById:
70+
docs: Get a guidance document for a given domain
71+
path: /{domain}/{guidance_id}
72+
method: GET
73+
audiences:
74+
- customers
75+
path-parameters:
76+
domain: string
77+
guidance_id: string
78+
response: Guidance
79+
errors:
80+
- commons.BadRequestError
81+
- commons.InternalError
82+
83+
getGuidances:
84+
docs: Retrieve all paginated guidance documents for a given domain
85+
path: /{domain}
86+
method: GET
87+
audiences:
88+
- customers
89+
path-parameters:
90+
domain:
91+
type: string
92+
docs: The domain to retrieve documents for
93+
request:
94+
name: GetGuidancesRequest
95+
query-parameters:
96+
page: optional<integer>
97+
limit: optional<integer>
98+
response: GuidanceList
99+
errors:
100+
- commons.BadRequestError
101+
- commons.InternalError
102+
103+
types:
104+
Guidance:
105+
properties:
106+
guidance_id: string
107+
context: list<string>
108+
domain: string
109+
document: string
110+
created_at: datetime
111+
updated_at: datetime
112+
113+
GuidanceList:
114+
properties:
115+
guidances: list<Guidance>
116+
pagination: Pagination
117+
118+
Pagination:
119+
properties:
120+
total: integer
121+
page: integer
122+
limit: integer

0 commit comments

Comments
 (0)