diff --git a/1-flask-exercise/.flaskenv b/1-flask-exercise/.flaskenv new file mode 100644 index 00000000..3e5827f6 --- /dev/null +++ b/1-flask-exercise/.flaskenv @@ -0,0 +1 @@ +FLASK_APP=psycho_site.py \ No newline at end of file diff --git a/1-flask-exercise/program/__init__.py b/1-flask-exercise/program/__init__.py new file mode 100644 index 00000000..379230b4 --- /dev/null +++ b/1-flask-exercise/program/__init__.py @@ -0,0 +1,5 @@ +from flask import Flask +app = Flask(__name__) + +from program import routes + diff --git a/1-flask-exercise/program/routes.py b/1-flask-exercise/program/routes.py new file mode 100644 index 00000000..98b17a73 --- /dev/null +++ b/1-flask-exercise/program/routes.py @@ -0,0 +1,13 @@ +from program import app +from flask import render_template + +@app.route('/') +@app.route('/index') +def index(): + return render_template('index.html') +@app.route('/about') +def about(): + return render_template('about.html') +@app.route('/tests') +def tests(): + return render_template("tests.html") diff --git a/1-flask-exercise/program/templates/about.html b/1-flask-exercise/program/templates/about.html new file mode 100644 index 00000000..6962b5e9 --- /dev/null +++ b/1-flask-exercise/program/templates/about.html @@ -0,0 +1,5 @@ +{% extends "base.html" %} +{% block content%} +

About the FullstackPsycho

+

My name is Chris, I am 30 years old and I enjoy being a psychometrician.

+{% endblock%} \ No newline at end of file diff --git a/1-flask-exercise/program/templates/base.html b/1-flask-exercise/program/templates/base.html new file mode 100644 index 00000000..3789f5a0 --- /dev/null +++ b/1-flask-exercise/program/templates/base.html @@ -0,0 +1,26 @@ + + + + + + + + + + Welcome at FSP + + +

Website

+
+
+ + + +
+
+

This is from base.html

+ {% block content %} + {% endblock %} + + + \ No newline at end of file diff --git a/1-flask-exercise/program/templates/index.html b/1-flask-exercise/program/templates/index.html new file mode 100644 index 00000000..eb26d25f --- /dev/null +++ b/1-flask-exercise/program/templates/index.html @@ -0,0 +1,5 @@ +{% extends "base.html" %} +{% block content%} +

Welcome at FullStackPsycho's

+

Hi, I'm Chris and this is my blog. I hope you enjoy my maniac ranting.

+{% endblock%} \ No newline at end of file diff --git a/1-flask-exercise/program/templates/tests.html b/1-flask-exercise/program/templates/tests.html new file mode 100644 index 00000000..4f5ebfd8 --- /dev/null +++ b/1-flask-exercise/program/templates/tests.html @@ -0,0 +1,5 @@ +{% extends "base.html" %} +{% block content%} +

Tests

+

Here you can find our selection of tests

+{% endblock%} \ No newline at end of file diff --git a/1-flask-exercise/psycho_site.py b/1-flask-exercise/psycho_site.py new file mode 100644 index 00000000..519ad1ab --- /dev/null +++ b/1-flask-exercise/psycho_site.py @@ -0,0 +1,2 @@ +from program import app + diff --git a/1-flask/.flaskenv b/1-flask/.flaskenv new file mode 100644 index 00000000..7aff9a66 --- /dev/null +++ b/1-flask/.flaskenv @@ -0,0 +1 @@ +FLASK_APP=demo.py \ No newline at end of file diff --git a/1-flask/demo.py b/1-flask/demo.py new file mode 100644 index 00000000..64dbd6fb --- /dev/null +++ b/1-flask/demo.py @@ -0,0 +1 @@ +from program import app diff --git a/1-flask/program/__init__.py b/1-flask/program/__init__.py new file mode 100644 index 00000000..baf9a7a4 --- /dev/null +++ b/1-flask/program/__init__.py @@ -0,0 +1,6 @@ +from flask import Flask + +app = Flask(__name__) + +#has to happen after creation of app +from program import routes \ No newline at end of file diff --git a/1-flask/program/routes.py b/1-flask/program/routes.py new file mode 100644 index 00000000..d1088ac5 --- /dev/null +++ b/1-flask/program/routes.py @@ -0,0 +1,10 @@ +from program import app +from flask import render_template + +@app.route('/') +@app.route('/index') +def index(): #name functions similar to url + return render_template('index.html') +@app.route('/100days') +def p100days(): + return render_template('100days.html') \ No newline at end of file diff --git a/1-flask/program/templates/100days.html b/1-flask/program/templates/100days.html new file mode 100644 index 00000000..807f7b33 --- /dev/null +++ b/1-flask/program/templates/100days.html @@ -0,0 +1,8 @@ +{% extends "base.html" %} + +{% block content %} +

Congrats on starting you 100 Days of Code challenge!

+

THIS IS TEXT FROM 100DAYS.HTML not base.html + +

+{% endblock %} \ No newline at end of file diff --git a/1-flask/program/templates/base.html b/1-flask/program/templates/base.html new file mode 100644 index 00000000..b8f544b8 --- /dev/null +++ b/1-flask/program/templates/base.html @@ -0,0 +1,21 @@ + + + + + + + + + + Welcome at FullStackPsycho + + +
Menu Bar - + + +
+
+ {% block content %} {% endblock %} + + + \ No newline at end of file diff --git a/1-flask/program/templates/index.html b/1-flask/program/templates/index.html new file mode 100644 index 00000000..25255352 --- /dev/null +++ b/1-flask/program/templates/index.html @@ -0,0 +1,11 @@ +{% extends "base.html" %} + +{% block content %} +

Enter the Asylum!

+

Hello, I'm Chris and this is my blog "FullStackPsycho". + I am a psychologist, or more precisely a psychometrician and develop + psychometric tests such as intelligence tests and personality questionnaires. + My main passion is the implementation of machine learning and ai into psychometrics. +

+ +{% endblock %} \ No newline at end of file diff --git a/1-flask/program/templates/template.html b/1-flask/program/templates/template.html new file mode 100644 index 00000000..d21dbb9c --- /dev/null +++ b/1-flask/program/templates/template.html @@ -0,0 +1,10 @@ + + + + + Welcome at FullStackPsycho's + + + + + \ No newline at end of file diff --git a/2-Http+exercise/extras/form.css b/2-Http+exercise/extras/form.css new file mode 100644 index 00000000..83631dd8 --- /dev/null +++ b/2-Http+exercise/extras/form.css @@ -0,0 +1,55 @@ + +form input, form select { + + display: block; + width: 100%; + height: calc(1.5em + .75rem + 2px); + padding: .375rem .75rem; + font-size: 1rem; + font-weight: 400; + line-height: 1.5; + color: #495057; + background-color: #fff; + background-clip: padding-box; + border: 1px solid #ced4da; + border-radius: .25rem; + transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out; + +} + +form input::placeholder { + color: #6c757d; + opacity: 1; +} + +button { + display: inline-block; + font-weight: 400; + color: #212529; + text-align: center; + vertical-align: middle; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + background-color: transparent; + border: 1px solid transparent; + border-top-color: transparent; + border-right-color: transparent; + border-bottom-color: transparent; + border-left-color: transparent; + padding: .375rem .75rem; + font-size: 1rem; + line-height: 1.5; + border-radius: .25rem; + transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out; +} + + +button { + + color: #fff; + background-color: #28a745; + border-color: #28a745; + +} \ No newline at end of file diff --git a/2-Http+exercise/extras/form_hook.js b/2-Http+exercise/extras/form_hook.js new file mode 100644 index 00000000..258992f9 --- /dev/null +++ b/2-Http+exercise/extras/form_hook.js @@ -0,0 +1,19 @@ +$(document).ready(function () { + + $("form").submit(function (e) { + e.preventDefault() + + const $inputs = $('form :input'); + + let values = {} + $inputs.each(function () { + if (this.name) { + values[this.name] = $(this).val(); + } + }) + + alert(JSON.stringify(values, null, 2)) + + return false + }) +}) diff --git a/2-Http+exercise/extras/site.css b/2-Http+exercise/extras/site.css new file mode 100644 index 00000000..dd8e19a1 --- /dev/null +++ b/2-Http+exercise/extras/site.css @@ -0,0 +1,32 @@ + +form { + margin-left: auto; + margin-right: auto; + max-width: 350px; + background-color: white; + padding: 20px; + padding-right: 30px; + border-radius: 10px; +} + +form > * { + margin: 10px; +} + +form > div { + text-align: right; + margin-right: -10px; +} + +body { + background-color: #84cbff; +} + +h1 { + color: white; + text-align: center; + margin-top: 50px; + margin-bottom: 50px; + font-size: 64px; + font-weight: lighter; +} \ No newline at end of file diff --git a/2-Http+exercise/google_index.html b/2-Http+exercise/google_index.html new file mode 100644 index 00000000..7505e0c6 --- /dev/null +++ b/2-Http+exercise/google_index.html @@ -0,0 +1,52 @@ + + + + + Title + + +
+

Google

+
+
+
+
+
Search the Web using Google!
+
+
+
+
+ + + + + + +
+

Special Searches

+ Stanford Search
+ Linux Search +
+ Help!
+ About Google!
+ Company Info
+ Google! Logos +
+

Get Google!
Updates monthly:

+
+
+ + Archive +
+
+
+
+ Log In +
+ + + \ No newline at end of file diff --git a/2-Http+exercise/google_login.html b/2-Http+exercise/google_login.html new file mode 100644 index 00000000..9c4909a1 --- /dev/null +++ b/2-Http+exercise/google_login.html @@ -0,0 +1,20 @@ + + + + + Title + + +
+
+ + + + + +
+
+ + + + \ No newline at end of file diff --git a/2-Http+exercise/index.html b/2-Http+exercise/index.html new file mode 100644 index 00000000..d46e1b49 --- /dev/null +++ b/2-Http+exercise/index.html @@ -0,0 +1,30 @@ + + + + + Sign Up for FoxRem + + + + + +

FoxRem Sign Up

+
+ + + + + + +
+ + + + + \ No newline at end of file diff --git a/3-fastAPI/joke_index.py b/3-fastAPI/joke_index.py new file mode 100644 index 00000000..82ba6866 --- /dev/null +++ b/3-fastAPI/joke_index.py @@ -0,0 +1,59 @@ +import fastapi +import uvicorn +import pyjokes +import enum + +class JokeCategory(enum.StrEnum): + all = "all" + chuck_norris = "chuck" + neutral = "neutral" + +api = fastapi.FastAPI() + +@api.get('/') +def index(): + body = ""\ + ""\ + "

Welcome to my joke API

"\ + "

Please select a category of joke

"\ + "All
" \ + "Neutral
" \ + "Chuck Norris
" \ + ""\ + "" + return fastapi.responses.HTMLResponse(content = body) + +@api.get('/api/laugh/all/en') +def all_jokes(): + joke = pyjokes.get_joke(language='en', category="all") + return fastapi.responses.JSONResponse( + content={ + "category": "All", + "language": "en", + "joke": joke + } + ) + +@api.get('/api/laugh/neutral/en') +def neutral(): + joke = pyjokes.get_joke(language='en', category="neutral") + return fastapi.responses.JSONResponse( + content={ + "category": "Neutral", + "language": "en", + "joke": joke + } + ) + +@api.get('/api/laugh/chuck/en') +def chuck(): + joke = pyjokes.get_joke(language='en', category="chuck") + return fastapi.responses.JSONResponse( + content={ + "category": "Chuck", + "language": "en", + "joke": joke + } + ) + +uvicorn.run(api, host="127.0.0.1", port=8000) \ No newline at end of file diff --git a/3-fastAPI/main.py b/3-fastAPI/main.py new file mode 100644 index 00000000..a96ea62e --- /dev/null +++ b/3-fastAPI/main.py @@ -0,0 +1,37 @@ +import fastapi +import uvicorn +from typing import Optional + +api = fastapi.FastAPI() + +@api.get("/") +def index(): + body=""\ + ""\ + "

Welcome to the API

"\ + "
"\ + "Try it: /api/calculate?x=8&y=9&z=10"\ + "
"\ + ""\ + "" + return fastapi.responses.HTMLResponse(content=body) + + +@api.get('/api/calculate') +def calculate(x:int, y:int, z: Optional[int] = None): + if z==0: + return fastapi.responses.JSONResponse(content={"Error": "Z cannot be zero"}, + status_code=400) + + value = (x + y) + if z is not None: + value /= z + + + return { + 'x': x, + 'y': y, + 'z': z, + 'value': value} + +uvicorn.run(api, host='0.0.0.0', port=8000) \ No newline at end of file diff --git a/3-fastAPI/requirements.txt b/3-fastAPI/requirements.txt new file mode 100644 index 00000000..0fac11e5 --- /dev/null +++ b/3-fastAPI/requirements.txt @@ -0,0 +1,3 @@ +black +fastapi +uvicorn \ No newline at end of file diff --git a/days/025-028-javascript/demo/calculator/index-template.html b/days/025-028-javascript/demo/calculator/index-template.html index 5c3972a7..8ed3be6d 100644 --- a/days/025-028-javascript/demo/calculator/index-template.html +++ b/days/025-028-javascript/demo/calculator/index-template.html @@ -39,6 +39,26 @@

Basic JS Calculator

diff --git a/days/025-028-javascript/demo/calories/js/script-template.js b/days/025-028-javascript/demo/calories/js/script-template.js index d89b5dd2..12fa3269 100644 --- a/days/025-028-javascript/demo/calories/js/script-template.js +++ b/days/025-028-javascript/demo/calories/js/script-template.js @@ -12,7 +12,7 @@ new autoComplete({ let matches = []; for(i=0; i diff --git a/days/025-028-javascript/demo/language/functions/numbers.html b/days/025-028-javascript/demo/language/functions/numbers.html index f7f2c298..fea4e6cd 100644 --- a/days/025-028-javascript/demo/language/functions/numbers.html +++ b/days/025-028-javascript/demo/language/functions/numbers.html @@ -10,7 +10,17 @@ called range to return that range of integers */ function sum(numbers){ - // you code + function range() { + return Array.from({length: 100}, (_, i) => i + 1); + } + if(numbers === undefined){ + numbers = range() + } + const initialValue = 0; + return numbers.reduce( + (accumulator, currentValue) => accumulator + currentValue, + initialValue, + ); } diff --git a/days/025-028-javascript/demo/language/looping/drive.html b/days/025-028-javascript/demo/language/looping/drive.html index 252dcee2..d97bfedc 100644 --- a/days/025-028-javascript/demo/language/looping/drive.html +++ b/days/025-028-javascript/demo/language/looping/drive.html @@ -24,7 +24,18 @@ const ages = [14, 33, 17, 18, 25, 7]; // you code - + let i = 0 + while (i < 6){ + let name_i = names[i] + let age_i = ages[i] + if(age_i >17){ + console.log(`${name_i} is allowed to drive`) + } + else{ + console.log(`${name_i} is not allowed to drive`) + } + i+=1 + } diff --git a/days/025-028-javascript/demo/language/objects/food.html b/days/025-028-javascript/demo/language/objects/food.html index 06902340..3792fb65 100644 --- a/days/025-028-javascript/demo/language/objects/food.html +++ b/days/025-028-javascript/demo/language/objects/food.html @@ -18,7 +18,14 @@ {Sausage McMuffin [3.9 oz / 111 g]: "370"} */ - // you code + let foods = Array() + foods.push({"Egg McMuffin [4.8 oz / 136 g]": "300"}) + foods.push({"Egg White Delight [4.8 oz / 135 g]": "250"}) + foods.push({"Sausage McMuffin [3.9 oz / 111 g]": "370"}) + + for(i in foods){ + console.log(foods[i]) + } diff --git a/days/033-036-sqlalchemy-orm/demo/hovershare_app_starter/data/models/locations.py b/days/033-036-sqlalchemy-orm/demo/hovershare_app_starter/data/models/locations.py new file mode 100644 index 00000000..542a8350 --- /dev/null +++ b/days/033-036-sqlalchemy-orm/demo/hovershare_app_starter/data/models/locations.py @@ -0,0 +1,14 @@ +import sqlalchemy as sa +import datetime +from data.sqlalchemybase import SqlAlchemyBase + +class Locations(SqlAlchemyBase): + __tablename__ = 'locations' + + id = sa.Column(sa.Integer, primary_key=True, autoincrement=True) + created_date = sa.Column(sa.DateTime, default=datetime.datetime.now, index=True) + street = sa.Column(sa.String) + city = sa.Column(sa.String, index=True) + state = sa.Column(sa.String, index=True) + + max_storage = sa.Column(sa.Integer, index=True) diff --git a/days/033-036-sqlalchemy-orm/demo/hovershare_app_starter/data/models/rentals.py b/days/033-036-sqlalchemy-orm/demo/hovershare_app_starter/data/models/rentals.py new file mode 100644 index 00000000..411416c5 --- /dev/null +++ b/days/033-036-sqlalchemy-orm/demo/hovershare_app_starter/data/models/rentals.py @@ -0,0 +1,13 @@ +import sqlalchemy as sa +import datetime +from data.sqlalchemybase import SqlAlchemyBase + +class rentals(SqlAlchemyBase): + __tablename__ = 'rentals' + + id = sa.Column(sa.Integer, primary_key=True, autoincrement=True) + + created_date = sa.Column(sa.DateTime, default=datetime.datetime.now, index=True) + start_date = sa.Column(sa.DateTime, default=datetime.datetime.now, index=True) + end_date = sa.Column(sa.DateTime, default=datetime.datetime.now, index=True) + diff --git a/days/033-036-sqlalchemy-orm/demo/hovershare_app_starter/data/models/scooters.py b/days/033-036-sqlalchemy-orm/demo/hovershare_app_starter/data/models/scooters.py new file mode 100644 index 00000000..2b39b6f1 --- /dev/null +++ b/days/033-036-sqlalchemy-orm/demo/hovershare_app_starter/data/models/scooters.py @@ -0,0 +1,14 @@ +import sqlalchemy as sa +import datetime + +from data.sqlalchemybase import SqlAlchemyBase + + +class Scooter(SqlAlchemyBase): + __tablename__ = "scooters" + + id = sa.Column(sa.Integer, primary_key=True, autoincrement=True) # automatically indexed + created_date = sa.Column(sa.DateTime, default=datetime.datetime.now) + vin = sa.Column(sa.String, index=True, unique=True) + model = sa.Column(sa.String, index=True) + batter_level = sa.Column(ksa.Integer, index=True) \ No newline at end of file diff --git a/days/033-036-sqlalchemy-orm/demo/hovershare_app_starter/data/models/users.py b/days/033-036-sqlalchemy-orm/demo/hovershare_app_starter/data/models/users.py new file mode 100644 index 00000000..9fcec64a --- /dev/null +++ b/days/033-036-sqlalchemy-orm/demo/hovershare_app_starter/data/models/users.py @@ -0,0 +1,14 @@ +import sqlalchemy as sa +import datetime +from data.sqlalchemybase import SqlAlchemyBase + +class users(SqlAlchemyBase): + __tablename__ = 'users' + + id = sa.Column(sa.Integer, primary_key=True) + name = sa.Column(sa.String, index=True, nullable=True) + email = sa.Column(sa.String, index=True, nullable=True) + hased_password = sa.Column(sa.String, index=True, nullable=True) + created_date = sa.Column(sa.DateTime, default=datetime.datetime.now, index=True) + last_login = sa.Column(sa.DateTime, default=datetime.datetime.now, index=True) + diff --git a/days/033-036-sqlalchemy-orm/demo/hovershare_app_starter/data/session_factory.py b/days/033-036-sqlalchemy-orm/demo/hovershare_app_starter/data/session_factory.py new file mode 100644 index 00000000..93f32528 --- /dev/null +++ b/days/033-036-sqlalchemy-orm/demo/hovershare_app_starter/data/session_factory.py @@ -0,0 +1,23 @@ +import sqlalchemy +import sqlalchemy as sa +import sqlalchemy.orm as orm + +__engine = None +__factory = None + + +def global_init(db_name:str): + global __engine, __factory + + if __factory: + return + + conn_str = 'sqlite:///' + db_folder.get_full_path(db_name) + '.db' + __engine = sa.create_engine(conn_str, echo=False) + __factory = orm.sessionmaker(bind=__engine) + +def create_tables(): + pass + +def create_session()-> sqlalchemy.orm.Session: + pass \ No newline at end of file diff --git a/days/033-036-sqlalchemy-orm/demo/hovershare_app_starter/data/sqlalchemybase.py b/days/033-036-sqlalchemy-orm/demo/hovershare_app_starter/data/sqlalchemybase.py new file mode 100644 index 00000000..90c9a731 --- /dev/null +++ b/days/033-036-sqlalchemy-orm/demo/hovershare_app_starter/data/sqlalchemybase.py @@ -0,0 +1,3 @@ +import sqlalchemy.ext.declarative + +SqlAlchemyBase = sqlalchemy.ext.declarative.declarative_base() \ No newline at end of file diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/axios/CHANGELOG.md b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/axios/CHANGELOG.md index d336ec10..35feb70f 100644 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/axios/CHANGELOG.md +++ b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/axios/CHANGELOG.md @@ -1,16 +1,524 @@ # Changelog +### 0.21.2 (September 4, 2021) + +Fixes and Functionality: + +- Updating axios requests to be delayed by pre-emptive promise creation ([#2702](https://github.com/axios/axios/pull/2702)) +- Adding "synchronous" and "runWhen" options to interceptors api ([#2702](https://github.com/axios/axios/pull/2702)) +- Updating of transformResponse ([#3377](https://github.com/axios/axios/pull/3377)) +- Adding ability to omit User-Agent header ([#3703](https://github.com/axios/axios/pull/3703)) +- Adding multiple JSON improvements ([#3688](https://github.com/axios/axios/pull/3688), [#3763](https://github.com/axios/axios/pull/3763)) +- Fixing quadratic runtime and extra memory usage when setting a maxContentLength ([#3738](https://github.com/axios/axios/pull/3738)) +- Adding parseInt to config.timeout ([#3781](https://github.com/axios/axios/pull/3781)) +- Adding custom return type support to interceptor ([#3783](https://github.com/axios/axios/pull/3783)) +- Adding security fix for ReDoS vulnerability ([#3980](https://github.com/axios/axios/pull/3980)) + +Internal and Tests: + +- Updating build dev dependancies ([#3401](https://github.com/axios/axios/pull/3401)) +- Fixing builds running on Travis CI ([#3538](https://github.com/axios/axios/pull/3538)) +- Updating follow rediect version ([#3694](https://github.com/axios/axios/pull/3694), [#3771](https://github.com/axios/axios/pull/3771)) +- Updating karma sauce launcher to fix failing sauce tests ([#3712](https://github.com/axios/axios/pull/3712), [#3717](https://github.com/axios/axios/pull/3717)) +- Updating content-type header for application/json to not contain charset field, according do RFC 8259 ([#2154](https://github.com/axios/axios/pull/2154)) +- Fixing tests by bumping karma-sauce-launcher version ([#3813](https://github.com/axios/axios/pull/3813)) +- Changing testing process from Travis CI to GitHub Actions ([#3938](https://github.com/axios/axios/pull/3938)) + +Documentation: + +- Updating documentation around the use of `AUTH_TOKEN` with multiple domain endpoints ([#3539](https://github.com/axios/axios/pull/3539)) +- Remove duplication of item in changelog ([#3523](https://github.com/axios/axios/pull/3523)) +- Fixing gramatical errors ([#2642](https://github.com/axios/axios/pull/2642)) +- Fixing spelling error ([#3567](https://github.com/axios/axios/pull/3567)) +- Moving gitpod metion ([#2637](https://github.com/axios/axios/pull/2637)) +- Adding new axios documentation website link ([#3681](https://github.com/axios/axios/pull/3681), [#3707](https://github.com/axios/axios/pull/3707)) +- Updating documentation around dispatching requests ([#3772](https://github.com/axios/axios/pull/3772)) +- Adding documentation for the type guard isAxiosError ([#3767](https://github.com/axios/axios/pull/3767)) +- Adding explanation of cancel token ([#3803](https://github.com/axios/axios/pull/3803)) +- Updating CI status badge ([#3953](https://github.com/axios/axios/pull/3953)) +- Fixing errors with JSON documentation ([#3936](https://github.com/axios/axios/pull/3936)) +- Fixing README typo under Request Config ([#3825](https://github.com/axios/axios/pull/3825)) +- Adding axios-multi-api to the ecosystem file ([#3817](https://github.com/axios/axios/pull/3817)) +- Adding SECURITY.md to properly disclose security vulnerabilities ([#3981](https://github.com/axios/axios/pull/3981)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- [Jay](mailto:jasonsaayman@gmail.com) +- [Sasha Korotkov](https://github.com/SashaKoro) +- [Daniel Lopretto](https://github.com/timemachine3030) +- [Mike Bishop](https://github.com/MikeBishop) +- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS) +- [Mark](https://github.com/bimbiltu) +- [Philipe Gouveia Paixão](https://github.com/piiih) +- [hippo](https://github.com/hippo2cat) +- [ready-research](https://github.com/ready-research) +- [Xianming Zhong](https://github.com/chinesedfan) +- [Christopher Chrapka](https://github.com/OJezu) +- [Brian Anglin](https://github.com/anglinb) +- [Kohta Ito](https://github.com/koh110) +- [Ali Clark](https://github.com/aliclark) +- [caikan](https://github.com/caikan) +- [Elina Gorshkova](https://github.com/elinagorshkova) +- [Ryota Ikezawa](https://github.com/paveg) +- [Nisar Hassan Naqvi](https://github.com/nisarhassan12) +- [Jake](https://github.com/codemaster138) +- [TagawaHirotaka](https://github.com/wafuwafu13) +- [Johannes Jarbratt](https://github.com/johachi) +- [Mo Sattler](https://github.com/MoSattler) +- [Sam Carlton](https://github.com/ThatGuySam) +- [Matt Czapliński](https://github.com/MattCCC) +- [Ziding Zhang](https://github.com/zidingz) + +### 0.21.1 (December 21, 2020) + +Fixes and Functionality: + +- Hotfix: Prevent SSRF ([#3410](https://github.com/axios/axios/pull/3410)) +- Protocol not parsed when setting proxy config from env vars ([#3070](https://github.com/axios/axios/pull/3070)) +- Updating axios in types to be lower case ([#2797](https://github.com/axios/axios/pull/2797)) +- Adding a type guard for `AxiosError` ([#2949](https://github.com/axios/axios/pull/2949)) + +Internal and Tests: + +- Remove the skipping of the `socket` http test ([#3364](https://github.com/axios/axios/pull/3364)) +- Use different socket for Win32 test ([#3375](https://github.com/axios/axios/pull/3375)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- Daniel Lopretto +- Jason Kwok +- Jay +- Jonathan Foster +- Remco Haszing +- Xianming Zhong + +### 0.21.0 (October 23, 2020) + +Fixes and Functionality: + +- Fixing requestHeaders.Authorization ([#3287](https://github.com/axios/axios/pull/3287)) +- Fixing node types ([#3237](https://github.com/axios/axios/pull/3237)) +- Fixing axios.delete ignores config.data ([#3282](https://github.com/axios/axios/pull/3282)) +- Revert "Fixing overwrite Blob/File type as Content-Type in browser. (#1773)" ([#3289](https://github.com/axios/axios/pull/3289)) +- Fixing an issue that type 'null' and 'undefined' is not assignable to validateStatus when typescript strict option is enabled ([#3200](https://github.com/axios/axios/pull/3200)) + +Internal and Tests: + +- Lock travis to not use node v15 ([#3361](https://github.com/axios/axios/pull/3361)) + +Documentation: + +- Fixing simple typo, existant -> existent ([#3252](https://github.com/axios/axios/pull/3252)) +- Fixing typos ([#3309](https://github.com/axios/axios/pull/3309)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- Allan Cruz <57270969+Allanbcruz@users.noreply.github.com> +- George Cheng +- Jay +- Kevin Kirsche +- Remco Haszing +- Taemin Shin +- Tim Gates +- Xianming Zhong + +### 0.20.0 (August 20, 2020) + +Release of 0.20.0-pre as a full release with no other changes. + +### 0.20.0-pre (July 15, 2020) + +Fixes and Functionality: + +- Fixing response with utf-8 BOM can not parse to json ([#2419](https://github.com/axios/axios/pull/2419)) + - fix: remove byte order marker (UTF-8 BOM) when transform response + - fix: remove BOM only utf-8 + - test: utf-8 BOM + - fix: incorrect param name +- Refactor mergeConfig without utils.deepMerge ([#2844](https://github.com/axios/axios/pull/2844)) + - Adding failing test + - Fixing #2587 default custom config persisting + - Adding Concat keys and filter duplicates + - Fixed value from CPE + - update for review feedbacks + - no deepMerge + - only merge between plain objects + - fix rename + - always merge config by mergeConfig + - extract function mergeDeepProperties + - refactor mergeConfig with all keys, and add special logic for validateStatus + - add test for resetting headers + - add lots of tests and fix a bug + - should not inherit `data` + - use simple toString +- Fixing overwrite Blob/File type as Content-Type in browser. ([#1773](https://github.com/axios/axios/pull/1773)) +- Fixing an issue that type 'null' is not assignable to validateStatus ([#2773](https://github.com/axios/axios/pull/2773)) +- Fixing special char encoding ([#1671](https://github.com/axios/axios/pull/1671)) + - removing @ character from replacement list since it is a reserved character + - Updating buildURL test to not include the @ character + - Removing console logs +- Fixing password encoding with special characters in basic authentication ([#1492](https://github.com/axios/axios/pull/1492)) + - Fixing password encoding with special characters in basic authentication + - Adding test to check if password with non-Latin1 characters pass +- Fixing 'Network Error' in react native android ([#1487](https://github.com/axios/axios/pull/1487)) + There is a bug in react native Android platform when using get method. It will trigger a 'Network Error' when passing the requestData which is an empty string to request.send function. So if the requestData is an empty string we can set it to null as well to fix the bug. +- Fixing Cookie Helper with Async Components ([#1105](https://github.com/axios/axios/pull/1105)) ([#1107](https://github.com/axios/axios/pull/1107)) +- Fixing 'progressEvent' type ([#2851](https://github.com/axios/axios/pull/2851)) + - Fix 'progressEvent' type + - Update axios.ts +- Fixing getting local files (file://) failed ([#2470](https://github.com/axios/axios/pull/2470)) + - fix issue #2416, #2396 + - fix Eslint warn + - Modify judgment conditions + - add unit test + - update unit test + - update unit test +- Allow PURGE method in typings ([#2191](https://github.com/axios/axios/pull/2191)) +- Adding option to disable automatic decompression ([#2661](https://github.com/axios/axios/pull/2661)) + - Adding ability to disable auto decompression + - Updating decompress documentation in README + - Fixing test\unit\adapters\http.js lint errors + - Adding test for disabling auto decompression + - Removing changes that fixed lint errors in tests + - Removing formatting change to unit test +- Add independent `maxBodyLength` option ([#2781](https://github.com/axios/axios/pull/2781)) + - Add independent option to set the maximum size of the request body + - Remove maxBodyLength check + - Update README + - Assert for error code and message +- Adding responseEncoding to mergeConfig ([#1745](https://github.com/axios/axios/pull/1745)) +- Compatible with follow-redirect aborts the request ([#2689](https://github.com/axios/axios/pull/2689)) + - Compatible with follow-redirect aborts the request + - Use the error code +- Fix merging of params ([#2656](https://github.com/axios/axios/pull/2656)) + - Name function to avoid ESLint func-names warning + - Switch params config to merge list and update tests + - Restore testing of both false and null + - Restore test cases for keys without defaults + - Include test for non-object values that aren't false-y. +- Revert `finally` as `then` ([#2683](https://github.com/axios/axios/pull/2683)) + +Internal and Tests: + +- Fix stale bot config ([#3049](https://github.com/axios/axios/pull/3049)) + - fix stale bot config + - fix multiple lines +- Add days and change name to work ([#3035](https://github.com/axios/axios/pull/3035)) +- Update close-issues.yml ([#3031](https://github.com/axios/axios/pull/3031)) + - Update close-issues.yml + Update close message to read better 😄 + - Fix use of quotations + Use single quotes as per other .yml files + - Remove user name form message +- Add GitHub actions to close stale issues/prs ([#3029](https://github.com/axios/axios/pull/3029)) + - prepare stale actions + - update messages + - Add exempt labels and lighten up comments +- Add GitHub actions to close invalid issues ([#3022](https://github.com/axios/axios/pull/3022)) + - add close actions + - fix with checkout + - update issue templates + - add reminder + - update close message +- Add test with Node.js 12 ([#2860](https://github.com/axios/axios/pull/2860)) + - test with Node.js 12 + - test with latest +- Adding console log on sandbox server startup ([#2210](https://github.com/axios/axios/pull/2210)) + - Adding console log on sandbox server startup + - Update server.js + Add server error handling + - Update server.js + Better error message, remove retry. +- Adding tests for method `options` type definitions ([#1996](https://github.com/axios/axios/pull/1996)) + Update tests. +- Add test for redirecting with too large response ([#2695](https://github.com/axios/axios/pull/2695)) +- Fixing unit test failure in Windows OS ([#2601](https://github.com/axios/axios/pull/2601)) +- Fixing issue for HEAD method and gzipped response ([#2666](https://github.com/axios/axios/pull/2666)) +- Fix tests in browsers ([#2748](https://github.com/axios/axios/pull/2748)) +- chore: add `jsdelivr` and `unpkg` support ([#2443](https://github.com/axios/axios/pull/2443)) + +Documentation: + +- Adding support for URLSearchParams in node ([#1900](https://github.com/axios/axios/pull/1900)) + - Adding support for URLSearchParams in node + - Remove un-needed code + - Update utils.js + - Make changes as suggested +- Adding table of content (preview) ([#3050](https://github.com/axios/axios/pull/3050)) + - add toc (preview) + - remove toc in toc + Signed-off-by: Moni + - fix sublinks + - fix indentation + - remove redundant table links + - update caps and indent + - remove axios +- Replace 'blacklist' with 'blocklist' ([#3006](https://github.com/axios/axios/pull/3006)) +- docs(): Detailed config options environment. ([#2088](https://github.com/axios/axios/pull/2088)) + - docs(): Detailed config options environment. + - Update README.md +- Include axios-data-unpacker in ECOSYSTEM.md ([#2080](https://github.com/axios/axios/pull/2080)) +- Allow opening examples in Gitpod ([#1958](https://github.com/axios/axios/pull/1958)) +- Remove axios.all() and axios.spread() from Readme.md ([#2727](https://github.com/axios/axios/pull/2727)) + - remove axios.all(), axios.spread() + - replace example + - axios.all() -> Promise.all() + - axios.spread(function (acct, perms)) -> function (acct, perms) + - add deprecated mark +- Update README.md ([#2887](https://github.com/axios/axios/pull/2887)) + Small change to the data attribute doc of the config. A request body can also be set for DELETE methods but this wasn't mentioned in the documentation (it only mentioned POST, PUT and PATCH). Took my some 10-20 minutes until I realized that I don't need to manipulate the request body with transformRequest in the case of DELETE. +- Include swagger-taxos-codegen in ECOSYSTEM.md ([#2162](https://github.com/axios/axios/pull/2162)) +- Add CDNJS version badge in README.md ([#878](https://github.com/axios/axios/pull/878)) + This badge will show the version on CDNJS! +- Documentation update to clear up ambiguity in code examples ([#2928](https://github.com/axios/axios/pull/2928)) + - Made an adjustment to the documentation to clear up any ambiguity around the use of "fs". This should help clear up that the code examples with "fs" cannot be used on the client side. +- Update README.md about validateStatus ([#2912](https://github.com/axios/axios/pull/2912)) + Rewrote the comment from "Reject only if the status code is greater than or equal to 500" to "Resolve only if the status code is less than 500" +- Updating documentation for usage form-data ([#2805](https://github.com/axios/axios/pull/2805)) + Closes #2049 +- Fixing CHANGELOG.md issue link ([#2784](https://github.com/axios/axios/pull/2784)) +- Include axios-hooks in ECOSYSTEM.md ([#2003](https://github.com/axios/axios/pull/2003)) +- Added Response header access instructions ([#1901](https://github.com/axios/axios/pull/1901)) + - Added Response header access instructions + - Added note about using bracket notation +- Add `onUploadProgress` and `onDownloadProgress` are browser only ([#2763](https://github.com/axios/axios/pull/2763)) + Saw in #928 and #1966 that `onUploadProgress` and `onDownloadProgress` only work in the browser and was missing that from the README. +- Update ' sign to ` in proxy spec ([#2778](https://github.com/axios/axios/pull/2778)) +- Adding jsDelivr link in README ([#1110](https://github.com/axios/axios/pull/1110)) + - Adding jsDelivr link + - Add SRI + - Remove SRI + +Huge thanks to everyone who contributed to this release via code (authors listed +below) or via reviews and triaging on GitHub: + +- Alan Wang +- Alexandru Ungureanu +- Anubhav Srivastava +- Benny Neugebauer +- Cr <631807682@qq.com> +- David +- David Ko +- David Tanner +- Emily Morehouse +- Felipe Martins +- Fonger <5862369+Fonger@users.noreply.github.com> +- Frostack +- George Cheng +- grumblerchester +- Gustavo López +- hexaez <45806662+hexaez@users.noreply.github.com> +- huangzuizui +- Ian Wijma +- Jay +- jeffjing +- jennynju <46782518+jennynju@users.noreply.github.com> +- Jimmy Liao <52391190+jimmy-liao-gogoro@users.noreply.github.com> +- Jonathan Sharpe +- JounQin +- Justin Beckwith +- Kamil Posiadała <3dcreator.pl@gmail.com> +- Lukas Drgon +- marcinx +- Martti Laine +- Michał Zarach +- Moni +- Motonori Iwata <121048+iwata@users.noreply.github.com> +- Nikita Galkin +- Petr Mares +- Philippe Recto +- Remco Haszing +- rockcs1992 +- Ryan Bown +- Samina Fu +- Simone Busoli +- Spencer von der Ohe +- Sven Efftinge +- Taegyeoung Oh +- Taemin Shin +- Thibault Ehrhart <1208424+ehrhart@users.noreply.github.com> +- Xianming Zhong +- Yasu Flores +- Zac Delventhal + +### 0.19.2 (Jan 20, 2020) + +- Remove unnecessary XSS check ([#2679](https://github.com/axios/axios/pull/2679)) (see ([#2646](https://github.com/axios/axios/issues/2646)) for discussion) + +### 0.19.1 (Jan 7, 2020) + +Fixes and Functionality: + +- Fixing invalid agent issue ([#1904](https://github.com/axios/axios/pull/1904)) +- Fix ignore set withCredentials false ([#2582](https://github.com/axios/axios/pull/2582)) +- Delete useless default to hash ([#2458](https://github.com/axios/axios/pull/2458)) +- Fix HTTP/HTTPs agents passing to follow-redirect ([#1904](https://github.com/axios/axios/pull/1904)) +- Fix ignore set withCredentials false ([#2582](https://github.com/axios/axios/pull/2582)) +- Fix CI build failure ([#2570](https://github.com/axios/axios/pull/2570)) +- Remove dependency on is-buffer from package.json ([#1816](https://github.com/axios/axios/pull/1816)) +- Adding options typings ([#2341](https://github.com/axios/axios/pull/2341)) +- Adding Typescript HTTP method definition for LINK and UNLINK. ([#2444](https://github.com/axios/axios/pull/2444)) +- Update dist with newest changes, fixes Custom Attributes issue +- Change syntax to see if build passes ([#2488](https://github.com/axios/axios/pull/2488)) +- Update Webpack + deps, remove now unnecessary polyfills ([#2410](https://github.com/axios/axios/pull/2410)) +- Fix to prevent XSS, throw an error when the URL contains a JS script ([#2464](https://github.com/axios/axios/pull/2464)) +- Add custom timeout error copy in config ([#2275](https://github.com/axios/axios/pull/2275)) +- Add error toJSON example ([#2466](https://github.com/axios/axios/pull/2466)) +- Fixing Vulnerability A Fortify Scan finds a critical Cross-Site Scrip… ([#2451](https://github.com/axios/axios/pull/2451)) +- Fixing subdomain handling on no_proxy ([#2442](https://github.com/axios/axios/pull/2442)) +- Make redirection from HTTP to HTTPS work ([#2426](https://github.com/axios/axios/pull/2426)) and ([#2547](https://github.com/axios/axios/pull/2547)) +- Add toJSON property to AxiosError type ([#2427](https://github.com/axios/axios/pull/2427)) +- Fixing socket hang up error on node side for slow response. ([#1752](https://github.com/axios/axios/pull/1752)) +- Alternative syntax to send data into the body ([#2317](https://github.com/axios/axios/pull/2317)) +- Fixing custom config options ([#2207](https://github.com/axios/axios/pull/2207)) +- Fixing set `config.method` after mergeConfig for Axios.prototype.request ([#2383](https://github.com/axios/axios/pull/2383)) +- Axios create url bug ([#2290](https://github.com/axios/axios/pull/2290)) +- Do not modify config.url when using a relative baseURL (resolves [#1628](https://github.com/axios/axios/issues/1098)) ([#2391](https://github.com/axios/axios/pull/2391)) + +Internal: + +- Revert "Update Webpack + deps, remove now unnecessary polyfills" ([#2479](https://github.com/axios/axios/pull/2479)) +- Order of if/else blocks is causing unit tests mocking XHR. ([#2201](https://github.com/axios/axios/pull/2201)) +- Add license badge ([#2446](https://github.com/axios/axios/pull/2446)) +- Fix travis CI build [#2386](https://github.com/axios/axios/pull/2386) +- Fix cancellation error on build master. #2290 #2207 ([#2407](https://github.com/axios/axios/pull/2407)) + +Documentation: + +- Fixing typo in CHANGELOG.md: s/Functionallity/Functionality ([#2639](https://github.com/axios/axios/pull/2639)) +- Fix badge, use master branch ([#2538](https://github.com/axios/axios/pull/2538)) +- Fix typo in changelog [#2193](https://github.com/axios/axios/pull/2193) +- Document fix ([#2514](https://github.com/axios/axios/pull/2514)) +- Update docs with no_proxy change, issue #2484 ([#2513](https://github.com/axios/axios/pull/2513)) +- Fixing missing words in docs template ([#2259](https://github.com/axios/axios/pull/2259)) +- 🐛Fix request finally documentation in README ([#2189](https://github.com/axios/axios/pull/2189)) +- updating spelling and adding link to docs ([#2212](https://github.com/axios/axios/pull/2212)) +- docs: minor tweak ([#2404](https://github.com/axios/axios/pull/2404)) +- Update response interceptor docs ([#2399](https://github.com/axios/axios/pull/2399)) +- Update README.md ([#2504](https://github.com/axios/axios/pull/2504)) +- Fix word 'sintaxe' to 'syntax' in README.md ([#2432](https://github.com/axios/axios/pull/2432)) +- updating README: notes on CommonJS autocomplete ([#2256](https://github.com/axios/axios/pull/2256)) +- Fix grammar in README.md ([#2271](https://github.com/axios/axios/pull/2271)) +- Doc fixes, minor examples cleanup ([#2198](https://github.com/axios/axios/pull/2198)) + +### 0.19.0 (May 30, 2019) + +Fixes and Functionality: + +- Added support for no_proxy env variable ([#1693](https://github.com/axios/axios/pull/1693/files)) - Chance Dickson +- Unzip response body only for statuses != 204 ([#1129](https://github.com/axios/axios/pull/1129)) - drawski +- Destroy stream on exceeding maxContentLength (fixes [#1098](https://github.com/axios/axios/issues/1098)) ([#1485](https://github.com/axios/axios/pull/1485)) - Gadzhi Gadzhiev +- Makes Axios error generic to use AxiosResponse ([#1738](https://github.com/axios/axios/pull/1738)) - Suman Lama +- Fixing Mocha tests by locking follow-redirects version to 1.5.10 ([#1993](https://github.com/axios/axios/pull/1993)) - grumblerchester +- Allow uppercase methods in typings. ([#1781](https://github.com/axios/axios/pull/1781)) - Ken Powers +- Fixing building url with hash mark ([#1771](https://github.com/axios/axios/pull/1771)) - Anatoly Ryabov +- This commit fix building url with hash map (fragment identifier) when parameters are present: they must not be added after `#`, because client cut everything after `#` +- Preserve HTTP method when following redirect ([#1758](https://github.com/axios/axios/pull/1758)) - Rikki Gibson +- Add `getUri` signature to TypeScript definition. ([#1736](https://github.com/axios/axios/pull/1736)) - Alexander Trauzzi +- Adding isAxiosError flag to errors thrown by axios ([#1419](https://github.com/axios/axios/pull/1419)) - Ayush Gupta + +Internal: + +- Fixing .eslintrc without extension ([#1789](https://github.com/axios/axios/pull/1789)) - Manoel +- Fix failing SauceLabs tests by updating configuration - Emily Morehouse +- Add issue templates - Emily Morehouse + +Documentation: + +- Consistent coding style in README ([#1787](https://github.com/axios/axios/pull/1787)) - Ali Servet Donmez +- Add information about auth parameter to README ([#2166](https://github.com/axios/axios/pull/2166)) - xlaguna +- Add DELETE to list of methods that allow data as a config option ([#2169](https://github.com/axios/axios/pull/2169)) - Daniela Borges Matos de Carvalho +- Update ECOSYSTEM.md - Add Axios Endpoints ([#2176](https://github.com/axios/axios/pull/2176)) - Renan +- Add r2curl in ECOSYSTEM ([#2141](https://github.com/axios/axios/pull/2141)) - 유용우 / CX +- Update README.md - Add instructions for installing with yarn ([#2036](https://github.com/axios/axios/pull/2036)) - Victor Hermes +- Fixing spacing for README.md ([#2066](https://github.com/axios/axios/pull/2066)) - Josh McCarty +- Update README.md. - Change `.then` to `.finally` in example code ([#2090](https://github.com/axios/axios/pull/2090)) - Omar Cai +- Clarify what values responseType can have in Node ([#2121](https://github.com/axios/axios/pull/2121)) - Tyler Breisacher +- docs(ECOSYSTEM): add axios-api-versioning ([#2020](https://github.com/axios/axios/pull/2020)) - Weffe +- It seems that `responseType: 'blob'` doesn't actually work in Node (when I tried using it, response.data was a string, not a Blob, since Node doesn't have Blobs), so this clarifies that this option should only be used in the browser +- Update README.md. - Add Querystring library note ([#1896](https://github.com/axios/axios/pull/1896)) - Dmitriy Eroshenko +- Add react-hooks-axios to Libraries section of ECOSYSTEM.md ([#1925](https://github.com/axios/axios/pull/1925)) - Cody Chan +- Clarify in README that default timeout is 0 (no timeout) ([#1750](https://github.com/axios/axios/pull/1750)) - Ben Standefer + +### 0.19.0-beta.1 (Aug 9, 2018) + +**NOTE:** This is a beta version of this release. There may be functionality that is broken in +certain browsers, though we suspect that builds are hanging and not erroring. See +https://saucelabs.com/u/axios for the most up-to-date information. + +New Functionality: + +- Add getUri method ([#1712](https://github.com/axios/axios/issues/1712)) +- Add support for no_proxy env variable ([#1693](https://github.com/axios/axios/issues/1693)) +- Add toJSON to decorated Axios errors to facilitate serialization ([#1625](https://github.com/axios/axios/issues/1625)) +- Add second then on axios call ([#1623](https://github.com/axios/axios/issues/1623)) +- Typings: allow custom return types +- Add option to specify character set in responses (with http adapter) + +Fixes: + +- Fix Keep defaults local to instance ([#385](https://github.com/axios/axios/issues/385)) +- Correctly catch exception in http test ([#1475](https://github.com/axios/axios/issues/1475)) +- Fix accept header normalization ([#1698](https://github.com/axios/axios/issues/1698)) +- Fix http adapter to allow HTTPS connections via HTTP ([#959](https://github.com/axios/axios/issues/959)) +- Fix Removes usage of deprecated Buffer constructor. ([#1555](https://github.com/axios/axios/issues/1555), [#1622](https://github.com/axios/axios/issues/1622)) +- Fix defaults to use httpAdapter if available ([#1285](https://github.com/axios/axios/issues/1285)) + - Fixing defaults to use httpAdapter if available + - Use a safer, cross-platform method to detect the Node environment +- Fix Reject promise if request is cancelled by the browser ([#537](https://github.com/axios/axios/issues/537)) +- [Typescript] Fix missing type parameters on delete/head methods +- [NS]: Send `false` flag isStandardBrowserEnv for Nativescript +- Fix missing type parameters on delete/head +- Fix Default method for an instance always overwritten by get +- Fix type error when socketPath option in AxiosRequestConfig +- Capture errors on request data streams +- Decorate resolve and reject to clear timeout in all cases + +Huge thanks to everyone who contributed to this release via code (authors listed +below) or via reviews and triaging on GitHub: + +- Andrew Scott +- Anthony Gauthier +- arpit +- ascott18 +- Benedikt Rötsch +- Chance Dickson +- Dave Stewart +- Deric Cain +- Guillaume Briday +- Jacob Wejendorp +- Jim Lynch +- johntron +- Justin Beckwith +- Justin Beckwith +- Khaled Garbaya +- Lim Jing Rong +- Mark van den Broek +- Martti Laine +- mattridley +- mattridley +- Nicolas Del Valle +- Nilegfx +- pbarbiero +- Rikki Gibson +- Sako Hartounian +- Shane Fitzpatrick +- Stephan Schneider +- Steven +- Tim Garthwaite +- Tim Johns +- Yutaro Miyazaki + ### 0.18.0 (Feb 19, 2018) - Adding support for UNIX Sockets when running with Node.js ([#1070](https://github.com/axios/axios/pull/1070)) - Fixing typings ([#1177](https://github.com/axios/axios/pull/1177)): - - AxiosRequestConfig.proxy: allows type false - - AxiosProxyConfig: added auth field + - AxiosRequestConfig.proxy: allows type false + - AxiosProxyConfig: added auth field - Adding function signature in AxiosInstance interface so AxiosInstance can be invoked ([#1192](https://github.com/axios/axios/pull/1192), [#1254](https://github.com/axios/axios/pull/1254)) - Allowing maxContentLength to pass through to redirected calls as maxBodyLength in follow-redirects config ([#1287](https://github.com/axios/axios/pull/1287)) - Fixing configuration when using an instance - method can now be set ([#1342](https://github.com/axios/axios/pull/1342)) - ### 0.17.1 (Nov 11, 2017) - Fixing issue with web workers ([#1160](https://github.com/axios/axios/pull/1160)) diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/axios/README.md b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/axios/README.md index ec78817c..2971f74d 100755 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/axios/README.md +++ b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/axios/README.md @@ -1,14 +1,51 @@ # axios [![npm version](https://img.shields.io/npm/v/axios.svg?style=flat-square)](https://www.npmjs.org/package/axios) -[![build status](https://img.shields.io/travis/axios/axios.svg?style=flat-square)](https://travis-ci.org/axios/axios) +[![CDNJS](https://img.shields.io/cdnjs/v/axios.svg?style=flat-square)](https://cdnjs.com/libraries/axios) +![Build status](https://github.com/axios/axios/actions/workflows/ci.yml/badge.svg) +[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/axios/axios) [![code coverage](https://img.shields.io/coveralls/mzabriskie/axios.svg?style=flat-square)](https://coveralls.io/r/mzabriskie/axios) +[![install size](https://packagephobia.now.sh/badge?p=axios)](https://packagephobia.now.sh/result?p=axios) [![npm downloads](https://img.shields.io/npm/dm/axios.svg?style=flat-square)](http://npm-stat.com/charts.html?package=axios) [![gitter chat](https://img.shields.io/gitter/room/mzabriskie/axios.svg?style=flat-square)](https://gitter.im/mzabriskie/axios) [![code helpers](https://www.codetriage.com/axios/axios/badges/users.svg)](https://www.codetriage.com/axios/axios) Promise based HTTP client for the browser and node.js +> New axios docs website: [click here](https://axios-http.com/) + +## Table of Contents + + - [Features](#features) + - [Browser Support](#browser-support) + - [Installing](#installing) + - [Example](#example) + - [Axios API](#axios-api) + - [Request method aliases](#request-method-aliases) + - [Concurrency (Deprecated)](#concurrency-deprecated) + - [Creating an instance](#creating-an-instance) + - [Instance methods](#instance-methods) + - [Request Config](#request-config) + - [Response Schema](#response-schema) + - [Config Defaults](#config-defaults) + - [Global axios defaults](#global-axios-defaults) + - [Custom instance defaults](#custom-instance-defaults) + - [Config order of precedence](#config-order-of-precedence) + - [Interceptors](#interceptors) + - [Handling Errors](#handling-errors) + - [Cancellation](#cancellation) + - [Using application/x-www-form-urlencoded format](#using-applicationx-www-form-urlencoded-format) + - [Browser](#browser) + - [Node.js](#nodejs) + - [Query string](#query-string) + - [Form data](#form-data) + - [Semver](#semver) + - [Promises](#promises) + - [TypeScript](#typescript) + - [Resources](#resources) + - [Credits](#credits) + - [License](#license) + ## Features - Make [XMLHttpRequests](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) from the browser @@ -24,7 +61,7 @@ Promise based HTTP client for the browser and node.js ![Chrome](https://raw.github.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.github.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png) | ![Safari](https://raw.github.com/alrra/browser-logos/master/src/safari/safari_48x48.png) | ![Opera](https://raw.github.com/alrra/browser-logos/master/src/opera/opera_48x48.png) | ![Edge](https://raw.github.com/alrra/browser-logos/master/src/edge/edge_48x48.png) | ![IE](https://raw.github.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png) | --- | --- | --- | --- | --- | --- | -Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 8+ ✔ | +Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 11 ✔ | [![Browser Matrix](https://saucelabs.com/open_sauce/build_matrix/axios.svg)](https://saucelabs.com/u/axios) @@ -42,7 +79,19 @@ Using bower: $ bower install axios ``` -Using cdn: +Using yarn: + +```bash +$ yarn add axios +``` + +Using jsDelivr CDN: + +```html + +``` + +Using unpkg CDN: ```html @@ -50,16 +99,32 @@ Using cdn: ## Example +### note: CommonJS usage +In order to gain the TypeScript typings (for intellisense / autocomplete) while using CommonJS imports with `require()` use the following approach: + +```js +const axios = require('axios').default; + +// axios. will now provide autocomplete and parameter typings +``` + Performing a `GET` request ```js +const axios = require('axios'); + // Make a request for a user with a given ID axios.get('/user?ID=12345') .then(function (response) { + // handle success console.log(response); }) .catch(function (error) { + // handle error console.log(error); + }) + .then(function () { + // always executed }); // Optionally the request above could also be done as @@ -73,9 +138,25 @@ axios.get('/user', { }) .catch(function (error) { console.log(error); - }); + }) + .then(function () { + // always executed + }); + +// Want to use async/await? Add the `async` keyword to your outer function/method. +async function getUser() { + try { + const response = await axios.get('/user?ID=12345'); + console.log(response); + } catch (error) { + console.error(error); + } +} ``` +> **NOTE:** `async/await` is part of ECMAScript 2017 and is not supported in Internet +> Explorer and older browsers, so use with caution. + Performing a `POST` request ```js @@ -102,10 +183,11 @@ function getUserPermissions() { return axios.get('/user/12345/permissions'); } -axios.all([getUserAccount(), getUserPermissions()]) - .then(axios.spread(function (acct, perms) { - // Both requests are now complete - })); +Promise.all([getUserAccount(), getUserPermissions()]) + .then(function (results) { + const acct = results[0]; + const perm = results[1]; + }); ``` ## axios API @@ -127,15 +209,15 @@ axios({ ``` ```js -// GET request for remote image +// GET request for remote image in node.js axios({ - method:'get', - url:'http://bit.ly/2mTM3nY', - responseType:'stream' + method: 'get', + url: 'http://bit.ly/2mTM3nY', + responseType: 'stream' }) - .then(function(response) { - response.data.pipe(fs.createWriteStream('ada_lovelace.jpg')) -}); + .then(function (response) { + response.data.pipe(fs.createWriteStream('ada_lovelace.jpg')) + }); ``` ##### axios(url[, config]) @@ -161,12 +243,13 @@ For convenience aliases have been provided for all supported request methods. ###### NOTE When using the alias methods `url`, `method`, and `data` properties don't need to be specified in config. -### Concurrency +### Concurrency (Deprecated) +Please use `Promise.all` to replace the below functions. Helper functions for dealing with concurrent requests. -##### axios.all(iterable) -##### axios.spread(callback) +axios.all(iterable) +axios.spread(callback) ### Creating an instance @@ -175,7 +258,7 @@ You can create a new instance of axios with a custom config. ##### axios.create([config]) ```js -var instance = axios.create({ +const instance = axios.create({ baseURL: 'https://some-domain.com/api/', timeout: 1000, headers: {'X-Custom-Header': 'foobar'} @@ -194,6 +277,7 @@ The available instance methods are listed below. The specified config will be me ##### axios#post(url[, data[, config]]) ##### axios#put(url[, data[, config]]) ##### axios#patch(url[, data[, config]]) +##### axios#getUri([config]) ## Request Config @@ -213,7 +297,7 @@ These are the available config options for making requests. Only the `url` is re baseURL: 'https://some-domain.com/api/', // `transformRequest` allows changes to the request data before it is sent to the server - // This is only applicable for request methods 'PUT', 'POST', and 'PATCH' + // This is only applicable for request methods 'PUT', 'POST', 'PATCH' and 'DELETE' // The last function in the array must return a string or an instance of Buffer, ArrayBuffer, // FormData or Stream // You may modify the headers object. @@ -242,12 +326,12 @@ These are the available config options for making requests. Only the `url` is re // `paramsSerializer` is an optional function in charge of serializing `params` // (e.g. https://www.npmjs.com/package/qs, http://api.jquery.com/jquery.param/) - paramsSerializer: function(params) { + paramsSerializer: function (params) { return Qs.stringify(params, {arrayFormat: 'brackets'}) }, // `data` is the data to be sent as the request body - // Only applicable for request methods 'PUT', 'POST', and 'PATCH' + // Only applicable for request methods 'PUT', 'POST', 'DELETE , and 'PATCH' // When no `transformRequest` is set, must be of one of the following types: // - string, plain object, ArrayBuffer, ArrayBufferView, URLSearchParams // - Browser only: FormData, File, Blob @@ -255,10 +339,15 @@ These are the available config options for making requests. Only the `url` is re data: { firstName: 'Fred' }, + + // syntax alternative to send data into the body + // method post + // only the value is sent, not the key + data: 'Country=Brasil&City=Belo Horizonte', // `timeout` specifies the number of milliseconds before the request times out. // If the request takes longer than `timeout`, the request will be aborted. - timeout: 1000, + timeout: 1000, // default is `0` (no timeout) // `withCredentials` indicates whether or not cross-site Access-Control requests // should be made using credentials @@ -273,15 +362,22 @@ These are the available config options for making requests. Only the `url` is re // `auth` indicates that HTTP Basic auth should be used, and supplies credentials. // This will set an `Authorization` header, overwriting any existing // `Authorization` custom headers you have set using `headers`. + // Please note that only HTTP Basic auth is configurable through this parameter. + // For Bearer tokens and such, use `Authorization` custom headers instead. auth: { username: 'janedoe', password: 's00pers3cret' }, // `responseType` indicates the type of data that the server will respond with - // options are 'arraybuffer', 'blob', 'document', 'json', 'text', 'stream' + // options are: 'arraybuffer', 'document', 'json', 'text', 'stream' + // browser only: 'blob' responseType: 'json', // default + // `responseEncoding` indicates encoding to use for decoding responses (Node.js only) + // Note: Ignored for `responseType` of 'stream' or client-side requests + responseEncoding: 'utf8', // default + // `xsrfCookieName` is the name of the cookie to use as a value for xsrf token xsrfCookieName: 'XSRF-TOKEN', // default @@ -289,18 +385,23 @@ These are the available config options for making requests. Only the `url` is re xsrfHeaderName: 'X-XSRF-TOKEN', // default // `onUploadProgress` allows handling of progress events for uploads + // browser only onUploadProgress: function (progressEvent) { // Do whatever you want with the native progress event }, // `onDownloadProgress` allows handling of progress events for downloads + // browser only onDownloadProgress: function (progressEvent) { // Do whatever you want with the native progress event }, - // `maxContentLength` defines the max size of the http response content allowed + // `maxContentLength` defines the max size of the http response content in bytes allowed in node.js maxContentLength: 2000, + // `maxBodyLength` (Node only option) defines the max size of the http request content in bytes allowed + maxBodyLength: 2000, + // `validateStatus` defines whether to resolve or reject the promise for a given // HTTP response status code. If `validateStatus` returns `true` (or is set to `null` // or `undefined`), the promise will be resolved; otherwise, the promise will be @@ -325,13 +426,19 @@ These are the available config options for making requests. Only the `url` is re httpAgent: new http.Agent({ keepAlive: true }), httpsAgent: new https.Agent({ keepAlive: true }), - // 'proxy' defines the hostname and port of the proxy server + // `proxy` defines the hostname, port, and protocol of the proxy server. + // You can also define your proxy using the conventional `http_proxy` and + // `https_proxy` environment variables. If you are using environment variables + // for your proxy configuration, you can also define a `no_proxy` environment + // variable as a comma-separated list of domains that should not be proxied. // Use `false` to disable proxies, ignoring environment variables. // `auth` indicates that HTTP Basic auth should be used to connect to the proxy, and // supplies credentials. // This will set an `Proxy-Authorization` header, overwriting any existing // `Proxy-Authorization` custom headers you have set using `headers`. + // If the proxy server uses HTTPS, then you must set the protocol to `https`. proxy: { + protocol: 'https', host: '127.0.0.1', port: 9000, auth: { @@ -343,7 +450,27 @@ These are the available config options for making requests. Only the `url` is re // `cancelToken` specifies a cancel token that can be used to cancel the request // (see Cancellation section below for details) cancelToken: new CancelToken(function (cancel) { - }) + }), + + // `decompress` indicates whether or not the response body should be decompressed + // automatically. If set to `true` will also remove the 'content-encoding' header + // from the responses objects of all decompressed responses + // - Node only (XHR cannot turn off decompression) + decompress: true, // default + + // transitional options for backward compatibility that may be removed in the newer versions + transitional: { + // silent JSON parsing mode + // `true` - ignore JSON parsing errors and set response.data to null if parsing failed (old behaviour) + // `false` - throw SyntaxError if JSON parsing failed (Note: responseType must be set to 'json') + silentJSONParsing: true, // default value for the current Axios version + + // try to parse the response string as JSON even if `responseType` is not 'json' + forcedJSONParsing: true; + + // throw ETIMEDOUT error instead of generic ECONNABORTED on request timeouts + clarifyTimeoutError: false, + } } ``` @@ -362,8 +489,9 @@ The response for a request contains the following information. // `statusText` is the HTTP status message from the server response statusText: 'OK', - // `headers` the headers that the server responded with - // All header names are lower cased + // `headers` the HTTP headers that the server responded with + // All header names are lower cased and can be accessed using the bracket notation. + // Example: `response.headers['content-type']` headers: {}, // `config` is the config that was provided to `axios` for the request @@ -371,7 +499,7 @@ The response for a request contains the following information. // `request` is the request that generated this response // It is the last ClientRequest instance in node.js (in redirects) - // and an XMLHttpRequest instance the browser + // and an XMLHttpRequest instance in the browser request: {} } ``` @@ -380,7 +508,7 @@ When using `then`, you will receive the response as follows: ```js axios.get('/user/12345') - .then(function(response) { + .then(function (response) { console.log(response.data); console.log(response.status); console.log(response.statusText); @@ -399,7 +527,11 @@ You can specify config defaults that will be applied to every request. ```js axios.defaults.baseURL = 'https://api.example.com'; + +// Important: If axios is used with multiple domains, the AUTH_TOKEN will be sent to all of them. +// See below for an example using Custom instance defaults instead. axios.defaults.headers.common['Authorization'] = AUTH_TOKEN; + axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; ``` @@ -407,7 +539,7 @@ axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded ```js // Set config defaults when creating the instance -var instance = axios.create({ +const instance = axios.create({ baseURL: 'https://api.example.com' }); @@ -422,10 +554,10 @@ Config will be merged with an order of precedence. The order is library defaults ```js // Create an instance using the config defaults provided by the library // At this point the timeout config value is `0` as is the default for the library -var instance = axios.create(); +const instance = axios.create(); // Override timeout default for the library -// Now all requests will wait 2.5 seconds before timing out +// Now all requests using this instance will wait 2.5 seconds before timing out instance.defaults.timeout = 2500; // Override timeout for this request as it's known to take a long time @@ -450,28 +582,58 @@ axios.interceptors.request.use(function (config) { // Add a response interceptor axios.interceptors.response.use(function (response) { + // Any status code that lie within the range of 2xx cause this function to trigger // Do something with response data return response; }, function (error) { + // Any status codes that falls outside the range of 2xx cause this function to trigger // Do something with response error return Promise.reject(error); }); ``` -If you may need to remove an interceptor later you can. +If you need to remove an interceptor later you can. ```js -var myInterceptor = axios.interceptors.request.use(function () {/*...*/}); +const myInterceptor = axios.interceptors.request.use(function () {/*...*/}); axios.interceptors.request.eject(myInterceptor); ``` You can add interceptors to a custom instance of axios. ```js -var instance = axios.create(); +const instance = axios.create(); instance.interceptors.request.use(function () {/*...*/}); ``` +When you add request interceptors, they are presumed to be asynchronous by default. This can cause a delay +in the execution of your axios request when the main thread is blocked (a promise is created under the hood for +the interceptor and your request gets put on the bottom of the call stack). If your request interceptors are synchronous you can add a flag +to the options object that will tell axios to run the code synchronously and avoid any delays in request execution. + +```js +axios.interceptors.request.use(function (config) { + config.headers.test = 'I am only a header!'; + return config; +}, null, { synchronous: true }); +``` + +If you want to execute a particular interceptor based on a runtime check, +you can add a `runWhen` function to the options object. The interceptor will not be executed **if and only if** the return +of `runWhen` is `false`. The function will be called with the config +object (don't forget that you can bind your own arguments to it as well.) This can be handy when you have an +asynchronous request interceptor that only needs to run at certain times. + +```js +function onGetCall(config) { + return config.method === 'get'; +} +axios.interceptors.request.use(function (config) { + config.headers.test = 'special get headers'; + return config; +}, null, { runWhen: onGetCall }); +``` + ## Handling Errors ```js @@ -496,16 +658,25 @@ axios.get('/user/12345') }); ``` -You can define a custom HTTP status code error range using the `validateStatus` config option. +Using the `validateStatus` config option, you can define HTTP code(s) that should throw an error. ```js axios.get('/user/12345', { validateStatus: function (status) { - return status < 500; // Reject only if the status code is greater than or equal to 500 + return status < 500; // Resolve only if the status code is less than 500 } }) ``` +Using `toJSON` you get an object with more information about the HTTP error. + +```js +axios.get('/user/12345') + .catch(function (error) { + console.log(error.toJSON()); + }); +``` + ## Cancellation You can cancel a request using a *cancel token*. @@ -515,12 +686,12 @@ You can cancel a request using a *cancel token*. You can create a cancel token using the `CancelToken.source` factory as shown below: ```js -var CancelToken = axios.CancelToken; -var source = CancelToken.source(); +const CancelToken = axios.CancelToken; +const source = CancelToken.source(); axios.get('/user/12345', { cancelToken: source.token -}).catch(function(thrown) { +}).catch(function (thrown) { if (axios.isCancel(thrown)) { console.log('Request canceled', thrown.message); } else { @@ -541,8 +712,8 @@ source.cancel('Operation canceled by the user.'); You can also create a cancel token by passing an executor function to the `CancelToken` constructor: ```js -var CancelToken = axios.CancelToken; -var cancel; +const CancelToken = axios.CancelToken; +let cancel; axios.get('/user/12345', { cancelToken: new CancelToken(function executor(c) { @@ -556,6 +727,7 @@ cancel(); ``` > Note: you can cancel several requests with the same cancel token. +> If a cancellation token is already cancelled at the moment of starting an Axios request, then the request is cancelled immediately, without any attempts to make real request. ## Using application/x-www-form-urlencoded format @@ -566,7 +738,7 @@ By default, axios serializes JavaScript objects to `JSON`. To send data in the ` In a browser, you can use the [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) API as follows: ```js -var params = new URLSearchParams(); +const params = new URLSearchParams(); params.append('param1', 'value1'); params.append('param2', 'value2'); axios.post('/foo', params); @@ -577,21 +749,74 @@ axios.post('/foo', params); Alternatively, you can encode data using the [`qs`](https://github.com/ljharb/qs) library: ```js -var qs = require('qs'); +const qs = require('qs'); axios.post('/foo', qs.stringify({ 'bar': 123 })); ``` +Or in another way (ES6), + +```js +import qs from 'qs'; +const data = { 'bar': 123 }; +const options = { + method: 'POST', + headers: { 'content-type': 'application/x-www-form-urlencoded' }, + data: qs.stringify(data), + url, +}; +axios(options); +``` + ### Node.js +#### Query string + In node.js, you can use the [`querystring`](https://nodejs.org/api/querystring.html) module as follows: ```js -var querystring = require('querystring'); +const querystring = require('querystring'); axios.post('http://something.com/', querystring.stringify({ foo: 'bar' })); ``` +or ['URLSearchParams'](https://nodejs.org/api/url.html#url_class_urlsearchparams) from ['url module'](https://nodejs.org/api/url.html) as follows: + +```js +const url = require('url'); +const params = new url.URLSearchParams({ foo: 'bar' }); +axios.post('http://something.com/', params.toString()); +``` + You can also use the [`qs`](https://github.com/ljharb/qs) library. +###### NOTE +The `qs` library is preferable if you need to stringify nested objects, as the `querystring` method has known issues with that use case (https://github.com/nodejs/node-v0.x-archive/issues/1665). + +#### Form data + +In node.js, you can use the [`form-data`](https://github.com/form-data/form-data) library as follows: + +```js +const FormData = require('form-data'); + +const form = new FormData(); +form.append('my_field', 'my value'); +form.append('my_buffer', new Buffer(10)); +form.append('my_file', fs.createReadStream('/foo/bar.jpg')); + +axios.post('https://example.com', form, { headers: form.getHeaders() }) +``` + +Alternatively, use an interceptor: + +```js +axios.interceptors.request.use(config => { + if (config.data instanceof FormData) { + Object.assign(config.headers, config.data.getHeaders()); + } + return config; +}); +``` + ## Semver Until axios reaches a `1.0` release, breaking changes will be released with a new minor version. For example `0.5.1`, and `0.5.4` will have the same API, but `0.6.0` will have breaking changes. @@ -602,12 +827,30 @@ axios depends on a native ES6 Promise implementation to be [supported](http://ca If your environment doesn't support ES6 Promises, you can [polyfill](https://github.com/jakearchibald/es6-promise). ## TypeScript -axios includes [TypeScript](http://typescriptlang.org) definitions. + +axios includes [TypeScript](http://typescriptlang.org) definitions and a type guard for axios errors. + ```typescript -import axios from 'axios'; -axios.get('/user?ID=12345'); +let user: User = null; +try { + const { data } = await axios.get('/user?ID=12345'); + user = data.userDetails; +} catch (error) { + if (axios.isAxiosError(error)) { + handleAxiosError(error); + } else { + handleUnexpectedError(error); + } +} ``` +## Online one-click setup + +You can use Gitpod an online IDE(which is free for Open Source) for contributing or running the examples online. + +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/axios/axios/blob/master/examples/server.js) + + ## Resources * [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md) @@ -622,4 +865,4 @@ axios is heavily inspired by the [$http service](https://docs.angularjs.org/api/ ## License -MIT +[MIT](LICENSE) diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/axios/UPGRADE_GUIDE.md b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/axios/UPGRADE_GUIDE.md index eedb0492..745e8049 100644 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/axios/UPGRADE_GUIDE.md +++ b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/axios/UPGRADE_GUIDE.md @@ -135,7 +135,7 @@ This will polyfill the global environment, and only needs to be done once. #### `axios.success`/`axios.error` -The `success`, and `error` aliases were deprectated in [0.4.0](https://github.com/axios/axios/blob/master/CHANGELOG.md#040-oct-03-2014). As of this release they have been removed entirely. Instead please use `axios.then`, and `axios.catch` respectively. +The `success`, and `error` aliases were deprecated in [0.4.0](https://github.com/axios/axios/blob/master/CHANGELOG.md#040-oct-03-2014). As of this release they have been removed entirely. Instead please use `axios.then`, and `axios.catch` respectively. ```js axios.get('some/url') diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/axios/index.d.ts b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/axios/index.d.ts index 403fd1af..78f733f8 100644 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/axios/index.d.ts +++ b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/axios/index.d.ts @@ -17,12 +17,39 @@ export interface AxiosProxyConfig { auth?: { username: string; password:string; - } + }; + protocol?: string; +} + +export type Method = + | 'get' | 'GET' + | 'delete' | 'DELETE' + | 'head' | 'HEAD' + | 'options' | 'OPTIONS' + | 'post' | 'POST' + | 'put' | 'PUT' + | 'patch' | 'PATCH' + | 'purge' | 'PURGE' + | 'link' | 'LINK' + | 'unlink' | 'UNLINK' + +export type ResponseType = + | 'arraybuffer' + | 'blob' + | 'document' + | 'json' + | 'text' + | 'stream' + +export interface TransitionalOptions{ + silentJSONParsing: boolean; + forcedJSONParsing: boolean; + clarifyTimeoutError: boolean; } export interface AxiosRequestConfig { url?: string; - method?: string; + method?: Method; baseURL?: string; transformRequest?: AxiosTransformer | AxiosTransformer[]; transformResponse?: AxiosTransformer | AxiosTransformer[]; @@ -31,21 +58,26 @@ export interface AxiosRequestConfig { paramsSerializer?: (params: any) => string; data?: any; timeout?: number; + timeoutErrorMessage?: string; withCredentials?: boolean; adapter?: AxiosAdapter; auth?: AxiosBasicCredentials; - responseType?: string; + responseType?: ResponseType; xsrfCookieName?: string; xsrfHeaderName?: string; onUploadProgress?: (progressEvent: any) => void; onDownloadProgress?: (progressEvent: any) => void; maxContentLength?: number; - validateStatus?: (status: number) => boolean; + validateStatus?: ((status: number) => boolean) | null; + maxBodyLength?: number; maxRedirects?: number; + socketPath?: string | null; httpAgent?: any; httpsAgent?: any; proxy?: AxiosProxyConfig | false; cancelToken?: CancelToken; + decompress?: boolean; + transitional?: TransitionalOptions } export interface AxiosResponse { @@ -57,11 +89,13 @@ export interface AxiosResponse { request?: any; } -export interface AxiosError extends Error { +export interface AxiosError extends Error { config: AxiosRequestConfig; code?: string; request?: any; - response?: AxiosResponse; + response?: AxiosResponse; + isAxiosError: boolean; + toJSON: () => object; } export interface AxiosPromise extends Promise> { @@ -96,7 +130,7 @@ export interface CancelTokenSource { } export interface AxiosInterceptorManager { - use(onFulfilled?: (value: V) => V | Promise, onRejected?: (error: any) => any): number; + use(onFulfilled?: (value: V) => T | Promise, onRejected?: (error: any) => any): number; eject(id: number): void; } @@ -108,13 +142,15 @@ export interface AxiosInstance { request: AxiosInterceptorManager; response: AxiosInterceptorManager; }; - request(config: AxiosRequestConfig): AxiosPromise; - get(url: string, config?: AxiosRequestConfig): AxiosPromise; - delete(url: string, config?: AxiosRequestConfig): AxiosPromise; - head(url: string, config?: AxiosRequestConfig): AxiosPromise; - post(url: string, data?: any, config?: AxiosRequestConfig): AxiosPromise; - put(url: string, data?: any, config?: AxiosRequestConfig): AxiosPromise; - patch(url: string, data?: any, config?: AxiosRequestConfig): AxiosPromise; + getUri(config?: AxiosRequestConfig): string; + request> (config: AxiosRequestConfig): Promise; + get>(url: string, config?: AxiosRequestConfig): Promise; + delete>(url: string, config?: AxiosRequestConfig): Promise; + head>(url: string, config?: AxiosRequestConfig): Promise; + options>(url: string, config?: AxiosRequestConfig): Promise; + post>(url: string, data?: any, config?: AxiosRequestConfig): Promise; + put>(url: string, data?: any, config?: AxiosRequestConfig): Promise; + patch>(url: string, data?: any, config?: AxiosRequestConfig): Promise; } export interface AxiosStatic extends AxiosInstance { @@ -124,8 +160,9 @@ export interface AxiosStatic extends AxiosInstance { isCancel(value: any): boolean; all(values: (T | Promise)[]): Promise; spread(callback: (...args: T[]) => R): (array: T[]) => R; + isAxiosError(payload: any): payload is AxiosError; } -declare const Axios: AxiosStatic; +declare const axios: AxiosStatic; -export default Axios; +export default axios; diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/axios/package.json b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/axios/package.json index af396f33..ffe4bde8 100644 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/axios/package.json +++ b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/axios/package.json @@ -1,111 +1,84 @@ { - "_from": "axios", - "_id": "axios@0.18.0", - "_inBundle": false, - "_integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=", - "_location": "/axios", - "_phantomChildren": {}, - "_requested": { - "type": "tag", - "registry": true, - "raw": "axios", - "name": "axios", - "escapedName": "axios", - "rawSpec": "", - "saveSpec": null, - "fetchSpec": "latest" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/axios/-/axios-0.18.0.tgz", - "_shasum": "32d53e4851efdc0a11993b6cd000789d70c05102", - "_spec": "axios", - "_where": "/Users/mkennedy/github/talk-python/courses/100web/web100-demos/days/093-096-vuejs/your-turn/your_movie_exploder", - "author": { - "name": "Matt Zabriskie" + "name": "axios", + "version": "0.21.2", + "description": "Promise based HTTP client for the browser and node.js", + "main": "index.js", + "scripts": { + "test": "grunt test", + "start": "node ./sandbox/server.js", + "build": "NODE_ENV=production grunt build", + "preversion": "npm test", + "version": "npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json", + "postversion": "git push && git push --tags", + "examples": "node ./examples/server.js", + "coveralls": "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js", + "fix": "eslint --fix lib/**/*.js" }, - "browser": { - "./lib/adapters/http.js": "./lib/adapters/xhr.js" + "repository": { + "type": "git", + "url": "https://github.com/axios/axios.git" }, + "keywords": [ + "xhr", + "http", + "ajax", + "promise", + "node" + ], + "author": "Matt Zabriskie", + "license": "MIT", "bugs": { "url": "https://github.com/axios/axios/issues" }, - "bundleDependencies": false, - "bundlesize": [ - { - "path": "./dist/axios.min.js", - "threshold": "5kB" - } - ], - "dependencies": { - "follow-redirects": "^1.3.0", - "is-buffer": "^1.1.5" - }, - "deprecated": false, - "description": "Promise based HTTP client for the browser and node.js", + "homepage": "https://axios-http.com", "devDependencies": { - "bundlesize": "^0.5.7", - "coveralls": "^2.11.9", - "es6-promise": "^4.0.5", - "grunt": "^1.0.1", + "coveralls": "^3.0.0", + "es6-promise": "^4.2.4", + "grunt": "^1.3.0", "grunt-banner": "^0.6.0", "grunt-cli": "^1.2.0", - "grunt-contrib-clean": "^1.0.0", - "grunt-contrib-nodeunit": "^1.0.0", + "grunt-contrib-clean": "^1.1.0", "grunt-contrib-watch": "^1.0.0", - "grunt-eslint": "^19.0.0", - "grunt-karma": "^2.0.0", - "grunt-ts": "^6.0.0-beta.3", - "grunt-webpack": "^1.0.18", + "grunt-eslint": "^23.0.0", + "grunt-karma": "^4.0.0", + "grunt-mocha-test": "^0.13.3", + "grunt-ts": "^6.0.0-beta.19", + "grunt-webpack": "^4.0.2", "istanbul-instrumenter-loader": "^1.0.0", "jasmine-core": "^2.4.1", - "karma": "^1.3.0", - "karma-chrome-launcher": "^2.0.0", - "karma-coverage": "^1.0.0", - "karma-firefox-launcher": "^1.0.0", - "karma-jasmine": "^1.0.2", + "karma": "^6.3.2", + "karma-chrome-launcher": "^3.1.0", + "karma-firefox-launcher": "^2.1.0", + "karma-jasmine": "^1.1.1", "karma-jasmine-ajax": "^0.1.13", - "karma-opera-launcher": "^1.0.0", "karma-safari-launcher": "^1.0.0", - "karma-sauce-launcher": "^1.1.0", + "karma-sauce-launcher": "^4.3.6", "karma-sinon": "^1.0.5", - "karma-sourcemap-loader": "^0.3.7", - "karma-webpack": "^1.7.0", + "karma-sourcemap-loader": "^0.3.8", + "karma-webpack": "^4.0.2", "load-grunt-tasks": "^3.5.2", "minimist": "^1.2.0", - "sinon": "^1.17.4", - "typescript": "^2.0.3", - "url-search-params": "^0.6.1", - "webpack": "^1.13.1", - "webpack-dev-server": "^1.14.1" - }, - "homepage": "https://github.com/axios/axios", - "keywords": [ - "xhr", - "http", - "ajax", - "promise", - "node" - ], - "license": "MIT", - "main": "index.js", - "name": "axios", - "repository": { - "type": "git", - "url": "git+https://github.com/axios/axios.git" + "mocha": "^8.2.1", + "sinon": "^4.5.0", + "terser-webpack-plugin": "^4.2.3", + "typescript": "^4.0.5", + "url-search-params": "^0.10.0", + "webpack": "^4.44.2", + "webpack-dev-server": "^3.11.0" }, - "scripts": { - "build": "NODE_ENV=production grunt build", - "coveralls": "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js", - "examples": "node ./examples/server.js", - "postversion": "git push && git push --tags", - "preversion": "npm test", - "start": "node ./sandbox/server.js", - "test": "grunt test && bundlesize", - "version": "npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json" + "browser": { + "./lib/adapters/http.js": "./lib/adapters/xhr.js" }, + "jsdelivr": "dist/axios.min.js", + "unpkg": "dist/axios.min.js", "typings": "./index.d.ts", - "version": "0.18.0" + "dependencies": { + "follow-redirects": "^1.14.0" + }, + "bundlesize": [ + { + "path": "./dist/axios.min.js", + "threshold": "5kB" + } + ] } diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/debug/CHANGELOG.md b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/debug/CHANGELOG.md deleted file mode 100644 index 820d21e3..00000000 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/debug/CHANGELOG.md +++ /dev/null @@ -1,395 +0,0 @@ - -3.1.0 / 2017-09-26 -================== - - * Add `DEBUG_HIDE_DATE` env var (#486) - * Remove ReDoS regexp in %o formatter (#504) - * Remove "component" from package.json - * Remove `component.json` - * Ignore package-lock.json - * Examples: fix colors printout - * Fix: browser detection - * Fix: spelling mistake (#496, @EdwardBetts) - -3.0.1 / 2017-08-24 -================== - - * Fix: Disable colors in Edge and Internet Explorer (#489) - -3.0.0 / 2017-08-08 -================== - - * Breaking: Remove DEBUG_FD (#406) - * Breaking: Use `Date#toISOString()` instead to `Date#toUTCString()` when output is not a TTY (#418) - * Breaking: Make millisecond timer namespace specific and allow 'always enabled' output (#408) - * Addition: document `enabled` flag (#465) - * Addition: add 256 colors mode (#481) - * Addition: `enabled()` updates existing debug instances, add `destroy()` function (#440) - * Update: component: update "ms" to v2.0.0 - * Update: separate the Node and Browser tests in Travis-CI - * Update: refactor Readme, fixed documentation, added "Namespace Colors" section, redid screenshots - * Update: separate Node.js and web browser examples for organization - * Update: update "browserify" to v14.4.0 - * Fix: fix Readme typo (#473) - -2.6.9 / 2017-09-22 -================== - - * remove ReDoS regexp in %o formatter (#504) - -2.6.8 / 2017-05-18 -================== - - * Fix: Check for undefined on browser globals (#462, @marbemac) - -2.6.7 / 2017-05-16 -================== - - * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom) - * Fix: Inline extend function in node implementation (#452, @dougwilson) - * Docs: Fix typo (#455, @msasad) - -2.6.5 / 2017-04-27 -================== - - * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek) - * Misc: clean up browser reference checks (#447, @thebigredgeek) - * Misc: add npm-debug.log to .gitignore (@thebigredgeek) - - -2.6.4 / 2017-04-20 -================== - - * Fix: bug that would occur if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo) - * Chore: ignore bower.json in npm installations. (#437, @joaovieira) - * Misc: update "ms" to v0.7.3 (@tootallnate) - -2.6.3 / 2017-03-13 -================== - - * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts) - * Docs: Changelog fix (@thebigredgeek) - -2.6.2 / 2017-03-10 -================== - - * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin) - * Docs: Add backers and sponsors from Open Collective (#422, @piamancini) - * Docs: Add Slackin invite badge (@tootallnate) - -2.6.1 / 2017-02-10 -================== - - * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error - * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0) - * Fix: IE8 "Expected identifier" error (#414, @vgoma) - * Fix: Namespaces would not disable once enabled (#409, @musikov) - -2.6.0 / 2016-12-28 -================== - - * Fix: added better null pointer checks for browser useColors (@thebigredgeek) - * Improvement: removed explicit `window.debug` export (#404, @tootallnate) - * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate) - -2.5.2 / 2016-12-25 -================== - - * Fix: reference error on window within webworkers (#393, @KlausTrainer) - * Docs: fixed README typo (#391, @lurch) - * Docs: added notice about v3 api discussion (@thebigredgeek) - -2.5.1 / 2016-12-20 -================== - - * Fix: babel-core compatibility - -2.5.0 / 2016-12-20 -================== - - * Fix: wrong reference in bower file (@thebigredgeek) - * Fix: webworker compatibility (@thebigredgeek) - * Fix: output formatting issue (#388, @kribblo) - * Fix: babel-loader compatibility (#383, @escwald) - * Misc: removed built asset from repo and publications (@thebigredgeek) - * Misc: moved source files to /src (#378, @yamikuronue) - * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue) - * Test: coveralls integration (#378, @yamikuronue) - * Docs: simplified language in the opening paragraph (#373, @yamikuronue) - -2.4.5 / 2016-12-17 -================== - - * Fix: `navigator` undefined in Rhino (#376, @jochenberger) - * Fix: custom log function (#379, @hsiliev) - * Improvement: bit of cleanup + linting fixes (@thebigredgeek) - * Improvement: rm non-maintainted `dist/` dir (#375, @freewil) - * Docs: simplified language in the opening paragraph. (#373, @yamikuronue) - -2.4.4 / 2016-12-14 -================== - - * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts) - -2.4.3 / 2016-12-14 -================== - - * Fix: navigation.userAgent error for react native (#364, @escwald) - -2.4.2 / 2016-12-14 -================== - - * Fix: browser colors (#367, @tootallnate) - * Misc: travis ci integration (@thebigredgeek) - * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek) - -2.4.1 / 2016-12-13 -================== - - * Fix: typo that broke the package (#356) - -2.4.0 / 2016-12-13 -================== - - * Fix: bower.json references unbuilt src entry point (#342, @justmatt) - * Fix: revert "handle regex special characters" (@tootallnate) - * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate) - * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate) - * Improvement: allow colors in workers (#335, @botverse) - * Improvement: use same color for same namespace. (#338, @lchenay) - -2.3.3 / 2016-11-09 -================== - - * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne) - * Fix: Returning `localStorage` saved values (#331, Levi Thomason) - * Improvement: Don't create an empty object when no `process` (Nathan Rajlich) - -2.3.2 / 2016-11-09 -================== - - * Fix: be super-safe in index.js as well (@TooTallNate) - * Fix: should check whether process exists (Tom Newby) - -2.3.1 / 2016-11-09 -================== - - * Fix: Added electron compatibility (#324, @paulcbetts) - * Improvement: Added performance optimizations (@tootallnate) - * Readme: Corrected PowerShell environment variable example (#252, @gimre) - * Misc: Removed yarn lock file from source control (#321, @fengmk2) - -2.3.0 / 2016-11-07 -================== - - * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic) - * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos) - * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15) - * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran) - * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom) - * Package: Update "ms" to 0.7.2 (#315, @DevSide) - * Package: removed superfluous version property from bower.json (#207 @kkirsche) - * Readme: fix USE_COLORS to DEBUG_COLORS - * Readme: Doc fixes for format string sugar (#269, @mlucool) - * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0) - * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable) - * Readme: better docs for browser support (#224, @matthewmueller) - * Tooling: Added yarn integration for development (#317, @thebigredgeek) - * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek) - * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman) - * Misc: Updated contributors (@thebigredgeek) - -2.2.0 / 2015-05-09 -================== - - * package: update "ms" to v0.7.1 (#202, @dougwilson) - * README: add logging to file example (#193, @DanielOchoa) - * README: fixed a typo (#191, @amir-s) - * browser: expose `storage` (#190, @stephenmathieson) - * Makefile: add a `distclean` target (#189, @stephenmathieson) - -2.1.3 / 2015-03-13 -================== - - * Updated stdout/stderr example (#186) - * Updated example/stdout.js to match debug current behaviour - * Renamed example/stderr.js to stdout.js - * Update Readme.md (#184) - * replace high intensity foreground color for bold (#182, #183) - -2.1.2 / 2015-03-01 -================== - - * dist: recompile - * update "ms" to v0.7.0 - * package: update "browserify" to v9.0.3 - * component: fix "ms.js" repo location - * changed bower package name - * updated documentation about using debug in a browser - * fix: security error on safari (#167, #168, @yields) - -2.1.1 / 2014-12-29 -================== - - * browser: use `typeof` to check for `console` existence - * browser: check for `console.log` truthiness (fix IE 8/9) - * browser: add support for Chrome apps - * Readme: added Windows usage remarks - * Add `bower.json` to properly support bower install - -2.1.0 / 2014-10-15 -================== - - * node: implement `DEBUG_FD` env variable support - * package: update "browserify" to v6.1.0 - * package: add "license" field to package.json (#135, @panuhorsmalahti) - -2.0.0 / 2014-09-01 -================== - - * package: update "browserify" to v5.11.0 - * node: use stderr rather than stdout for logging (#29, @stephenmathieson) - -1.0.4 / 2014-07-15 -================== - - * dist: recompile - * example: remove `console.info()` log usage - * example: add "Content-Type" UTF-8 header to browser example - * browser: place %c marker after the space character - * browser: reset the "content" color via `color: inherit` - * browser: add colors support for Firefox >= v31 - * debug: prefer an instance `log()` function over the global one (#119) - * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) - -1.0.3 / 2014-07-09 -================== - - * Add support for multiple wildcards in namespaces (#122, @seegno) - * browser: fix lint - -1.0.2 / 2014-06-10 -================== - - * browser: update color palette (#113, @gscottolson) - * common: make console logging function configurable (#108, @timoxley) - * node: fix %o colors on old node <= 0.8.x - * Makefile: find node path using shell/which (#109, @timoxley) - -1.0.1 / 2014-06-06 -================== - - * browser: use `removeItem()` to clear localStorage - * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) - * package: add "contributors" section - * node: fix comment typo - * README: list authors - -1.0.0 / 2014-06-04 -================== - - * make ms diff be global, not be scope - * debug: ignore empty strings in enable() - * node: make DEBUG_COLORS able to disable coloring - * *: export the `colors` array - * npmignore: don't publish the `dist` dir - * Makefile: refactor to use browserify - * package: add "browserify" as a dev dependency - * Readme: add Web Inspector Colors section - * node: reset terminal color for the debug content - * node: map "%o" to `util.inspect()` - * browser: map "%j" to `JSON.stringify()` - * debug: add custom "formatters" - * debug: use "ms" module for humanizing the diff - * Readme: add "bash" syntax highlighting - * browser: add Firebug color support - * browser: add colors for WebKit browsers - * node: apply log to `console` - * rewrite: abstract common logic for Node & browsers - * add .jshintrc file - -0.8.1 / 2014-04-14 -================== - - * package: re-add the "component" section - -0.8.0 / 2014-03-30 -================== - - * add `enable()` method for nodejs. Closes #27 - * change from stderr to stdout - * remove unnecessary index.js file - -0.7.4 / 2013-11-13 -================== - - * remove "browserify" key from package.json (fixes something in browserify) - -0.7.3 / 2013-10-30 -================== - - * fix: catch localStorage security error when cookies are blocked (Chrome) - * add debug(err) support. Closes #46 - * add .browser prop to package.json. Closes #42 - -0.7.2 / 2013-02-06 -================== - - * fix package.json - * fix: Mobile Safari (private mode) is broken with debug - * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript - -0.7.1 / 2013-02-05 -================== - - * add repository URL to package.json - * add DEBUG_COLORED to force colored output - * add browserify support - * fix component. Closes #24 - -0.7.0 / 2012-05-04 -================== - - * Added .component to package.json - * Added debug.component.js build - -0.6.0 / 2012-03-16 -================== - - * Added support for "-" prefix in DEBUG [Vinay Pulim] - * Added `.enabled` flag to the node version [TooTallNate] - -0.5.0 / 2012-02-02 -================== - - * Added: humanize diffs. Closes #8 - * Added `debug.disable()` to the CS variant - * Removed padding. Closes #10 - * Fixed: persist client-side variant again. Closes #9 - -0.4.0 / 2012-02-01 -================== - - * Added browser variant support for older browsers [TooTallNate] - * Added `debug.enable('project:*')` to browser variant [TooTallNate] - * Added padding to diff (moved it to the right) - -0.3.0 / 2012-01-26 -================== - - * Added millisecond diff when isatty, otherwise UTC string - -0.2.0 / 2012-01-22 -================== - - * Added wildcard support - -0.1.0 / 2011-12-02 -================== - - * Added: remove colors unless stderr isatty [TooTallNate] - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/debug/LICENSE b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/debug/LICENSE deleted file mode 100644 index 658c933d..00000000 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/debug/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 TJ Holowaychuk - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software -and associated documentation files (the 'Software'), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial -portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT -LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/debug/README.md b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/debug/README.md deleted file mode 100644 index 0ee7634d..00000000 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/debug/README.md +++ /dev/null @@ -1,437 +0,0 @@ -# debug -[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug) [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) -[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) - - - -A tiny JavaScript debugging utility modelled after Node.js core's debugging -technique. Works in Node.js and web browsers. - -## Installation - -```bash -$ npm install debug -``` - -## Usage - -`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. - -Example [_app.js_](./examples/node/app.js): - -```js -var debug = require('debug')('http') - , http = require('http') - , name = 'My App'; - -// fake app - -debug('booting %o', name); - -http.createServer(function(req, res){ - debug(req.method + ' ' + req.url); - res.end('hello\n'); -}).listen(3000, function(){ - debug('listening'); -}); - -// fake worker of some kind - -require('./worker'); -``` - -Example [_worker.js_](./examples/node/worker.js): - -```js -var a = require('debug')('worker:a') - , b = require('debug')('worker:b'); - -function work() { - a('doing lots of uninteresting work'); - setTimeout(work, Math.random() * 1000); -} - -work(); - -function workb() { - b('doing some work'); - setTimeout(workb, Math.random() * 2000); -} - -workb(); -``` - -The `DEBUG` environment variable is then used to enable these based on space or -comma-delimited names. - -Here are some examples: - -screen shot 2017-08-08 at 12 53 04 pm -screen shot 2017-08-08 at 12 53 38 pm -screen shot 2017-08-08 at 12 53 25 pm - -#### Windows command prompt notes - -##### CMD - -On Windows the environment variable is set using the `set` command. - -```cmd -set DEBUG=*,-not_this -``` - -Example: - -```cmd -set DEBUG=* & node app.js -``` - -##### PowerShell (VS Code default) - -PowerShell uses different syntax to set environment variables. - -```cmd -$env:DEBUG = "*,-not_this" -``` - -Example: - -```cmd -$env:DEBUG='app';node app.js -``` - -Then, run the program to be debugged as usual. - -npm script example: -```js - "windowsDebug": "@powershell -Command $env:DEBUG='*';node app.js", -``` - -## Namespace Colors - -Every debug instance has a color generated for it based on its namespace name. -This helps when visually parsing the debug output to identify which debug instance -a debug line belongs to. - -#### Node.js - -In Node.js, colors are enabled when stderr is a TTY. You also _should_ install -the [`supports-color`](https://npmjs.org/supports-color) module alongside debug, -otherwise debug will only use a small handful of basic colors. - - - -#### Web Browser - -Colors are also enabled on "Web Inspectors" that understand the `%c` formatting -option. These are WebKit web inspectors, Firefox ([since version -31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) -and the Firebug plugin for Firefox (any version). - - - - -## Millisecond diff - -When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. - - - -When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below: - - - - -## Conventions - -If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable. You can then use it for normal output as well as debug output. - -## Wildcards - -The `*` character may be used as a wildcard. Suppose for example your library has -debuggers named "connect:bodyParser", "connect:compress", "connect:session", -instead of listing all three with -`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do -`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. - -You can also exclude specific debuggers by prefixing them with a "-" character. -For example, `DEBUG=*,-connect:*` would include all debuggers except those -starting with "connect:". - -## Environment Variables - -When running through Node.js, you can set a few environment variables that will -change the behavior of the debug logging: - -| Name | Purpose | -|-----------|-------------------------------------------------| -| `DEBUG` | Enables/disables specific debugging namespaces. | -| `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY). | -| `DEBUG_COLORS`| Whether or not to use colors in the debug output. | -| `DEBUG_DEPTH` | Object inspection depth. | -| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | - - -__Note:__ The environment variables beginning with `DEBUG_` end up being -converted into an Options object that gets used with `%o`/`%O` formatters. -See the Node.js documentation for -[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) -for the complete list. - -## Formatters - -Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. -Below are the officially supported formatters: - -| Formatter | Representation | -|-----------|----------------| -| `%O` | Pretty-print an Object on multiple lines. | -| `%o` | Pretty-print an Object all on a single line. | -| `%s` | String. | -| `%d` | Number (both integer and float). | -| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | -| `%%` | Single percent sign ('%'). This does not consume an argument. | - - -### Custom formatters - -You can add custom formatters by extending the `debug.formatters` object. -For example, if you wanted to add support for rendering a Buffer as hex with -`%h`, you could do something like: - -```js -const createDebug = require('debug') -createDebug.formatters.h = (v) => { - return v.toString('hex') -} - -// …elsewhere -const debug = createDebug('foo') -debug('this is hex: %h', new Buffer('hello world')) -// foo this is hex: 68656c6c6f20776f726c6421 +0ms -``` - - -## Browser Support - -You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), -or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), -if you don't want to build it yourself. - -Debug's enable state is currently persisted by `localStorage`. -Consider the situation shown below where you have `worker:a` and `worker:b`, -and wish to debug both. You can enable this using `localStorage.debug`: - -```js -localStorage.debug = 'worker:*' -``` - -And then refresh the page. - -```js -a = debug('worker:a'); -b = debug('worker:b'); - -setInterval(function(){ - a('doing some work'); -}, 1000); - -setInterval(function(){ - b('doing some work'); -}, 1200); -``` - - -## Output streams - - By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: - -Example [_stdout.js_](./examples/node/stdout.js): - -```js -var debug = require('debug'); -var error = debug('app:error'); - -// by default stderr is used -error('goes to stderr!'); - -var log = debug('app:log'); -// set this namespace to log via console.log -log.log = console.log.bind(console); // don't forget to bind to console! -log('goes to stdout'); -error('still goes to stderr!'); - -// set all output to go via console.info -// overrides all per-namespace log settings -debug.log = console.info.bind(console); -error('now goes to stdout via console.info'); -log('still goes to stdout, but via console.info now'); -``` - -## Extend -You can simply extend debugger -```js -const log = require('debug')('auth'); - -//creates new debug instance with extended namespace -const logSign = log.extend('sign'); -const logLogin = log.extend('login'); - -log('hello'); // auth hello -logSign('hello'); //auth:sign hello -logLogin('hello'); //auth:login hello -``` - -## Set dynamically - -You can also enable debug dynamically by calling the `enable()` method : - -```js -let debug = require('debug'); - -console.log(1, debug.enabled('test')); - -debug.enable('test'); -console.log(2, debug.enabled('test')); - -debug.disable(); -console.log(3, debug.enabled('test')); - -``` - -print : -``` -1 false -2 true -3 false -``` - -Usage : -`enable(namespaces)` -`namespaces` can include modes separated by a colon and wildcards. - -Note that calling `enable()` completely overrides previously set DEBUG variable : - -``` -$ DEBUG=foo node -e 'var dbg = require("debug"); dbg.enable("bar"); console.log(dbg.enabled("foo"))' -=> false -``` - -## Checking whether a debug target is enabled - -After you've created a debug instance, you can determine whether or not it is -enabled by checking the `enabled` property: - -```javascript -const debug = require('debug')('http'); - -if (debug.enabled) { - // do stuff... -} -``` - -You can also manually toggle this property to force the debug instance to be -enabled or disabled. - - -## Authors - - - TJ Holowaychuk - - Nathan Rajlich - - Andrew Rhyne - -## Backers - -Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -## Sponsors - -Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -## License - -(The MIT License) - -Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca> - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/debug/node.js b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/debug/node.js deleted file mode 100644 index 7fc36fe6..00000000 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/debug/node.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./src/node'); diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/debug/package.json b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/debug/package.json deleted file mode 100644 index 9d0dc9ef..00000000 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/debug/package.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "_from": "debug@^3.2.6", - "_id": "debug@3.2.6", - "_inBundle": false, - "_integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "_location": "/debug", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "debug@^3.2.6", - "name": "debug", - "escapedName": "debug", - "rawSpec": "^3.2.6", - "saveSpec": null, - "fetchSpec": "^3.2.6" - }, - "_requiredBy": [ - "/follow-redirects" - ], - "_resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "_shasum": "e83d17de16d8a7efb7717edbe5fb10135eee629b", - "_spec": "debug@^3.2.6", - "_where": "/Users/mkennedy/github/talk-python/courses/100web/web100-demos/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/follow-redirects", - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "browser": "./src/browser.js", - "bugs": { - "url": "https://github.com/visionmedia/debug/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "http://n8.io" - }, - { - "name": "Andrew Rhyne", - "email": "rhyneandrew@gmail.com" - } - ], - "dependencies": { - "ms": "^2.1.1" - }, - "deprecated": false, - "description": "small debugging utility", - "devDependencies": { - "@babel/cli": "^7.0.0", - "@babel/core": "^7.0.0", - "@babel/preset-env": "^7.0.0", - "browserify": "14.4.0", - "chai": "^3.5.0", - "concurrently": "^3.1.0", - "coveralls": "^3.0.2", - "istanbul": "^0.4.5", - "karma": "^3.0.0", - "karma-chai": "^0.1.0", - "karma-mocha": "^1.3.0", - "karma-phantomjs-launcher": "^1.0.2", - "mocha": "^5.2.0", - "mocha-lcov-reporter": "^1.2.0", - "rimraf": "^2.5.4", - "xo": "^0.23.0" - }, - "files": [ - "src", - "node.js", - "dist/debug.js", - "LICENSE", - "README.md" - ], - "homepage": "https://github.com/visionmedia/debug#readme", - "keywords": [ - "debug", - "log", - "debugger" - ], - "license": "MIT", - "main": "./src/index.js", - "name": "debug", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/debug.git" - }, - "unpkg": "./dist/debug.js", - "version": "3.2.6" -} diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/debug/src/browser.js b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/debug/src/browser.js deleted file mode 100644 index c924b0ac..00000000 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/debug/src/browser.js +++ /dev/null @@ -1,180 +0,0 @@ -"use strict"; - -function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -/* eslint-env browser */ - -/** - * This is the web browser implementation of `debug()`. - */ -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.storage = localstorage(); -/** - * Colors. - */ - -exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33']; -/** - * Currently only WebKit-based Web Inspectors, Firefox >= v31, - * and the Firebug extension (any Firefox version) are known - * to support "%c" CSS customizations. - * - * TODO: add a `localStorage` variable to explicitly enable/disable colors - */ -// eslint-disable-next-line complexity - -function useColors() { - // NB: In an Electron preload script, document will be defined but not fully - // initialized. Since we know we're in Chrome, we'll just detect this case - // explicitly - if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { - return true; - } // Internet Explorer and Edge do not support colors. - - - if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; - } // Is webkit? http://stackoverflow.com/a/16459606/376773 - // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 - - - return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 - typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker - typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); -} -/** - * Colorize log arguments if enabled. - * - * @api public - */ - - -function formatArgs(args) { - args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); - - if (!this.useColors) { - return; - } - - var c = 'color: ' + this.color; - args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other - // arguments passed either before or after the %c, so we need to - // figure out the correct index to insert the CSS into - - var index = 0; - var lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, function (match) { - if (match === '%%') { - return; - } - - index++; - - if (match === '%c') { - // We only are interested in the *last* %c - // (the user may have provided their own) - lastC = index; - } - }); - args.splice(lastC, 0, c); -} -/** - * Invokes `console.log()` when available. - * No-op when `console.log` is not a "function". - * - * @api public - */ - - -function log() { - var _console; - - // This hackery is required for IE8/9, where - // the `console.log` function doesn't have 'apply' - return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments); -} -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ - - -function save(namespaces) { - try { - if (namespaces) { - exports.storage.setItem('debug', namespaces); - } else { - exports.storage.removeItem('debug'); - } - } catch (error) {// Swallow - // XXX (@Qix-) should we be logging these? - } -} -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - - -function load() { - var r; - - try { - r = exports.storage.getItem('debug'); - } catch (error) {} // Swallow - // XXX (@Qix-) should we be logging these? - // If debug isn't set in LS, and we're in Electron, try to load $DEBUG - - - if (!r && typeof process !== 'undefined' && 'env' in process) { - r = process.env.DEBUG; - } - - return r; -} -/** - * Localstorage attempts to return the localstorage. - * - * This is necessary because safari throws - * when a user disables cookies/localstorage - * and you attempt to access it. - * - * @return {LocalStorage} - * @api private - */ - - -function localstorage() { - try { - // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context - // The Browser also has localStorage in the global context. - return localStorage; - } catch (error) {// Swallow - // XXX (@Qix-) should we be logging these? - } -} - -module.exports = require('./common')(exports); -var formatters = module.exports.formatters; -/** - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. - */ - -formatters.j = function (v) { - try { - return JSON.stringify(v); - } catch (error) { - return '[UnexpectedJSONParseError]: ' + error.message; - } -}; - diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/debug/src/common.js b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/debug/src/common.js deleted file mode 100644 index e0de3fb5..00000000 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/debug/src/common.js +++ /dev/null @@ -1,249 +0,0 @@ -"use strict"; - -/** - * This is the common logic for both the Node.js and web browser - * implementations of `debug()`. - */ -function setup(env) { - createDebug.debug = createDebug; - createDebug.default = createDebug; - createDebug.coerce = coerce; - createDebug.disable = disable; - createDebug.enable = enable; - createDebug.enabled = enabled; - createDebug.humanize = require('ms'); - Object.keys(env).forEach(function (key) { - createDebug[key] = env[key]; - }); - /** - * Active `debug` instances. - */ - - createDebug.instances = []; - /** - * The currently active debug mode names, and names to skip. - */ - - createDebug.names = []; - createDebug.skips = []; - /** - * Map of special "%n" handling functions, for the debug "format" argument. - * - * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". - */ - - createDebug.formatters = {}; - /** - * Selects a color for a debug namespace - * @param {String} namespace The namespace string for the for the debug instance to be colored - * @return {Number|String} An ANSI color code for the given namespace - * @api private - */ - - function selectColor(namespace) { - var hash = 0; - - for (var i = 0; i < namespace.length; i++) { - hash = (hash << 5) - hash + namespace.charCodeAt(i); - hash |= 0; // Convert to 32bit integer - } - - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; - } - - createDebug.selectColor = selectColor; - /** - * Create a debugger with the given `namespace`. - * - * @param {String} namespace - * @return {Function} - * @api public - */ - - function createDebug(namespace) { - var prevTime; - - function debug() { - // Disabled? - if (!debug.enabled) { - return; - } - - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - var self = debug; // Set `diff` timestamp - - var curr = Number(new Date()); - var ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; - args[0] = createDebug.coerce(args[0]); - - if (typeof args[0] !== 'string') { - // Anything else let's inspect with %O - args.unshift('%O'); - } // Apply any `formatters` transformations - - - var index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) { - // If we encounter an escaped % then don't increase the array index - if (match === '%%') { - return match; - } - - index++; - var formatter = createDebug.formatters[format]; - - if (typeof formatter === 'function') { - var val = args[index]; - match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` - - args.splice(index, 1); - index--; - } - - return match; - }); // Apply env-specific formatting (colors, etc.) - - createDebug.formatArgs.call(self, args); - var logFn = self.log || createDebug.log; - logFn.apply(self, args); - } - - debug.namespace = namespace; - debug.enabled = createDebug.enabled(namespace); - debug.useColors = createDebug.useColors(); - debug.color = selectColor(namespace); - debug.destroy = destroy; - debug.extend = extend; // Debug.formatArgs = formatArgs; - // debug.rawLog = rawLog; - // env-specific initialization logic for debug instances - - if (typeof createDebug.init === 'function') { - createDebug.init(debug); - } - - createDebug.instances.push(debug); - return debug; - } - - function destroy() { - var index = createDebug.instances.indexOf(this); - - if (index !== -1) { - createDebug.instances.splice(index, 1); - return true; - } - - return false; - } - - function extend(namespace, delimiter) { - return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); - } - /** - * Enables a debug mode by namespaces. This can include modes - * separated by a colon and wildcards. - * - * @param {String} namespaces - * @api public - */ - - - function enable(namespaces) { - createDebug.save(namespaces); - createDebug.names = []; - createDebug.skips = []; - var i; - var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); - var len = split.length; - - for (i = 0; i < len; i++) { - if (!split[i]) { - // ignore empty strings - continue; - } - - namespaces = split[i].replace(/\*/g, '.*?'); - - if (namespaces[0] === '-') { - createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); - } else { - createDebug.names.push(new RegExp('^' + namespaces + '$')); - } - } - - for (i = 0; i < createDebug.instances.length; i++) { - var instance = createDebug.instances[i]; - instance.enabled = createDebug.enabled(instance.namespace); - } - } - /** - * Disable debug output. - * - * @api public - */ - - - function disable() { - createDebug.enable(''); - } - /** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - - - function enabled(name) { - if (name[name.length - 1] === '*') { - return true; - } - - var i; - var len; - - for (i = 0, len = createDebug.skips.length; i < len; i++) { - if (createDebug.skips[i].test(name)) { - return false; - } - } - - for (i = 0, len = createDebug.names.length; i < len; i++) { - if (createDebug.names[i].test(name)) { - return true; - } - } - - return false; - } - /** - * Coerce `val`. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - - - function coerce(val) { - if (val instanceof Error) { - return val.stack || val.message; - } - - return val; - } - - createDebug.enable(createDebug.load()); - return createDebug; -} - -module.exports = setup; - diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/debug/src/index.js b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/debug/src/index.js deleted file mode 100644 index 02173159..00000000 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/debug/src/index.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; - -/** - * Detect Electron renderer / nwjs process, which is node, but we should - * treat as a browser. - */ -if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { - module.exports = require('./browser.js'); -} else { - module.exports = require('./node.js'); -} - diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/debug/src/node.js b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/debug/src/node.js deleted file mode 100644 index dbbb5f10..00000000 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/debug/src/node.js +++ /dev/null @@ -1,174 +0,0 @@ -"use strict"; - -/** - * Module dependencies. - */ -var tty = require('tty'); - -var util = require('util'); -/** - * This is the Node.js implementation of `debug()`. - */ - - -exports.init = init; -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -/** - * Colors. - */ - -exports.colors = [6, 2, 3, 4, 5, 1]; - -try { - // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) - // eslint-disable-next-line import/no-extraneous-dependencies - var supportsColor = require('supports-color'); - - if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { - exports.colors = [20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221]; - } -} catch (error) {} // Swallow - we only care if `supports-color` is available; it doesn't have to be. - -/** - * Build up the default `inspectOpts` object from the environment variables. - * - * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js - */ - - -exports.inspectOpts = Object.keys(process.env).filter(function (key) { - return /^debug_/i.test(key); -}).reduce(function (obj, key) { - // Camel-case - var prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, function (_, k) { - return k.toUpperCase(); - }); // Coerce string value into JS value - - var val = process.env[key]; - - if (/^(yes|on|true|enabled)$/i.test(val)) { - val = true; - } else if (/^(no|off|false|disabled)$/i.test(val)) { - val = false; - } else if (val === 'null') { - val = null; - } else { - val = Number(val); - } - - obj[prop] = val; - return obj; -}, {}); -/** - * Is stdout a TTY? Colored output is enabled when `true`. - */ - -function useColors() { - return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd); -} -/** - * Adds ANSI color escape codes if enabled. - * - * @api public - */ - - -function formatArgs(args) { - var name = this.namespace, - useColors = this.useColors; - - if (useColors) { - var c = this.color; - var colorCode = "\x1B[3" + (c < 8 ? c : '8;5;' + c); - var prefix = " ".concat(colorCode, ";1m").concat(name, " \x1B[0m"); - args[0] = prefix + args[0].split('\n').join('\n' + prefix); - args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + "\x1B[0m"); - } else { - args[0] = getDate() + name + ' ' + args[0]; - } -} - -function getDate() { - if (exports.inspectOpts.hideDate) { - return ''; - } - - return new Date().toISOString() + ' '; -} -/** - * Invokes `util.format()` with the specified arguments and writes to stderr. - */ - - -function log() { - return process.stderr.write(util.format.apply(util, arguments) + '\n'); -} -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ - - -function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - // If you set a process.env field to null or undefined, it gets cast to the - // string 'null' or 'undefined'. Just delete instead. - delete process.env.DEBUG; - } -} -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - - -function load() { - return process.env.DEBUG; -} -/** - * Init logic for `debug` instances. - * - * Create a new `inspectOpts` object in case `useColors` is set - * differently for a particular `debug` instance. - */ - - -function init(debug) { - debug.inspectOpts = {}; - var keys = Object.keys(exports.inspectOpts); - - for (var i = 0; i < keys.length; i++) { - debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; - } -} - -module.exports = require('./common')(exports); -var formatters = module.exports.formatters; -/** - * Map %o to `util.inspect()`, all on a single line. - */ - -formatters.o = function (v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts).replace(/\s*\n\s*/g, ' '); -}; -/** - * Map %O to `util.inspect()`, allowing multiple lines if needed. - */ - - -formatters.O = function (v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); -}; - diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/follow-redirects/README.md b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/follow-redirects/README.md index 91e1220e..ea618ab7 100644 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/follow-redirects/README.md +++ b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/follow-redirects/README.md @@ -1,26 +1,25 @@ ## Follow Redirects -Drop-in replacement for Nodes `http` and `https` that automatically follows redirects. +Drop-in replacement for Node's `http` and `https` modules that automatically follows redirects. [![npm version](https://img.shields.io/npm/v/follow-redirects.svg)](https://www.npmjs.com/package/follow-redirects) -[![Build Status](https://travis-ci.org/follow-redirects/follow-redirects.svg?branch=master)](https://travis-ci.org/follow-redirects/follow-redirects) +[![Build Status](https://github.com/follow-redirects/follow-redirects/workflows/CI/badge.svg)](https://github.com/follow-redirects/follow-redirects/actions) [![Coverage Status](https://coveralls.io/repos/follow-redirects/follow-redirects/badge.svg?branch=master)](https://coveralls.io/r/follow-redirects/follow-redirects?branch=master) -[![Dependency Status](https://david-dm.org/follow-redirects/follow-redirects.svg)](https://david-dm.org/follow-redirects/follow-redirects) [![npm downloads](https://img.shields.io/npm/dm/follow-redirects.svg)](https://www.npmjs.com/package/follow-redirects) +[![Sponsor on GitHub](https://img.shields.io/static/v1?label=Sponsor&message=%F0%9F%92%96&logo=GitHub)](https://github.com/sponsors/RubenVerborgh) `follow-redirects` provides [request](https://nodejs.org/api/http.html#http_http_request_options_callback) and [get](https://nodejs.org/api/http.html#http_http_get_options_callback) methods that behave identically to those found on the native [http](https://nodejs.org/api/http.html#http_http_request_options_callback) and [https](https://nodejs.org/api/https.html#https_https_request_options_callback) modules, with the exception that they will seamlessly follow redirects. ```javascript -var http = require('follow-redirects').http; -var https = require('follow-redirects').https; +const { http, https } = require('follow-redirects'); -http.get('http://bit.ly/900913', function (response) { - response.on('data', function (chunk) { +http.get('http://bit.ly/900913', response => { + response.on('data', chunk => { console.log(chunk); }); -}).on('error', function (err) { +}).on('error', err => { console.error(err); }); ``` @@ -29,13 +28,14 @@ You can inspect the final redirected URL through the `responseUrl` property on t If no redirection happened, `responseUrl` is the original request URL. ```javascript -https.request({ +const request = https.request({ host: 'bitly.com', path: '/UHfDGO', -}, function (response) { +}, response => { console.log(response.responseUrl); // 'http://duckduckgo.com/robots.txt' }); +request.end(); ``` ## Options @@ -43,7 +43,7 @@ https.request({ Global options are set directly on the `follow-redirects` module: ```javascript -var followRedirects = require('follow-redirects'); +const followRedirects = require('follow-redirects'); followRedirects.maxRedirects = 10; followRedirects.maxBodyLength = 20 * 1024 * 1024; // 20 MB ``` @@ -54,16 +54,23 @@ The following global options are supported: - `maxBodyLength` (default: 10MB) – sets the maximum size of the request body; if exceeded, an error will be emitted. - ### Per-request options Per-request options are set by passing an `options` object: ```javascript -var url = require('url'); -var followRedirects = require('follow-redirects'); +const url = require('url'); +const { http, https } = require('follow-redirects'); -var options = url.parse('http://bit.ly/900913'); +const options = url.parse('http://bit.ly/900913'); options.maxRedirects = 10; +options.beforeRedirect = (options, { headers }) => { + // Use this to adjust the request options upon redirecting, + // to inspect the latest response headers, + // or to cancel the request by throwing an error + if (options.hostname === "example.com") { + options.auth = "user:password"; + } +}; http.request(options); ``` @@ -75,6 +82,8 @@ the following per-request options are supported: - `maxBodyLength` (default: 10MB) – sets the maximum size of the request body; if exceeded, an error will be emitted. +- `beforeRedirect` (default: `undefined`) – optionally change the request `options` on redirects, or abort the request by throwing an error. + - `agents` (default: `undefined`) – sets the `agent` option per protocol, since HTTP and HTTPS use different agents. Example value: `{ http: new http.Agent(), https: new https.Agent() }` - `trackRedirects` (default: `false`) – whether to store the redirected response details into the `redirects` array on the response object. @@ -88,7 +97,7 @@ To enable features such as caching and/or intermediate request tracking, you might instead want to wrap `follow-redirects` around custom protocol implementations: ```javascript -var followRedirects = require('follow-redirects').wrap({ +const { http, https } = require('follow-redirects').wrap({ http: require('your-custom-http'), https: require('your-custom-https'), }); @@ -103,8 +112,8 @@ the `http` and `https` browser equivalents perform redirects by default. By requiring `follow-redirects` this way: ```javascript -var http = require('follow-redirects/http'); -var https = require('follow-redirects/https'); +const http = require('follow-redirects/http'); +const https = require('follow-redirects/https'); ``` you can easily tell webpack and friends to replace `follow-redirect` by the built-in versions: @@ -130,9 +139,9 @@ Pull Requests are always welcome. Please [file an issue](https://github.com/foll ## Authors -- Olivier Lalonde (olalonde@gmail.com) -- James Talmage (james@talmage.io) - [Ruben Verborgh](https://ruben.verborgh.org/) +- [Olivier Lalonde](mailto:olalonde@gmail.com) +- [James Talmage](mailto:james@talmage.io) ## License diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/follow-redirects/index.js b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/follow-redirects/index.js index da33ef06..02f37eac 100644 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/follow-redirects/index.js +++ b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/follow-redirects/index.js @@ -2,27 +2,42 @@ var url = require("url"); var URL = url.URL; var http = require("http"); var https = require("https"); -var assert = require("assert"); var Writable = require("stream").Writable; -var debug = require("debug")("follow-redirects"); - -// RFC7231§4.2.1: Of the request methods defined by this specification, -// the GET, HEAD, OPTIONS, and TRACE methods are defined to be safe. -var SAFE_METHODS = { GET: true, HEAD: true, OPTIONS: true, TRACE: true }; +var assert = require("assert"); +var debug = require("./debug"); // Create handlers that pass events from native requests +var events = ["abort", "aborted", "connect", "error", "socket", "timeout"]; var eventHandlers = Object.create(null); -["abort", "aborted", "error", "socket", "timeout"].forEach(function (event) { - eventHandlers[event] = function (arg) { - this._redirectable.emit(event, arg); +events.forEach(function (event) { + eventHandlers[event] = function (arg1, arg2, arg3) { + this._redirectable.emit(event, arg1, arg2, arg3); }; }); +// Error types with codes +var RedirectionError = createErrorType( + "ERR_FR_REDIRECTION_FAILURE", + "Redirected request failed" +); +var TooManyRedirectsError = createErrorType( + "ERR_FR_TOO_MANY_REDIRECTS", + "Maximum number of redirects exceeded" +); +var MaxBodyLengthExceededError = createErrorType( + "ERR_FR_MAX_BODY_LENGTH_EXCEEDED", + "Request body larger than maxBodyLength limit" +); +var WriteAfterEndError = createErrorType( + "ERR_STREAM_WRITE_AFTER_END", + "write after end" +); + // An HTTP(S) request that can be redirected function RedirectableRequest(options, responseCallback) { // Initialize the request Writable.call(this); - options.headers = options.headers || {}; + this._sanitizeOptions(options); this._options = options; this._ended = false; this._ending = false; @@ -31,17 +46,6 @@ function RedirectableRequest(options, responseCallback) { this._requestBodyLength = 0; this._requestBodyBuffers = []; - // Since http.request treats host as an alias of hostname, - // but the url module interprets host as hostname plus port, - // eliminate the host property to avoid confusion. - if (options.host) { - // Use hostname if set, because it has precedence - if (!options.hostname) { - options.hostname = options.host; - } - delete options.host; - } - // Attach a callback if passed if (responseCallback) { this.on("response", responseCallback); @@ -53,33 +57,26 @@ function RedirectableRequest(options, responseCallback) { self._processResponse(response); }; - // Complete the URL object when necessary - if (!options.pathname && options.path) { - var searchPos = options.path.indexOf("?"); - if (searchPos < 0) { - options.pathname = options.path; - } - else { - options.pathname = options.path.substring(0, searchPos); - options.search = options.path.substring(searchPos); - } - } - // Perform the first request this._performRequest(); } RedirectableRequest.prototype = Object.create(Writable.prototype); +RedirectableRequest.prototype.abort = function () { + abortRequest(this._currentRequest); + this.emit("abort"); +}; + // Writes buffered data to the current native request RedirectableRequest.prototype.write = function (data, encoding, callback) { // Writing is not allowed if end has been called if (this._ending) { - throw new Error("write after end"); + throw new WriteAfterEndError(); } // Validate input and shift parameters if necessary if (!(typeof data === "string" || typeof data === "object" && ("length" in data))) { - throw new Error("data should be a string, Buffer or Uint8Array"); + throw new TypeError("data should be a string, Buffer or Uint8Array"); } if (typeof encoding === "function") { callback = encoding; @@ -102,7 +99,7 @@ RedirectableRequest.prototype.write = function (data, encoding, callback) { } // Error when we exceed the maximum body length else { - this.emit("error", new Error("Request body larger than maxBodyLength limit")); + this.emit("error", new MaxBodyLengthExceededError()); this.abort(); } }; @@ -149,40 +146,72 @@ RedirectableRequest.prototype.removeHeader = function (name) { // Global timeout for all underlying requests RedirectableRequest.prototype.setTimeout = function (msecs, callback) { + var self = this; + + // Destroys the socket on timeout + function destroyOnTimeout(socket) { + socket.setTimeout(msecs); + socket.removeListener("timeout", socket.destroy); + socket.addListener("timeout", socket.destroy); + } + + // Sets up a timer to trigger a timeout event + function startTimer(socket) { + if (self._timeout) { + clearTimeout(self._timeout); + } + self._timeout = setTimeout(function () { + self.emit("timeout"); + clearTimer(); + }, msecs); + destroyOnTimeout(socket); + } + + // Stops a timeout from triggering + function clearTimer() { + // Clear the timeout + if (self._timeout) { + clearTimeout(self._timeout); + self._timeout = null; + } + + // Clean up all attached listeners + self.removeListener("abort", clearTimer); + self.removeListener("error", clearTimer); + self.removeListener("response", clearTimer); + if (callback) { + self.removeListener("timeout", callback); + } + if (!self.socket) { + self._currentRequest.removeListener("socket", startTimer); + } + } + + // Attach callback if passed if (callback) { - this.once("timeout", callback); + this.on("timeout", callback); } + // Start the timer if or when the socket is opened if (this.socket) { - startTimer(this, msecs); + startTimer(this.socket); } else { - var self = this; - this._currentRequest.once("socket", function () { - startTimer(self, msecs); - }); + this._currentRequest.once("socket", startTimer); } - this.once("response", clearTimer); - this.once("error", clearTimer); + // Clean up on events + this.on("socket", destroyOnTimeout); + this.on("abort", clearTimer); + this.on("error", clearTimer); + this.on("response", clearTimer); return this; }; -function startTimer(request, msecs) { - clearTimeout(request._timeout); - request._timeout = setTimeout(function () { - request.emit("timeout"); - }, msecs); -} - -function clearTimer() { - clearTimeout(this._timeout); -} - // Proxy all other public ClientRequest methods [ - "abort", "flushHeaders", "getHeader", + "flushHeaders", "getHeader", "setNoDelay", "setSocketKeepAlive", ].forEach(function (method) { RedirectableRequest.prototype[method] = function (a, b) { @@ -197,13 +226,44 @@ function clearTimer() { }); }); +RedirectableRequest.prototype._sanitizeOptions = function (options) { + // Ensure headers are always present + if (!options.headers) { + options.headers = {}; + } + + // Since http.request treats host as an alias of hostname, + // but the url module interprets host as hostname plus port, + // eliminate the host property to avoid confusion. + if (options.host) { + // Use hostname if set, because it has precedence + if (!options.hostname) { + options.hostname = options.host; + } + delete options.host; + } + + // Complete the URL object when necessary + if (!options.pathname && options.path) { + var searchPos = options.path.indexOf("?"); + if (searchPos < 0) { + options.pathname = options.path; + } + else { + options.pathname = options.path.substring(0, searchPos); + options.search = options.path.substring(searchPos); + } + } +}; + + // Executes the next native request (initial or redirect) RedirectableRequest.prototype._performRequest = function () { // Load the native protocol var protocol = this._options.protocol; var nativeProtocol = this._options.nativeProtocols[protocol]; if (!nativeProtocol) { - this.emit("error", new Error("Unsupported protocol " + protocol)); + this.emit("error", new TypeError("Unsupported protocol " + protocol)); return; } @@ -221,11 +281,8 @@ RedirectableRequest.prototype._performRequest = function () { // Set up event handlers request._redirectable = this; - for (var event in eventHandlers) { - /* istanbul ignore else */ - if (event) { - request.on(event, eventHandlers[event]); - } + for (var e = 0; e < events.length; e++) { + request.on(events[e], eventHandlers[events[e]]); } // End a redirected request @@ -264,11 +321,12 @@ RedirectableRequest.prototype._performRequest = function () { // Processes a response from the current native request RedirectableRequest.prototype._processResponse = function (response) { // Store the redirected response + var statusCode = response.statusCode; if (this._options.trackRedirects) { this._redirects.push({ url: this._currentUrl, headers: response.headers, - statusCode: response.statusCode, + statusCode: statusCode, }); } @@ -280,57 +338,86 @@ RedirectableRequest.prototype._processResponse = function (response) { // even if the specific status code is not understood. var location = response.headers.location; if (location && this._options.followRedirects !== false && - response.statusCode >= 300 && response.statusCode < 400) { + statusCode >= 300 && statusCode < 400) { // Abort the current request - this._currentRequest.removeAllListeners(); - this._currentRequest.on("error", noop); - this._currentRequest.abort(); + abortRequest(this._currentRequest); + // Discard the remainder of the response to avoid waiting for data + response.destroy(); // RFC7231§6.4: A client SHOULD detect and intervene // in cyclical redirections (i.e., "infinite" redirection loops). if (++this._redirectCount > this._options.maxRedirects) { - this.emit("error", new Error("Max redirects exceeded.")); + this.emit("error", new TooManyRedirectsError()); return; } // RFC7231§6.4: Automatic redirection needs to done with - // care for methods not known to be safe […], - // since the user might not wish to redirect an unsafe request. - // RFC7231§6.4.7: The 307 (Temporary Redirect) status code indicates - // that the target resource resides temporarily under a different URI - // and the user agent MUST NOT change the request method - // if it performs an automatic redirection to that URI. - var header; - var headers = this._options.headers; - if (response.statusCode !== 307 && !(this._options.method in SAFE_METHODS)) { + // care for methods not known to be safe, […] + // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change + // the request method from POST to GET for the subsequent request. + if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || + // RFC7231§6.4.4: The 303 (See Other) status code indicates that + // the server is redirecting the user agent to a different resource […] + // A user agent can perform a retrieval request targeting that URI + // (a GET or HEAD request if using HTTP) […] + (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) { this._options.method = "GET"; // Drop a possible entity and headers related to it this._requestBodyBuffers = []; - for (header in headers) { - if (/^content-/i.test(header)) { - delete headers[header]; - } - } + removeMatchingHeaders(/^content-/i, this._options.headers); } // Drop the Host header, as the redirect might lead to a different host - if (!this._isRedirect) { - for (header in headers) { - if (/^host$/i.test(header)) { - delete headers[header]; - } - } + var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers); + + // If the redirect is relative, carry over the host of the last request + var currentUrlParts = url.parse(this._currentUrl); + var currentHost = currentHostHeader || currentUrlParts.host; + var currentUrl = /^\w+:/.test(location) ? this._currentUrl : + url.format(Object.assign(currentUrlParts, { host: currentHost })); + + // Determine the URL of the redirection + var redirectUrl; + try { + redirectUrl = url.resolve(currentUrl, location); + } + catch (cause) { + this.emit("error", new RedirectionError(cause)); + return; } - // Perform the redirected request - var redirectUrl = url.resolve(this._currentUrl, location); + // Create the redirected request debug("redirecting to", redirectUrl); - Object.assign(this._options, url.parse(redirectUrl)); this._isRedirect = true; - this._performRequest(); + var redirectUrlParts = url.parse(redirectUrl); + Object.assign(this._options, redirectUrlParts); - // Discard the remainder of the response to avoid waiting for data - response.destroy(); + // Drop confidential headers when redirecting to another scheme:domain + if (redirectUrlParts.protocol !== currentUrlParts.protocol || + !isSameOrSubdomain(redirectUrlParts.host, currentHost)) { + removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers); + } + + // Evaluate the beforeRedirect callback + if (typeof this._options.beforeRedirect === "function") { + var responseDetails = { headers: response.headers }; + try { + this._options.beforeRedirect.call(null, this._options, responseDetails); + } + catch (err) { + this.emit("error", err); + return; + } + this._sanitizeOptions(this._options); + } + + // Perform the redirected request + try { + this._performRequest(); + } + catch (cause) { + this.emit("error", new RedirectionError(cause)); + } } else { // The response is not a redirect; return it as-is @@ -359,7 +446,7 @@ function wrap(protocols) { var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol); // Executes a request, following redirects - wrappedProtocol.request = function (input, options, callback) { + function request(input, options, callback) { // Parse parameters if (typeof input === "string") { var urlStr = input; @@ -394,14 +481,20 @@ function wrap(protocols) { assert.equal(options.protocol, protocol, "protocol mismatch"); debug("options", options); return new RedirectableRequest(options, callback); - }; + } // Executes a GET request, following redirects - wrappedProtocol.get = function (input, options, callback) { - var request = wrappedProtocol.request(input, options, callback); - request.end(); - return request; - }; + function get(input, options, callback) { + var wrappedRequest = wrappedProtocol.request(input, options, callback); + wrappedRequest.end(); + return wrappedRequest; + } + + // Expose the properties on the wrapped protocol + Object.defineProperties(wrappedProtocol, { + request: { value: request, configurable: true, enumerable: true, writable: true }, + get: { value: get, configurable: true, enumerable: true, writable: true }, + }); }); return exports; } @@ -429,6 +522,52 @@ function urlToOptions(urlObject) { return options; } +function removeMatchingHeaders(regex, headers) { + var lastValue; + for (var header in headers) { + if (regex.test(header)) { + lastValue = headers[header]; + delete headers[header]; + } + } + return (lastValue === null || typeof lastValue === "undefined") ? + undefined : String(lastValue).trim(); +} + +function createErrorType(code, defaultMessage) { + function CustomError(cause) { + Error.captureStackTrace(this, this.constructor); + if (!cause) { + this.message = defaultMessage; + } + else { + this.message = defaultMessage + ": " + cause.message; + this.cause = cause; + } + } + CustomError.prototype = new Error(); + CustomError.prototype.constructor = CustomError; + CustomError.prototype.name = "Error [" + code + "]"; + CustomError.prototype.code = code; + return CustomError; +} + +function abortRequest(request) { + for (var e = 0; e < events.length; e++) { + request.removeListener(events[e], eventHandlers[events[e]]); + } + request.on("error", noop); + request.abort(); +} + +function isSameOrSubdomain(subdomain, domain) { + if (subdomain === domain) { + return true; + } + const dot = subdomain.length - domain.length - 1; + return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); +} + // Exports module.exports = wrap({ http: http, https: https }); module.exports.wrap = wrap; diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/follow-redirects/package.json b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/follow-redirects/package.json index ae21e627..6dc258b7 100644 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/follow-redirects/package.json +++ b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/follow-redirects/package.json @@ -1,68 +1,28 @@ { - "_from": "follow-redirects@^1.3.0", - "_id": "follow-redirects@1.7.0", - "_inBundle": false, - "_integrity": "sha512-m/pZQy4Gj287eNy94nivy5wchN3Kp+Q5WgUPNy5lJSZ3sgkVKSYV/ZChMAQVIgx1SqfZ2zBZtPA2YlXIWxxJOQ==", - "_location": "/follow-redirects", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "follow-redirects@^1.3.0", - "name": "follow-redirects", - "escapedName": "follow-redirects", - "rawSpec": "^1.3.0", - "saveSpec": null, - "fetchSpec": "^1.3.0" - }, - "_requiredBy": [ - "/axios" - ], - "_resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.7.0.tgz", - "_shasum": "489ebc198dc0e7f64167bd23b03c4c19b5784c76", - "_spec": "follow-redirects@^1.3.0", - "_where": "/Users/mkennedy/github/talk-python/courses/100web/web100-demos/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/axios", - "author": { - "name": "Ruben Verborgh", - "email": "ruben@verborgh.org", - "url": "https://ruben.verborgh.org/" - }, - "bugs": { - "url": "https://github.com/follow-redirects/follow-redirects/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Olivier Lalonde", - "email": "olalonde@gmail.com", - "url": "http://www.syskall.com" - }, - { - "name": "James Talmage", - "email": "james@talmage.io" - } - ], - "dependencies": { - "debug": "^3.2.6" - }, - "deprecated": false, + "name": "follow-redirects", + "version": "1.14.8", "description": "HTTP and HTTPS modules that follow redirects.", - "devDependencies": { - "concat-stream": "^1.6.0", - "coveralls": "^3.0.2", - "eslint": "^4.19.1", - "express": "^4.16.2", - "lolex": "^3.0.0", - "mocha": "^5.0.0", - "nyc": "^11.8.0" - }, - "engines": { - "node": ">=4.0" - }, + "license": "MIT", + "main": "index.js", "files": [ "*.js" ], + "engines": { + "node": ">=4.0" + }, + "scripts": { + "test": "npm run lint && npm run mocha", + "lint": "eslint *.js test", + "mocha": "nyc mocha" + }, + "repository": { + "type": "git", + "url": "git@github.com:follow-redirects/follow-redirects.git" + }, "homepage": "https://github.com/follow-redirects/follow-redirects", + "bugs": { + "url": "https://github.com/follow-redirects/follow-redirects/issues" + }, "keywords": [ "http", "https", @@ -72,23 +32,28 @@ "location", "utility" ], - "license": "MIT", - "main": "index.js", - "name": "follow-redirects", - "nyc": { - "reporter": [ - "lcov", - "text" - ] - }, - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/follow-redirects/follow-redirects.git" - }, - "scripts": { - "lint": "eslint *.js test", - "mocha": "nyc mocha", - "test": "npm run lint && npm run mocha" + "author": "Ruben Verborgh (https://ruben.verborgh.org/)", + "contributors": [ + "Olivier Lalonde (http://www.syskall.com)", + "James Talmage " + ], + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "peerDependenciesMeta": { + "debug": { + "optional": true + } }, - "version": "1.7.0" + "devDependencies": { + "concat-stream": "^2.0.0", + "eslint": "^5.16.0", + "express": "^4.16.4", + "lolex": "^3.1.0", + "mocha": "^6.0.2", + "nyc": "^14.1.1" + } } diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/is-buffer/LICENSE b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/is-buffer/LICENSE deleted file mode 100644 index 0c068cee..00000000 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/is-buffer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Feross Aboukhadijeh - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/is-buffer/README.md b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/is-buffer/README.md deleted file mode 100644 index cce0a8cf..00000000 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/is-buffer/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# is-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] - -[travis-image]: https://img.shields.io/travis/feross/is-buffer/master.svg -[travis-url]: https://travis-ci.org/feross/is-buffer -[npm-image]: https://img.shields.io/npm/v/is-buffer.svg -[npm-url]: https://npmjs.org/package/is-buffer -[downloads-image]: https://img.shields.io/npm/dm/is-buffer.svg -[downloads-url]: https://npmjs.org/package/is-buffer -[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg -[standard-url]: https://standardjs.com - -#### Determine if an object is a [`Buffer`](http://nodejs.org/api/buffer.html) (including the [browserify Buffer](https://github.com/feross/buffer)) - -[![saucelabs][saucelabs-image]][saucelabs-url] - -[saucelabs-image]: https://saucelabs.com/browser-matrix/is-buffer.svg -[saucelabs-url]: https://saucelabs.com/u/is-buffer - -## Why not use `Buffer.isBuffer`? - -This module lets you check if an object is a `Buffer` without using `Buffer.isBuffer` (which includes the whole [buffer](https://github.com/feross/buffer) module in [browserify](http://browserify.org/)). - -It's future-proof and works in node too! - -## install - -```bash -npm install is-buffer -``` - -## usage - -```js -var isBuffer = require('is-buffer') - -isBuffer(new Buffer(4)) // true - -isBuffer(undefined) // false -isBuffer(null) // false -isBuffer('') // false -isBuffer(true) // false -isBuffer(false) // false -isBuffer(0) // false -isBuffer(1) // false -isBuffer(1.0) // false -isBuffer('string') // false -isBuffer({}) // false -isBuffer(function foo () {}) // false -``` - -## license - -MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org). diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/is-buffer/index.js b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/is-buffer/index.js deleted file mode 100644 index 9cce3965..00000000 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/is-buffer/index.js +++ /dev/null @@ -1,21 +0,0 @@ -/*! - * Determine if an object is a Buffer - * - * @author Feross Aboukhadijeh - * @license MIT - */ - -// The _isBuffer check is for Safari 5-7 support, because it's missing -// Object.prototype.constructor. Remove this eventually -module.exports = function (obj) { - return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer) -} - -function isBuffer (obj) { - return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) -} - -// For Node v0.10 support. Remove this eventually. -function isSlowBuffer (obj) { - return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) -} diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/is-buffer/package.json b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/is-buffer/package.json deleted file mode 100644 index c127c4bd..00000000 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/is-buffer/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "_from": "is-buffer@^1.1.5", - "_id": "is-buffer@1.1.6", - "_inBundle": false, - "_integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "_location": "/is-buffer", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-buffer@^1.1.5", - "name": "is-buffer", - "escapedName": "is-buffer", - "rawSpec": "^1.1.5", - "saveSpec": null, - "fetchSpec": "^1.1.5" - }, - "_requiredBy": [ - "/axios" - ], - "_resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "_shasum": "efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be", - "_spec": "is-buffer@^1.1.5", - "_where": "/Users/mkennedy/github/talk-python/courses/100web/web100-demos/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/axios", - "author": { - "name": "Feross Aboukhadijeh", - "email": "feross@feross.org", - "url": "http://feross.org/" - }, - "bugs": { - "url": "https://github.com/feross/is-buffer/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Determine if an object is a Buffer", - "devDependencies": { - "standard": "*", - "tape": "^4.0.0", - "zuul": "^3.0.0" - }, - "homepage": "https://github.com/feross/is-buffer#readme", - "keywords": [ - "buffer", - "buffers", - "type", - "core buffer", - "browser buffer", - "browserify", - "typed array", - "uint32array", - "int16array", - "int32array", - "float32array", - "float64array", - "browser", - "arraybuffer", - "dataview" - ], - "license": "MIT", - "main": "index.js", - "name": "is-buffer", - "repository": { - "type": "git", - "url": "git://github.com/feross/is-buffer.git" - }, - "scripts": { - "test": "standard && npm run test-node && npm run test-browser", - "test-browser": "zuul -- test/*.js", - "test-browser-local": "zuul --local -- test/*.js", - "test-node": "tape test/*.js" - }, - "testling": { - "files": "test/*.js" - }, - "version": "1.1.6" -} diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/is-buffer/test/basic.js b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/is-buffer/test/basic.js deleted file mode 100644 index be4f8e43..00000000 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/is-buffer/test/basic.js +++ /dev/null @@ -1,24 +0,0 @@ -var isBuffer = require('../') -var test = require('tape') - -test('is-buffer', function (t) { - t.equal(isBuffer(Buffer.alloc(4)), true, 'new Buffer(4)') - t.equal(isBuffer(Buffer.allocUnsafeSlow(100)), true, 'SlowBuffer(100)') - - t.equal(isBuffer(undefined), false, 'undefined') - t.equal(isBuffer(null), false, 'null') - t.equal(isBuffer(''), false, 'empty string') - t.equal(isBuffer(true), false, 'true') - t.equal(isBuffer(false), false, 'false') - t.equal(isBuffer(0), false, '0') - t.equal(isBuffer(1), false, '1') - t.equal(isBuffer(1.0), false, '1.0') - t.equal(isBuffer('string'), false, 'string') - t.equal(isBuffer({}), false, '{}') - t.equal(isBuffer([]), false, '[]') - t.equal(isBuffer(function foo () {}), false, 'function foo () {}') - t.equal(isBuffer({ isBuffer: null }), false, '{ isBuffer: null }') - t.equal(isBuffer({ isBuffer: function () { throw new Error() } }), false, '{ isBuffer: function () { throw new Error() } }') - - t.end() -}) diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/AUTHORS.txt b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/AUTHORS.txt index 4bb5da15..2fce2984 100644 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/AUTHORS.txt +++ b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/AUTHORS.txt @@ -311,3 +311,17 @@ Henry Zhu Saptak Sengupta Nilton Cesar basil.belokon +tmybr11 +Luis Emilio Velasco Sanchez +Ed S +Bert Zhang +Andrei Fangli +Marja Hölttä +abnud1 +buddh4 +Pat O'Callaghan +Ahmed.S.ElAfifi +Wonseop Kim +Christian Oliff +Christian Wenz +Sean Robinson diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/LICENSE.txt b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/LICENSE.txt index e4e5e00e..e3dbacb9 100644 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/LICENSE.txt +++ b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/LICENSE.txt @@ -1,14 +1,5 @@ Copyright JS Foundation and other contributors, https://js.foundation/ -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/jquery/jquery - -The following license applies to all parts of this software except as -documented below: - -==== - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including @@ -27,10 +18,3 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -==== - -All files located in the node_modules and external directories are -externally maintained libraries used by this software which have their -own licenses; we recommend you read them, as their terms may differ from -the terms above. diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/README.md b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/README.md index 83e7b937..df6888c0 100644 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/README.md +++ b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/README.md @@ -5,7 +5,7 @@ For information on how to get started and how to use jQuery, please see [jQuery's documentation](http://api.jquery.com/). For source files and issues, please visit the [jQuery repo](https://github.com/jquery/jquery). -If upgrading, please see the [blog post for 3.3.1](https://blog.jquery.com/2017/03/20/jquery-3.3.1-now-available/). This includes notable differences from the previous version and a more readable changelog. +If upgrading, please see the [blog post for 3.5.0](https://blog.jquery.com/2020/04/10/jquery-3-5-0-released/). This includes notable differences from the previous version and a more readable changelog. ## Including jQuery @@ -16,7 +16,7 @@ Below are some of the most common ways to include jQuery. #### Script tag ```html - + ``` #### Babel @@ -32,7 +32,7 @@ import $ from "jquery"; There are several ways to use [Browserify](http://browserify.org/) and [Webpack](https://webpack.github.io/). For more information on using these tools, please refer to the corresponding project's documention. In the script, including jQuery will usually look like this... ```js -var $ = require("jquery"); +var $ = require( "jquery" ); ``` #### AMD (Asynchronous Module Definition) @@ -40,9 +40,9 @@ var $ = require("jquery"); AMD is a module format built for the browser. For more information, we recommend [require.js' documentation](http://requirejs.org/docs/whyamd.html). ```js -define(["jquery"], function($) { +define( [ "jquery" ], function( $ ) { -}); +} ); ``` ### Node @@ -56,12 +56,7 @@ npm install jquery For jQuery to work in Node, a window with a document is required. Since no such window exists natively in Node, one can be mocked by tools such as [jsdom](https://github.com/tmpvar/jsdom). This can be useful for testing purposes. ```js -require("jsdom").env("", function(err, window) { - if (err) { - console.error(err); - return; - } - - var $ = require("jquery")(window); -}); +const { JSDOM } = require( "jsdom" ); +const { window } = new JSDOM( "" ); +const $ = require( "jquery" )( window ); ``` diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/external/sizzle/LICENSE.txt b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/external/sizzle/LICENSE.txt index dd7ce940..88fcd178 100644 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/external/sizzle/LICENSE.txt +++ b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/external/sizzle/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright jQuery Foundation and other contributors, https://jquery.org/ +Copyright JS Foundation and other contributors, https://js.foundation/ This software consists of voluntary contributions made by many individuals. For exact contribution history, see the revision history diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/package.json b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/package.json index c303f0c9..05d6aad2 100644 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/package.json +++ b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/package.json @@ -1,36 +1,83 @@ { - "_from": "jquery", - "_id": "jquery@3.3.1", - "_inBundle": false, - "_integrity": "sha512-Ubldcmxp5np52/ENotGxlLe6aGMvmF4R8S6tZjsP6Knsaxd/xp3Zrh50cG93lR6nPXyUFwzN3ZSOQI0wRJNdGg==", - "_location": "/jquery", - "_phantomChildren": {}, - "_requested": { - "type": "tag", - "registry": true, - "raw": "jquery", - "name": "jquery", - "escapedName": "jquery", - "rawSpec": "", - "saveSpec": null, - "fetchSpec": "latest" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/jquery/-/jquery-3.3.1.tgz", - "_shasum": "958ce29e81c9790f31be7792df5d4d95fc57fbca", - "_spec": "jquery", - "_where": "/Users/mkennedy/github/talk-python/courses/100web/web100-demos/days/093-096-vuejs/your-turn/your_movie_exploder", + "name": "jquery", + "title": "jQuery", + "description": "JavaScript library for DOM operations", + "version": "3.5.0", + "main": "dist/jquery.js", + "homepage": "https://jquery.com", "author": { "name": "JS Foundation and other contributors", - "url": "https://github.com/jquery/jquery/blob/3.3.1/AUTHORS.txt" + "url": "https://github.com/jquery/jquery/blob/3.5.0/AUTHORS.txt" + }, + "repository": { + "type": "git", + "url": "https://github.com/jquery/jquery.git" }, + "keywords": [ + "jquery", + "javascript", + "browser", + "library" + ], "bugs": { "url": "https://github.com/jquery/jquery/issues" }, - "bundleDependencies": false, + "license": "MIT", + "dependencies": {}, + "devDependencies": { + "@babel/core": "7.3.3", + "@babel/plugin-transform-for-of": "7.2.0", + "commitplease": "3.2.0", + "core-js": "2.6.5", + "eslint-config-jquery": "2.0.0", + "grunt": "1.0.3", + "grunt-babel": "8.0.0", + "grunt-cli": "1.3.2", + "grunt-compare-size": "0.4.2", + "grunt-contrib-uglify": "3.4.0", + "grunt-contrib-watch": "1.1.0", + "grunt-eslint": "22.0.0", + "grunt-git-authors": "3.2.0", + "grunt-jsonlint": "1.1.0", + "grunt-karma": "3.0.1", + "grunt-newer": "1.3.0", + "grunt-npmcopy": "0.1.0", + "gzip-js": "0.3.2", + "husky": "1.3.1", + "insight": "0.10.1", + "jsdom": "13.2.0", + "karma": "4.0.1", + "karma-browserstack-launcher": "1.4.0", + "karma-chrome-launcher": "2.2.0", + "karma-firefox-launcher": "1.1.0", + "karma-ie-launcher": "1.0.0", + "karma-jsdom-launcher": "7.1.0", + "karma-qunit": "3.0.0", + "load-grunt-tasks": "4.0.0", + "native-promise-only": "0.8.1", + "promises-aplus-tests": "2.1.2", + "q": "1.5.1", + "qunit": "2.9.2", + "raw-body": "2.3.3", + "requirejs": "2.3.6", + "sinon": "2.3.7", + "sizzle": "2.3.5", + "strip-json-comments": "2.0.1", + "testswarm": "1.1.0", + "uglify-js": "3.4.7" + }, + "scripts": { + "build": "npm install && grunt", + "start": "grunt watch", + "test:browserless": "grunt && grunt test:slow", + "test:browser": "grunt && grunt karma:main", + "test:amd": "grunt && grunt karma:amd", + "test:no-deprecated": "grunt test:prepare && grunt custom:-deprecated && grunt karma:main", + "test:no-sizzle": "grunt test:prepare && grunt custom:-sizzle && grunt karma:main", + "test:slim": "grunt test:prepare && grunt custom:slim && grunt karma:main", + "test": "npm run test:slim && npm run test:no-deprecated && npm run test:no-sizzle && grunt && grunt test:slow && grunt karma:main && grunt karma:amd", + "jenkins": "npm run test:browserless" + }, "commitplease": { "nohook": true, "components": [ @@ -61,74 +108,10 @@ "markerPattern": "^((clos|fix|resolv)(e[sd]|ing))|^(refs?)", "ticketPattern": "^((Closes|Fixes) ([a-zA-Z]{2,}-)[0-9]+)|^(Refs? [^#])" }, - "dependencies": {}, - "deprecated": false, - "description": "JavaScript library for DOM operations", - "devDependencies": { - "babel-core": "7.0.0-beta.0", - "babel-plugin-transform-es2015-for-of": "7.0.0-beta.0", - "commitplease": "2.7.10", - "core-js": "2.4.1", - "eslint-config-jquery": "1.0.1", - "grunt": "1.0.1", - "grunt-babel": "7.0.0", - "grunt-cli": "1.2.0", - "grunt-compare-size": "0.4.2", - "grunt-contrib-uglify": "3.0.1", - "grunt-contrib-watch": "1.0.0", - "grunt-eslint": "20.0.0", - "grunt-git-authors": "3.2.0", - "grunt-jsonlint": "1.1.0", - "grunt-karma": "2.0.0", - "grunt-newer": "1.3.0", - "grunt-npmcopy": "0.1.0", - "gzip-js": "0.3.2", - "husky": "0.14.3", - "insight": "0.8.4", - "jsdom": "5.6.1", - "karma": "1.7.0", - "karma-browserstack-launcher": "1.3.0", - "karma-chrome-launcher": "2.2.0", - "karma-firefox-launcher": "1.0.1", - "karma-qunit": "1.2.1", - "load-grunt-tasks": "3.5.2", - "native-promise-only": "0.8.1", - "promises-aplus-tests": "2.1.2", - "q": "1.5.0", - "qunit-assert-step": "1.0.3", - "qunitjs": "1.23.1", - "raw-body": "2.2.0", - "requirejs": "2.3.3", - "sinon": "2.3.7", - "sizzle": "2.3.3", - "strip-json-comments": "2.0.1", - "testswarm": "1.1.0", - "uglify-js": "3.3.4" - }, - "homepage": "https://jquery.com", - "keywords": [ - "jquery", - "javascript", - "browser", - "library" - ], - "license": "MIT", - "main": "dist/jquery.js", - "name": "jquery", - "repository": { - "type": "git", - "url": "git+https://github.com/jquery/jquery.git" - }, - "scripts": { - "build": "npm install && grunt", - "commitmsg": "node node_modules/commitplease", - "jenkins": "npm run test:browserless", - "precommit": "grunt lint:newer qunit_fixture", - "start": "grunt watch", - "test": "grunt && grunt test:slow && grunt karma:main", - "test:browser": "grunt && grunt karma:main", - "test:browserless": "grunt && grunt test:slow" - }, - "title": "jQuery", - "version": "3.3.1" + "husky": { + "hooks": { + "commit-msg": "node node_modules/commitplease", + "pre-commit": "grunt lint:newer qunit_fixture" + } + } } diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/src/.eslintrc.json b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/src/.eslintrc.json deleted file mode 100644 index 3a4a3d25..00000000 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/src/.eslintrc.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "root": true, - - "extends": "../.eslintrc-browser.json" -} diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/src/ajax.js b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/src/ajax.js index aec26830..d1bebd54 100644 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/src/ajax.js +++ b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/src/ajax.js @@ -8,7 +8,7 @@ define( [ "./ajax/var/rquery", "./core/init", - "./ajax/parseXML", + "./core/parseXML", "./event/trigger", "./deferred", "./serialize" // jQuery.param @@ -459,12 +459,14 @@ jQuery.extend( { if ( !responseHeaders ) { responseHeaders = {}; while ( ( match = rheaders.exec( responseHeadersString ) ) ) { - responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ]; + responseHeaders[ match[ 1 ].toLowerCase() + " " ] = + ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) + .concat( match[ 2 ] ); } } - match = responseHeaders[ key.toLowerCase() ]; + match = responseHeaders[ key.toLowerCase() + " " ]; } - return match == null ? null : match; + return match == null ? null : match.join( ", " ); }, // Raw string @@ -608,7 +610,8 @@ jQuery.extend( { // Add or update anti-cache param if needed if ( s.cache === false ) { cacheURL = cacheURL.replace( rantiCache, "$1" ); - uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached; + uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + + uncached; } // Put hash and anti-cache on the URL that will be requested (gh-1732) @@ -741,6 +744,11 @@ jQuery.extend( { response = ajaxHandleResponses( s, jqXHR, responses ); } + // Use a noop converter for missing script + if ( !isSuccess && jQuery.inArray( "script", s.dataTypes ) > -1 ) { + s.converters[ "text script" ] = function() {}; + } + // Convert no matter what (that way responseXXX fields are always set) response = ajaxConvert( s, response, jqXHR, isSuccess ); @@ -831,7 +839,7 @@ jQuery.extend( { } } ); -jQuery.each( [ "get", "post" ], function( i, method ) { +jQuery.each( [ "get", "post" ], function( _i, method ) { jQuery[ method ] = function( url, data, callback, type ) { // Shift arguments if data argument was omitted @@ -852,5 +860,14 @@ jQuery.each( [ "get", "post" ], function( i, method ) { }; } ); +jQuery.ajaxPrefilter( function( s ) { + var i; + for ( i in s.headers ) { + if ( i.toLowerCase() === "content-type" ) { + s.contentType = s.headers[ i ] || ""; + } + } +} ); + return jQuery; } ); diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/src/ajax/jsonp.js b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/src/ajax/jsonp.js index 28ae0365..10186dea 100644 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/src/ajax/jsonp.js +++ b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/src/ajax/jsonp.js @@ -15,7 +15,7 @@ var oldCallbacks = [], jQuery.ajaxSetup( { jsonp: "callback", jsonpCallback: function() { - var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); + var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) ); this[ callback ] = true; return callback; } diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/src/ajax/parseXML.js b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/src/ajax/parseXML.js deleted file mode 100644 index acf7ab25..00000000 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/src/ajax/parseXML.js +++ /dev/null @@ -1,30 +0,0 @@ -define( [ - "../core" -], function( jQuery ) { - -"use strict"; - -// Cross-browser xml parsing -jQuery.parseXML = function( data ) { - var xml; - if ( !data || typeof data !== "string" ) { - return null; - } - - // Support: IE 9 - 11 only - // IE throws on parseFromString with invalid input. - try { - xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); - } catch ( e ) { - xml = undefined; - } - - if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { - jQuery.error( "Invalid XML: " + data ); - } - return xml; -}; - -return jQuery.parseXML; - -} ); diff --git a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/src/ajax/script.js b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/src/ajax/script.js index 6e0d21e9..410c82ca 100644 --- a/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/src/ajax/script.js +++ b/days/093-096-vuejs/your-turn/your_movie_exploder/node_modules/jquery/src/ajax/script.js @@ -43,24 +43,21 @@ jQuery.ajaxPrefilter( "script", function( s ) { // Bind script tag hack transport jQuery.ajaxTransport( "script", function( s ) { - // This transport only deals with cross domain requests - if ( s.crossDomain ) { + // This transport only deals with cross domain or forced-by-attrs requests + if ( s.crossDomain || s.scriptAttrs ) { var script, callback; return { send: function( _, complete ) { - script = jQuery( "