From 2b0bf07220f67c401882a9b94883bd226f56bb5e Mon Sep 17 00:00:00 2001 From: isstuev Date: Mon, 11 Sep 2023 10:40:42 -0300 Subject: [PATCH] default spec url --- configs/app/features/restApiDocs.ts | 13 +++---------- configs/envs/.env.eth | 1 - configs/envs/.env.eth_goerli | 1 - configs/envs/.env.localhost | 1 - configs/envs/.env.main | 1 - configs/envs/.env.main.L2 | 1 - configs/envs/.env.poa_core | 1 - configs/envs/.env.polygon | 1 - configs/envs/.env.rootstock | 1 - deploy/values/l2-optimism-goerli/values.yaml | 1 - deploy/values/main/values.yaml | 1 - deploy/values/review-l2/values.yaml.gotmpl | 2 -- deploy/values/review/values.yaml.gotmpl | 2 -- docs/ENVS.md | 2 +- 14 files changed, 4 insertions(+), 25 deletions(-) diff --git a/configs/app/features/restApiDocs.ts b/configs/app/features/restApiDocs.ts index e18cf60306..5c9e3b57f2 100644 --- a/configs/app/features/restApiDocs.ts +++ b/configs/app/features/restApiDocs.ts @@ -2,22 +2,15 @@ import type { Feature } from './types'; import { getEnvValue } from '../utils'; -const specUrl = getEnvValue(process.env.NEXT_PUBLIC_API_SPEC_URL); +const specUrl = getEnvValue(process.env.NEXT_PUBLIC_API_SPEC_URL) || `https://raw.githubusercontent.com/blockscout/blockscout-api-v2-swagger/main/swagger.yaml`; const title = 'REST API documentation'; const config: Feature<{ specUrl: string }> = (() => { - if (specUrl) { - return Object.freeze({ - title, - isEnabled: true, - specUrl, - }); - } - return Object.freeze({ title, - isEnabled: false, + isEnabled: true, + specUrl, }); })(); diff --git a/configs/envs/.env.eth b/configs/envs/.env.eth index ddf01df54f..052c90ce87 100644 --- a/configs/envs/.env.eth +++ b/configs/envs/.env.eth @@ -33,7 +33,6 @@ NEXT_PUBLIC_NETWORK_EXPLORERS=[{'title':'Etherscan','baseUrl':'https://etherscan NEXT_PUBLIC_APP_INSTANCE=local NEXT_PUBLIC_APP_ENV=development NEXT_PUBLIC_GRAPHIQL_TRANSACTION=0xf7d4972356e6ae44ae948d0cf19ef2beaf0e574c180997e969a2837da15e349d -NEXT_PUBLIC_API_SPEC_URL=https://raw.githubusercontent.com/blockscout/blockscout-api-v2-swagger/main/swagger.yaml NEXT_PUBLIC_HAS_BEACON_CHAIN=true NEXT_PUBLIC_IS_ACCOUNT_SUPPORTED=true NEXT_PUBLIC_AUTH_URL=http://localhost:3000 diff --git a/configs/envs/.env.eth_goerli b/configs/envs/.env.eth_goerli index 4d4fbfde8f..950943f425 100644 --- a/configs/envs/.env.eth_goerli +++ b/configs/envs/.env.eth_goerli @@ -36,7 +36,6 @@ NEXT_PUBLIC_NETWORK_EXPLORERS=[{'title':'Bitquery','baseUrl':'https://explorer.b NEXT_PUBLIC_APP_INSTANCE=local NEXT_PUBLIC_APP_ENV=development NEXT_PUBLIC_GRAPHIQL_TRANSACTION=0xf7d4972356e6ae44ae948d0cf19ef2beaf0e574c180997e969a2837da15e349d -NEXT_PUBLIC_API_SPEC_URL=https://raw.githubusercontent.com/blockscout/blockscout-api-v2-swagger/main/swagger.yaml NEXT_PUBLIC_IS_ACCOUNT_SUPPORTED=true NEXT_PUBLIC_AUTH_URL=http://localhost:3000 NEXT_PUBLIC_LOGOUT_URL=https://blockscoutcom.us.auth0.com/v2/logout diff --git a/configs/envs/.env.localhost b/configs/envs/.env.localhost index 3097fff5a6..ff2e0d843b 100644 --- a/configs/envs/.env.localhost +++ b/configs/envs/.env.localhost @@ -35,7 +35,6 @@ NEXT_PUBLIC_NETWORK_EXPLORERS=[{'title':'Anyblock','baseUrl':'https://explorer.a # app features NEXT_PUBLIC_APP_INSTANCE=local NEXT_PUBLIC_APP_ENV=development -NEXT_PUBLIC_API_SPEC_URL=https://raw.githubusercontent.com/blockscout/blockscout-api-v2-swagger/main/swagger.yaml NEXT_PUBLIC_IS_ACCOUNT_SUPPORTED=true NEXT_PUBLIC_AUTH_URL=http://localhost:3000 NEXT_PUBLIC_LOGOUT_URL=https://blockscoutcom.us.auth0.com/v2/logout diff --git a/configs/envs/.env.main b/configs/envs/.env.main index 2eaab1e09b..3447d5e697 100644 --- a/configs/envs/.env.main +++ b/configs/envs/.env.main @@ -36,7 +36,6 @@ NEXT_PUBLIC_NETWORK_EXPLORERS=[{'title':'Bitquery','baseUrl':'https://explorer.b NEXT_PUBLIC_APP_INSTANCE=local NEXT_PUBLIC_APP_ENV=development NEXT_PUBLIC_GRAPHIQL_TRANSACTION=0xf7d4972356e6ae44ae948d0cf19ef2beaf0e574c180997e969a2837da15e349d -NEXT_PUBLIC_API_SPEC_URL=https://raw.githubusercontent.com/blockscout/blockscout-api-v2-swagger/main/swagger.yaml NEXT_PUBLIC_IS_ACCOUNT_SUPPORTED=true NEXT_PUBLIC_AUTH_URL=http://localhost:3000 NEXT_PUBLIC_LOGOUT_URL=https://blockscoutcom.us.auth0.com/v2/logout diff --git a/configs/envs/.env.main.L2 b/configs/envs/.env.main.L2 index bdf30bef44..087743b5a6 100644 --- a/configs/envs/.env.main.L2 +++ b/configs/envs/.env.main.L2 @@ -36,7 +36,6 @@ NEXT_PUBLIC_NETWORK_ICON=https://raw.githubusercontent.com/blockscout/frontend-c NEXT_PUBLIC_APP_INSTANCE=local NEXT_PUBLIC_APP_ENV=development NEXT_PUBLIC_GRAPHIQL_TRANSACTION=0x4a0ed8ddf751a7cb5297f827699117b0f6d21a0b2907594d300dc9fed75c7e62 -NEXT_PUBLIC_API_SPEC_URL=https://raw.githubusercontent.com/blockscout/blockscout-api-v2-swagger/main/swagger.yaml NEXT_PUBLIC_WEB3_WALLETS=['coinbase'] NEXT_PUBLIC_WEB3_DISABLE_ADD_TOKEN_TO_WALLET=true NEXT_PUBLIC_IS_ACCOUNT_SUPPORTED=true diff --git a/configs/envs/.env.poa_core b/configs/envs/.env.poa_core index d798856d95..f46ee88ca5 100644 --- a/configs/envs/.env.poa_core +++ b/configs/envs/.env.poa_core @@ -34,7 +34,6 @@ NEXT_PUBLIC_NETWORK_EXPLORERS=[{'title':'Anyblock','baseUrl':'https://explorer.a # app features NEXT_PUBLIC_APP_INSTANCE=local NEXT_PUBLIC_APP_ENV=development -NEXT_PUBLIC_API_SPEC_URL=https://raw.githubusercontent.com/blockscout/blockscout-api-v2-swagger/main/swagger.yaml NEXT_PUBLIC_IS_ACCOUNT_SUPPORTED=true NEXT_PUBLIC_AUTH_URL=http://localhost:3000 NEXT_PUBLIC_LOGOUT_URL=https://blockscoutcom.us.auth0.com/v2/logout diff --git a/configs/envs/.env.polygon b/configs/envs/.env.polygon index c09af4cd24..8a53ff00f9 100644 --- a/configs/envs/.env.polygon +++ b/configs/envs/.env.polygon @@ -37,7 +37,6 @@ NEXT_PUBLIC_NETWORK_ICON=https://raw.githubusercontent.com/blockscout/frontend-c NEXT_PUBLIC_APP_INSTANCE=local NEXT_PUBLIC_APP_ENV=development # NEXT_PUBLIC_GRAPHIQL_TRANSACTION=0x97fa753626b8d44011d0b9f9a947c735f20b6e895efdee49d7cda76a50001017 -NEXT_PUBLIC_API_SPEC_URL=https://raw.githubusercontent.com/blockscout/blockscout-api-v2-swagger/main/swagger.yaml NEXT_PUBLIC_HAS_BEACON_CHAIN=false # NEXT_PUBLIC_STATS_API_HOST=https://stats-rsk-testnet.k8s.blockscout.com NEXT_PUBLIC_VISUALIZE_API_HOST=https://visualizer.services.blockscout.com diff --git a/configs/envs/.env.rootstock b/configs/envs/.env.rootstock index da604bf921..097fc852ee 100644 --- a/configs/envs/.env.rootstock +++ b/configs/envs/.env.rootstock @@ -38,7 +38,6 @@ NEXT_PUBLIC_VIEWS_BLOCK_HIDDEN_FIELDS=['burnt_fees','total_reward','nonce'] NEXT_PUBLIC_APP_INSTANCE=local NEXT_PUBLIC_APP_ENV=development NEXT_PUBLIC_GRAPHIQL_TRANSACTION=0x97fa753626b8d44011d0b9f9a947c735f20b6e895efdee49d7cda76a50001017 -NEXT_PUBLIC_API_SPEC_URL=https://raw.githubusercontent.com/blockscout/blockscout-api-v2-swagger/main/swagger.yaml NEXT_PUBLIC_HAS_BEACON_CHAIN=false NEXT_PUBLIC_STATS_API_HOST=https://stats-rsk-testnet.k8s.blockscout.com NEXT_PUBLIC_VISUALIZE_API_HOST=https://visualizer.services.blockscout.com diff --git a/deploy/values/l2-optimism-goerli/values.yaml b/deploy/values/l2-optimism-goerli/values.yaml index 350de67450..3cc584504c 100644 --- a/deploy/values/l2-optimism-goerli/values.yaml +++ b/deploy/values/l2-optimism-goerli/values.yaml @@ -182,7 +182,6 @@ frontend: NEXT_PUBLIC_FEATURED_NETWORKS: https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/featured-networks/base-goerli.json NEXT_PUBLIC_MARKETPLACE_SUBMIT_FORM: https://airtable.com/shrqUAcjgGJ4jU88C NEXT_PUBLIC_LOGOUT_URL: https://blockscoutcom.us.auth0.com/v2/logout - NEXT_PUBLIC_API_SPEC_URL: https://raw.githubusercontent.com/blockscout/blockscout-api-v2-swagger/main/swagger.yaml NEXT_PUBLIC_MARKETPLACE_CONFIG_URL: https://raw.githubusercontent.com/blockscout/frontend-configs/dev/configs/marketplace/base-goerli.json NEXT_PUBLIC_NETWORK_EXPLORERS: '' NEXT_PUBLIC_HOMEPAGE_PLATE_BACKGROUND: "linear-gradient(136.9deg,rgb(107 94 236) 1.5%,rgb(0 82 255) 56.84%,rgb(82 62 231) 98.54%)" diff --git a/deploy/values/main/values.yaml b/deploy/values/main/values.yaml index d7e01f4d26..e3f273dd03 100644 --- a/deploy/values/main/values.yaml +++ b/deploy/values/main/values.yaml @@ -155,7 +155,6 @@ frontend: NEXT_PUBLIC_LOGOUT_URL: https://blockscoutcom.us.auth0.com/v2/logout NEXT_PUBLIC_NETWORK_RPC_URL: https://rpc.ankr.com/eth_goerli NEXT_PUBLIC_HOMEPAGE_CHARTS: "['daily_txs','coin_price','market_cap']" - NEXT_PUBLIC_API_SPEC_URL: https://raw.githubusercontent.com/blockscout/blockscout-api-v2-swagger/main/swagger.yaml NEXT_PUBLIC_MARKETPLACE_CONFIG_URL: https://raw.githubusercontent.com/blockscout/frontend-configs/dev/configs/marketplace/eth-goerli.json NEXT_PUBLIC_GRAPHIQL_TRANSACTION: 0xf7d4972356e6ae44ae948d0cf19ef2beaf0e574c180997e969a2837da15e349d NEXT_PUBLIC_WEB3_WALLETS: "['token_pocket','coinbase','metamask']" diff --git a/deploy/values/review-l2/values.yaml.gotmpl b/deploy/values/review-l2/values.yaml.gotmpl index d35fe7150f..f1b3f13708 100644 --- a/deploy/values/review-l2/values.yaml.gotmpl +++ b/deploy/values/review-l2/values.yaml.gotmpl @@ -100,8 +100,6 @@ frontend: _default: https://blockscoutcom.us.auth0.com/v2/logout NEXT_PUBLIC_STATS_API_HOST: _default: https://stats-optimism-goerli.k8s-dev.blockscout.com - NEXT_PUBLIC_API_SPEC_URL: - _default: https://raw.githubusercontent.com/blockscout/blockscout-api-v2-swagger/main/swagger.yaml NEXT_PUBLIC_MARKETPLACE_CONFIG_URL: _default: https://raw.githubusercontent.com/blockscout/frontend-configs/dev/configs/marketplace/base-goerli.json NEXT_PUBLIC_NETWORK_EXPLORERS: diff --git a/deploy/values/review/values.yaml.gotmpl b/deploy/values/review/values.yaml.gotmpl index 0fd3ee5697..3a7540f653 100644 --- a/deploy/values/review/values.yaml.gotmpl +++ b/deploy/values/review/values.yaml.gotmpl @@ -108,8 +108,6 @@ frontend: _default: https://rpc.ankr.com/eth_goerli NEXT_PUBLIC_NETWORK_EXPLORERS: _default: "[{'title':'Bitquery','baseUrl':'https://explorer.bitquery.io/','paths':{'tx':'/goerli/tx','address':'/goerli/address','token':'/goerli/token','block':'/goerli/block'}},{'title':'Etherscan','baseUrl':'https://goerli.etherscan.io/','paths':{'tx':'/tx','address':'/address','token':'/token','block':'/block'}}]" - NEXT_PUBLIC_API_SPEC_URL: - _default: https://raw.githubusercontent.com/blockscout/blockscout-api-v2-swagger/main/swagger.yaml NEXT_PUBLIC_MARKETPLACE_CONFIG_URL: _default: https://raw.githubusercontent.com/blockscout/frontend-configs/dev/configs/marketplace/eth-goerli.json NEXT_PUBLIC_IS_TESTNET: diff --git a/docs/ENVS.md b/docs/ENVS.md index 1413c79ba0..811c9d4b91 100644 --- a/docs/ENVS.md +++ b/docs/ENVS.md @@ -300,7 +300,7 @@ This feature is **always enabled**, but you can configure its behavior by passin | Variable | Type| Description | Compulsoriness | Default value | Example value | | --- | --- | --- | --- | --- | --- | -| NEXT_PUBLIC_API_SPEC_URL | `string` | Spec to be displayed on `/api-docs` page | Required | - | `https://raw.githubusercontent.com/blockscout/blockscout-api-v2-swagger/main/swagger.yaml` | +| NEXT_PUBLIC_API_SPEC_URL | `string` | Spec to be displayed on `/api-docs` page | Required | `https://raw.githubusercontent.com/blockscout/blockscout-api-v2-swagger/main/swagger.yaml` | `https://raw.githubusercontent.com/blockscout/blockscout-api-v2-swagger/main/swagger.yaml` |