forked from chariot-giving/chariot-openapi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(feat): introduce fern for docs + sdk
- Loading branch information
Showing
14 changed files
with
316 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Fern Check | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
fern-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Install fern | ||
run: npm install -g fern-api | ||
- name: fern check | ||
run: fern check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Preview Docs | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
permissions: write-all | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Fern | ||
run: npm install -g fern-api | ||
|
||
- name: Generate preview URL | ||
id: generate-docs | ||
env: | ||
FERN_TOKEN: ${{ secrets.FERN_TOKEN }} | ||
run: | | ||
OUTPUT=$(fern generate --docs --preview 2>&1) || true | ||
echo "$OUTPUT" | ||
URL=$(echo "$OUTPUT" | grep -oP 'Published docs to \K.*(?= \()') | ||
echo "Preview URL: $URL" | ||
echo "🌿 Preview your docs: $URL" > preview_url.txt | ||
- name: Comment URL in PR | ||
uses: thollander/[email protected] | ||
with: | ||
filePath: preview_url.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Publish Docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event_name == 'push' && contains(github.ref, 'refs/heads/main') && github.run_number > 1 }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Fern | ||
run: npm install -g fern-api | ||
|
||
- name: Publish Docs | ||
env: | ||
FERN_TOKEN: ${{ secrets.FERN_TOKEN }} | ||
run: fern generate --docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Release TypeScript SDK | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: "The version of the Typescript SDK that you would like to release" | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
|
||
- name: Download Fern | ||
run: npm install -g fern-api | ||
|
||
- name: Release TypeScript SDK | ||
env: | ||
FERN_TOKEN: ${{ secrets.FERN_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: | | ||
fern generate --group ts-sdk --version ${{ inputs.version }} --log-level debug | ||
- name: Update Code Snippets | ||
env: | ||
FERN_TOKEN: ${{ secrets.FERN_TOKEN }} | ||
run: | | ||
fern generate --docs |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* :not(.dark) body { | ||
color: #240642 !important; | ||
} | ||
:is(.dark) body { | ||
color: #ffffff !important; | ||
} | ||
:not(.dark) .prose { | ||
color: #240642 !important; | ||
} | ||
:is(.dark) .prose { | ||
color: #ffffff !important; | ||
} */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
instances: | ||
- url: https://chariot.docs.buildwithfern.com | ||
title: Chariot Documentation | ||
|
||
navigation: | ||
- section: Documentation | ||
contents: | ||
- section: Get Started | ||
contents: | ||
- page: Overview | ||
slug: overview | ||
path: ./pages/overview.mdx | ||
- api: API Reference | ||
snippets: | ||
typescript: chariot | ||
|
||
colors: | ||
accentPrimary: | ||
light: "#35BBF4" | ||
dark: "#35BBF4" | ||
background: | ||
light: "#f8f9fb" | ||
dark: "#004676" | ||
sidebar-background: | ||
light: "#ffffff" | ||
dark: "#000000" | ||
header-background: | ||
light: '#ffffff' | ||
dark: "#000000" | ||
logo: | ||
light: assets/logo.png | ||
dark: assets/logo.png | ||
height: 40 | ||
favicon: assets/favicon.png | ||
css: assets/styles.css | ||
layout: | ||
page-width: full | ||
disable-header: false | ||
header-height: 73px | ||
searchbar-placement: header | ||
typography: | ||
bodyFont: | ||
name: OpenSans | ||
path: ./assets/matter.woff2 | ||
weight: "400" | ||
headingsFont: | ||
name: OpenSans | ||
path: ./assets/matter-bold.woff2 | ||
weight: "600" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"organization": "chariot", | ||
"version": "0.35.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
api: | ||
path: ../specs/v1.yaml | ||
overrides: ./openapi-overrides.yml | ||
settings: | ||
use-title: false | ||
groups: | ||
ts-sdk: | ||
generators: | ||
- name: fernapi/fern-typescript-node-sdk | ||
version: 0.36.1 | ||
output: | ||
location: npm | ||
package-name: "chariot" | ||
# token: ${NPM_TOKEN} | ||
github: | ||
repository: "chariot-giving/typescript-sdk" | ||
# mode: push | ||
# branch: main | ||
mode: pull-request | ||
config: | ||
namespaceExport: Chariot | ||
allowCustomFetcher: true | ||
skipResponseValidation: true | ||
smart-casing: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
paths: | ||
/v1/nonprofit/{ein}: | ||
get: | ||
x-fern-sdk-group-name: | ||
- nonprofits | ||
x-fern-sdk-method-name: getByEin | ||
/v1/nonprofits: | ||
post: | ||
x-fern-sdk-group-name: | ||
- nonprofits | ||
x-fern-sdk-method-name: create | ||
/v1/nonprofits/{id}: | ||
get: | ||
x-fern-sdk-group-name: | ||
- nonprofits | ||
x-fern-sdk-method-name: getById | ||
/v1/connects: | ||
post: | ||
x-fern-sdk-group-name: | ||
- connects | ||
x-fern-sdk-method-name: create | ||
/v1/connects/{id}: | ||
get: | ||
x-fern-sdk-group-name: | ||
- connects | ||
x-fern-sdk-method-name: get | ||
/v1/grants: | ||
get: | ||
x-fern-sdk-group-name: | ||
- grants | ||
x-fern-sdk-method-name: list | ||
post: | ||
x-fern-sdk-group-name: | ||
- grants | ||
x-fern-sdk-method-name: create | ||
/v1/grants/{id}: | ||
get: | ||
x-fern-sdk-group-name: | ||
- grants | ||
x-fern-sdk-method-name: get | ||
patch: | ||
x-fern-sdk-group-name: | ||
- grants | ||
x-fern-sdk-method-name: update | ||
/v1/unintegrated_grants: | ||
get: | ||
x-fern-sdk-group-name: | ||
- grants | ||
x-fern-sdk-method-name: list | ||
/v1/unintegrated_grants/{id}: | ||
get: | ||
x-fern-sdk-group-name: | ||
- grants | ||
x-fern-sdk-method-name: get | ||
patch: | ||
x-fern-sdk-group-name: | ||
- grants | ||
x-fern-sdk-method-name: update | ||
/v1/dafs: | ||
get: | ||
x-fern-sdk-group-name: | ||
- daFs | ||
x-fern-sdk-method-name: list | ||
/v1/dafs/{id}: | ||
get: | ||
x-fern-sdk-group-name: | ||
- daFs | ||
x-fern-sdk-method-name: get | ||
/v1/events: | ||
get: | ||
x-fern-sdk-group-name: | ||
- events | ||
x-fern-sdk-method-name: list | ||
/v1/events/{id}: | ||
get: | ||
x-fern-sdk-group-name: | ||
- events | ||
x-fern-sdk-method-name: get | ||
/v1/event_subscriptions: | ||
get: | ||
x-fern-sdk-group-name: | ||
- eventSubscriptions | ||
x-fern-sdk-method-name: list | ||
post: | ||
x-fern-sdk-group-name: | ||
- eventSubscriptions | ||
x-fern-sdk-method-name: create | ||
/v1/event_subscriptions/{id}: | ||
get: | ||
x-fern-sdk-group-name: | ||
- eventSubscriptions | ||
x-fern-sdk-method-name: get | ||
patch: | ||
x-fern-sdk-group-name: | ||
- eventSubscriptions | ||
x-fern-sdk-method-name: update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
title: Overview | ||
subtitle: A comprehensive reference for integrating with Chariot API endpoints | ||
--- | ||
The Chariot API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. | ||
|
||
<Info title="Issues, Ideas or Feedback"> | ||
If you feel like something is missing from our API docs, feel free to create an Issue on our [OpenAPI GitHub repo](https://github.com/chariot-giving/chariot-openapi). | ||
</Info> | ||
|
||
## API protocols and headers | ||
|
||
The Chariot API uses standard HTTP response codes to indicate status and errors. All responses come in standard JSON. The Chariot API is served over HTTPS TLS v1.2+ to ensure data privacy; HTTP and HTTPS with TLS versions below 1.2 are not supported. All requests with a payload must include a Content-Type of application/JSON and the body must be valid JSON. | ||
|
||
Every Chariot API response includes a request_id as the `X-Request-Id` header. The request_id is included whether the API request succeeded or failed. For faster support, include the request_id when contacting support regarding a specific API call. | ||
|
||
## API host | ||
|
||
```js Server.js | ||
https://sandboxapi.givechariot.com (Sandbox) | ||
https://api.givechariot.com (Production) | ||
``` | ||
|
||
Chariot has two environments: Sandbox and Production. The Sandbox environment supports only test data. All activity in the Production environment is real. When you’re getting ready to launch into production, please let us know by emailing [[email protected]]([email protected]) to get your production credentials. |