yup-io / yup_docs Goto Github PK
View Code? Open in Web Editor NEWYup documents / tutorials
License: MIT License
Yup documents / tutorials
License: MIT License
I am looking at deploying the docs locally and I can't figure out how to deploy the gitbook.
Whenever I try an npm install
I get an error about EINTEGRITY:
npm ERR! code EINTEGRITY
npm ERR! sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ== integrity checksum failed when using sha512: wanted sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ== but got sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==. (2962 bytes)
I then deleted the package-lock.json file and tried again and ran into another issue:
> [email protected] build /redacted/yup_docs
> rollup -c
/redacted/yup_docs/src/js/index.js โ dist/docsify-tabs.js...
[!] (eslint plugin) Error: No ESLint configuration found.
src/js/index.js
Error: No ESLint configuration found.
Is this hosted on the gitkeep cloud instead and cannot be deployed locally?
Is the documentation on this webpage accurate?
I am trying to utilize the API as indicated and I am continually receiving errors for most endpoints. Notably, I am receiving 404 errors for all, suggesting the page doesn't exist. As far as I can tell, I am building the URLs correctly.
See test code below.
# ----------------
# ----------------
# FUNCTIONS
# ----------------
# ----------------
def get_post_data(base_url, endpoint, post_id):
"""
Send a GET request to the specified post endpoint for the given post ID.
Args:
base_url (str): The base URL of the API.
endpoint (str): The endpoint to which the GET request is sent.
post_id (str): The post ID to retrieve.
Returns:
dict: The response data received from the API in JSON format.
"""
# Construct the full URL
url = f"{base_url}{endpoint}{post_id}"
print("Hitting following URL:", url)
# Send the GET request
response = requests.get(url)
# Check if the request was successful
if response.status_code == 200:
return response.json() # Return the JSON response
else:
return {"error": f"Failed to retrieve data, status code: {response.status_code}"}
def get_user_data(base_url, endpoint, username):
"""
Send a GET request to the specified post endpoint for the given post ID.
Args:
base_url (str): The base URL of the API.
endpoint (str): The endpoint to which the GET request is sent.
post_id (str): The post ID to retrieve.
Returns:
dict: The response data received from the API in JSON format.
"""
# Construct the full URL
if endpoint == "levels":
url = f"{base_url}{endpoint}"
else:
url = f"{base_url}{endpoint}{username}"
print("Hitting following URL:", url)
# Send the GET request
response = requests.get(url)
# Check if the request was successful
if response.status_code == 200:
return response.json() # Return the JSON response
else:
return {"error": f"Failed to retrieve data, status code: {response.status_code}"}
# ----------------
# ----------------
# TESTING ENDPOINTS
# ----------------
# ----------------
base_url = "http://api.yup.io/"
my_username = "mrd"
my_post_id = "03925e2a-a3bb-4710-b3ce-331cd96bd2c1"
posts_endpoints = [
"posts/post/",
"comments/post/",
"posts/interactions/",
]
users_endpoints = [
"levels",
"levels/users/",
"accounts/",
"followers/",
"following/",
]
print("GET POSTS")
for endpoint in posts_endpoints:
data = get_post_data(base_url, endpoint, my_post_id)
if "error" not in data:
print("\t- Successful retrieval.")
continue
print("\t- ",data)
print("\n\n")
print("GET USERS")
for endpoint in users_endpoints:
data = get_user_data(base_url, endpoint, my_username)
if "error" not in data:
print("\t- Successful retrieval.")
continue
print("\t- ",data)
This outputs the below
GET POSTS
Hitting following URL: http://api.yup.io/posts/post/03925e2a-a3bb-4710-b3ce-331cd96bd2c1
- Successful retrieval.
Hitting following URL: http://api.yup.io/comments/post/03925e2a-a3bb-4710-b3ce-331cd96bd2c1
- {'error': 'Failed to retrieve data, status code: 404'}
Hitting following URL: http://api.yup.io/posts/interactions/03925e2a-a3bb-4710-b3ce-331cd96bd2c1
- {'error': 'Failed to retrieve data, status code: 404'}
GET USERS
Hitting following URL: http://api.yup.io/levels
- {'error': 'Failed to retrieve data, status code: 404'}
Hitting following URL: http://api.yup.io/levels/users/mrd
- {'error': 'Failed to retrieve data, status code: 404'}
Hitting following URL: http://api.yup.io/accounts/mrd
- Successful retrieval.
Hitting following URL: http://api.yup.io/followers/mrd
- {'error': 'Failed to retrieve data, status code: 404'}
Hitting following URL: http://api.yup.io/following/mrd
- {'error': 'Failed to retrieve data, status code: 404'}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.