diff --git a/arcsi/api/item.py b/arcsi/api/item.py index 86870385..d1417ffd 100644 --- a/arcsi/api/item.py +++ b/arcsi/api/item.py @@ -1,7 +1,7 @@ from datetime import datetime, timedelta from flask import jsonify, make_response, request, redirect -from flask_security import login_required, auth_token_required, roles_required +from flask_security import auth_token_required, roles_required from marshmallow import fields, post_load, Schema from sqlalchemy import func @@ -65,6 +65,7 @@ def make_item(self, data, **kwargs): @arcsi.route("/item", methods=["GET"]) @arcsi.route("/item/all", methods=["GET"]) +@auth_token_required def list_items(): do = DoArchive() items = Item.query.all() @@ -78,6 +79,7 @@ def list_items(): @arcsi.route("/item/latest", methods=["GET"]) +@auth_token_required def list_items_latest(): do = DoArchive() page = request.args.get('page', 1, type=int) @@ -96,6 +98,7 @@ def list_items_latest(): @arcsi.route("/item/", methods=["GET"]) +@auth_token_required def view_item(id): item_query = Item.query.filter_by(id=id) item = item_query.first_or_404() @@ -112,7 +115,6 @@ def view_item(id): @arcsi.route("/item/add", methods=["POST"]) -@login_required @roles_required("admin") def add_item(): no_error = True @@ -278,174 +280,8 @@ def add_item(): return "Some error happened, check server logs for details. Note that your media may have been uploaded (to DO and/or Azurcast)." -@arcsi.route("/item/add_api", methods=["POST"]) -@auth_token_required -@roles_required("admin") -def add_item_api(): - no_error = True - if request.is_json: - return make_response( - jsonify("Only accepts multipart/form-data for now, sorry"), 503, headers - ) - # work around ImmutableDict type - item_metadata = request.form.to_dict() - # TODO if we could send JSON payloads w/ ajax then this prevalidation isn't needed - item_metadata["shows"] = [ - {"id": item_metadata["shows"], "name": item_metadata["show_name"]} - ] - item_metadata.pop("show_name", None) - # validate payload - err = item_schema.validate(item_metadata) - if err: - return make_response( - jsonify("Invalid data sent to add item, see: {}".format(err)), 500, headers - ) - else: - item_metadata = item_schema.load(item_metadata) - download_count = 0 - length = 0 - archived = False - image_file_name = None - image_file = None - image_url = "" - play_file = None - play_file_name = None - archive_lahmastore_canonical_url = "" - archive_mixcloud_canonical_url = "" - shows = ( - db.session.query(Show) - .filter(Show.id.in_((show.id for show in item_metadata.shows))) - .all() - ) - - new_item = Item( - number=item_metadata.number, - name=item_metadata.name, - description=item_metadata.description, - language=item_metadata.language, - play_date=item_metadata.play_date, - image_url=image_url, - play_file_name=play_file_name, - length=length, - live=item_metadata.live, - broadcast=item_metadata.broadcast, - archive_lahmastore=item_metadata.archive_lahmastore, - archive_lahmastore_canonical_url=archive_lahmastore_canonical_url, - archive_mixcloud=item_metadata.archive_mixcloud, - archive_mixcloud_canonical_url=archive_mixcloud_canonical_url, - archived=archived, - download_count=download_count, - uploader=item_metadata.uploader, - shows=shows, - ) - - #Check for duplicate files - name_occurrence = item_duplications_number(new_item) - - db.session.add(new_item) - db.session.flush() - - # TODO get show cover img and set as fallback - if request.files: - # Defend against possible duplicate files - if name_occurrence: - version_prefix = uuid4() - item_name = "{}-{}".format(new_item.name,version_prefix) - else: - item_name = new_item.name - - # process files first - if request.files["play_file"]: - if request.files["play_file"] != "": - play_file = request.files["play_file"] - - new_item.play_file_name = save_file( - archive_base=new_item.shows[0].archive_lahmastore_base_url, - archive_idx=new_item.number, - archive_file=play_file, - archive_file_name=(new_item.shows[0].name, item_name), - ) - - if request.files["image_file"]: - if request.files["image_file"] != "": - image_file = request.files["image_file"] - - image_file_name = save_file( - archive_base=new_item.shows[0].archive_lahmastore_base_url, - archive_idx=new_item.number, - archive_file=image_file, - archive_file_name=(new_item.shows[0].name, item_name), - ) - - if new_item.broadcast: - # we require both image and audio if broadcast (Azuracast) is set - if not (image_file_name and new_item.play_file_name): - no_error = False - # this branch is typically used for pre-uploading live episodes (no audio) - else: - if not image_file_name: - no_error = False - - # archive files if asked - if new_item.archive_lahmastore: - if no_error and (play_file or image_file): - if image_file_name: - new_item.image_url = archive( - archive_base=new_item.shows[0].archive_lahmastore_base_url, - archive_file_name=image_file_name, - archive_idx=new_item.number, - ) - if not new_item.image_url: - no_error = False - if new_item.play_file_name: - new_item.archive_lahmastore_canonical_url = archive( - archive_base=new_item.shows[0].archive_lahmastore_base_url, - archive_file_name=new_item.play_file_name, - archive_idx=new_item.number, - ) - - if new_item.archive_lahmastore_canonical_url: - # Only set archived if there is audio data otherwise it's live episode - new_item.archived = True - else: # Upload didn't succeed - no_error = False - - # broadcast episode if asked - if new_item.broadcast and no_error: - if not (play_file and image_file): - no_error = False - else: - new_item.airing = broadcast_audio( - archive_base=new_item.shows[0].archive_lahmastore_base_url, - archive_idx=new_item.number, - broadcast_file_name=new_item.play_file_name, - broadcast_playlist=new_item.shows[0].playlist_name, - broadcast_show=new_item.shows[0].name, - broadcast_title=new_item.name, - image_file_name=image_file_name, - ) - if not new_item.airing: - no_error = False - - # TODO some mp3 error - # TODO Maybe I used vanilla mp3 not from azuracast - # item_audio_obj = MP3(item_path) - # return item_audio_obj.filename - # item_length = item_audio_obj.info.length - - db.session.commit() - # TODO no_error is just bandaid for proper exc handling - if no_error: - return make_response( - jsonify(item_schema.dump(new_item)), - 200, - headers, - ) - else: - return "Some error happened, check server logs for details. Note that your media may have been uploaded (to DO and/or Azurcast)." - - @arcsi.route("item//listen", methods=["GET"]) +@auth_token_required def listen_play_file(id): do = DoArchive() item_query = Item.query.filter_by(id=id) @@ -457,6 +293,7 @@ def listen_play_file(id): @arcsi.route("/item//download", methods=["GET"]) +@auth_token_required def download_play_file(id): do = DoArchive() item_query = Item.query.filter_by(id=id) @@ -468,7 +305,7 @@ def download_play_file(id): @arcsi.route("/item/", methods=["DELETE"]) -@auth_token_required +@roles_required("admin") def delete_item(id): item_query = Item.query.filter_by(id=id) item = item_query.first_or_404() @@ -478,7 +315,6 @@ def delete_item(id): @arcsi.route("/item//edit", methods=["POST"]) -@login_required @roles_required("admin") def edit_item(id): no_error = True @@ -624,154 +460,8 @@ def edit_item(id): return "Some error happened, check server logs for details. Note that your media may have been uploaded (to DO and/or Azurcast)." -@arcsi.route("/item//edit_api", methods=["POST"]) -@auth_token_required -@roles_required("admin") -def edit_item_api(id): - no_error = True - image_file = None - image_file_name = None - play_file = None - - item_query = Item.query.filter_by(id=id) - item = item_query.first_or_404() - - # work around ImmutableDict type - item_metadata = request.form.to_dict() - - # TODO if we could send JSON payloads w/ ajax then this prevalidation isn't needed - item_metadata["shows"] = [ - {"id": item_metadata["shows"], "name": item_metadata["show_name"]} - ] - item_metadata.pop("show_name", None) - - # validate payload - # TODO handle what happens on f.e: empty payload? - # if err: -- need to check files {put IMG, put AUDIO} first - err = item_schema.validate(item_metadata) - if err: - return make_response( - jsonify("Invalid data sent to edit item, see: {}".format(err)), - 500, - headers, - ) - else: - # TODO edit uploaded media -- remove re-up etc. - # TODO broadcast / airing - item_metadata = item_schema.load(item_metadata) - - #Check for duplicate files (before item is updated!) - name_occurrence = item_duplications_number(item_metadata) - - item.number = item_metadata.number - item.name = item_metadata.name - item.description = item_metadata.description - item.language = item_metadata.language - item.play_date = item_metadata.play_date - item.live = item_metadata.live - item.broadcast = item_metadata.broadcast - item.airing = item_metadata.airing - item.uploader = item_metadata.uploader - item.archive_lahmastore = item_metadata.archive_lahmastore - item.archive_mixcloud = item_metadata.archive_mixcloud - - # conflict between shows from detached object load(item_metadata) added to session vs original persistent object item from query - item.shows = ( - db.session.query(Show) - .filter(Show.id.in_((show.id for show in item_metadata.shows))) - .all() - ) - - db.session.add(item) - db.session.flush() - - if request.files: - # Defend against possible duplicate files - if name_occurrence: - version_prefix = uuid4() - item_name = "{}-{}".format(item.name,version_prefix) - else: - item_name = item.name - - # process files first - if request.files["image_file"]: - if request.files["image_file"] != "": - image_file = request.files["image_file"] - - image_file_name = save_file( - archive_base=item.shows[0].archive_lahmastore_base_url, - archive_idx=item.number, - archive_file=image_file, - archive_file_name=(item.shows[0].name, item_name), - ) - - if request.files["play_file"]: - if request.files["play_file"] != "": - play_file = request.files["play_file"] - - item.play_file_name = save_file( - archive_base=item.shows[0].archive_lahmastore_base_url, - archive_idx=item.number, - archive_file=play_file, - archive_file_name=(item.shows[0].name, item_name), - ) - if item.broadcast: - # we require both image and audio if broadcast (Azuracast) is set - if not (image_file_name and item.play_file_name): - no_error = False - # this branch is typically used for pre-uploading live episodes (no audio) - else: - if not image_file_name: - no_error = False - - # archive files if asked - if item.archive_lahmastore: - if no_error and (play_file or image_file): - if image_file_name: - item.image_url = archive( - archive_base=item.shows[0].archive_lahmastore_base_url, - archive_file_name=image_file_name, - archive_idx=item.number, - ) - if not item.image_url: - no_error = False - if item.play_file_name: - item.archive_lahmastore_canonical_url = archive( - archive_base=item.shows[0].archive_lahmastore_base_url, - archive_file_name=item.play_file_name, - archive_idx=item.number, - ) - # Only set archived if there is audio data otherwise it's live episode - if item.archive_lahmastore_canonical_url: - item.archived = True - else: - no_error = False - # broadcast episode if asked - if item.broadcast and no_error: - if not (play_file and image_file): - no_error = False - else: - item.airing = broadcast_audio( - archive_base=item.shows[0].archive_lahmastore_base_url, - archive_idx=item.number, - broadcast_file_name=item.play_file_name, - broadcast_playlist=item.shows[0].playlist_name, - broadcast_show=item.shows[0].name, - broadcast_title=item.name, - image_file_name=image_file_name, - ) - if not item.airing: - no_error = False - - db.session.commit() - if no_error: - return make_response( - jsonify(item_partial_schema.dump(item)), 200, headers - ) - return "Some error happened, check server logs for details. Note that your media may have been uploaded (to DO and/or Azurcast)." - - @arcsi.route("/item/search", methods=["GET"]) +@auth_token_required def search_item(): do = DoArchive() page = request.args.get('page', 1, type=int) diff --git a/arcsi/api/show.py b/arcsi/api/show.py index 428e1b66..f58cd3ae 100644 --- a/arcsi/api/show.py +++ b/arcsi/api/show.py @@ -2,7 +2,7 @@ from datetime import datetime, timedelta from flask import jsonify, make_response, request -from flask_security import login_required, auth_token_required, roles_required +from flask_security import auth_token_required, roles_required from marshmallow import fields, post_load, Schema from sqlalchemy import func @@ -84,16 +84,19 @@ def make_show(self, data, **kwargs): @arcsi.route("/show", methods=["GET"]) # We use this route on the legacy for a massive shows query @arcsi.route("/show/all", methods=["GET"]) +@auth_token_required def list_shows(): return shows_schema.dumps(get_shows()) @arcsi.route("/show/all_without_items", methods=["GET"]) +@auth_token_required def list_shows_without_items(): return shows_schedule_schema.dumps(get_shows()) @arcsi.route("/show/schedule", methods=["GET"]) +@auth_token_required def list_shows_for_schedule(): do = DoArchive() shows = Show.query.filter(Show.active == True).all() @@ -106,6 +109,7 @@ def list_shows_for_schedule(): @arcsi.route("/show/schedule_by", methods=["GET"]) +@auth_token_required def list_shows_for_schedule_by(): do = DoArchive() day = request.args.get('day', 1, type=int) @@ -139,6 +143,7 @@ def list_shows_for_schedule_by(): # We are gonna use this on the new page as the show/all @arcsi.route("/show/list", methods=["GET"]) +@auth_token_required def list_shows_page(): return shows_archive_schema.dumps(get_shows()) @@ -146,7 +151,6 @@ def list_shows_page(): # TODO /item//add route so that each upload has unique id to begin with # no need for different methods for `POST` & `PUT` @arcsi.route("/show/add", methods=["POST"]) -@login_required @roles_required("admin") def add_show(): if request.is_json: @@ -222,87 +226,8 @@ def add_show(): ) -# TODO /item//add route so that each upload has unique id to begin with -# no need for different methods for `POST` & `PUT` -@arcsi.route("/show/add_api", methods=["POST"]) -@auth_token_required -@roles_required("admin") -def add_show_api(): - if request.is_json: - return make_response( - jsonify("Only accepts multipart/form-data for now, sorry"), 503, headers - ) - # work around ImmutableDict type - show_metadata = request.form.to_dict() - # TODO see item.py same line - show_metadata["users"] = [ - { - "id": show_metadata["users"], - "name": show_metadata["user_name"], - "email": show_metadata["user_email"], - } - ] - show_metadata.pop("user_name", None) - show_metadata.pop("user_email", None) - - # validate payload - err = show_schema.validate(show_metadata) - if err: - return make_response( - jsonify("Invalid data sent to add show, see: {}".format(err)), 500, headers - ) - else: - # host = User.query.filter_by(id=show_metadata["users"]).first() - show_metadata = show_schema.load(show_metadata) - new_show = Show( - active=show_metadata.active, - name=show_metadata.name, - description=show_metadata.description, - language=show_metadata.language, - playlist_name=show_metadata.playlist_name, - frequency=show_metadata.frequency, - week=show_metadata.week, - day=show_metadata.day, - start=show_metadata.start, - end=show_metadata.end, - archive_lahmastore=show_metadata.archive_lahmastore, - archive_lahmastore_base_url=slug(show_metadata.name), - archive_mixcloud=show_metadata.archive_mixcloud, - # archive_mixcloud_base_url=archive_mixcloud_base_url, - users=db.session.query(User) - .filter(User.id.in_((user.id for user in show_metadata.users))) - .all(), - ) - - db.session.add(new_show) - db.session.flush() - - if request.files: - if request.files["image_file"]: - cover_image_name = save_file( - archive_base=new_show.archive_lahmastore_base_url, - archive_idx=0, - archive_file=request.files["image_file"], - archive_file_name=(new_show.name, "cover"), - ) - if cover_image_name: - new_show.cover_image_url = archive( - archive_base=new_show.archive_lahmastore_base_url, - archive_idx=0, - archive_file_name=cover_image_name, - ) - - db.session.commit() - - return make_response( - jsonify(show_schema.dump(new_show)), - 200, - headers, - ) - - @arcsi.route("/show/", methods=["DELETE"]) -@auth_token_required +@roles_required("admin") def delete_show(id): show_query = Show.query.filter_by(id=id) show_query.delete() @@ -311,7 +236,6 @@ def delete_show(id): @arcsi.route("/show//edit", methods=["POST"]) -@login_required @roles_required("admin") def edit_show(id): show_query = Show.query.filter_by(id=id) @@ -385,82 +309,8 @@ def edit_show(id): ) -@arcsi.route("/show//edit_api", methods=["POST"]) -@auth_token_required -@roles_required("admin") -def edit_show_api(id): - show_query = Show.query.filter_by(id=id) - show = show_query.first_or_404() - - # work around ImmutableDict type - show_metadata = request.form.to_dict() - - # TODO see item.py same line - show_metadata["users"] = [ - { - "id": show_metadata["users"], - "name": show_metadata["user_name"], - "email": show_metadata["user_email"], - } - ] - show_metadata.pop("user_name", None) - show_metadata.pop("user_email", None) - - # validate payload - err = show_partial_schema.validate(show_metadata) - if err: - return make_response( - jsonify("Invalid data sent to edit show, see: {}".format(err)), - 500, - headers, - ) - else: - # TODO edit uploaded media - show_metadata = show_schema.load(show_metadata) - show.active = show_metadata.active - show.name = show_metadata.name - show.description = show_metadata.description - show.language = show_metadata.language - show.playlist_name = show_metadata.playlist_name - show.frequency = show_metadata.frequency - show.week = show_metadata.week - show.day = show_metadata.day - show.start = show_metadata.start - show.end = show_metadata.end - show.archive_lahmastore = show_metadata.archive_lahmastore - show.archive_lahmastore_base_url = slug(show_metadata.name) - show.archive_mixcloud = show_metadata.archive_mixcloud - show.users = ( - db.session.query(User) - .filter(User.id.in_((user.id for user in show_metadata.users))) - .all() - ) - - db.session.add(show) - db.session.flush() - - if request.files: - if request.files["image_file"]: - cover_image_name = save_file( - archive_base=show.archive_lahmastore_base_url, - archive_idx=0, - archive_file=request.files["image_file"], - archive_file_name=(show.name, "cover"), - ) - if cover_image_name: - show.cover_image_url = archive( - archive_base=show.archive_lahmastore_base_url, - archive_idx=0, - archive_file_name=cover_image_name, - ) - - db.session.commit() - return make_response( - jsonify(show_partial_schema.dump(show)), 200, headers - ) - - @arcsi.route("show/", methods=["GET"]) +@auth_token_required def view_show(id): do = DoArchive() show_query = Show.query.filter_by(id=id) @@ -485,6 +335,7 @@ def view_show(id): # We use this route on the legacy front-end show page @arcsi.route("show//archive", methods=["GET"]) +@auth_token_required def view_show_archive(show_slug): do = DoArchive() show_query = Show.query.filter_by(archive_lahmastore_base_url=show_slug) @@ -510,6 +361,7 @@ def view_show_archive(show_slug): # This will be the one that we are gonna use at the new page @arcsi.route("show//page", methods=["GET"]) +@auth_token_required def view_show_page(show_slug): do = DoArchive() show_query = Show.query.filter_by(archive_lahmastore_base_url=show_slug) @@ -541,6 +393,7 @@ def view_show_page(show_slug): @arcsi.route("show//item/", methods=["GET"]) +@auth_token_required def view_episode_archive(show_slug, item_slug): do = DoArchive() show_query = Show.query.filter_by(archive_lahmastore_base_url=show_slug) @@ -556,6 +409,7 @@ def view_episode_archive(show_slug, item_slug): @arcsi.route("/show/search", methods=["GET"]) +@auth_token_required def search_show(): do = DoArchive() page = request.args.get('page', 1, type=int) diff --git a/arcsi/templates/item/view.html b/arcsi/templates/item/view.html index a6a78f43..9150cb7c 100644 --- a/arcsi/templates/item/view.html +++ b/arcsi/templates/item/view.html @@ -18,8 +18,9 @@

{% block title %}{{item.name}}{% endblock %}

Episode broadcasted?: {{item["broadcast"]}}

Episode (currently) airing?: {{item.airing}}

Episode archive lahmastore: {{item["archive_lahmastore"]}}

-

Episode archive lahmastore URL : Download || -

Episode archive lahmastore URL : {{item.archive_lahmastore_canonical_url}}

+

+

diff --git a/arcsi/view/item.py b/arcsi/view/item.py index e17e57a2..459fb45a 100644 --- a/arcsi/view/item.py +++ b/arcsi/view/item.py @@ -3,13 +3,13 @@ from flask import current_app as app from flask import render_template, url_for from flask_login import current_user -from flask_security import roles_accepted +from flask_security import login_required, roles_accepted from arcsi.view import router @router.route("/item/all") -@roles_accepted("admin", "host", "guest") +@login_required def list_items(): result = requests.get(app.config["APP_BASE_URL"] + url_for("arcsi.list_items"), headers = {"Authentication-Token": current_user.get_auth_token()}) items = result.json() @@ -34,7 +34,7 @@ def add_item(): @router.route("/item/", methods=["GET"]) -@roles_accepted("admin", "host", "guest") +@login_required def view_item(id): relpath = url_for("arcsi.view_item", id=id) item = requests.get(app.config["APP_BASE_URL"] + relpath, headers = {"Authentication-Token": current_user.get_auth_token()}) diff --git a/arcsi/view/show.py b/arcsi/view/show.py index 35394a5c..5d1fe442 100644 --- a/arcsi/view/show.py +++ b/arcsi/view/show.py @@ -3,13 +3,13 @@ from flask import current_app as app from flask import render_template, url_for from flask_login import current_user -from flask_security import roles_accepted +from flask_security import login_required, roles_accepted from arcsi.view import router @router.route("/show/all") -@roles_accepted("admin", "host", "guest") +@login_required def list_shows(): result = requests.get(app.config["APP_BASE_URL"] + url_for("arcsi.list_shows"), headers = {"Authentication-Token": current_user.get_auth_token()}) shows = result.json() @@ -23,7 +23,7 @@ def add_show(): @router.route("/show/", methods=["GET"]) -@roles_accepted("admin", "host", "guest") +@login_required def view_show(id): relpath = url_for("arcsi.view_show", id=id) show = requests.get(app.config["APP_BASE_URL"] + relpath, headers = {"Authentication-Token": current_user.get_auth_token()}) diff --git a/test/postman/test.postman_collection.json b/test/postman/test.postman_collection.json index 83ee91fd..2b98b09b 100644 --- a/test/postman/test.postman_collection.json +++ b/test/postman/test.postman_collection.json @@ -1,9 +1,8 @@ { "info": { - "_postman_id": "35ab0ff9-55a1-4746-879e-f2ba1e6e0fec", + "_postman_id": "f8aeca05-6c90-4215-aa89-4977d913683a", "name": "CI test", - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", - "_exporter_id": "19378201" + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, "item": [ { @@ -318,13 +317,13 @@ ] }, "url": { - "raw": "{{url}}/show/add_api", + "raw": "{{url}}/show/add", "host": [ "{{url}}" ], "path": [ "show", - "add_api" + "add" ] } }, @@ -635,7 +634,7 @@ "});\r", "\r", "pm.test(\"API responds within 10 sec (\" + pm.response.responseTime + \" msec)\", () => {\r", - " const expectedTimeInMilliseconds = 10000;\r", + " const expectedTimeInMilliseconds = 12500;\r", " pm.expect(pm.response.responseTime).to.be.lessThan(\r", " expectedTimeInMilliseconds + 1,\r", " `Response came in ${pm.response.responseTime} ms`);\r", @@ -763,13 +762,13 @@ ] }, "url": { - "raw": "{{url}}/item/add_api", + "raw": "{{url}}/item/add", "host": [ "{{url}}" ], "path": [ "item", - "add_api" + "add" ] } }, @@ -881,7 +880,7 @@ "});\r", "\r", "pm.test(\"API responds within 10 sec (\" + pm.response.responseTime + \" msec)\", () => {\r", - " const expectedTimeInMilliseconds = 10000;\r", + " const expectedTimeInMilliseconds = 12500;\r", " pm.expect(pm.response.responseTime).to.be.lessThan(\r", " expectedTimeInMilliseconds + 1,\r", " `Response came in ${pm.response.responseTime} ms`);\r", @@ -1015,14 +1014,14 @@ ] }, "url": { - "raw": "{{url}}/item/:id/edit_api", + "raw": "{{url}}/item/:id/edit", "host": [ "{{url}}" ], "path": [ "item", ":id", - "edit_api" + "edit" ], "variable": [ { @@ -1050,7 +1049,7 @@ "});\r", "\r", "pm.test(\"API responds within 10 sec (\" + pm.response.responseTime + \" msec)\", () => {\r", - " const expectedTimeInMilliseconds = 10000;\r", + " const expectedTimeInMilliseconds = 12500;\r", " pm.expect(pm.response.responseTime).to.be.lessThan(\r", " expectedTimeInMilliseconds + 1,\r", " `Response came in ${pm.response.responseTime} ms`);\r", @@ -1177,13 +1176,13 @@ ] }, "url": { - "raw": "{{url}}/item/add_api", + "raw": "{{url}}/item/add", "host": [ "{{url}}" ], "path": [ "item", - "add_api" + "add" ] } }, @@ -1295,7 +1294,7 @@ "});\r", "\r", "pm.test(\"API responds within 10 sec (\" + pm.response.responseTime + \" msec)\", () => {\r", - " const expectedTimeInMilliseconds = 10000;\r", + " const expectedTimeInMilliseconds = 12500;\r", " pm.expect(pm.response.responseTime).to.be.lessThan(\r", " expectedTimeInMilliseconds + 1,\r", " `Response came in ${pm.response.responseTime} ms`);\r", @@ -1422,13 +1421,13 @@ ] }, "url": { - "raw": "{{url}}/item/add_api", + "raw": "{{url}}/item/add", "host": [ "{{url}}" ], "path": [ "item", - "add_api" + "add" ] } }, @@ -1540,7 +1539,7 @@ "});\r", "\r", "pm.test(\"API responds within 10 sec (\" + pm.response.responseTime + \" msec)\", () => {\r", - " const expectedTimeInMilliseconds = 10000;\r", + " const expectedTimeInMilliseconds = 12500;\r", " pm.expect(pm.response.responseTime).to.be.lessThan(\r", " expectedTimeInMilliseconds + 1,\r", " `Response came in ${pm.response.responseTime} ms`);\r", @@ -1668,13 +1667,13 @@ ] }, "url": { - "raw": "{{url}}/item/add_api", + "raw": "{{url}}/item/add", "host": [ "{{url}}" ], "path": [ "item", - "add_api" + "add" ] } }, @@ -1786,7 +1785,7 @@ "});\r", "\r", "pm.test(\"API responds within 10 sec (\" + pm.response.responseTime + \" msec)\", () => {\r", - " const expectedTimeInMilliseconds = 10000;\r", + " const expectedTimeInMilliseconds = 12500;\r", " pm.expect(pm.response.responseTime).to.be.lessThan(\r", " expectedTimeInMilliseconds + 1,\r", " `Response came in ${pm.response.responseTime} ms`);\r", @@ -1920,14 +1919,14 @@ ] }, "url": { - "raw": "{{url}}/item/:id/edit_api", + "raw": "{{url}}/item/:id/edit", "host": [ "{{url}}" ], "path": [ "item", ":id", - "edit_api" + "edit" ], "variable": [ { @@ -1955,7 +1954,7 @@ "});\r", "\r", "pm.test(\"API responds within 10 sec (\" + pm.response.responseTime + \" msec)\", () => {\r", - " const expectedTimeInMilliseconds = 10000;\r", + " const expectedTimeInMilliseconds = 12500;\r", " pm.expect(pm.response.responseTime).to.be.lessThan(\r", " expectedTimeInMilliseconds + 1,\r", " `Response came in ${pm.response.responseTime} ms`);\r", @@ -2089,14 +2088,14 @@ ] }, "url": { - "raw": "{{url}}/item/:id/edit_api", + "raw": "{{url}}/item/:id/edit", "host": [ "{{url}}" ], "path": [ "item", ":id", - "edit_api" + "edit" ], "variable": [ {