Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor & improve public API #86

Merged
merged 40 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
beb90bc
Add hono and try some routes
Redm4x Nov 28, 2023
78c5f29
Test openai/swagger
Redm4x Dec 5, 2023
90bafb3
Move some routes to the new folder structure
Redm4x Jan 9, 2024
5193aa3
Moved some more routes into their new folder
Redm4x Jan 9, 2024
7b3fd05
Refactor some more endpoints
Redm4x Jan 9, 2024
811b6eb
Move more endpoints
Redm4x Jan 10, 2024
66add29
Add deployment detail endpoint
Redm4x Jan 10, 2024
0e5fb7d
Add tags & summaries
Redm4x Jan 10, 2024
b29e54b
Move version and provider attribute endpoints
Redm4x Jan 11, 2024
f2c4b7b
Move graphs endpoints
Redm4x Jan 11, 2024
7a20a7d
Move blocks endpoints
Redm4x Jan 16, 2024
0ac0e30
Remove unecessary openapi properties
Redm4x Jan 16, 2024
df6e6bb
Improve doc
Redm4x Jan 16, 2024
3bafe6e
Add eslint
Redm4x Jan 16, 2024
696983f
Improve typing
Redm4x Jan 16, 2024
3587c54
.
Redm4x Jan 16, 2024
c9bdea8
Cleanup
Redm4x Jan 16, 2024
6a8fd59
Remove /api prefix and migrate dashboardRouter to hono
Redm4x Jan 16, 2024
e07793a
Migrate web3-index router to hono
Redm4x Jan 16, 2024
06d61aa
Merge branch 'main' into refactor/improve-api
Redm4x Jan 16, 2024
24ec332
Fix merge
Redm4x Jan 16, 2024
672ea8a
Change api urls in deploy website
Redm4x Jan 16, 2024
19fb38f
Add version to baseapiurl
Redm4x Jan 16, 2024
e46bed9
Add cors to hono
Redm4x Jan 16, 2024
af7bd91
Convert required user endpoints
Redm4x Jan 23, 2024
e6d7197
Convert optional user routes
Redm4x Jan 23, 2024
a51ab03
Remove unused dependencies
Redm4x Jan 23, 2024
edf60b4
.
Redm4x Jan 23, 2024
546588d
.
Redm4x Jan 23, 2024
5581a29
.
Redm4x Jan 23, 2024
98becf2
Improve typing
Redm4x Jan 26, 2024
71ea6b1
Add legacy router
Redm4x Jan 29, 2024
5f20c3d
Add sentry middleware
Redm4x Jan 30, 2024
86cad6d
Add jwks caching
Redm4x Jan 30, 2024
eb3e716
Set correct swagger servers
Redm4x Jan 30, 2024
3911ca6
Add documentation
Redm4x Jan 30, 2024
28f5d6a
Rename providers to services
Redm4x Jan 30, 2024
7034500
Merge branch 'main' into refactor/improve-api
Redm4x Feb 13, 2024
972965b
Merge fixes
Redm4x Feb 13, 2024
775cde7
.
Redm4x Feb 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions api/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"env": {
"browser": true,
"es2021": true
},
"ignorePatterns": ["node_modules/", "dist/", "webpack.*.js"],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"rules": {
"@typescript-eslint/no-unused-vars": ["error", { "ignoreRestSiblings": true }]
}
}
38 changes: 38 additions & 0 deletions api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,41 @@ Auth0Issuer|ex: `'https://dev-5aprb0lr.us.auth0.com/'`
Auth0Issuer|ex: `'https://auth.cloudmos.io/'`
StripeSecretKey|ex: `sk_test_12aw315wdawd3...293d12d32df8jf`
WebsiteUrl|`http://localhost:3001`

## Changes from **beta** to **v1** (February 2024)

### Api Versioning

The public api version will now be included in the url like so: api.cloudmos.io/**v1**/\<endpoint>

Changes that are backward compatible like adding new endpoint will be done in the existing version.
Changes that are **not** backward compatible, such as removing an endpoint, will be done in a new version. When releasing a new version, a list of breaking changes will be made available. We will keep the old version available for a while to give users enough time to migrate their applications to the latest version.

### Swagger Documentation

A swagger documentation is now available at https://api.cloudmos.io/v1/swagger. You can use it to see the list of available endpoints and try them directly in your browser.

### Route Changes

The `/api` prefix was removed from every public endpoints and instead the version should be used (ex: `/v1/<endpoint>`)

Here is a list of endpoints that have changed in this release. Old endpoints will temporarily redirect to the new ones. In future releases, the [versioning system](#api-versioning) will be used instead of redirects.


|Old|New|
|-|-
|`/predicted-block-date/<height>/<blockWindow>` | `/predicted-block-date/<height>?blockWindow=<blockWindow>`
|`/predicted-date-height/<timestamp>/<blockWindow>` | `/predicted-date-height/<timestamp>?blockWindow=<blockWindow>`
|`/getNetworkCapacity`|`/network-capacity`
|`/marketData`|`/market-data`
|`/dashboardData`|`/dashboard-data`
|`getMainnetNodes`|`/nodes/mainnet`
|`/getSandboxNodes`|`/nodes/sandbox`
|`/getTestnetNodes`|`/nodes/testnet`
|`/getProviderAttributesSchema`|`/provider-attributes-schema`
|`/getMainnetVersion`|`/version/mainnet`
|`/getSandboxVersion`|`/version/sandbox`
|`/getTestnetVersion`|`/version/testnet`
|`/getProviderGraphData/<dataName>`|`/provider-graph-data/<dataName>`
|`/getProviderActiveLeasesGraphData/<address>`|`/provider-active-leases-graph-data/<address>`
|`/getGraphData/<dataName>`|`/graph-data/<dataName>`
Loading
Loading