diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..722670a --- /dev/null +++ b/.env.example @@ -0,0 +1,2 @@ +COMPETITOR_DASHBOARD_DATA_FILE=./data/competitor-dashboard.json +COMPETITOR_DASHBOARD_ARTIFACT_ROOT=./outputs/competitor-dashboard-artifacts diff --git a/.gitignore b/.gitignore index 1541da5..ed1aee7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,15 @@ -__pycache__/ -.env \ No newline at end of file +node_modules/ +.next/ +dist/ + +.env +.env.local + +data/*.json +!data/.gitkeep + +outputs/competitor-dashboard-artifacts/** +!outputs/competitor-dashboard-artifacts/.gitkeep + +coverage/ +npm-debug.log* diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 32a1453..0000000 --- a/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -# start by pulling the python image -FROM python:3.11-alpine - -# copy the requirements file into the image -COPY ./ /app/ - -# switch working directory -WORKDIR /app - -# install the dependencies and packages in the requirements file -RUN pip install -r requirements.txt - -# configure the container to run in an executed manner -ENV FLASK_APP=app.py -EXPOSE 5000 -ENTRYPOINT [ "python" ] -CMD ["app.py"] - -## DOCKER COMMANDS -# docker build -t flask-test . -# docker run -dit --name test -p 5000:5000 flask-test diff --git a/README.md b/README.md index e1bcc8d..1e5b495 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,126 @@ -# temp-fe +# Competitor Research Dashboard -A temporary frontend for new api functions, before we can redo them in react. +Local-first competitor dashboard rebuilt in Next.js + TypeScript. -# deployment +## What this is +This app replaces the previous Flask and Python implementation with a Node-only stack that is easy to run in a normal VS Code terminal. + +- Framework: Next.js App Router +- Language: TypeScript +- Runtime: Node.js + npm +- Storage: local JSON file under `data/competitor-dashboard.json` +- Artifacts: local PDF and PNG files under `outputs/competitor-dashboard-artifacts` + +The dashboard preserves separate competitor report records across sweep runs so users can browse historical reports, compare runs, inspect findings, and download artifacts. + +## Why JSON instead of SQLite + +SQLite would work well here, but the primary pain points called out for this migration were local setup friction and dependency churn. For the current local-first dashboard, a structured JSON store is enough to preserve history, support filtering, generate artifacts, and keep install reliability high with no native database setup. + +If this grows into a shared multi-user service later, the data layer can be swapped to SQLite or another database behind the same query helpers. + +## Local setup + +Requirements: + +- Node.js 20+ +- npm + +Install dependencies: + +```bash +npm install +``` + +Seed the local archive and artifacts: + +```bash +npm run seed ``` -kubectl apply -f https://raw.githubusercontent.com/ff14-advanced-market-search/temp-fe/main/kube-manifest-fe.yml -kubectl get pods -kubectl get service + +Start the app locally: + +```bash +npm run dev +``` + +Open: + +- `http://localhost:3000/research/dashboard` +- `http://localhost:3000/research/settings` +- `http://localhost:3000/api/health` + +Build for production verification: + +```bash +npm run build ``` -# pics +## Package scripts + +- `npm install` +- `npm run dev` +- `npm run build` +- `npm run seed` +- `npm run typecheck` + +## Environment + +Optional environment variables are documented in `.env.example`: + +- `COMPETITOR_DASHBOARD_DATA_FILE` +- `COMPETITOR_DASHBOARD_ARTIFACT_ROOT` + +Both paths are repo-root-relative by default. + +## Main routes + +- `/research/dashboard`: archive home with sticky filters and table/card view +- `/research/competitors`: competitor index +- `/research/competitors/[slug]`: per-competitor run comparison +- `/research/runs`: sweep run history +- `/research/reports/[reportId]`: detailed competitor report page +- `/research/findings`: findings search and review page +- `/research/sources`: source ledger page +- `/research/settings`: access notes, purpose, and local operations + +## API routes + +- `/api/health` +- `/api/reports` +- `/api/reports/[reportId]` +- `/api/findings` +- `/api/sources` +- `/api/artifacts/[artifactId]` + +## Seeded demo behavior + +`npm run seed` creates: + +- 3 sweep runs +- 7 competitors +- 21 competitor-specific reports +- 42 findings +- 126 sources +- 42 artifacts + +Artifacts are written under: + +- `outputs/competitor-dashboard-artifacts` -image +Local data is written to: -image +- `data/competitor-dashboard.json` -image +## Developer notes -image +- No Python runtime is required. +- No Flask, pip, virtualenv, ddtrace, or Python-only dependencies remain. +- All filesystem paths are repo-root-relative. +- The seed script emits developer-friendly logs and fails loudly if artifact generation breaks. -image +## Additional docs +- `docs/competitor_research_dashboard.md` +- `docs/migration-notes.md` diff --git a/app.py b/app.py deleted file mode 100644 index d40c221..0000000 --- a/app.py +++ /dev/null @@ -1,931 +0,0 @@ -import json, os -from datetime import datetime - -from flask import Flask -from flask import render_template -from flask import request -from flask import redirect - -from flask_cors import CORS -from flask_limiter import Limiter -from flask_limiter.util import get_remote_address -import requests, logging - -from ddtrace import patch_all, tracer, config, Pin -from ddtrace.profiling import Profiler - -from routes.ffxiv import ffxiv_bp -from routes.general import general_bp -from routes.wow import wow_bp -from utils.security import add_security_headers, return_safe_html - -# Enable Datadog tracing -patch_all() -profiler = Profiler() -profiler.start() - -# Initialize Datadog tracer -DD_AGENT_HOST = os.getenv("DD_AGENT_HOST", "localhost") -tracer.configure( - hostname=DD_AGENT_HOST, # Replace with your Datadog agent hostname if different - port=8126, # Replace with your Datadog agent port if different -) - -# Set Datadog service and environment variables -os.environ["DD_SERVICE"] = "flask-test" -os.environ["DD_ENV"] = "production" -os.environ["DD_VERSION"] = "1.0" -os.environ["DD_LOGS_INJECTION"] = "true" - -# Alternatively, configure Datadog settings directly -config.service = "flask-test" -config.env = "production" -config.version = "1.0" - -# Get API URL from environment variable or use default if not set -api_url = os.getenv("TEMP_API_URL", "http://api.saddlebagexchange.com/api") - -app = Flask(__name__) -# Attach the tracer to the Flask app -Pin.override(app, service="flask-test") - -# Initialize Flask-CORS with your app and specify allowed origins -origins = [ - "http://127.0.0.1:5000", - "http://localhost:5000", - "https://temp.saddlebagexchange.com", - "http://tryanna.xyz", -] -CORS(app, resources={r"/*": {"origins": origins}}) - -# Check for NO_RATE_LIMIT environment variable -NO_RATE_LIMIT = os.getenv("NO_RATE_LIMIT", False) -if not NO_RATE_LIMIT: - # Apply rate limit if NO_RATE_LIMIT is not set - limiter = Limiter(get_remote_address, app=app, default_limits=["1 per second"]) - -# Set the logging level to INFO for the Flask app -app.logger.setLevel(logging.INFO) -app.logger.disabled = True -logging.basicConfig(level=logging.INFO) - -# Setup logging for custom errors - -# Configure the logger with the custom format -log_format = ( - "%(levelname)s:\t[%(process)d][%(asctime)s] [%(module)s][%(funcName)s] %(message)s" -) -formatter = logging.Formatter(log_format) - -# Create a handler and set the formatter -handler = logging.StreamHandler() -handler.setFormatter(formatter) - -# Create the logger and add the handler -logger = logging.getLogger(__name__) -logger.setLevel(logging.DEBUG) # Set the logging level to DEBUG -logger.addHandler(handler) - - -class CustomLogHandler(logging.StreamHandler): - def __init__(self): - logging.StreamHandler.__init__(self) - - def format(self, record): - return f"{record.levelname}: {record.getMessage()}" - - -custom_handler = CustomLogHandler() -app.logger.addHandler(custom_handler) - - -# Register blueprints to add routes -app.register_blueprint(wow_bp) -app.register_blueprint(ffxiv_bp) -app.register_blueprint(general_bp) - - -# Use add_security_headers from utils/security.py -@app.after_request -def apply_security_headers(response): - return add_security_headers(response) - - -@app.route("/ffxivcraftsim", methods=["GET", "POST"]) -def ffxivcraftsim(): - return redirect("https://saddlebagexchange.com/ffxiv/craftsim/queries") - - # DEPRECIATED - if request.method == "GET": - return return_safe_html(render_template("ffxiv_craftsim.html")) - elif request.method == "POST": - if request.form.get("hide_expert_recipes") == "True": - hide_expert_recipes = True - else: - hide_expert_recipes = False - - json_data = { - "home_server": request.form.get("home_server"), - "cost_metric": request.form.get("cost_metric"), - "revenue_metric": request.form.get("revenue_metric"), - "sales_per_week": int(request.form.get("sales_per_week")), - "median_sale_price": int(request.form.get("median_sale_price")), - "max_material_cost": int(request.form.get("max_material_cost")), - "jobs": [int(request.form.get("job"))], - "filters": [int(request.form.get("filters"))], - "stars": int(request.form.get("stars")), - "lvl_lower_limit": int(request.form.get("lvl_lower_limit")), - "lvl_upper_limit": int(request.form.get("lvl_upper_limit")), - "yields": int(request.form.get("yields")), - "hide_expert_recipes": hide_expert_recipes, - } - - craftsim_post_json = requests.post( - f"{api_url}/v2/craftsim", - headers={"Accept": "application/json"}, - json=json_data, - ).json() - - return craftsim_results_table( - craftsim_post_json, "ffxiv_craftsim.html", json_data - ) - - -def craftsim_results_table(craftsim_results, html_file_name, json_data={}): - if "data" not in craftsim_results: - logger.error(str(craftsim_results)) - # send generic error message to remove XSS potential - return f"error no matching results found matching search inputs" - - if len(craftsim_results["data"]) == 0: - if json_data: - return ( - f"error no matching results found matching search inputs:\n {json_data}" - ) - else: - return f"error no matching results found matching search inputs:\n {craftsim_results}" - - craftsim_results = craftsim_results["data"] - - for item_data in craftsim_results: - del item_data["itemID"] - hq = item_data["hq"] - del item_data["hq"] - yields = item_data["yieldsPerCraft"] - del item_data["yieldsPerCraft"] - - se_link = item_data["itemData"] - del item_data["itemData"] - universalisLink = item_data["universalisLink"] - del item_data["universalisLink"] - - costEst = item_data["costEst"] - del item_data["costEst"] - revenueEst = item_data["revenueEst"] - del item_data["revenueEst"] - - item_data["hq"] = hq - item_data["yields"] = yields - item_data["item-data"] = se_link - item_data["universalisLink"] = universalisLink - - item_data["material - current region min listing cost:"] = costEst[ - "material_min_listing_cost" - ] - item_data["material - median regional cost:"] = costEst["material_median_cost"] - item_data["material - average regional cost:"] = costEst["material_avg_cost"] - - item_data["revenue - current home server min listing price:"] = revenueEst[ - "revenue_home_min_listing" - ] - item_data["revenue - current regional min listing price:"] = revenueEst[ - "revenue_region_min_listing" - ] - item_data["revenue - regional median sale price:"] = revenueEst[ - "revenue_median" - ] - item_data["revenue - regional average sale price:"] = revenueEst["revenue_avg"] - - fieldnames = list(craftsim_results[0].keys()) - - return return_safe_html( - render_template( - html_file_name, - results=craftsim_results, - fieldnames=fieldnames, - len=len, - ) - ) - - -@app.route("/ffxivshoppinglist", methods=["GET", "POST"]) -def ffxiv_shopping_list(): - return redirect("https://saddlebagexchange.com/ffxiv/shopping-list") - - # DEPRECIATED - if request.method == "GET": - return return_safe_html(render_template("ffxiv_shoppinglist.html")) - elif request.method == "POST": - shopping_list = request.form.get("shopping_list") - json_data = { - "home_server": request.form.get("home_server"), - "region_wide": bool(request.form.get("region_wide")), - "shopping_list": json.loads(shopping_list), - } - - shopping_list_json = requests.post( - f"{api_url}/v2/shoppinglist", - headers={"Accept": "application/json"}, - json=json_data, - ).json() - - return ffxiv_shopping_list_result( - shopping_list_json, "ffxiv_shoppinglist.html", json_data - ) - - -def ffxiv_shopping_list_result(shopping_list_results, html_file_name, json_data={}): - if "data" not in shopping_list_results: - logger.error(str(shopping_list_results)) - # send generic error message to remove XSS potential - return f"error no matching results found matching search inputs" - - if len(shopping_list_results["data"]) == 0: - if json_data: - return ( - f"error no matching results found matching search inputs:\n {json_data}" - ) - else: - return f"error no matching results found matching search inputs:\n {shopping_list_results}" - - shopping_list_data = shopping_list_results["data"] - for item_data in shopping_list_data: - itemID = item_data["itemID"] - del item_data["itemID"] - item_data_copy = { - "worldName": item_data["worldName"], - "name": item_data["name"], - "hq": item_data["hq"], - "pricePerUnit": item_data["pricePerUnit"], - "quantity": item_data["quantity"], - "itemData": f"https://saddlebagexchange.com/queries/item-data/{itemID}", - "uniLink": f"https://universalis.app/market/{itemID}", - } - for k, v in item_data_copy.items(): - if k not in item_data.keys(): - item_data[k] = v - else: - del item_data[k] - item_data[k] = v - - fieldnames = list(shopping_list_data[0].keys()) - return return_safe_html( - render_template( - html_file_name, - results=shopping_list_data, - fieldnames=fieldnames, - len=len, - ) - ) - - -@app.route("/ffxivbestdeals", methods=["GET", "POST"]) -def ffxivbestdeals(): - if request.method == "GET": - return return_safe_html(render_template("ffxivbestdeals.html")) - elif request.method == "POST": - json_data = { - "home_server": request.form.get("home_server"), - "discount": int(request.form.get("discount")), - "medianPrice": int(request.form.get("medianPrice")), - "salesAmount": int(request.form.get("salesAmount")), - "maxBuyPrice": int(request.form.get("maxBuyPrice")), - "filters": [int(request.form.get("filters"))], - } - response = requests.post( - f"{api_url}/bestdeals", - headers={"Accept": "application/json"}, - json=json_data, - ).json() - - if "data" not in response: - logger.error(str(response)) - # send generic error message to remove XSS potential - return f"error no matching results found matching search inputs" - - if len(response["data"]) == 0: - logger.error( - f"No matching results found with seach inputs {json_data} response {response}" - ) - # send generic error message to remove XSS potential - return f"error no matching results found matching search inputs" - - resp_list = response["data"] - column_order = [ - "itemName", - "worldName", - "discountHQ", - "discountNQ", - "minPriceHQ", - "minPrice", - "medianHQ", - "medianNQ", - "salesAmountHQ", - "salesAmountNQ", - "quantitySoldHQ", - "quantitySoldNQ", - "averageHQ", - "averageNQ", - "mainCategory", - "subCategory", - "itemData", - "uniLink", - "lastUploadTime", - ] - resp_list = [{key: item.get(key) for key in column_order} for item in resp_list] - fieldnames = list(resp_list[0].keys()) - return return_safe_html( - render_template( - "ffxivbestdeals.html", results=resp_list, fieldnames=fieldnames, len=len - ) - ) - - -#### WOW #### -@app.route("/uploadtimers", methods=["GET", "POST"]) -def uploadtimers(): - return redirect("https://saddlebagexchange.com/wow/upload-timers") - - # DEPRECIATED - if request.method == "GET": - return return_safe_html(render_template("uploadtimers.html")) - elif request.method == "POST": - json_data = {} - response = requests.post( - f"{api_url}/wow/uploadtimers", - headers={"Accept": "application/json"}, - json=json_data, - ).json() - - if "data" not in response: - logger.error( - f"No matching results found with seach inputs {json_data} response {response}" - ) - # send generic error message to remove XSS potential - return f"error no matching results found matching search inputs" - - response = response["data"] - - for row in response: - del row["tableName"] - del row["lastUploadUnix"] - - pop = row["dataSetName"] - del row["dataSetName"] - row["dataSetName"] = pop - - fieldnames = list(response[0].keys()) - - return return_safe_html( - render_template( - "uploadtimers.html", results=response, fieldnames=fieldnames, len=len - ) - ) - - -# -# @app.route("/itemnames", methods=["GET", "POST"]) -# def itemnames(): -# if request.method == "GET": -# return return_safe_html(render_template("itemnames.html")) -# elif request.method == "POST": -# json_data = {} -# response = requests.post( -# f"{api_url}/wow/itemnames", -# headers={"Accept": "application/json"}, -# json=json_data, -# ).json() -# -# resp_list = [] -# for k, v in response.items(): -# resp_list.append({"id": k, "name": v}) -# -# return return_safe_html( -# render_template( -# "itemnames.html", results=resp_list, fieldnames=["id", "name"], len=len -# ) -# ) - - -@app.route("/megaitemnames", methods=["GET", "POST"]) -def megaitemnames(): - if request.method == "GET": - return return_safe_html(render_template("megaitemnames.html")) - elif request.method == "POST": - json_data = { - "region": request.form.get("region"), - "discount": int(request.form.get("discount")), - } - response = requests.post( - f"{api_url}/wow/megaitemnames", - headers={"Accept": "application/json"}, - json=json_data, - ).json() - - column_order = [ - "itemID", - "desiredPrice", - "itemName", - "salesPerDay", - ] - response = [{key: item.get(key) for key in column_order} for item in response] - fieldnames = list(response[0].keys()) - return return_safe_html( - render_template( - "megaitemnames.html", results=response, fieldnames=fieldnames, len=len - ) - ) - - -@app.route("/petshoppinglist", methods=["GET", "POST"]) -def petshoppinglist(): - return redirect("https://saddlebagexchange.com/wow/shopping-list") - - # DEPRECIATED - if request.method == "GET": - return return_safe_html(render_template("petshoppinglist.html")) - elif request.method == "POST": - json_data = { - "region": request.form.get("region"), - "itemID": int(request.form.get("petID")), - "maxPurchasePrice": int(request.form.get("maxPurchasePrice")), - "connectedRealmIDs": {}, - } - - response = requests.post( - f"{api_url}/wow/shoppinglistx", - headers={"Accept": "application/json"}, - json=json_data, - ).json() - - if "data" not in response: - logger.error( - f"Error no matching data with given inputs {json_data} response {response}" - ) - if NO_RATE_LIMIT: - return f"Error no matching data with given inputs {json_data} response {response}" - # send generic error message to remove XSS potential - return f"error no matching results found matching search inputs" - - response = response["data"] - - column_order = [ - "realmID", - "price", - "quantity", - "realmName", - "realmNames", - "link", - ] - response = [{key: item.get(key) for key in column_order} for item in response] - fieldnames = list(response[0].keys()) - - return return_safe_html( - render_template( - "petshoppinglist.html", results=response, fieldnames=fieldnames, len=len - ) - ) - - -@app.route("/petmarketshare", methods=["GET", "POST"]) -def petmarketshare(): - return redirect("https://saddlebagexchange.com/wow/pet-marketshare") - - # DEPRECIATED - if request.method == "GET": - return return_safe_html(render_template("petmarketshare.html")) - elif request.method == "POST": - json_data = { - "region": request.form.get("region"), - "homeRealmName": request.form.get("homeRealmName"), - "minPrice": int(request.form.get("minPrice")), - "salesPerDay": int(request.form.get("salesPerDay")), - "includeCategories": [], - "excludeCategories": [], - "sortBy": "estimatedRegionMarketValue", - } - - response = requests.post( - f"{api_url}/wow/petmarketshare", - headers={"Accept": "application/json"}, - json=json_data, - ).json() - - if "data" not in response: - logger.error( - f"Error no matching data with given inputs {json_data} response {response}" - ) - if NO_RATE_LIMIT: - return f"Error no matching data with given inputs {json_data} response {response}" - # send generic error message to remove XSS potential - return f"error no matching results found matching search inputs" - - response = response["data"] - column_order = [ - "salesPerDay", - "itemName", - "percentChange", - "state", - "avgTSMPrice", - "estimatedRegionMarketValue", - "homeMinPrice", - "itemID", - "link", - "undermineLink", - "warcraftPetsLink", - ] - response = [{key: item.get(key) for key in column_order} for item in response] - fieldnames = list(response[0].keys()) - - return return_safe_html( - render_template( - "petmarketshare.html", results=response, fieldnames=fieldnames, len=len - ) - ) - - -@app.route("/petexport", methods=["GET", "POST"]) -def petexport(): - return redirect("https://saddlebagexchange.com/wow/export-search") - - # DEPRECIATED - if request.method == "GET": - return return_safe_html(render_template("petexport.html")) - elif request.method == "POST": - json_data = { - "region": request.form.get("region"), - "itemID": int(request.form.get("itemID")), - "populationWP": int(request.form.get("populationWP")), - "populationBlizz": int(request.form.get("populationBlizz")), - "rankingWP": int(request.form.get("rankingWP")), - "minPrice": int(request.form.get("minPrice")), - "maxQuantity": int(request.form.get("maxQuantity")), - "sortBy": "minPrice", - "connectedRealmIDs": {}, - } - - response = requests.post( - f"{api_url}/wow/exportx", - headers={"Accept": "application/json"}, - json=json_data, - ).json() - - if "data" not in response: - logger.error( - f"Error no matching data with given inputs {json_data} response {response}" - ) - if NO_RATE_LIMIT: - return f"Error no matching data with given inputs {json_data} response {response}" - # send generic error message to remove XSS potential - return f"error no matching results found matching search inputs" - response = response["data"] - - for row in response: - del row["connectedRealmID"] - del row["realmPopulationInt"] - row["allRealms"] = row["connectedRealmNames"] - row["connectedRealmNames"] = row["connectedRealmNames"][0] - link = row["link"] - del row["link"] - row["link"] = link - undermineLink = row["undermineLink"] - del row["undermineLink"] - row["undermineLink"] = undermineLink - - fieldnames = list(response[0].keys()) - - return return_safe_html( - render_template( - "petexport.html", results=response, fieldnames=fieldnames, len=len - ) - ) - - -@app.route("/regionundercut", methods=["GET", "POST"]) -def regionundercut(): - return redirect("https://saddlebagexchange.com/wow/region-undercut") - - # DEPRECIATED - if request.method == "GET": - return return_safe_html(render_template("regionundercut.html")) - elif request.method == "POST": - addonData = request.form.get("addonData") - json_data = { - "region": request.form.get("region"), - "homeRealmID": int(request.form.get("homeRealmID")), - "addonData": json.loads(addonData), - } - - response = requests.post( - f"{api_url}/wow/regionundercut", - headers={"Accept": "application/json"}, - json=json_data, - ).json() - - if "undercut_list" not in response or "not_found_list" not in response: - logger.error( - f"Error no matching data with given inputs {json_data} response {response}" - ) - if NO_RATE_LIMIT: - return f"Error no matching data with given inputs {json_data} response {response}" - # send generic error message to remove XSS potential - return f"error no matching results found matching search inputs" - undercuts = response["undercut_list"] - - for row in undercuts: - del row["connectedRealmId"] - realmName = row["realmName"] - del row["realmName"] - row["realmName"] = realmName - undermineLink = row["link"] - del row["link"] - row["undermineLink"] = undermineLink - - undercuts_fieldnames = list(undercuts[0].keys()) - - if "not_found_list" not in response: - logger.error( - f"Error no matching data with given inputs {json_data} response {response}" - ) - # send generic error message to remove XSS potential - return f"error no matching results found matching search inputs" - not_found = response["not_found_list"] - - for row in not_found: - del row["connectedRealmId"] - realmName = row["realmName"] - del row["realmName"] - row["realmName"] = realmName - undermineLink = row["link"] - del row["link"] - row["undermineLink"] = undermineLink - - not_found_fieldnames = list(not_found[0].keys()) - - return return_safe_html( - render_template( - "regionundercut.html", - results=undercuts, - fieldnames=undercuts_fieldnames, - results_n=not_found, - fieldnames_n=not_found_fieldnames, - len=len, - ) - ) - - -@app.route("/bestdeals", methods=["GET", "POST"]) -def bestdeals(): - return redirect("https://saddlebagexchange.com/wow/best-deals/recommended") - - # DEPRECIATED - if request.method == "GET": - return return_safe_html(render_template("bestdeals.html")) - elif request.method == "POST": - json_data = { - "region": request.form.get("region"), - "type": request.form.get("type"), - "discount": int(request.form.get("discount")), - "minPrice": int(request.form.get("minPrice")), - "salesPerDay": float(request.form.get("salesPerDay")), - "item_class": int(request.form.get("item_class")), - "item_subclass": -1, - } - - response = requests.post( - f"{api_url}/wow/bestdeals", - headers={"Accept": "application/json"}, - json=json_data, - ).json() - - if "data" not in response or len(response["data"]) == 0: - logger.error( - f"Error no matching data with given inputs {json_data} response {response}" - ) - if NO_RATE_LIMIT: - return f"Error no matching data with given inputs {json_data} response {response}" - # send generic error message to remove XSS potential - return f"error no matching results found matching search inputs" - response = response["data"] - - for row in response: - del row["itemID"] - del row["connectedRealmId"] - - minPrice = row["minPrice"] - del row["minPrice"] - row["minPrice"] = minPrice - - historicalPrice = row["historicPrice"] - del row["historicPrice"] - row["historicPrice"] = historicalPrice - - itemName = row["itemName"] - del row["itemName"] - row["itemName"] = itemName - - realmName = row["realmName"] - del row["realmName"] - row["realmName"] = realmName - - link = row["link"] - del row["link"] - row["link"] = link - - link = row["exportLink"] - del row["exportLink"] - row["exportLink"] = link - - fieldnames = list(response[0].keys()) - - return return_safe_html( - render_template( - "bestdeals.html", - results=response, - fieldnames=fieldnames, - len=len, - ) - ) - - - - -@app.route("/petimport", methods=["GET", "POST"]) -def petimport(): - if request.method == "GET": - return render_template("petimport.html") - elif request.method == "POST": - headers = {"Accept": "application/json"} - petsOnly = request.form.get("petsOnly") - if petsOnly == "False": - petsOnly = False - else: - petsOnly = True - json_data = { - "region": request.form.get("region"), - "homeRealmID": int(request.form.get("homeRealmID")), - "ROI": int(request.form.get("ROI")), - "avgPrice": int(request.form.get("avgPrice")), - "maxPurchasePrice": int(request.form.get("maxPurchasePrice")), - "profitAmount": int(request.form.get("profitAmount")), - "salesPerDay": float(request.form.get("salesPerDay")), - "includeCategories": [], - "excludeCategories": [], - "sortBy": "lowestPrice", - "petsOnly": petsOnly, - "connectedRealmIDs": {}, - } - - response = requests.post( - f"{api_url}/api/wow/import", - headers=headers, - json=json_data, - ).json() - - if "data" not in response: - return f"Error no matching data with given inputs {response}" - response = response["data"] - if len(response) == 0: - return f"No item found with given inputs, try lowering price or sale amount {json_data}" - - for row in response: - del row["itemID"] - del row["lowestPriceRealmID"] - realm = row["lowestPriceRealmName"] - del row["lowestPriceRealmName"] - row["lowestPriceRealmName"] = realm - - link = row["link"] - del row["link"] - row["link"] = link - - undermineLink = row["undermineLink"] - del row["undermineLink"] - row["undermineLink"] = undermineLink - - warcraftPetsLink = row["warcraftPetsLink"] - del row["warcraftPetsLink"] - row["warcraftPetsLink"] = warcraftPetsLink - - fieldnames = list(response[0].keys()) - - return render_template( - "petimport.html", - results=response, - fieldnames=fieldnames, - len=len, - ) - - -@app.route("/ffxivsalehistory", methods=["GET", "POST"]) -def ffxivsalehistory(): - return redirect("https://saddlebagexchange.com/ffxiv/extended-history") - - # DEPRECIATED - if request.method == "GET": - return return_safe_html(render_template("ffxiv_sale_history.html")) - elif request.method == "POST": - # json_data = { - # "home_server": request.form.get("home_server"), - # "item_id": int(request.form.get("item_id")), - # "initial_days": 7, - # "end_days": 0, - # "item_type": "all", - # } - region = request.form.get("region") - item_id = int(request.form.get("item_id")) - response = requests.get( - "https://universalis.app/api/v2/history/" + f"{region}/{item_id}" - ).json() - - if "entries" not in response: - return "Error refresh the page or contact the devs on discord" - if len(response["entries"]) == 0: - return "Error no sales in past week" - - fixed_response = [] - for sale in response["entries"]: - sale["date"] = datetime.utcfromtimestamp(sale["timestamp"]).strftime( - "%Y-%m-%d %H:%M:%S" - ) - for val in [ - "hq", - "pricePerUnit", - "quantity", - "buyerName", - "onMannequin", - "worldID", - ]: - temp = sale[val] - del sale[val] - sale[val] = temp - - fixed_response.append(sale) - fieldnames = list(fixed_response[0].keys()) - - return return_safe_html( - render_template( - "ffxiv_sale_history.html", - results=fixed_response, - fieldnames=fieldnames, - len=len, - ) - ) - - -@app.route("/ffxivscripexchange", methods=["GET", "POST"]) -def ffxiv_scrip_exchange(): - return redirect("https://saddlebagexchange.com/ffxiv/scrip-exchange") - - # DEPRECIATED - if request.method == "GET": - return return_safe_html(render_template("ffxiv_scrip_exchange.html")) - elif request.method == "POST": - json_data = { - "home_server": request.form.get("home_server"), - "color": request.form.get("color"), - } - - response = requests.post( - f"{api_url}/ffxiv/scripexchange", - headers={"Accept": "application/json"}, - json=json_data, - ).json() - - if "data" not in response: - return "Error refresh the page or contact the devs on discord" - if len(response["data"]) == 0: - return "Error no sales in past week" - - fieldnames = list(response["data"][0].keys()) - - return return_safe_html( - render_template( - "ffxiv_scrip_exchange.html", - results=response["data"], - fieldnames=fieldnames, - len=len, - ) - ) - - -if __name__ == "__main__": - app.run(host="0.0.0.0") - - # for testing - - ## http - # app.run(host="0.0.0.0", debug=True) - - ## https - # app.run(host='0.0.0.0',port=443,debug=True, ssl_context=("./certs/full_chain.crt","./certs/private.key")) diff --git a/app/api/artifacts/[artifactId]/route.ts b/app/api/artifacts/[artifactId]/route.ts new file mode 100644 index 0000000..8aece9c --- /dev/null +++ b/app/api/artifacts/[artifactId]/route.ts @@ -0,0 +1,35 @@ +import fs from "node:fs/promises"; + +import { resolveFromRepo } from "@/lib/competitor-dashboard/paths"; +import { getArtifactById } from "@/lib/competitor-dashboard/queries"; +import { loadDashboardData } from "@/lib/competitor-dashboard/store"; + +export async function GET( + _request: Request, + { params }: { params: { artifactId: string } } +) { + const data = await loadDashboardData(); + if (!data) { + return new Response("No local dashboard data found. Run npm run seed.", { status: 404 }); + } + + const artifact = getArtifactById(data, params.artifactId); + if (!artifact || !artifact.relativePath) { + return new Response("Artifact not found.", { status: 404 }); + } + + const filePath = resolveFromRepo(artifact.relativePath); + + try { + const file = await fs.readFile(filePath); + return new Response(file, { + status: 200, + headers: { + "Content-Type": artifact.mimeType, + "Content-Disposition": `inline; filename="${artifact.title}"` + } + }); + } catch { + return new Response("Artifact file missing.", { status: 404 }); + } +} diff --git a/app/api/findings/route.ts b/app/api/findings/route.ts new file mode 100644 index 0000000..c8d62c9 --- /dev/null +++ b/app/api/findings/route.ts @@ -0,0 +1,14 @@ +import { buildFindings, getDashboardContext } from "@/lib/competitor-dashboard/queries"; + +export async function GET(request: Request) { + const context = await getDashboardContext(new URL(request.url).searchParams); + + if (!context) { + return Response.json({ findings: [], error: "No local dashboard data found. Run npm run seed." }); + } + + return Response.json({ + findings: buildFindings(context), + lastSeededAt: context.data.lastSeededAt + }); +} diff --git a/app/api/health/route.ts b/app/api/health/route.ts new file mode 100644 index 0000000..2d0a582 --- /dev/null +++ b/app/api/health/route.ts @@ -0,0 +1,35 @@ +import fs from "node:fs/promises"; + +import { + artifactRootPath, + dataFilePath, + toRepoRelative +} from "@/lib/competitor-dashboard/paths"; +import { loadDashboardData } from "@/lib/competitor-dashboard/store"; + +export const dynamic = "force-dynamic"; + +export async function GET() { + const [data, artifactStat] = await Promise.all([ + loadDashboardData(), + fs + .stat(artifactRootPath()) + .then(() => true) + .catch(() => false) + ]); + const ok = Boolean(data) && artifactStat; + + return Response.json( + { + ok, + dataFile: toRepoRelative(dataFilePath()), + artifactRoot: toRepoRelative(artifactRootPath()), + hasSeedData: Boolean(data), + artifactRootExists: artifactStat, + lastSeededAt: data?.lastSeededAt ?? null + }, + { + status: ok ? 200 : 503 + } + ); +} diff --git a/app/api/reports/[reportId]/route.ts b/app/api/reports/[reportId]/route.ts new file mode 100644 index 0000000..efd839d --- /dev/null +++ b/app/api/reports/[reportId]/route.ts @@ -0,0 +1,21 @@ +import { getDashboardContext, getReportDetail } from "@/lib/competitor-dashboard/queries"; + +export async function GET( + _request: Request, + { params }: { params: { reportId: string } } +) { + const context = await getDashboardContext({}); + if (!context) { + return Response.json( + { error: "No local dashboard data found. Run npm run seed." }, + { status: 404 } + ); + } + + const detail = getReportDetail(context, params.reportId); + if (!detail) { + return Response.json({ error: "Report not found." }, { status: 404 }); + } + + return Response.json(detail); +} diff --git a/app/api/reports/route.ts b/app/api/reports/route.ts new file mode 100644 index 0000000..14df157 --- /dev/null +++ b/app/api/reports/route.ts @@ -0,0 +1,14 @@ +import { buildReportRows, getDashboardContext } from "@/lib/competitor-dashboard/queries"; + +export async function GET(request: Request) { + const context = await getDashboardContext(new URL(request.url).searchParams); + + if (!context) { + return Response.json({ reports: [], error: "No local dashboard data found. Run npm run seed." }); + } + + return Response.json({ + reports: buildReportRows(context), + lastSeededAt: context.data.lastSeededAt + }); +} diff --git a/app/api/sources/route.ts b/app/api/sources/route.ts new file mode 100644 index 0000000..dacf913 --- /dev/null +++ b/app/api/sources/route.ts @@ -0,0 +1,14 @@ +import { buildSources, getDashboardContext } from "@/lib/competitor-dashboard/queries"; + +export async function GET(request: Request) { + const context = await getDashboardContext(new URL(request.url).searchParams); + + if (!context) { + return Response.json({ sources: [], error: "No local dashboard data found. Run npm run seed." }); + } + + return Response.json({ + sources: buildSources(context), + lastSeededAt: context.data.lastSeededAt + }); +} diff --git a/app/globals.css b/app/globals.css new file mode 100644 index 0000000..95f78e4 --- /dev/null +++ b/app/globals.css @@ -0,0 +1,525 @@ +:root { + --bg: #f3f6fb; + --surface: #ffffff; + --surface-muted: #e8eef7; + --ink: #152033; + --ink-soft: #56657f; + --line: #d4deec; + --accent: #174ea6; + --accent-soft: #dbe8ff; + --success: #107853; + --success-soft: #def4ea; + --warn: #a56a00; + --warn-soft: #fff2d4; + --danger: #b42332; + --danger-soft: #ffe2e6; + --shadow: 0 14px 38px rgba(20, 36, 71, 0.08); + color-scheme: light; +} + +* { + box-sizing: border-box; +} + +html, +body { + margin: 0; + min-height: 100%; + background: linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%); + color: var(--ink); + font-family: + "IBM Plex Sans", + "Segoe UI", + system-ui, + sans-serif; +} + +a { + color: var(--accent); + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +button, +input, +select, +textarea { + font: inherit; +} + +button { + cursor: pointer; +} + +.app-shell { + display: grid; + grid-template-columns: 300px minmax(0, 1fr); + min-height: 100vh; +} + +.sidebar { + position: sticky; + top: 0; + display: flex; + min-height: 100vh; + flex-direction: column; + gap: 1.5rem; + padding: 2rem 1.25rem; + border-right: 1px solid rgba(212, 222, 236, 0.75); + background: + radial-gradient(circle at top left, rgba(84, 120, 197, 0.14), transparent 34%), + linear-gradient(180deg, #0f1d34 0%, #152846 100%); + color: white; +} + +.sidebar__brand h1 { + margin: 0.5rem 0; + font-size: 1.55rem; + line-height: 1.15; +} + +.sidebar__brand p, +.sidebar__eyebrow { + color: rgba(224, 234, 255, 0.78); +} + +.sidebar__eyebrow, +.eyebrow { + text-transform: uppercase; + letter-spacing: 0.12em; + font-size: 0.75rem; + font-weight: 700; +} + +.sidebar__nav { + display: grid; + gap: 0.4rem; +} + +.sidebar__link { + border-radius: 14px; + padding: 0.9rem 1rem; + color: rgba(233, 239, 255, 0.88); + transition: 160ms ease; +} + +.sidebar__link:hover, +.sidebar__link--active { + background: rgba(255, 255, 255, 0.12); + color: white; + text-decoration: none; +} + +.app-main { + min-width: 0; + padding: 1.5rem; +} + +.page { + display: grid; + gap: 1.25rem; +} + +.page-header, +.filter-shell, +.table-shell, +.archive-card, +.detail-panel, +.finding-card, +.metric-card, +.empty-state { + border: 1px solid rgba(212, 222, 236, 0.9); + background: rgba(255, 255, 255, 0.92); + box-shadow: var(--shadow); + backdrop-filter: blur(10px); +} + +.page-header, +.table-shell, +.detail-panel, +.empty-state { + border-radius: 24px; + padding: 1.4rem; +} + +.page-header { + display: grid; + gap: 1rem; +} + +.page-header h1 { + margin: 0.35rem 0 0.5rem; + font-size: clamp(1.8rem, 2.3vw, 2.5rem); +} + +.page-header p { + margin: 0; + max-width: 72ch; + color: var(--ink-soft); +} + +.metric-strip { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); + gap: 0.9rem; +} + +.metric-card { + border-radius: 18px; + padding: 1rem 1.1rem; +} + +.metric-card span { + display: block; + margin-bottom: 0.4rem; + color: var(--ink-soft); + font-size: 0.82rem; + text-transform: uppercase; + letter-spacing: 0.08em; +} + +.metric-card strong { + display: block; + font-size: 1.05rem; + line-height: 1.3; +} + +.filter-shell { + position: sticky; + top: 1rem; + z-index: 10; + display: grid; + gap: 1rem; + border-radius: 24px; + padding: 1rem; +} + +.filter-form { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); + gap: 0.8rem; +} + +.field { + display: grid; + gap: 0.35rem; +} + +.field span { + font-size: 0.78rem; + font-weight: 700; + color: var(--ink-soft); + text-transform: uppercase; + letter-spacing: 0.07em; +} + +.field input, +.field select { + min-height: 42px; + border: 1px solid var(--line); + border-radius: 12px; + background: #fbfdff; + padding: 0.7rem 0.8rem; + color: var(--ink); +} + +.filter-form__actions { + display: flex; + align-items: flex-end; + gap: 0.8rem; +} + +.filter-form__actions button, +.empty-state__action button { + min-height: 42px; + border: 0; + border-radius: 12px; + background: var(--accent); + padding: 0.8rem 1rem; + color: white; + font-weight: 700; +} + +.filter-footer, +.saved-views, +.filter-chips, +.link-row { + display: flex; + flex-wrap: wrap; + gap: 0.7rem; +} + +.filter-footer { + justify-content: space-between; + align-items: center; +} + +.filter-chip, +.saved-view, +.status-chip { + display: inline-flex; + align-items: center; + border-radius: 999px; + padding: 0.5rem 0.8rem; + font-size: 0.85rem; +} + +.filter-chip { + background: var(--surface-muted); + color: var(--ink); +} + +.filter-chip--muted { + color: var(--ink-soft); +} + +.saved-view { + flex-direction: column; + align-items: flex-start; + gap: 0.2rem; + border: 1px solid var(--line); + border-radius: 16px; + padding: 0.75rem 0.9rem; + background: #f9fbff; + min-width: 190px; +} + +.saved-view span { + color: var(--ink-soft); + font-size: 0.82rem; +} + +.card-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); + gap: 1rem; +} + +.archive-card, +.finding-card { + border-radius: 22px; + padding: 1.15rem; +} + +.archive-card__header, +.finding-card__header { + display: flex; + justify-content: space-between; + gap: 1rem; + align-items: flex-start; +} + +.archive-card__header h2, +.finding-card__header h3 { + margin: 0; +} + +.archive-card__header p, +.finding-card__header p, +.subtle { + margin: 0.3rem 0 0; + color: var(--ink-soft); +} + +.archive-card__meta, +.detail-list { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 0.85rem; + margin: 1rem 0; +} + +.archive-card__meta dt, +.detail-list dt { + color: var(--ink-soft); + font-size: 0.82rem; +} + +.archive-card__meta dd, +.detail-list dd { + margin: 0.25rem 0 0; + font-weight: 700; +} + +.archive-card__footer { + display: flex; + justify-content: space-between; + align-items: center; + gap: 1rem; +} + +.table-shell { + overflow: auto; +} + +.data-table { + width: 100%; + border-collapse: collapse; + font-size: 0.95rem; +} + +.data-table th, +.data-table td { + border-bottom: 1px solid var(--line); + padding: 0.9rem 0.75rem; + text-align: left; + vertical-align: top; +} + +.data-table th { + color: var(--ink-soft); + text-transform: uppercase; + letter-spacing: 0.08em; + font-size: 0.77rem; +} + +.data-table tbody tr:hover { + background: rgba(222, 234, 252, 0.34); +} + +.status-chip { + font-weight: 700; +} + +.status-chip--validated { + background: var(--success-soft); + color: var(--success); +} + +.status-chip--partial { + background: #e3efff; + color: #245db4; +} + +.status-chip--community { + background: var(--warn-soft); + color: var(--warn); +} + +.status-chip--review { + background: var(--danger-soft); + color: var(--danger); +} + +.detail-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); + gap: 1rem; +} + +.detail-panel h2, +.stack h2 { + margin-top: 0; +} + +.detail-bullets { + margin: 0; + padding-left: 1.2rem; + display: grid; + gap: 0.7rem; +} + +.stack { + display: grid; + gap: 1rem; +} + +.finding-card__body { + display: grid; + gap: 0.75rem; + margin: 1rem 0; +} + +.finding-card__body p { + margin: 0; + color: var(--ink); +} + +.source-ledger { + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: 0.85rem; +} + +.source-ledger__column { + border-radius: 16px; + background: #f6f9fe; + padding: 0.9rem; +} + +.source-ledger__column h4 { + margin: 0 0 0.7rem; +} + +.source-ledger__column a { + display: grid; + gap: 0.3rem; + margin-bottom: 0.7rem; +} + +.empty-state { + border-radius: 24px; + padding: 2rem; + text-align: center; +} + +.empty-state h2 { + margin-top: 0; +} + +.empty-state p { + margin: 0 auto; + max-width: 56ch; + color: var(--ink-soft); +} + +.empty-state__action { + margin-top: 1rem; +} + +.code-block { + overflow: auto; + border-radius: 16px; + background: #0f1d34; + padding: 1rem; + color: #e5ecff; +} + +@media (max-width: 1100px) { + .app-shell { + grid-template-columns: 1fr; + } + + .sidebar { + position: static; + min-height: auto; + } + + .filter-shell { + top: 0; + } +} + +@media (max-width: 800px) { + .app-main { + padding: 1rem; + } + + .source-ledger { + grid-template-columns: 1fr; + } + + .archive-card__meta, + .detail-list { + grid-template-columns: 1fr; + } + + .archive-card__footer, + .filter-footer { + flex-direction: column; + align-items: flex-start; + } +} diff --git a/app/layout.tsx b/app/layout.tsx new file mode 100644 index 0000000..0b8c46f --- /dev/null +++ b/app/layout.tsx @@ -0,0 +1,17 @@ +import type { Metadata } from "next"; +import type { ReactNode } from "react"; + +import "./globals.css"; + +export const metadata: Metadata = { + title: "Competitor Research Dashboard", + description: "Local-first internal dashboard for historical competitor sweep reports." +}; + +export default function RootLayout({ children }: { children: ReactNode }) { + return ( + + {children} + + ); +} diff --git a/app/not-found.tsx b/app/not-found.tsx new file mode 100644 index 0000000..dee0ec2 --- /dev/null +++ b/app/not-found.tsx @@ -0,0 +1,10 @@ +export default function NotFound() { + return ( +
+
+

Page not found

+

The requested dashboard page does not exist.

+
+
+ ); +} diff --git a/app/page.tsx b/app/page.tsx new file mode 100644 index 0000000..c18ce3c --- /dev/null +++ b/app/page.tsx @@ -0,0 +1,5 @@ +import { redirect } from "next/navigation"; + +export default function HomePage() { + redirect("/research/dashboard"); +} diff --git a/app/research/competitors/[slug]/page.tsx b/app/research/competitors/[slug]/page.tsx new file mode 100644 index 0000000..6cfc95c --- /dev/null +++ b/app/research/competitors/[slug]/page.tsx @@ -0,0 +1,122 @@ +import Link from "next/link"; +import { notFound } from "next/navigation"; + +import { EmptyState } from "@/components/research/empty-state"; +import { StatusChip } from "@/components/research/status-chip"; +import { formatDate, formatDateTime, formatPercent } from "@/lib/competitor-dashboard/format"; +import { getCompetitorDetail, getDashboardContext } from "@/lib/competitor-dashboard/queries"; + +export default async function CompetitorDetailPage({ + params +}: { + params: { slug: string }; +}) { + const context = await getDashboardContext({}); + if (!context) { + return ( +
+ +
+ ); + } + + const detail = getCompetitorDetail(context, params.slug); + if (!detail) { + notFound(); + } + + return ( +
+
+
+ Competitor history +

{detail.competitor.name}

+

Compare multiple runs across time for the same competitor and review the newest findings first.

+
+
+
+ Reports + {detail.reports.length} +
+
+ Findings + {detail.findings.length} +
+
+ Last updated + {formatDateTime(context.data.lastSeededAt)} +
+
+
+ +
+

Run comparison

+ + + + + + + + + + + + + + {detail.reports.map((report) => ( + + + + + + + + + + ))} + +
Run IDGeneratedWindowFindingsValidationLatest movementArtifacts
+ {report.runId} + {formatDate(report.generatedAt)}{report.reportWindowLabel}{report.findingsCount}{formatPercent(report.validationCoverage)}{report.latestMovementFound ? "Found" : "Missing"} +
+ {report.artifacts.map((artifact) => ( + + {artifact.kind.toUpperCase()} + + ))} +
+
+
+ +
+

Recent finding log

+ {detail.findings.map((finding) => ( +
+
+
+

{finding.claim}

+

{formatDateTime(finding.createdAt)}

+
+ +
+
+

+ Supporting details: {finding.supportingDetails} +

+

+ Why it matters: {finding.whyItMatters} +

+

+ CodeRabbit comparison: {finding.codeRabbitComparison} +

+
+
+ ))} +
+
+ ); +} diff --git a/app/research/competitors/page.tsx b/app/research/competitors/page.tsx new file mode 100644 index 0000000..65c7a17 --- /dev/null +++ b/app/research/competitors/page.tsx @@ -0,0 +1,76 @@ +import Link from "next/link"; + +import { EmptyState } from "@/components/research/empty-state"; +import { formatDate, formatDateTime } from "@/lib/competitor-dashboard/format"; +import { buildCompetitorSummary, getDashboardContext } from "@/lib/competitor-dashboard/queries"; + +export const dynamic = "force-dynamic"; + +export default async function CompetitorsPage() { + const context = await getDashboardContext({}); + + if (!context) { + return ( +
+ +
+ ); + } + + const summaries = buildCompetitorSummary(context); + + return ( +
+
+
+ Competitors +

Competitor report entities

+

Each competitor is tracked as a separate report entity across sweep runs.

+
+
+
+ Competitors + {summaries.length} +
+
+ Last updated + {formatDateTime(context.data.lastSeededAt)} +
+
+
+ +
+ {summaries.map((summary) => ( +
+
+
+

{summary.competitor.name}

+

{summary.competitor.vendor}

+
+
+
+
+
Reports
+
{summary.reports}
+
+
+
Findings
+
{summary.findings}
+
+
+
Latest report
+
{summary.latestReport ? formatDate(summary.latestReport.generatedAt) : "Not available"}
+
+
+
+ Open competitor history +
+
+ ))} +
+
+ ); +} diff --git a/app/research/dashboard/page.tsx b/app/research/dashboard/page.tsx new file mode 100644 index 0000000..fb3b133 --- /dev/null +++ b/app/research/dashboard/page.tsx @@ -0,0 +1,174 @@ +import Link from "next/link"; + +import { EmptyState } from "@/components/research/empty-state"; +import { FilterForm } from "@/components/research/filter-form"; +import { StatusChip } from "@/components/research/status-chip"; +import { formatDate, formatDateTime, formatPercent } from "@/lib/competitor-dashboard/format"; +import { buildReportRows, buildRunsSummary, getDashboardContext } from "@/lib/competitor-dashboard/queries"; + +export default async function DashboardPage({ + searchParams +}: { + searchParams: Record; +}) { + const context = await getDashboardContext(searchParams); + + if (!context) { + return ( +
+ +
+ ); + } + + const reports = buildReportRows(context); + const runs = buildRunsSummary(context); + const latestReport = reports[0]; + const totalFindings = reports.reduce((total, report) => total + report.findingsCount, 0); + const cardsView = context.filters.view === "cards"; + + return ( +
+
+
+ Archive dashboard +

Historical competitor sweep reports

+

+ Review separate competitor report entities across time, filter the archive, and open detail + pages with finding logs, source ledgers, and artifact downloads. +

+
+
+
+ Reports + {reports.length} +
+
+ Findings + {totalFindings} +
+
+ Last updated + {formatDateTime(context.data.lastSeededAt)} +
+
+ Latest run + {latestReport ? formatDate(latestReport.generatedAt) : "Not available"} +
+
+
+ + ({ + id: competitor.id, + name: competitor.name + }))} + runs={runs.map((run) => ({ id: run.id, label: run.id }))} + savedViews={context.data.savedViews} + /> + + {cardsView ? ( +
+ {reports.map((report) => ( +
+
+
+

{report.competitor.name}

+

{report.runId}

+
+ finding.reportId === report.id)?.validationStatus ?? + "needs_review" + } + /> +
+
+
+
Run date
+
{formatDate(report.sweepRunDate)}
+
+
+
Window
+
{report.reportWindowLabel}
+
+
+
Findings
+
{report.findingsCount}
+
+
+
Newest finding
+
{formatDate(report.newestFindingDate)}
+
+
+
Validation
+
{formatPercent(report.validationCoverage)}
+
+
+
Latest movement
+
{report.latestMovementFound ? "Found" : "Missing"}
+
+
+
+ Open report +
+ {report.artifacts.map((artifact) => ( + + {artifact.kind.toUpperCase()} + + ))} +
+
+
+ ))} +
+ ) : ( +
+ + + + + + + + + + + + + + + {reports.map((report) => ( + + + + + + + + + + + ))} + +
CompetitorRun dateWindowFindingsNewest findingValidationLatest movementArtifacts
+ {report.competitor.name} +
{report.runId}
+
{formatDate(report.sweepRunDate)}{report.reportWindowLabel}{report.findingsCount}{formatDate(report.newestFindingDate)}{formatPercent(report.validationCoverage)}{report.latestMovementFound ? "Found" : "Missing"} +
+ {report.artifacts.map((artifact) => ( + + {artifact.kind.toUpperCase()} + + ))} +
+
+
+ )} +
+ ); +} diff --git a/app/research/error.tsx b/app/research/error.tsx new file mode 100644 index 0000000..6c5fa74 --- /dev/null +++ b/app/research/error.tsx @@ -0,0 +1,23 @@ +"use client"; + +export default function ResearchError({ + error, + reset +}: { + error: Error; + reset: () => void; +}) { + return ( +
+
+

Dashboard error

+

{error.message}

+
+ +
+
+
+ ); +} diff --git a/app/research/findings/page.tsx b/app/research/findings/page.tsx new file mode 100644 index 0000000..2dcc7cd --- /dev/null +++ b/app/research/findings/page.tsx @@ -0,0 +1,76 @@ +import Link from "next/link"; + +import { EmptyState } from "@/components/research/empty-state"; +import { FilterForm } from "@/components/research/filter-form"; +import { StatusChip } from "@/components/research/status-chip"; +import { formatDateTime } from "@/lib/competitor-dashboard/format"; +import { buildFindings, buildRunsSummary, getDashboardContext } from "@/lib/competitor-dashboard/queries"; + +export default async function FindingsPage({ + searchParams +}: { + searchParams: Record; +}) { + const context = await getDashboardContext(searchParams); + if (!context) { + return ( +
+ +
+ ); + } + + const findings = buildFindings(context); + const runs = buildRunsSummary(context); + + return ( +
+
+
+ Findings +

Finding log

+

Search across findings, compare validation state, and jump into detailed competitor reports.

+
+
+ + ({ + id: competitor.id, + name: competitor.name + }))} + runs={runs.map((run) => ({ id: run.id, label: run.id }))} + savedViews={context.data.savedViews} + showViewToggle={false} + /> + +
+ {findings.map((finding) => ( +
+
+
+

{finding.claim}

+

+ {finding.competitor.name} · {formatDateTime(finding.createdAt)} ·{" "} + {finding.report.runId} +

+
+ +
+
+

+ Supporting details: {finding.supportingDetails} +

+

+ Why it matters: {finding.whyItMatters} +

+

+ CodeRabbit comparison: {finding.codeRabbitComparison} +

+
+
+ ))} +
+
+ ); +} diff --git a/app/research/layout.tsx b/app/research/layout.tsx new file mode 100644 index 0000000..a041959 --- /dev/null +++ b/app/research/layout.tsx @@ -0,0 +1,12 @@ +import type { ReactNode } from "react"; + +import { Sidebar } from "@/components/research/sidebar"; + +export default function ResearchLayout({ children }: { children: ReactNode }) { + return ( +
+ +
{children}
+
+ ); +} diff --git a/app/research/reports/[reportId]/page.tsx b/app/research/reports/[reportId]/page.tsx new file mode 100644 index 0000000..19d3585 --- /dev/null +++ b/app/research/reports/[reportId]/page.tsx @@ -0,0 +1,150 @@ +import Link from "next/link"; +import { notFound } from "next/navigation"; + +import { EmptyState } from "@/components/research/empty-state"; +import { StatusChip } from "@/components/research/status-chip"; +import { formatDate, formatDateTime, formatPercent } from "@/lib/competitor-dashboard/format"; +import { getDashboardContext, getReportDetail } from "@/lib/competitor-dashboard/queries"; + +export default async function ReportDetailPage({ + params +}: { + params: { reportId: string }; +}) { + const context = await getDashboardContext({}); + if (!context) { + return ( +
+ +
+ ); + } + + const detail = getReportDetail(context, params.reportId); + if (!detail) { + notFound(); + } + + return ( +
+
+
+ Competitor report +

{detail.competitor.name}

+

{detail.report.summary}

+
+
+
+ Generated at + {formatDateTime(detail.report.generatedAt)} +
+
+ Window + {detail.report.reportWindowLabel} +
+
+ Validation + {formatPercent(detail.report.validationCoverage)} +
+
+
+ +
+
+

Report metadata

+
+
+
Run ID
+
{detail.report.runId}
+
+
+
Sweep run date
+
{formatDate(detail.report.sweepRunDate)}
+
+
+
Newest finding date
+
{formatDate(detail.report.newestFindingDate)}
+
+
+
Latest changelog movement
+
{detail.report.latestMovementFound ? "Found" : "Missing"}
+
+
+
Artifacts
+
+ {detail.artifacts.map((artifact) => ( + + {artifact.kind.toUpperCase()} + + ))} +
+
+
+
+ +
+

Source coverage

+
+
+
Level 1
+
{detail.report.sourceCoverage.level1}
+
+
+
Level 2
+
{detail.report.sourceCoverage.level2}
+
+
+
Level 3
+
{detail.report.sourceCoverage.level3}
+
+
+
+
+ +
+

Recent finding log

+ {detail.findings.map((finding) => ( +
+
+
+

{finding.claim}

+

{formatDateTime(finding.createdAt)}

+
+ +
+
+

+ Supporting details: {finding.supportingDetails} +

+

+ Why it matters: {finding.whyItMatters} +

+

+ CodeRabbit comparison: {finding.codeRabbitComparison} +

+
+
+ {[1, 2, 3].map((level) => { + const levelSources = finding.sources.filter((source) => source.level === level); + return ( +
+

Level {level}

+ {levelSources.map((source) => ( + + {source.title} + {source.excerpt} + + ))} +
+ ); + })} +
+
+ ))} +
+
+ ); +} diff --git a/app/research/runs/page.tsx b/app/research/runs/page.tsx new file mode 100644 index 0000000..cac2182 --- /dev/null +++ b/app/research/runs/page.tsx @@ -0,0 +1,58 @@ +import { EmptyState } from "@/components/research/empty-state"; +import { formatDateTime } from "@/lib/competitor-dashboard/format"; +import { buildRunsSummary, getDashboardContext } from "@/lib/competitor-dashboard/queries"; + +export const dynamic = "force-dynamic"; + +export default async function RunsPage() { + const context = await getDashboardContext({}); + if (!context) { + return ( +
+ +
+ ); + } + + const runs = buildRunsSummary(context); + + return ( +
+
+
+ Runs +

Sweep runs

+

One sweep run produces multiple competitor-specific report records that remain preserved over time.

+
+
+ +
+ + + + + + + + + + + + {runs.map((run) => ( + + + + + + + + ))} + +
Run IDGeneratedWindowReportsFindings
{run.id}{formatDateTime(run.generatedAt)}{run.reportWindowLabel}{run.reportCount}{run.findingsCount}
+
+
+ ); +} diff --git a/app/research/settings/page.tsx b/app/research/settings/page.tsx new file mode 100644 index 0000000..26d810f --- /dev/null +++ b/app/research/settings/page.tsx @@ -0,0 +1,62 @@ +import { EmptyState } from "@/components/research/empty-state"; +import { formatDateTime } from "@/lib/competitor-dashboard/format"; +import { getDashboardContext } from "@/lib/competitor-dashboard/queries"; + +export const dynamic = "force-dynamic"; + +export default async function SettingsPage() { + const context = await getDashboardContext({}); + if (!context) { + return ( +
+ +
+ ); + } + + return ( +
+
+
+ Settings and docs +

Access, purpose, and local operations

+

Everything needed to run the local dashboard, understand its purpose, and keep the seeded archive current.

+
+
+ +
+
+

Access and purpose

+
    +
  • Run `npm install`, then `npm run seed`, then `npm run dev` from the repo root.
  • +
  • Open `/research/dashboard` for the archive home and `/research/settings` for operator notes.
  • +
  • The dashboard preserves separate competitor report entities across sweep runs instead of merging them.
  • +
  • Last seeded at: {formatDateTime(context.data.lastSeededAt)}
  • +
+
+ +
+

SE use cases

+
    +
  • Prep demos by pulling the newest validated competitor movement before a call.
  • +
  • Compare multiple runs for the same competitor to spot repeated claims or product shifts.
  • +
  • Download PDF and PNG artifacts for fast internal briefing or call prep.
  • +
  • Use findings and source filters to isolate official evidence or community-signal gaps.
  • +
+
+
+ +
+
+

Local commands

+
{`npm install\nnpm run seed\nnpm run dev\nnpm run build`}
+
+ +
+

Docs

+
{`README.md\ndocs/competitor_research_dashboard.md\ndocs/migration-notes.md`}
+
+
+
+ ); +} diff --git a/app/research/sources/page.tsx b/app/research/sources/page.tsx new file mode 100644 index 0000000..de2e343 --- /dev/null +++ b/app/research/sources/page.tsx @@ -0,0 +1,75 @@ +import { EmptyState } from "@/components/research/empty-state"; +import { FilterForm } from "@/components/research/filter-form"; +import { formatDateTime } from "@/lib/competitor-dashboard/format"; +import { buildRunsSummary, buildSources, getDashboardContext } from "@/lib/competitor-dashboard/queries"; + +export default async function SourcesPage({ + searchParams +}: { + searchParams: Record; +}) { + const context = await getDashboardContext(searchParams); + if (!context) { + return ( +
+ +
+ ); + } + + const sources = buildSources(context); + const runs = buildRunsSummary(context); + + return ( +
+
+
+ Sources +

Source ledger

+

Filter the evidence ledger by competitor, validation state, source level, and time window.

+
+
+ + ({ + id: competitor.id, + name: competitor.name + }))} + runs={runs.map((run) => ({ id: run.id, label: run.id }))} + savedViews={context.data.savedViews} + showViewToggle={false} + /> + +
+ + + + + + + + + + + + {sources.map((source) => ( + + + + + + + + ))} + +
SourceCompetitorLevelPublishedRun
+ + {source.title} + +
{source.excerpt}
+
{source.competitor.name}Level {source.level}{formatDateTime(source.publishedAt)}{source.report.runId}
+
+
+ ); +} diff --git a/components/research/empty-state.tsx b/components/research/empty-state.tsx new file mode 100644 index 0000000..9f8c0b6 --- /dev/null +++ b/components/research/empty-state.tsx @@ -0,0 +1,19 @@ +import type { ReactNode } from "react"; + +export function EmptyState({ + title, + description, + action +}: { + title: string; + description: string; + action?: ReactNode; +}) { + return ( +
+

{title}

+

{description}

+ {action ?
{action}
: null} +
+ ); +} diff --git a/components/research/filter-form.tsx b/components/research/filter-form.tsx new file mode 100644 index 0000000..16ff6d3 --- /dev/null +++ b/components/research/filter-form.tsx @@ -0,0 +1,173 @@ +import Link from "next/link"; + +import { DATE_PRESETS, HISTORY_BANDS } from "@/lib/competitor-dashboard/constants"; +import { filtersToSearchParams } from "@/lib/competitor-dashboard/filters"; +import type { DashboardFilters } from "@/lib/competitor-dashboard/types"; + +interface FilterFormProps { + filters: DashboardFilters; + competitors: Array<{ id: string; name: string }>; + runs: Array<{ id: string; label: string }>; + savedViews?: Array<{ id: string; name: string; description: string; params: Record }>; + enableSearch?: boolean; + showViewToggle?: boolean; +} + +export function FilterForm({ + filters, + competitors, + runs, + savedViews = [], + enableSearch = true, + showViewToggle = true +}: FilterFormProps) { + const activeEntries = Object.entries(filters).filter(([, value]) => value); + + return ( +
+
+ {enableSearch ? ( + + ) : null} + + + + + + + + + + + + + + + + + + + + {showViewToggle ? ( + + ) : null} + +
+ + Reset +
+
+ +
+
+ {activeEntries.length ? ( + activeEntries.map(([key, value]) => ( + + {key}: {value} + + )) + ) : ( + No filters applied + )} +
+ + {savedViews.length ? ( +
+ {savedViews.map((view) => { + const params = filtersToSearchParams({ ...filters, ...view.params }); + return ( + + {view.name} + {view.description} + + ); + })} +
+ ) : null} +
+
+ ); +} + +function isoDate(value?: string): string | undefined { + return value ? value.slice(0, 10) : undefined; +} diff --git a/components/research/sidebar.tsx b/components/research/sidebar.tsx new file mode 100644 index 0000000..3033cee --- /dev/null +++ b/components/research/sidebar.tsx @@ -0,0 +1,41 @@ +"use client"; + +import Link from "next/link"; +import { usePathname } from "next/navigation"; + +const navItems = [ + { href: "/research/dashboard", label: "Dashboard" }, + { href: "/research/competitors", label: "Competitors" }, + { href: "/research/runs", label: "Runs" }, + { href: "/research/findings", label: "Findings" }, + { href: "/research/sources", label: "Sources" }, + { href: "/research/settings", label: "Settings" } +]; + +export function Sidebar() { + const pathname = usePathname(); + + return ( + + ); +} diff --git a/components/research/status-chip.tsx b/components/research/status-chip.tsx new file mode 100644 index 0000000..56966c7 --- /dev/null +++ b/components/research/status-chip.tsx @@ -0,0 +1,13 @@ +import { validationLabel } from "@/lib/competitor-dashboard/format"; +import type { ValidationStatus } from "@/lib/competitor-dashboard/types"; + +const toneClassName: Record = { + validated: "status-chip status-chip--validated", + partially_validated: "status-chip status-chip--partial", + community_signal: "status-chip status-chip--community", + needs_review: "status-chip status-chip--review" +}; + +export function StatusChip({ status }: { status: ValidationStatus }) { + return {validationLabel(status)}; +} diff --git a/data/.gitkeep b/data/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/data/.gitkeep @@ -0,0 +1 @@ + diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 1257edb..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -version: "3.9" - -services: - api: - build: - context: "." - ports: - - "5000:5000" - environment: - - DEBUG_MODE=True - volumes: - - ".:/app" - init: true diff --git a/docs/competitor_research_dashboard.md b/docs/competitor_research_dashboard.md new file mode 100644 index 0000000..aa083f1 --- /dev/null +++ b/docs/competitor_research_dashboard.md @@ -0,0 +1,186 @@ +# Competitor Research Dashboard + +## Purpose + +The Competitor Research Dashboard is a local-first internal archive for historical competitor sweep reports. + +It is designed to help teams: + +- review what was pulled across time +- browse separate competitor report entities per sweep run +- find the newest validated competitor movement quickly +- compare multiple runs for the same competitor +- download report artifacts for internal prep + +Each sweep run creates separate competitor reports for: + +- GitHub Copilot +- Cursor / Bugbot +- Qodo +- Greptile +- Gemini Code Assist +- Claude Code / Anthropic +- Cubic + +Reports are preserved over time and are never overwritten. + +## Access + +From the repo root: + +```bash +npm install +npm run seed +npm run dev +``` + +Then open: + +- `http://localhost:3000/research/dashboard` + +Useful companion routes: + +- `http://localhost:3000/research/settings` +- `http://localhost:3000/api/health` + +## What users can do + +### Dashboard + +The archive home supports: + +- recent-first sorting +- sticky filters that stay visible while browsing +- shareable URL state +- table or card view +- saved views for common slices + +Filters include: + +- competitor +- date preset: 7, 30, 49, 60, 90 days +- custom date range +- source level +- validation status +- report run ID +- history band +- latest changelog movement found or missing +- free-text search + +### Competitor history + +The competitor detail page lets users: + +- inspect all runs for one competitor +- compare report windows across time +- review the most recent findings first + +### Report detail + +Each report page shows: + +- competitor name +- sweep run date +- report window used +- number of findings +- newest finding date +- validation coverage +- latest changelog movement found or missing +- PDF and PNG artifact downloads +- recent finding log +- source ledger grouped into Level 1, Level 2, and Level 3 + +### Findings and sources + +The findings and sources pages support: + +- quick search +- filtered review +- validation-focused triage +- source-level browsing + +## SE use cases + +Sales Engineers can use this dashboard to prep for demos and stay current on competitor movement without digging through raw sweep outputs. + +### Before a demo + +Use the dashboard to: + +- open the latest report for the competitor most likely to come up on the call +- filter to the last 30 days +- focus on validated or partially validated findings +- download the PDF or PNG artifact for a quick internal brief + +### During objection handling prep + +Use the findings view to: + +- search by competitor or feature area +- isolate community-signal items that still need stronger proof +- identify where CodeRabbit comparison language is already captured + +### For historical comparisons + +Use competitor detail pages to: + +- compare multiple runs for the same competitor +- see whether messaging or product movement is new or recurring +- understand whether a claim is supported by official evidence or weaker sources + +### For quick internal handoff + +Use artifact links to: + +- share a seeded PDF summary +- share a PNG preview +- give a teammate a concrete report page URL with filters preserved in the query string + +## Recommended SE workflow + +1. Open `/research/dashboard`. +2. Apply a competitor filter and a recent date preset. +3. Check whether latest changelog movement was found. +4. Open the report detail page. +5. Review the newest findings first. +6. Use the source ledger to distinguish official evidence from weaker community signals. +7. Download the PDF or PNG artifact if you need a quick internal shareable asset. + +## Data and artifact locations + +Local dashboard data: + +- `data/competitor-dashboard.json` + +Generated artifacts: + +- `outputs/competitor-dashboard-artifacts` + +Both locations are configurable through `.env.example` and default to repo-root-relative paths. + +## How new sweep outputs get inserted + +The current implementation ships with a local TypeScript seed flow for demo and development use. + +`npm run seed`: + +- builds the local dashboard dataset +- creates sweep runs +- creates separate competitor reports per run +- creates findings, sources, and validation flags +- generates PDF and PNG artifacts +- writes the final dataset to `data/competitor-dashboard.json` + +The app reads that local dataset directly at runtime through the shared TypeScript data layer. + +## Reliability goals of this rewrite + +This version intentionally removes: + +- Python version drift +- pip install failures +- Flask dependency churn +- ddtrace build/install issues +- absolute-path output bugs + +The goal is a local workflow that works with standard Node tooling only. diff --git a/docs/migration-notes.md b/docs/migration-notes.md new file mode 100644 index 0000000..692f025 --- /dev/null +++ b/docs/migration-notes.md @@ -0,0 +1,102 @@ +# Migration Notes + +## Summary + +The old Flask + Python dashboard has been replaced with a Next.js + TypeScript implementation. + +This migration focuses on: + +- simpler local setup +- Node-only tooling +- repo-root-relative file handling +- preserved competitor dashboard product intent + +## Old to new mapping + +### Runtime + +- Old: Flask app in `app.py` +- New: Next.js App Router under `app/` + +### Server routes + +- Old: Flask routes in `routes/competitor_dashboard.py` +- New: Next route handlers in `app/api/**` + +### Templates and styling + +- Old: Jinja templates under `templates/research/**` and CSS under `static/competitor_dashboard.css` +- New: App Router pages under `app/research/**` and shared styling in `app/globals.css` + +### Data access + +- Old: Python service layer in `services/competitor_dashboard_db.py` +- New: TypeScript data layer in `lib/competitor-dashboard/store.ts` and `lib/competitor-dashboard/queries.ts` + +### Seed and bootstrap flow + +- Old: Python scripts `scripts/bootstrap_competitor_dashboard.py` and `scripts/ingest_competitor_sweep.py` +- New: TypeScript seed/bootstrap flow in `scripts/seed.ts` + +### Artifact generation + +- Old: Python PDF/PNG generation via reportlab and PIL-style tooling +- New: TypeScript/Node generation via: + - `pdf-lib` for PDFs + - `pngjs` for PNG previews + +### Persistence + +- Old: SQLite via Python +- New: local JSON data file at `data/competitor-dashboard.json` + +## Why JSON storage was chosen + +SQLite remains a valid option, but JSON was chosen for this rewrite because the top migration goal was local reliability with minimal setup friction. + +Benefits for this use case: + +- no native database setup +- no platform-specific binary issues +- easy inspection of seeded data +- simple Node-only local workflow + +If the dashboard later needs concurrent writes or shared multi-user hosting, the data layer can be swapped behind the existing query helpers. + +## Current TypeScript project structure + +- `app/`: App Router pages and API route handlers +- `components/research/`: shared dashboard UI components +- `lib/competitor-dashboard/`: local data model, filters, formatting, artifact generation, and queries +- `scripts/seed.ts`: seed/bootstrap flow +- `data/`: local JSON store +- `outputs/competitor-dashboard-artifacts/`: generated artifacts + +## Removed Python-specific pain points + +The new implementation eliminates these prior issues: + +- Python version incompatibilities +- pip dependency failures +- virtualenv churn +- Flask dependency churn +- ddtrace build/install failures +- absolute path bugs for generated outputs + +## Local run commands + +```bash +npm install +npm run seed +npm run dev +``` + +## Healthcheck + +The healthcheck endpoint is: + +```text +/api/health +``` + +It reports whether the local data file and artifact root are available. diff --git a/kube-manifest-fe.yml b/kube-manifest-fe.yml deleted file mode 100644 index 33ad363..0000000 --- a/kube-manifest-fe.yml +++ /dev/null @@ -1,53 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: flask-test -spec: - selector: - matchLabels: - run: flask-test - replicas: 2 - template: - metadata: - labels: - run: flask-test - spec: - securityContext: - runAsNonRoot: true - runAsUser: 1000 # Specify the UID of a non-root user - imagePullSecrets: - - name: regcred - containers: - - name: flask-test - image: cohenaj194/flask-test - ports: - - containerPort: 5000 - # Datadog APM - env: - - name: DD_AGENT_HOST - valueFrom: - fieldRef: - fieldPath: status.hostIP - - name: DD_ENV - value: "production" - - name: DD_SERVICE - value: "flask-test" - - name: DD_VERSION - value: "1.0" - - name: DD_LOGS_INJECTION - value: "true" - - name: DD_PROFILING_ENABLED - value: "true" ---- -apiVersion: v1 -kind: Service -metadata: - name: http-lb-flask -spec: - selector: - run: flask-test - ports: - - port: 80 - targetPort: 5000 - type: LoadBalancer - diff --git a/lib/competitor-dashboard/artifacts.ts b/lib/competitor-dashboard/artifacts.ts new file mode 100644 index 0000000..5d81efe --- /dev/null +++ b/lib/competitor-dashboard/artifacts.ts @@ -0,0 +1,184 @@ +import fs from "node:fs/promises"; +import path from "node:path"; + +import { PDFDocument, StandardFonts, rgb } from "pdf-lib"; +import { PNG } from "pngjs"; + +import { artifactRootPath, toRepoRelative } from "@/lib/competitor-dashboard/paths"; +import type { + Artifact, + Competitor, + CompetitorReport, + Finding, + SweepRun +} from "@/lib/competitor-dashboard/types"; + +export async function ensureArtifactRoot(): Promise { + const root = artifactRootPath(); + await fs.mkdir(root, { recursive: true }); + return root; +} + +export async function writeReportArtifacts(input: { + artifactPdf: Artifact; + artifactPng: Artifact; + competitor: Competitor; + report: CompetitorReport; + run: SweepRun; + findings: Finding[]; +}): Promise<{ pdfRelativePath: string; pngRelativePath: string }> { + const root = await ensureArtifactRoot(); + const pdfPath = path.join(root, input.artifactPdf.title); + const pngPath = path.join(root, input.artifactPng.title); + + await Promise.all([ + writePdfArtifact(pdfPath, input.competitor, input.report, input.run, input.findings), + writePngArtifact(pngPath, input.competitor, input.report) + ]); + + return { + pdfRelativePath: toRepoRelative(pdfPath), + pngRelativePath: toRepoRelative(pngPath) + }; +} + +async function writePdfArtifact( + filePath: string, + competitor: Competitor, + report: CompetitorReport, + run: SweepRun, + findings: Finding[] +): Promise { + const pdf = await PDFDocument.create(); + const page = pdf.addPage([612, 792]); + const font = await pdf.embedFont(StandardFonts.Helvetica); + const boldFont = await pdf.embedFont(StandardFonts.HelveticaBold); + + page.drawRectangle({ x: 0, y: 732, width: 612, height: 60, color: rgb(0.08, 0.12, 0.2) }); + page.drawText("Competitor Research Dashboard", { + x: 36, + y: 760, + font: boldFont, + size: 20, + color: rgb(1, 1, 1) + }); + page.drawText(competitor.name, { + x: 36, + y: 738, + font, + size: 12, + color: rgb(0.82, 0.88, 1) + }); + + let y = 700; + const lines = [ + `Run: ${run.label} (${run.reportWindowLabel})`, + `Report generated at: ${report.generatedAt}`, + `Validation coverage: ${report.validationCoverage}%`, + `Latest changelog movement found: ${report.latestMovementFound ? "Yes" : "No"}`, + `Summary: ${report.summary}` + ]; + + for (const line of lines) { + page.drawText(line, { x: 36, y, font, size: 11, color: rgb(0.12, 0.14, 0.18) }); + y -= 22; + } + + y -= 6; + page.drawText("Recent findings", { + x: 36, + y, + font: boldFont, + size: 14, + color: rgb(0.1, 0.14, 0.24) + }); + y -= 24; + + for (const finding of findings.slice(0, 4)) { + const block = [ + `Claim: ${finding.claim}`, + `Why it matters: ${finding.whyItMatters}`, + `CodeRabbit comparison: ${finding.codeRabbitComparison}` + ]; + + for (const line of block) { + page.drawText(trimLine(line, 96), { + x: 48, + y, + font, + size: 10, + color: rgb(0.18, 0.2, 0.25) + }); + y -= 18; + } + + y -= 8; + if (y < 80) { + break; + } + } + + await fs.writeFile(filePath, await pdf.save()); +} + +async function writePngArtifact( + filePath: string, + competitor: Competitor, + report: CompetitorReport +): Promise { + const width = 1280; + const height = 720; + const png = new PNG({ width, height }); + + for (let y = 0; y < height; y += 1) { + for (let x = 0; x < width; x += 1) { + const idx = (width * y + x) << 2; + const stripe = Math.floor(x / 180) % 3; + png.data[idx] = stripe === 0 ? 13 : stripe === 1 ? 21 : 32; + png.data[idx + 1] = stripe === 0 ? 21 : stripe === 1 ? 33 : 47; + png.data[idx + 2] = stripe === 0 ? 39 : stripe === 1 ? 52 : 67; + png.data[idx + 3] = 255; + } + } + + drawPanel(png, 48, 48, 1184, 624, [243, 247, 252]); + drawPanel(png, 80, 92, 480, 76, [26, 39, 63]); + drawPanel(png, 80, 200, 320, 160, [224, 233, 246]); + drawPanel(png, 430, 200, 320, 160, [224, 233, 246]); + drawPanel(png, 780, 200, 420, 330, [224, 233, 246]); + drawPanel(png, 80, 390, 670, 140, [233, 239, 248]); + drawPanel(png, 80, 560, 1120, 70, report.latestMovementFound ? [208, 238, 223] : [248, 224, 224]); + + const bannerColor: [number, number, number] = report.latestMovementFound + ? [20, 133, 79] + : [166, 54, 64]; + drawPanel(png, 850, 92, 260, 76, bannerColor); + + await fs.writeFile(filePath, PNG.sync.write(png)); + + // The preview is intentionally lightweight and text-free to avoid native dependencies. + void competitor; +} + +function drawPanel( + png: PNG, + xStart: number, + yStart: number, + width: number, + height: number, + color: [number, number, number] +): void { + for (let y = yStart; y < yStart + height; y += 1) { + for (let x = xStart; x < xStart + width; x += 1) { + const idx = (png.width * y + x) << 2; + png.data[idx] = color[0]; + png.data[idx + 1] = color[1]; + png.data[idx + 2] = color[2]; + png.data[idx + 3] = 255; + } + } +} + +function trimLine(line: string, limit: number): string { + return line.length <= limit ? line : `${line.slice(0, limit - 3)}...`; +} diff --git a/lib/competitor-dashboard/constants.ts b/lib/competitor-dashboard/constants.ts new file mode 100644 index 0000000..d857a9e --- /dev/null +++ b/lib/competitor-dashboard/constants.ts @@ -0,0 +1,108 @@ +import type { Competitor, SavedView, ValidationStatus } from "@/lib/competitor-dashboard/types"; + +export const COMPETITORS: Competitor[] = [ + { + id: "github-copilot", + slug: "github-copilot", + name: "GitHub Copilot", + shortName: "Copilot", + vendor: "GitHub", + category: "Code assistant" + }, + { + id: "cursor-bugbot", + slug: "cursor-bugbot", + name: "Cursor / Bugbot", + shortName: "Cursor", + vendor: "Cursor", + category: "IDE + review workflow" + }, + { + id: "qodo", + slug: "qodo", + name: "Qodo", + shortName: "Qodo", + vendor: "Qodo", + category: "Code quality" + }, + { + id: "greptile", + slug: "greptile", + name: "Greptile", + shortName: "Greptile", + vendor: "Greptile", + category: "PR review" + }, + { + id: "gemini-code-assist", + slug: "gemini-code-assist", + name: "Gemini Code Assist", + shortName: "Gemini", + vendor: "Google", + category: "Code assistant" + }, + { + id: "claude-code-anthropic", + slug: "claude-code-anthropic", + name: "Claude Code / Anthropic", + shortName: "Claude Code", + vendor: "Anthropic", + category: "Agentic coding" + }, + { + id: "cubic", + slug: "cubic", + name: "Cubic", + shortName: "Cubic", + vendor: "Cubic", + category: "Developer tooling" + } +]; + +export const VALIDATION_STATUS_LABELS: Record = { + validated: "Validated", + partially_validated: "Partially Validated", + community_signal: "Community Signal", + needs_review: "Needs Review" +}; + +export const DATE_PRESETS = [7, 30, 49, 60, 90]; + +export const HISTORY_BANDS = [ + { value: "0-30", label: "0-30 days" }, + { value: "30-49", label: "30-49 days" }, + { value: "49-90", label: "49-90 days" } +]; + +export const SAVED_VIEWS: SavedView[] = [ + { + id: "last-30-days", + name: "Last 30 days", + description: "Recent archive view for current competitive movement.", + params: { preset: "30" } + }, + { + id: "30-49-days", + name: "30-49 days", + description: "Reports old enough to compare against current claims.", + params: { historyBand: "30-49" } + }, + { + id: "missing-latest-changelog", + name: "Missing latest changelog", + description: "Reports that still need official product movement confirmation.", + params: { latestMovement: "missing" } + }, + { + id: "community-signal-only", + name: "Community-signal only", + description: "Items that still rely on weaker evidence.", + params: { validationStatus: "community_signal" } + } +]; + +export const LEVEL_LABELS = { + 1: "Level 1", + 2: "Level 2", + 3: "Level 3" +} as const; diff --git a/lib/competitor-dashboard/filters.ts b/lib/competitor-dashboard/filters.ts new file mode 100644 index 0000000..7a494f3 --- /dev/null +++ b/lib/competitor-dashboard/filters.ts @@ -0,0 +1,109 @@ +import { DATE_PRESETS } from "@/lib/competitor-dashboard/constants"; +import type { DashboardFilters, ResolvedDateRange } from "@/lib/competitor-dashboard/types"; + +export function normalizeFilters( + searchParams: + | URLSearchParams + | DashboardFilters + | Record + | Readonly> +): DashboardFilters { + const getValue = (key: string): string | undefined => { + if (searchParams instanceof URLSearchParams) { + return searchParams.get(key) ?? undefined; + } + + const value = (searchParams as Record)[key]; + return Array.isArray(value) ? value[0] : value; + }; + + return { + q: getValue("q")?.trim() || undefined, + competitor: getValue("competitor") || undefined, + preset: getValue("preset") || undefined, + start: getValue("start") || undefined, + end: getValue("end") || undefined, + sourceLevel: getValue("sourceLevel") || undefined, + validationStatus: getValue("validationStatus") || undefined, + reportRunId: getValue("reportRunId") || undefined, + historyBand: getValue("historyBand") || undefined, + latestMovement: getValue("latestMovement") || undefined, + view: getValue("view") || undefined + }; +} + +export function filtersToSearchParams(filters: DashboardFilters): URLSearchParams { + const params = new URLSearchParams(); + + for (const [key, value] of Object.entries(filters)) { + if (value) { + params.set(key, value); + } + } + + return params; +} + +export function resolveDateRange( + filters: DashboardFilters, + referenceIso: string +): ResolvedDateRange { + if (filters.start || filters.end) { + return { + label: "Custom range", + start: normalizeDateBoundary(filters.start, "start"), + end: normalizeDateBoundary(filters.end, "end") + }; + } + + const presetDays = Number(filters.preset); + if (DATE_PRESETS.includes(presetDays)) { + const endDate = new Date(referenceIso); + const startDate = new Date(referenceIso); + startDate.setUTCDate(startDate.getUTCDate() - presetDays); + return { + label: `Last ${presetDays} days`, + start: startDate.toISOString(), + end: endDate.toISOString() + }; + } + + return { label: "All time" }; +} + +function normalizeDateBoundary( + value: string | undefined, + boundary: "start" | "end" +): string | undefined { + if (!value) { + return undefined; + } + + if (/^\d{4}-\d{2}-\d{2}$/.test(value)) { + return boundary === "start" + ? `${value}T00:00:00.000Z` + : `${value}T23:59:59.999Z`; + } + + return value; +} + +export function historyBandMatches(historyBand: string | undefined, ageInDays: number): boolean { + if (!historyBand) { + return true; + } + + if (historyBand === "0-30") { + return ageInDays >= 0 && ageInDays <= 30; + } + + if (historyBand === "30-49") { + return ageInDays > 30 && ageInDays <= 49; + } + + if (historyBand === "49-90") { + return ageInDays > 49 && ageInDays <= 90; + } + + return true; +} diff --git a/lib/competitor-dashboard/format.ts b/lib/competitor-dashboard/format.ts new file mode 100644 index 0000000..b9a50d1 --- /dev/null +++ b/lib/competitor-dashboard/format.ts @@ -0,0 +1,49 @@ +import { VALIDATION_STATUS_LABELS } from "@/lib/competitor-dashboard/constants"; +import type { ValidationStatus } from "@/lib/competitor-dashboard/types"; + +const shortDateFormatter = new Intl.DateTimeFormat("en-US", { + month: "short", + day: "numeric", + year: "numeric", + timeZone: "UTC" +}); + +const longDateFormatter = new Intl.DateTimeFormat("en-US", { + month: "short", + day: "numeric", + year: "numeric", + hour: "numeric", + minute: "2-digit", + timeZone: "UTC" +}); + +export function formatDate(value?: string): string { + if (!value) { + return "Not available"; + } + + return shortDateFormatter.format(new Date(value)); +} + +export function formatDateTime(value?: string): string { + if (!value) { + return "Not available"; + } + + return `${longDateFormatter.format(new Date(value))} UTC`; +} + +export function formatPercent(value: number): string { + return `${Math.round(value)}%`; +} + +export function validationLabel(status: ValidationStatus): string { + return VALIDATION_STATUS_LABELS[status]; +} + +export function titleCase(value: string): string { + return value + .replaceAll("_", " ") + .replaceAll("-", " ") + .replace(/\b\w/g, (char) => char.toUpperCase()); +} diff --git a/lib/competitor-dashboard/paths.ts b/lib/competitor-dashboard/paths.ts new file mode 100644 index 0000000..9a18260 --- /dev/null +++ b/lib/competitor-dashboard/paths.ts @@ -0,0 +1,28 @@ +import path from "node:path"; + +const defaultDataFile = "./data/competitor-dashboard.json"; +const defaultArtifactRoot = "./outputs/competitor-dashboard-artifacts"; + +export function repoRoot(): string { + return process.cwd(); +} + +export function resolveFromRepo(relativeOrAbsolute: string): string { + return path.isAbsolute(relativeOrAbsolute) + ? relativeOrAbsolute + : path.resolve(repoRoot(), relativeOrAbsolute); +} + +export function dataFilePath(): string { + return resolveFromRepo(process.env.COMPETITOR_DASHBOARD_DATA_FILE ?? defaultDataFile); +} + +export function artifactRootPath(): string { + return resolveFromRepo( + process.env.COMPETITOR_DASHBOARD_ARTIFACT_ROOT ?? defaultArtifactRoot + ); +} + +export function toRepoRelative(targetPath: string): string { + return path.relative(repoRoot(), targetPath).split(path.sep).join("/"); +} diff --git a/lib/competitor-dashboard/queries.ts b/lib/competitor-dashboard/queries.ts new file mode 100644 index 0000000..6169357 --- /dev/null +++ b/lib/competitor-dashboard/queries.ts @@ -0,0 +1,326 @@ +import { COMPETITORS } from "@/lib/competitor-dashboard/constants"; +import { + historyBandMatches, + normalizeFilters, + resolveDateRange +} from "@/lib/competitor-dashboard/filters"; +import { loadDashboardData } from "@/lib/competitor-dashboard/store"; +import type { + Artifact, + Competitor, + CompetitorReport, + DashboardData, + DashboardFilters, + Finding, + Source +} from "@/lib/competitor-dashboard/types"; + +interface DashboardContext { + data: DashboardData; + filters: DashboardFilters; + referenceDate: string; +} + +export async function getDashboardContext( + rawFilters: DashboardFilters | URLSearchParams | Record +): Promise { + const data = await loadDashboardData(); + if (!data) { + return null; + } + + const filters = rawFilters instanceof URLSearchParams ? normalizeFilters(rawFilters) : normalizeFilters(rawFilters); + const referenceDate = data.lastSeededAt || data.generatedAt; + + return { data, filters, referenceDate }; +} + +export function buildReportRows(context: DashboardContext): Array< + CompetitorReport & { + competitor: Competitor; + runLabel: string; + artifacts: Artifact[]; + } +> { + const { data, filters, referenceDate } = context; + const resolvedRange = resolveDateRange(filters, referenceDate); + const sourceByReport = aggregateSourceLevels(data.sources); + + return data.reports + .filter((report) => reportMatchesFilters(report, data, filters, resolvedRange, referenceDate)) + .map((report) => ({ + ...report, + competitor: findCompetitor(data, report.competitorId), + runLabel: data.sweepRuns.find((run) => run.id === report.runId)?.label ?? report.runId, + artifacts: data.artifacts.filter((artifact) => artifact.reportId === report.id), + sourceCoverage: sourceByReport.get(report.id) ?? report.sourceCoverage + })) + .sort((left, right) => right.generatedAt.localeCompare(left.generatedAt)); +} + +export function buildFindings(context: DashboardContext): Array< + Finding & { + report: CompetitorReport; + competitor: Competitor; + sources: Source[]; + } +> { + const { data, filters, referenceDate } = context; + const resolvedRange = resolveDateRange(filters, referenceDate); + + return data.findings + .filter((finding) => { + const report = data.reports.find((candidate) => candidate.id === finding.reportId); + if (!report) { + return false; + } + + if (!reportMatchesFilters(report, data, filters, resolvedRange, referenceDate)) { + return false; + } + + if (filters.validationStatus && finding.validationStatus !== filters.validationStatus) { + return false; + } + + if (filters.sourceLevel) { + const level = Number(filters.sourceLevel); + const findingSources = data.sources.filter((source) => source.findingId === finding.id); + if (!findingSources.some((source) => source.level === level)) { + return false; + } + } + + if (filters.q) { + const haystack = `${finding.claim} ${finding.supportingDetails} ${finding.whyItMatters} ${finding.codeRabbitComparison} ${finding.tags.join(" ")}`.toLowerCase(); + if (!haystack.includes(filters.q.toLowerCase())) { + return false; + } + } + + return true; + }) + .map((finding) => ({ + ...finding, + report: data.reports.find((report) => report.id === finding.reportId)!, + competitor: findCompetitor(data, finding.competitorId), + sources: data.sources + .filter((source) => source.findingId === finding.id) + .sort((left, right) => left.level - right.level) + })) + .sort((left, right) => right.createdAt.localeCompare(left.createdAt)); +} + +export function buildSources(context: DashboardContext): Array< + Source & { + report: CompetitorReport; + competitor: Competitor; + } +> { + const { data, filters, referenceDate } = context; + const resolvedRange = resolveDateRange(filters, referenceDate); + + return data.sources + .filter((source) => { + const report = data.reports.find((candidate) => candidate.id === source.reportId); + if (!report) { + return false; + } + + if (!reportMatchesFilters(report, data, filters, resolvedRange, referenceDate)) { + return false; + } + + if (filters.sourceLevel && Number(filters.sourceLevel) !== source.level) { + return false; + } + + if (filters.q) { + const haystack = `${source.title} ${source.excerpt} ${source.url} ${source.tags.join(" ")}`.toLowerCase(); + if (!haystack.includes(filters.q.toLowerCase())) { + return false; + } + } + + return true; + }) + .map((source) => ({ + ...source, + report: data.reports.find((report) => report.id === source.reportId)!, + competitor: findCompetitor(data, data.reports.find((report) => report.id === source.reportId)!.competitorId) + })) + .sort((left, right) => right.publishedAt.localeCompare(left.publishedAt)); +} + +export function buildRunsSummary(context: DashboardContext): Array<{ + id: string; + label: string; + generatedAt: string; + reportWindowLabel: string; + reportCount: number; + findingsCount: number; +}> { + const { data } = context; + return data.sweepRuns + .map((run) => { + const reports = data.reports.filter((report) => report.runId === run.id); + const findingsCount = reports.reduce((total, report) => total + report.findingsCount, 0); + return { + id: run.id, + label: run.label, + generatedAt: run.generatedAt, + reportWindowLabel: run.reportWindowLabel, + reportCount: reports.length, + findingsCount + }; + }) + .sort((left, right) => right.generatedAt.localeCompare(left.generatedAt)); +} + +export function buildCompetitorSummary(context: DashboardContext): Array<{ + competitor: Competitor; + reports: number; + latestReport?: CompetitorReport; + findings: number; +}> { + const { data } = context; + return COMPETITORS.map((competitor) => { + const reports = data.reports + .filter((report) => report.competitorId === competitor.id) + .sort((left, right) => right.generatedAt.localeCompare(left.generatedAt)); + return { + competitor, + reports: reports.length, + latestReport: reports[0], + findings: reports.reduce((total, report) => total + report.findingsCount, 0) + }; + }); +} + +export function getReportDetail(context: DashboardContext, reportId: string) { + const { data } = context; + const report = data.reports.find((candidate) => candidate.id === reportId); + if (!report) { + return null; + } + + const competitor = findCompetitor(data, report.competitorId); + const run = data.sweepRuns.find((candidate) => candidate.id === report.runId); + const reportFindings = buildFindings(context).filter((finding) => finding.reportId === report.id); + const reportArtifacts = data.artifacts.filter((artifact) => artifact.reportId === report.id); + + return { report, competitor, run, findings: reportFindings, artifacts: reportArtifacts }; +} + +export function getCompetitorDetail(context: DashboardContext, slug: string) { + const { data } = context; + const competitor = data.competitors.find((candidate) => candidate.slug === slug); + if (!competitor) { + return null; + } + + const reports = buildReportRows(context).filter((report) => report.competitorId === competitor.id); + return { + competitor, + reports, + findings: buildFindings(context).filter((finding) => finding.competitorId === competitor.id) + }; +} + +export function getArtifactById(data: DashboardData, artifactId: string): Artifact | null { + return data.artifacts.find((artifact) => artifact.id === artifactId) ?? null; +} + +function reportMatchesFilters( + report: CompetitorReport, + data: DashboardData, + filters: DashboardFilters, + resolvedRange: { start?: string; end?: string }, + referenceDate: string +): boolean { + if (filters.competitor && report.competitorId !== filters.competitor) { + return false; + } + + if (filters.reportRunId && report.runId !== filters.reportRunId) { + return false; + } + + if (filters.validationStatus) { + const reportFindings = data.findings.filter((finding) => finding.reportId === report.id); + if (!reportFindings.some((finding) => finding.validationStatus === filters.validationStatus)) { + return false; + } + } + + if (filters.sourceLevel) { + const level = Number(filters.sourceLevel); + const hasSourceLevel = data.sources.some( + (source) => source.reportId === report.id && source.level === level + ); + if (!hasSourceLevel) { + return false; + } + } + + if (filters.latestMovement === "missing" && report.latestMovementFound) { + return false; + } + + if (filters.latestMovement === "found" && !report.latestMovementFound) { + return false; + } + + const reportGeneratedAt = Date.parse(report.generatedAt); + const rangeStart = resolvedRange.start ? Date.parse(resolvedRange.start) : NaN; + const rangeEnd = resolvedRange.end ? Date.parse(resolvedRange.end) : NaN; + + if (!Number.isNaN(rangeStart) && reportGeneratedAt < rangeStart) { + return false; + } + + if (!Number.isNaN(rangeEnd) && reportGeneratedAt > rangeEnd) { + return false; + } + + if (filters.historyBand) { + const ageInDays = Math.floor( + (new Date(referenceDate).getTime() - new Date(report.sweepRunDate).getTime()) / 86400000 + ); + if (!historyBandMatches(filters.historyBand, ageInDays)) { + return false; + } + } + + if (filters.q) { + const competitor = findCompetitor(data, report.competitorId); + const haystack = `${competitor.name} ${report.summary} ${report.tags.join(" ")} ${report.runId}`.toLowerCase(); + if (!haystack.includes(filters.q.toLowerCase())) { + return false; + } + } + + return true; +} + +function aggregateSourceLevels(sources: Source[]): Map { + const map = new Map(); + + for (const source of sources) { + const current = map.get(source.reportId) ?? { level1: 0, level2: 0, level3: 0 }; + if (source.level === 1) { + current.level1 += 1; + } else if (source.level === 2) { + current.level2 += 1; + } else { + current.level3 += 1; + } + map.set(source.reportId, current); + } + + return map; +} + +function findCompetitor(data: DashboardData, competitorId: string): Competitor { + return data.competitors.find((competitor) => competitor.id === competitorId) ?? COMPETITORS[0]; +} diff --git a/lib/competitor-dashboard/seed-data.ts b/lib/competitor-dashboard/seed-data.ts new file mode 100644 index 0000000..b8634b0 --- /dev/null +++ b/lib/competitor-dashboard/seed-data.ts @@ -0,0 +1,204 @@ +import { COMPETITORS, SAVED_VIEWS } from "@/lib/competitor-dashboard/constants"; +import type { + Artifact, + CompetitorReport, + DashboardData, + Finding, + Source, + SweepRun, + ValidationFlag, + ValidationStatus +} from "@/lib/competitor-dashboard/types"; + +const statusCycle: ValidationStatus[] = [ + "validated", + "partially_validated", + "community_signal", + "needs_review" +]; + +const runTemplates: Array<{ + id: string; + label: string; + sweepDate: string; + generatedAt: string; + reportWindowDays: number; + reportWindowLabel: string; + notes: string; +}> = [ + { + id: "sweep-2026-04-30", + label: "April 30 sweep", + sweepDate: "2026-04-30T09:00:00.000Z", + generatedAt: "2026-04-30T09:18:00.000Z", + reportWindowDays: 30, + reportWindowLabel: "Last 30 days", + notes: "Primary current-state sweep for demo prep." + }, + { + id: "sweep-2026-03-18", + label: "March 18 sweep", + sweepDate: "2026-03-18T10:00:00.000Z", + generatedAt: "2026-03-18T10:11:00.000Z", + reportWindowDays: 49, + reportWindowLabel: "Last 49 days", + notes: "Expanded comparison window for feature-change tracking." + }, + { + id: "sweep-2026-02-12", + label: "February 12 sweep", + sweepDate: "2026-02-12T11:00:00.000Z", + generatedAt: "2026-02-12T11:21:00.000Z", + reportWindowDays: 90, + reportWindowLabel: "Last 90 days", + notes: "Historical benchmark sweep for longer-term movement." + } +]; + +export interface SeedOutput { + data: DashboardData; + artifacts: Artifact[]; +} + +export function buildSeedData(): SeedOutput { + const sweepRuns: SweepRun[] = runTemplates.map((run) => ({ ...run })); + const reports: CompetitorReport[] = []; + const findings: Finding[] = []; + const sources: Source[] = []; + const artifacts: Artifact[] = []; + const validationFlags: ValidationFlag[] = []; + + for (const [runIndex, run] of sweepRuns.entries()) { + for (const [competitorIndex, competitor] of COMPETITORS.entries()) { + const reportId = `${run.id}-${competitor.slug}`; + const status = statusCycle[(runIndex + competitorIndex) % statusCycle.length]; + const latestMovementFound = (runIndex + competitorIndex) % 3 !== 0; + const validationCoverage = 62 + ((runIndex * 11 + competitorIndex * 5) % 36); + const newestFindingDate = shiftDate(run.generatedAt, competitorIndex); + const findingIds: string[] = []; + + for (const findingIndex of [0, 1]) { + const findingId = `${reportId}-finding-${findingIndex + 1}`; + const validationFlagId = `${findingId}-flag`; + const sourceIds: string[] = []; + const findingDate = shiftDate(newestFindingDate, findingIndex); + + for (const level of [1, 2, 3] as const) { + const sourceId = `${findingId}-source-${level}`; + sourceIds.push(sourceId); + sources.push({ + id: sourceId, + reportId, + findingId, + level, + title: `${competitor.shortName} source L${level} for ${run.reportWindowLabel}`, + url: `https://example.com/${competitor.slug}/${run.id}/finding-${findingIndex + 1}/level-${level}`, + publishedAt: shiftDate(findingDate, level), + excerpt: `${competitor.shortName} evidence captured at level ${level} for the seeded local dashboard.`, + tags: level === 1 ? ["official", "product"] : level === 2 ? ["github", "docs"] : ["community"] + }); + } + + validationFlags.push({ + id: validationFlagId, + reportId, + findingId, + status, + note: `${competitor.shortName} finding ${findingIndex + 1} is marked ${status.replaceAll("_", " ")} in the seeded dataset.` + }); + + findings.push({ + id: findingId, + reportId, + competitorId: competitor.id, + createdAt: findingDate, + newestSourceDate: sourceIds.length ? shiftDate(findingDate, 1) : findingDate, + claim: `${competitor.shortName} shipped movement relevant to pull-request review workflows in the ${run.reportWindowLabel.toLowerCase()}.`, + supportingDetails: `Seeded competitor report details for ${competitor.name} in ${run.label}, covering product changes, positioning, and review workflow claims.`, + whyItMatters: `Sales Engineers can use this item to compare CodeRabbit against ${competitor.shortName} during demos and competitive follow-up.`, + codeRabbitComparison: `CodeRabbit should be positioned against ${competitor.shortName} on review depth, validation quality, and PR workflow speed for this seeded example.`, + validationStatus: status, + sourceIds, + validationFlagIds: [validationFlagId], + tags: [ + competitor.shortName.toLowerCase(), + run.reportWindowDays > 30 ? "historical" : "recent", + latestMovementFound ? "release-movement" : "needs-follow-up" + ] + }); + + findingIds.push(findingId); + } + + const reportFlagId = `${reportId}-summary-flag`; + validationFlags.push({ + id: reportFlagId, + reportId, + status, + note: `${competitor.shortName} report summary validation state for ${run.label}.` + }); + + reports.push({ + id: reportId, + competitorId: competitor.id, + runId: run.id, + generatedAt: run.generatedAt, + sweepRunDate: run.sweepDate, + reportWindowDays: run.reportWindowDays, + reportWindowLabel: run.reportWindowLabel, + findingsCount: findingIds.length, + newestFindingDate, + validationCoverage, + latestMovementFound, + sourceCoverage: { level1: 2, level2: 2, level3: 2 }, + summary: `${competitor.name} archive report from ${run.label}, preserved as a separate entity for time-based comparison.`, + artifactIds: [`${reportId}-pdf`, `${reportId}-png`], + validationFlagIds: [reportFlagId], + tags: [competitor.shortName.toLowerCase(), run.reportWindowLabel.toLowerCase()] + }); + } + } + + for (const report of reports) { + artifacts.push({ + id: `${report.id}-pdf`, + reportId: report.id, + kind: "pdf", + title: `${report.id}.pdf`, + relativePath: "", + mimeType: "application/pdf", + createdAt: report.generatedAt + }); + artifacts.push({ + id: `${report.id}-png`, + reportId: report.id, + kind: "png", + title: `${report.id}.png`, + relativePath: "", + mimeType: "image/png", + createdAt: report.generatedAt + }); + } + + const data: DashboardData = { + schemaVersion: "competitor-dashboard-v1", + generatedAt: sweepRuns[0]?.generatedAt ?? new Date().toISOString(), + lastSeededAt: new Date().toISOString(), + competitors: COMPETITORS, + sweepRuns, + reports, + findings, + sources, + artifacts, + validationFlags, + savedViews: SAVED_VIEWS + }; + + return { data, artifacts }; +} + +function shiftDate(baseIso: string, offsetDays: number): string { + const date = new Date(baseIso); + date.setUTCDate(date.getUTCDate() - offsetDays); + return date.toISOString(); +} diff --git a/lib/competitor-dashboard/store.ts b/lib/competitor-dashboard/store.ts new file mode 100644 index 0000000..e3c0a8d --- /dev/null +++ b/lib/competitor-dashboard/store.ts @@ -0,0 +1,35 @@ +import fs from "node:fs/promises"; +import path from "node:path"; + +import { dataFilePath } from "@/lib/competitor-dashboard/paths"; +import type { DashboardData } from "@/lib/competitor-dashboard/types"; + +export async function ensureLocalDirectories(): Promise { + const dataFile = dataFilePath(); + await fs.mkdir(path.dirname(dataFile), { recursive: true }); +} + +export async function loadDashboardData(): Promise { + const filePath = dataFilePath(); + + try { + const raw = await fs.readFile(filePath, "utf8"); + return JSON.parse(raw) as DashboardData; + } catch (error) { + if ((error as NodeJS.ErrnoException).code === "ENOENT") { + return null; + } + + throw new Error( + `Failed to load competitor dashboard data from ${filePath}: ${ + error instanceof Error ? error.message : String(error) + }` + ); + } +} + +export async function saveDashboardData(data: DashboardData): Promise { + const filePath = dataFilePath(); + await ensureLocalDirectories(); + await fs.writeFile(filePath, `${JSON.stringify(data, null, 2)}\n`, "utf8"); +} diff --git a/lib/competitor-dashboard/types.ts b/lib/competitor-dashboard/types.ts new file mode 100644 index 0000000..75c8dcd --- /dev/null +++ b/lib/competitor-dashboard/types.ts @@ -0,0 +1,140 @@ +export type ValidationStatus = + | "validated" + | "partially_validated" + | "community_signal" + | "needs_review"; + +export type ArtifactKind = "pdf" | "png"; + +export type SourceLevel = 1 | 2 | 3; + +export interface Competitor { + id: string; + slug: string; + name: string; + shortName: string; + vendor: string; + category: string; +} + +export interface SweepRun { + id: string; + label: string; + sweepDate: string; + generatedAt: string; + reportWindowDays: number; + reportWindowLabel: string; + notes: string; +} + +export interface Artifact { + id: string; + reportId: string; + kind: ArtifactKind; + title: string; + relativePath: string; + mimeType: string; + createdAt: string; +} + +export interface Source { + id: string; + reportId: string; + findingId: string; + level: SourceLevel; + title: string; + url: string; + publishedAt: string; + excerpt: string; + tags: string[]; +} + +export interface ValidationFlag { + id: string; + reportId: string; + findingId?: string; + status: ValidationStatus; + note: string; +} + +export interface Finding { + id: string; + reportId: string; + competitorId: string; + createdAt: string; + newestSourceDate: string; + claim: string; + supportingDetails: string; + whyItMatters: string; + codeRabbitComparison: string; + validationStatus: ValidationStatus; + sourceIds: string[]; + validationFlagIds: string[]; + tags: string[]; +} + +export interface ReportSourceCoverage { + level1: number; + level2: number; + level3: number; +} + +export interface CompetitorReport { + id: string; + competitorId: string; + runId: string; + generatedAt: string; + sweepRunDate: string; + reportWindowDays: number; + reportWindowLabel: string; + findingsCount: number; + newestFindingDate: string; + validationCoverage: number; + latestMovementFound: boolean; + sourceCoverage: ReportSourceCoverage; + summary: string; + artifactIds: string[]; + validationFlagIds: string[]; + tags: string[]; +} + +export interface SavedView { + id: string; + name: string; + description: string; + params: Record; +} + +export interface DashboardData { + schemaVersion: "competitor-dashboard-v1"; + generatedAt: string; + lastSeededAt: string; + competitors: Competitor[]; + sweepRuns: SweepRun[]; + reports: CompetitorReport[]; + findings: Finding[]; + sources: Source[]; + artifacts: Artifact[]; + validationFlags: ValidationFlag[]; + savedViews: SavedView[]; +} + +export interface DashboardFilters { + q?: string; + competitor?: string; + preset?: string; + start?: string; + end?: string; + sourceLevel?: string; + validationStatus?: string; + reportRunId?: string; + historyBand?: string; + latestMovement?: string; + view?: string; +} + +export interface ResolvedDateRange { + label: string; + start?: string; + end?: string; +} diff --git a/next-env.d.ts b/next-env.d.ts new file mode 100644 index 0000000..4f11a03 --- /dev/null +++ b/next-env.d.ts @@ -0,0 +1,5 @@ +/// +/// + +// NOTE: This file should not be edited +// see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/next.config.mjs b/next.config.mjs new file mode 100644 index 0000000..4678774 --- /dev/null +++ b/next.config.mjs @@ -0,0 +1,4 @@ +/** @type {import('next').NextConfig} */ +const nextConfig = {}; + +export default nextConfig; diff --git a/openapi-spec.json b/openapi-spec.json deleted file mode 100644 index dbd16e5..0000000 --- a/openapi-spec.json +++ /dev/null @@ -1,1552 +0,0 @@ -{ - "components": {}, - "info": { - "title": "saddlebagexchange-firing-range-app", - "version": "0.1" - }, - "openapi": "3.0.0", - "paths": { - "/": { - "get": { - "operationId": "root_GET", - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "root_GET", - "x-source": "app.py~~126" - }, - "head": { - "operationId": "root_HEAD", - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "root_HEAD", - "x-source": "test.py~~32" - }, - "options": { - "operationId": "root_OPTIONS", - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "root_OPTIONS", - "x-source": "test.py~~32" - }, - "post": { - "operationId": "root_POST", - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "root_POST", - "x-source": "app.py~~126" - }, - "x-name": "root" - }, - "/2faca366-0ef0-4acb-9acc-3808e0470952.txt": { - "get": { - "operationId": "2faca366-0ef0-4acb-9acc-3808e0470952.txt_GET", - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "2faca366-0ef0-4acb-9acc-3808e0470952.txt_GET", - "x-source": "app.py~~115" - }, - "post": { - "operationId": "2faca366-0ef0-4acb-9acc-3808e0470952.txt_POST", - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "2faca366-0ef0-4acb-9acc-3808e0470952.txt_POST", - "x-source": "app.py~~115" - }, - "x-name": "2faca366-0ef0-4acb-9acc-3808e0470952.txt" - }, - "/bestdeals": { - "get": { - "operationId": "bestdeals_GET", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "discount": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "item_class": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "minPrice": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "region": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "salesPerDay": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "type": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - } - }, - "type": "object", - "x-field-kind": "normal", - "x-field-original-type": "object", - "x-field-type": "object" - } - } - }, - "x-code": "" - }, - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "bestdeals_GET", - "x-source": "app.py~~848" - }, - "post": { - "operationId": "bestdeals_POST", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "discount": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "item_class": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "minPrice": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "region": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "salesPerDay": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "type": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - } - }, - "type": "object", - "x-field-kind": "normal", - "x-field-original-type": "object", - "x-field-type": "object" - } - } - }, - "x-code": "" - }, - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "bestdeals_POST", - "x-source": "app.py~~848" - }, - "x-name": "bestdeals" - }, - "/favicon.ico": { - "get": { - "operationId": "favicon.ico_GET", - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "favicon.ico_GET", - "x-source": "app.py~~131" - }, - "post": { - "operationId": "favicon.ico_POST", - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "favicon.ico_POST", - "x-source": "app.py~~131" - }, - "x-name": "favicon.ico" - }, - "/ffxiv": { - "get": { - "operationId": "ffxiv_GET", - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "ffxiv_GET", - "x-source": "app.py~~213" - }, - "post": { - "operationId": "ffxiv_POST", - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "ffxiv_POST", - "x-source": "app.py~~213" - }, - "x-name": "ffxiv" - }, - "/ffxiv_itemnames": { - "get": { - "operationId": "ffxiv_itemnames_GET", - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "ffxiv_itemnames_GET", - "x-source": "app.py~~223" - }, - "post": { - "operationId": "ffxiv_itemnames_POST", - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "ffxiv_itemnames_POST", - "x-source": "app.py~~223" - }, - "x-name": "ffxiv_itemnames" - }, - "/ffxivbestdeals": { - "get": { - "operationId": "ffxivbestdeals_GET", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "discount": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "filters": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "home_server": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "maxBuyPrice": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "medianPrice": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "salesAmount": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - } - }, - "type": "object", - "x-field-kind": "normal", - "x-field-original-type": "object", - "x-field-type": "object" - } - } - }, - "x-code": "" - }, - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "ffxivbestdeals_GET", - "x-source": "app.py~~469" - }, - "post": { - "operationId": "ffxivbestdeals_POST", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "discount": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "filters": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "home_server": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "maxBuyPrice": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "medianPrice": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "salesAmount": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - } - }, - "type": "object", - "x-field-kind": "normal", - "x-field-original-type": "object", - "x-field-type": "object" - } - } - }, - "x-code": "" - }, - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "ffxivbestdeals_POST", - "x-source": "app.py~~469" - }, - "x-name": "ffxivbestdeals" - }, - "/ffxivcraftsim": { - "get": { - "operationId": "ffxivcraftsim_GET", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "cost_metric": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "filters": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "hide_expert_recipes": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "home_server": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "job": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "lvl_lower_limit": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "lvl_upper_limit": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "max_material_cost": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "median_sale_price": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "revenue_metric": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "sales_per_week": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "stars": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "yields": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - } - }, - "type": "object", - "x-field-kind": "normal", - "x-field-original-type": "object", - "x-field-type": "object" - } - } - }, - "x-code": "" - }, - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "ffxivcraftsim_GET", - "x-source": "app.py~~297" - }, - "post": { - "operationId": "ffxivcraftsim_POST", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "cost_metric": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "filters": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "hide_expert_recipes": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "home_server": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "job": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "lvl_lower_limit": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "lvl_upper_limit": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "max_material_cost": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "median_sale_price": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "revenue_metric": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "sales_per_week": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "stars": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "yields": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - } - }, - "type": "object", - "x-field-kind": "normal", - "x-field-original-type": "object", - "x-field-type": "object" - } - } - }, - "x-code": "" - }, - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "ffxivcraftsim_POST", - "x-source": "app.py~~297" - }, - "x-name": "ffxivcraftsim" - }, - "/ffxivscripexchange": { - "get": { - "operationId": "ffxivscripexchange_GET", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "color": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "home_server": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - } - }, - "type": "object", - "x-field-kind": "normal", - "x-field-original-type": "object", - "x-field-type": "object" - } - } - }, - "x-code": "" - }, - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "ffxivscripexchange_GET", - "x-source": "app.py~~1039" - }, - "post": { - "operationId": "ffxivscripexchange_POST", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "color": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "home_server": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - } - }, - "type": "object", - "x-field-kind": "normal", - "x-field-original-type": "object", - "x-field-type": "object" - } - } - }, - "x-code": "" - }, - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "ffxivscripexchange_POST", - "x-source": "app.py~~1039" - }, - "x-name": "ffxivscripexchange" - }, - "/ffxivshoppinglist": { - "get": { - "operationId": "ffxivshoppinglist_GET", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "home_server": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "region_wide": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "shopping_list": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - } - }, - "type": "object", - "x-field-kind": "normal", - "x-field-original-type": "object", - "x-field-type": "object" - } - } - }, - "x-code": "" - }, - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "ffxivshoppinglist_GET", - "x-source": "app.py~~401" - }, - "post": { - "operationId": "ffxivshoppinglist_POST", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "home_server": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "region_wide": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "shopping_list": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - } - }, - "type": "object", - "x-field-kind": "normal", - "x-field-original-type": "object", - "x-field-type": "object" - } - } - }, - "x-code": "" - }, - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "ffxivshoppinglist_POST", - "x-source": "app.py~~401" - }, - "x-name": "ffxivshoppinglist" - }, - "/itemnames": { - "get": { - "operationId": "itemnames_GET", - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "itemnames_GET", - "x-source": "app.py~~570" - }, - "post": { - "operationId": "itemnames_POST", - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "itemnames_POST", - "x-source": "app.py~~570" - }, - "x-name": "itemnames" - }, - "/megaitemnames": { - "get": { - "operationId": "megaitemnames_GET", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "discount": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "region": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - } - }, - "type": "object", - "x-field-kind": "normal", - "x-field-original-type": "object", - "x-field-type": "object" - } - } - }, - "x-code": "" - }, - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "megaitemnames_GET", - "x-source": "app.py~~593" - }, - "post": { - "operationId": "megaitemnames_POST", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "discount": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "region": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - } - }, - "type": "object", - "x-field-kind": "normal", - "x-field-original-type": "object", - "x-field-type": "object" - } - } - }, - "x-code": "" - }, - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "megaitemnames_POST", - "x-source": "app.py~~593" - }, - "x-name": "megaitemnames" - }, - "/petexport": { - "get": { - "operationId": "petexport_GET", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "itemID": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "maxQuantity": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "minPrice": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "populationBlizz": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "populationWP": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "rankingWP": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "region": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - } - }, - "type": "object", - "x-field-kind": "normal", - "x-field-original-type": "object", - "x-field-type": "object" - } - } - }, - "x-code": "" - }, - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "petexport_GET", - "x-source": "app.py~~724" - }, - "post": { - "operationId": "petexport_POST", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "itemID": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "maxQuantity": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "minPrice": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "populationBlizz": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "populationWP": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "rankingWP": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "region": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - } - }, - "type": "object", - "x-field-kind": "normal", - "x-field-original-type": "object", - "x-field-type": "object" - } - } - }, - "x-code": "" - }, - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "petexport_POST", - "x-source": "app.py~~724" - }, - "x-name": "petexport" - }, - "/petimport": { - "get": { - "operationId": "petimport_GET", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "ROI": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "avgPrice": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "homeRealmID": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "maxPurchasePrice": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "petsOnly": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "profitAmount": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "region": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "salesPerDay": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - } - }, - "type": "object", - "x-field-kind": "normal", - "x-field-original-type": "object", - "x-field-type": "object" - } - } - }, - "x-code": "" - }, - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "petimport_GET", - "x-source": "app.py~~919" - }, - "post": { - "operationId": "petimport_POST", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "ROI": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "avgPrice": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "homeRealmID": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "maxPurchasePrice": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "petsOnly": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "profitAmount": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "region": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "salesPerDay": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - } - }, - "type": "object", - "x-field-kind": "normal", - "x-field-original-type": "object", - "x-field-type": "object" - } - } - }, - "x-code": "" - }, - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "petimport_POST", - "x-source": "app.py~~919" - }, - "x-name": "petimport" - }, - "/petmarketshare": { - "get": { - "operationId": "petmarketshare_GET", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "homeRealmName": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "minPrice": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "region": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "salesPerDay": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - } - }, - "type": "object", - "x-field-kind": "normal", - "x-field-original-type": "object", - "x-field-type": "object" - } - } - }, - "x-code": "" - }, - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "petmarketshare_GET", - "x-source": "app.py~~670" - }, - "post": { - "operationId": "petmarketshare_POST", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "homeRealmName": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "minPrice": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "region": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "salesPerDay": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - } - }, - "type": "object", - "x-field-kind": "normal", - "x-field-original-type": "object", - "x-field-type": "object" - } - } - }, - "x-code": "" - }, - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "petmarketshare_POST", - "x-source": "app.py~~670" - }, - "x-name": "petmarketshare" - }, - "/petshoppinglist": { - "get": { - "operationId": "petshoppinglist_GET", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "maxPurchasePrice": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "petID": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "region": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - } - }, - "type": "object", - "x-field-kind": "normal", - "x-field-original-type": "object", - "x-field-type": "object" - } - } - }, - "x-code": "" - }, - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "petshoppinglist_GET", - "x-source": "app.py~~623" - }, - "post": { - "operationId": "petshoppinglist_POST", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "maxPurchasePrice": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "petID": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "region": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - } - }, - "type": "object", - "x-field-kind": "normal", - "x-field-original-type": "object", - "x-field-type": "object" - } - } - }, - "x-code": "" - }, - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "petshoppinglist_POST", - "x-source": "app.py~~623" - }, - "x-name": "petshoppinglist" - }, - "/pricecheck": { - "get": { - "operationId": "pricecheck_GET", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "jsonData": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - } - }, - "type": "object", - "x-field-kind": "normal", - "x-field-original-type": "object", - "x-field-type": "object" - } - } - }, - "x-code": "" - }, - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "pricecheck_GET", - "x-source": "app.py~~253" - }, - "post": { - "operationId": "pricecheck_POST", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "jsonData": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - } - }, - "type": "object", - "x-field-kind": "normal", - "x-field-original-type": "object", - "x-field-type": "object" - } - } - }, - "x-code": "" - }, - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "pricecheck_POST", - "x-source": "app.py~~253" - }, - "x-name": "pricecheck" - }, - "/regionundercut": { - "get": { - "operationId": "regionundercut_GET", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "addonData": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "homeRealmID": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "region": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - } - }, - "type": "object", - "x-field-kind": "normal", - "x-field-original-type": "object", - "x-field-type": "object" - } - } - }, - "x-code": "" - }, - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "regionundercut_GET", - "x-source": "app.py~~778" - }, - "post": { - "operationId": "regionundercut_POST", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "addonData": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "homeRealmID": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - }, - "region": { - "type": "string", - "x-field-kind": "normal", - "x-field-original-type": "builtin.str", - "x-field-type": "string" - } - }, - "type": "object", - "x-field-kind": "normal", - "x-field-original-type": "object", - "x-field-type": "object" - } - } - }, - "x-code": "" - }, - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "regionundercut_POST", - "x-source": "app.py~~778" - }, - "x-name": "regionundercut" - }, - "/uploadtimers": { - "get": { - "operationId": "uploadtimers_GET", - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "uploadtimers_GET", - "x-source": "app.py~~532" - }, - "post": { - "operationId": "uploadtimers_POST", - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "uploadtimers_POST", - "x-source": "app.py~~532" - }, - "x-name": "uploadtimers" - }, - "/wow": { - "get": { - "operationId": "wow_GET", - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "wow_GET", - "x-source": "app.py~~218" - }, - "post": { - "operationId": "wow_POST", - "responses": { - "default": { - "description": "Default response" - } - }, - "x-name": "wow_POST", - "x-source": "app.py~~218" - }, - "x-name": "wow" - } - }, - "servers": [ - { - "description": "Default server", - "url": "https://firing-range.saddlebagexchange.com/" - } - ] -} \ No newline at end of file diff --git a/openapi-spec.yml b/openapi-spec.yml deleted file mode 100644 index b7d6a9d..0000000 --- a/openapi-spec.yml +++ /dev/null @@ -1,1219 +0,0 @@ -components: {} -info: - title: saddlebagexchange-firing-range-app - version: "0.1" -openapi: 3.0.0 -paths: - /: - get: - operationId: root_GET - responses: - default: - description: Default response - x-name: root_GET - x-source: app.py~~126 - head: - operationId: root_HEAD - responses: - default: - description: Default response - x-name: root_HEAD - x-source: test.py~~32 - options: - operationId: root_OPTIONS - responses: - default: - description: Default response - x-name: root_OPTIONS - x-source: test.py~~32 - post: - operationId: root_POST - responses: - default: - description: Default response - x-name: root_POST - x-source: app.py~~126 - x-name: root - /2faca366-0ef0-4acb-9acc-3808e0470952.txt: - get: - operationId: 2faca366-0ef0-4acb-9acc-3808e0470952.txt_GET - responses: - default: - description: Default response - x-name: 2faca366-0ef0-4acb-9acc-3808e0470952.txt_GET - x-source: app.py~~115 - post: - operationId: 2faca366-0ef0-4acb-9acc-3808e0470952.txt_POST - responses: - default: - description: Default response - x-name: 2faca366-0ef0-4acb-9acc-3808e0470952.txt_POST - x-source: app.py~~115 - x-name: 2faca366-0ef0-4acb-9acc-3808e0470952.txt - /bestdeals: - get: - operationId: bestdeals_GET - requestBody: - content: - application/json: - schema: - properties: - discount: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - item_class: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - minPrice: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - region: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - salesPerDay: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - type: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - type: object - x-field-kind: normal - x-field-original-type: object - x-field-type: object - x-code: "" - responses: - default: - description: Default response - x-name: bestdeals_GET - x-source: app.py~~848 - post: - operationId: bestdeals_POST - requestBody: - content: - application/json: - schema: - properties: - discount: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - item_class: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - minPrice: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - region: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - salesPerDay: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - type: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - type: object - x-field-kind: normal - x-field-original-type: object - x-field-type: object - x-code: "" - responses: - default: - description: Default response - x-name: bestdeals_POST - x-source: app.py~~848 - x-name: bestdeals - /favicon.ico: - get: - operationId: favicon.ico_GET - responses: - default: - description: Default response - x-name: favicon.ico_GET - x-source: app.py~~131 - post: - operationId: favicon.ico_POST - responses: - default: - description: Default response - x-name: favicon.ico_POST - x-source: app.py~~131 - x-name: favicon.ico - /ffxiv: - get: - operationId: ffxiv_GET - responses: - default: - description: Default response - x-name: ffxiv_GET - x-source: app.py~~213 - post: - operationId: ffxiv_POST - responses: - default: - description: Default response - x-name: ffxiv_POST - x-source: app.py~~213 - x-name: ffxiv - /ffxiv_itemnames: - get: - operationId: ffxiv_itemnames_GET - responses: - default: - description: Default response - x-name: ffxiv_itemnames_GET - x-source: app.py~~223 - post: - operationId: ffxiv_itemnames_POST - responses: - default: - description: Default response - x-name: ffxiv_itemnames_POST - x-source: app.py~~223 - x-name: ffxiv_itemnames - /ffxivbestdeals: - get: - operationId: ffxivbestdeals_GET - requestBody: - content: - application/json: - schema: - properties: - discount: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - filters: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - home_server: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - maxBuyPrice: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - medianPrice: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - salesAmount: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - type: object - x-field-kind: normal - x-field-original-type: object - x-field-type: object - x-code: "" - responses: - default: - description: Default response - x-name: ffxivbestdeals_GET - x-source: app.py~~469 - post: - operationId: ffxivbestdeals_POST - requestBody: - content: - application/json: - schema: - properties: - discount: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - filters: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - home_server: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - maxBuyPrice: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - medianPrice: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - salesAmount: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - type: object - x-field-kind: normal - x-field-original-type: object - x-field-type: object - x-code: "" - responses: - default: - description: Default response - x-name: ffxivbestdeals_POST - x-source: app.py~~469 - x-name: ffxivbestdeals - /ffxivcraftsim: - get: - operationId: ffxivcraftsim_GET - requestBody: - content: - application/json: - schema: - properties: - cost_metric: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - filters: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - hide_expert_recipes: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - home_server: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - job: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - lvl_lower_limit: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - lvl_upper_limit: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - max_material_cost: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - median_sale_price: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - revenue_metric: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - sales_per_week: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - stars: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - yields: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - type: object - x-field-kind: normal - x-field-original-type: object - x-field-type: object - x-code: "" - responses: - default: - description: Default response - x-name: ffxivcraftsim_GET - x-source: app.py~~297 - post: - operationId: ffxivcraftsim_POST - requestBody: - content: - application/json: - schema: - properties: - cost_metric: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - filters: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - hide_expert_recipes: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - home_server: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - job: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - lvl_lower_limit: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - lvl_upper_limit: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - max_material_cost: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - median_sale_price: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - revenue_metric: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - sales_per_week: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - stars: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - yields: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - type: object - x-field-kind: normal - x-field-original-type: object - x-field-type: object - x-code: "" - responses: - default: - description: Default response - x-name: ffxivcraftsim_POST - x-source: app.py~~297 - x-name: ffxivcraftsim - # /ffxivsalehistory: - # get: - # operationId: ffxivsalehistory_GET - # requestBody: - # content: - # application/json: - # schema: - # properties: - # item_id: - # type: string - # x-field-kind: normal - # x-field-original-type: builtin.str - # x-field-type: string - # region: - # type: string - # x-field-kind: normal - # x-field-original-type: builtin.str - # x-field-type: string - # type: object - # x-field-kind: normal - # x-field-original-type: object - # x-field-type: object - # x-code: "" - # responses: - # default: - # description: Default response - # x-name: ffxivsalehistory_GET - # x-source: app.py~~986 - # post: - # operationId: ffxivsalehistory_POST - # requestBody: - # content: - # application/json: - # schema: - # properties: - # item_id: - # type: string - # x-field-kind: normal - # x-field-original-type: builtin.str - # x-field-type: string - # region: - # type: string - # x-field-kind: normal - # x-field-original-type: builtin.str - # x-field-type: string - # type: object - # x-field-kind: normal - # x-field-original-type: object - # x-field-type: object - # x-code: "" - # responses: - # default: - # description: Default response - # x-name: ffxivsalehistory_POST - # x-source: app.py~~986 - # x-name: ffxivsalehistory - /ffxivscripexchange: - get: - operationId: ffxivscripexchange_GET - requestBody: - content: - application/json: - schema: - properties: - color: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - home_server: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - type: object - x-field-kind: normal - x-field-original-type: object - x-field-type: object - x-code: "" - responses: - default: - description: Default response - x-name: ffxivscripexchange_GET - x-source: app.py~~1039 - post: - operationId: ffxivscripexchange_POST - requestBody: - content: - application/json: - schema: - properties: - color: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - home_server: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - type: object - x-field-kind: normal - x-field-original-type: object - x-field-type: object - x-code: "" - responses: - default: - description: Default response - x-name: ffxivscripexchange_POST - x-source: app.py~~1039 - x-name: ffxivscripexchange - /ffxivshoppinglist: - get: - operationId: ffxivshoppinglist_GET - requestBody: - content: - application/json: - schema: - properties: - home_server: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - region_wide: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - shopping_list: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - type: object - x-field-kind: normal - x-field-original-type: object - x-field-type: object - x-code: "" - responses: - default: - description: Default response - x-name: ffxivshoppinglist_GET - x-source: app.py~~401 - post: - operationId: ffxivshoppinglist_POST - requestBody: - content: - application/json: - schema: - properties: - home_server: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - region_wide: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - shopping_list: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - type: object - x-field-kind: normal - x-field-original-type: object - x-field-type: object - x-code: "" - responses: - default: - description: Default response - x-name: ffxivshoppinglist_POST - x-source: app.py~~401 - x-name: ffxivshoppinglist - /itemnames: - get: - operationId: itemnames_GET - responses: - default: - description: Default response - x-name: itemnames_GET - x-source: app.py~~570 - post: - operationId: itemnames_POST - responses: - default: - description: Default response - x-name: itemnames_POST - x-source: app.py~~570 - x-name: itemnames - /megaitemnames: - get: - operationId: megaitemnames_GET - requestBody: - content: - application/json: - schema: - properties: - discount: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - region: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - type: object - x-field-kind: normal - x-field-original-type: object - x-field-type: object - x-code: "" - responses: - default: - description: Default response - x-name: megaitemnames_GET - x-source: app.py~~593 - post: - operationId: megaitemnames_POST - requestBody: - content: - application/json: - schema: - properties: - discount: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - region: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - type: object - x-field-kind: normal - x-field-original-type: object - x-field-type: object - x-code: "" - responses: - default: - description: Default response - x-name: megaitemnames_POST - x-source: app.py~~593 - x-name: megaitemnames - /petexport: - get: - operationId: petexport_GET - requestBody: - content: - application/json: - schema: - properties: - itemID: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - maxQuantity: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - minPrice: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - populationBlizz: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - populationWP: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - rankingWP: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - region: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - type: object - x-field-kind: normal - x-field-original-type: object - x-field-type: object - x-code: "" - responses: - default: - description: Default response - x-name: petexport_GET - x-source: app.py~~724 - post: - operationId: petexport_POST - requestBody: - content: - application/json: - schema: - properties: - itemID: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - maxQuantity: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - minPrice: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - populationBlizz: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - populationWP: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - rankingWP: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - region: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - type: object - x-field-kind: normal - x-field-original-type: object - x-field-type: object - x-code: "" - responses: - default: - description: Default response - x-name: petexport_POST - x-source: app.py~~724 - x-name: petexport - /petimport: - get: - operationId: petimport_GET - requestBody: - content: - application/json: - schema: - properties: - ROI: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - avgPrice: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - homeRealmID: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - maxPurchasePrice: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - petsOnly: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - profitAmount: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - region: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - salesPerDay: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - type: object - x-field-kind: normal - x-field-original-type: object - x-field-type: object - x-code: "" - responses: - default: - description: Default response - x-name: petimport_GET - x-source: app.py~~919 - post: - operationId: petimport_POST - requestBody: - content: - application/json: - schema: - properties: - ROI: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - avgPrice: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - homeRealmID: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - maxPurchasePrice: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - petsOnly: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - profitAmount: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - region: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - salesPerDay: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - type: object - x-field-kind: normal - x-field-original-type: object - x-field-type: object - x-code: "" - responses: - default: - description: Default response - x-name: petimport_POST - x-source: app.py~~919 - x-name: petimport - /petmarketshare: - get: - operationId: petmarketshare_GET - requestBody: - content: - application/json: - schema: - properties: - homeRealmName: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - minPrice: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - region: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - salesPerDay: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - type: object - x-field-kind: normal - x-field-original-type: object - x-field-type: object - x-code: "" - responses: - default: - description: Default response - x-name: petmarketshare_GET - x-source: app.py~~670 - post: - operationId: petmarketshare_POST - requestBody: - content: - application/json: - schema: - properties: - homeRealmName: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - minPrice: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - region: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - salesPerDay: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - type: object - x-field-kind: normal - x-field-original-type: object - x-field-type: object - x-code: "" - responses: - default: - description: Default response - x-name: petmarketshare_POST - x-source: app.py~~670 - x-name: petmarketshare - /petshoppinglist: - get: - operationId: petshoppinglist_GET - requestBody: - content: - application/json: - schema: - properties: - maxPurchasePrice: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - petID: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - region: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - type: object - x-field-kind: normal - x-field-original-type: object - x-field-type: object - x-code: "" - responses: - default: - description: Default response - x-name: petshoppinglist_GET - x-source: app.py~~623 - post: - operationId: petshoppinglist_POST - requestBody: - content: - application/json: - schema: - properties: - maxPurchasePrice: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - petID: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - region: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - type: object - x-field-kind: normal - x-field-original-type: object - x-field-type: object - x-code: "" - responses: - default: - description: Default response - x-name: petshoppinglist_POST - x-source: app.py~~623 - x-name: petshoppinglist - /pricecheck: - get: - operationId: pricecheck_GET - requestBody: - content: - application/json: - schema: - properties: - jsonData: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - type: object - x-field-kind: normal - x-field-original-type: object - x-field-type: object - x-code: "" - responses: - default: - description: Default response - x-name: pricecheck_GET - x-source: app.py~~253 - post: - operationId: pricecheck_POST - requestBody: - content: - application/json: - schema: - properties: - jsonData: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - type: object - x-field-kind: normal - x-field-original-type: object - x-field-type: object - x-code: "" - responses: - default: - description: Default response - x-name: pricecheck_POST - x-source: app.py~~253 - x-name: pricecheck - /regionundercut: - get: - operationId: regionundercut_GET - requestBody: - content: - application/json: - schema: - properties: - addonData: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - homeRealmID: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - region: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - type: object - x-field-kind: normal - x-field-original-type: object - x-field-type: object - x-code: "" - responses: - default: - description: Default response - x-name: regionundercut_GET - x-source: app.py~~778 - post: - operationId: regionundercut_POST - requestBody: - content: - application/json: - schema: - properties: - addonData: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - homeRealmID: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - region: - type: string - x-field-kind: normal - x-field-original-type: builtin.str - x-field-type: string - type: object - x-field-kind: normal - x-field-original-type: object - x-field-type: object - x-code: "" - responses: - default: - description: Default response - x-name: regionundercut_POST - x-source: app.py~~778 - x-name: regionundercut - /uploadtimers: - get: - operationId: uploadtimers_GET - responses: - default: - description: Default response - x-name: uploadtimers_GET - x-source: app.py~~532 - post: - operationId: uploadtimers_POST - responses: - default: - description: Default response - x-name: uploadtimers_POST - x-source: app.py~~532 - x-name: uploadtimers - /wow: - get: - operationId: wow_GET - responses: - default: - description: Default response - x-name: wow_GET - x-source: app.py~~218 - post: - operationId: wow_POST - responses: - default: - description: Default response - x-name: wow_POST - x-source: app.py~~218 - x-name: wow -servers: -- description: Default server - url: https://firing-range.saddlebagexchange.com/ diff --git a/outputs/competitor-dashboard-artifacts/.gitkeep b/outputs/competitor-dashboard-artifacts/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/outputs/competitor-dashboard-artifacts/.gitkeep @@ -0,0 +1 @@ + diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..6cf71be --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1062 @@ +{ + "name": "competitor-research-dashboard", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "competitor-research-dashboard", + "version": "1.0.0", + "hasInstallScript": true, + "dependencies": { + "next": "14.2.5", + "pdf-lib": "1.17.1", + "pngjs": "7.0.0", + "react": "18.2.0", + "react-dom": "18.2.0" + }, + "devDependencies": { + "@types/node": "20.14.12", + "@types/react": "18.2.66", + "@types/react-dom": "18.2.22", + "tsx": "4.16.2", + "typescript": "5.5.4" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@next/env": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.5.tgz", + "integrity": "sha512-/zZGkrTOsraVfYjGP8uM0p6r0BDT6xWpkjdVbcz66PJVSpwXX3yNiRycxAuDfBKGWBrZBXRuK/YVlkNgxHGwmA==", + "license": "MIT" + }, + "node_modules/@next/swc-darwin-arm64": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.5.tgz", + "integrity": "sha512-/9zVxJ+K9lrzSGli1///ujyRfon/ZneeZ+v4ptpiPoOU+GKZnm8Wj8ELWU1Pm7GHltYRBklmXMTUqM/DqQ99FQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-darwin-x64": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.5.tgz", + "integrity": "sha512-vXHOPCwfDe9qLDuq7U1OYM2wUY+KQ4Ex6ozwsKxp26BlJ6XXbHleOUldenM67JRyBfVjv371oneEvYd3H2gNSA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-gnu": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.5.tgz", + "integrity": "sha512-vlhB8wI+lj8q1ExFW8lbWutA4M2ZazQNvMWuEDqZcuJJc78iUnLdPPunBPX8rC4IgT6lIx/adB+Cwrl99MzNaA==", + "cpu": [ + "arm64" + ], + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-musl": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.5.tgz", + "integrity": "sha512-NpDB9NUR2t0hXzJJwQSGu1IAOYybsfeB+LxpGsXrRIb7QOrYmidJz3shzY8cM6+rO4Aojuef0N/PEaX18pi9OA==", + "cpu": [ + "arm64" + ], + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-gnu": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.5.tgz", + "integrity": "sha512-8XFikMSxWleYNryWIjiCX+gU201YS+erTUidKdyOVYi5qUQo/gRxv/3N1oZFCgqpesN6FPeqGM72Zve+nReVXQ==", + "cpu": [ + "x64" + ], + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-musl": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.5.tgz", + "integrity": "sha512-6QLwi7RaYiQDcRDSU/os40r5o06b5ue7Jsk5JgdRBGGp8l37RZEh9JsLSM8QF0YDsgcosSeHjglgqi25+m04IQ==", + "cpu": [ + "x64" + ], + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-arm64-msvc": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.5.tgz", + "integrity": "sha512-1GpG2VhbspO+aYoMOQPQiqc/tG3LzmsdBH0LhnDS3JrtDx2QmzXe0B6mSZZiN3Bq7IOMXxv1nlsjzoS1+9mzZw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-ia32-msvc": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.5.tgz", + "integrity": "sha512-Igh9ZlxwvCDsu6438FXlQTHlRno4gFpJzqPjSIBZooD22tKeI4fE/YMRoHVJHmrQ2P5YL1DoZ0qaOKkbeFWeMg==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-x64-msvc": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.5.tgz", + "integrity": "sha512-tEQ7oinq1/CjSG9uSTerca3v4AZ+dFa+4Yu6ihaG8Ud8ddqLQgFGcnwYls13H5X5CPDPZJdYxyeMui6muOLd4g==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@pdf-lib/standard-fonts": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@pdf-lib/standard-fonts/-/standard-fonts-1.0.0.tgz", + "integrity": "sha512-hU30BK9IUN/su0Mn9VdlVKsWBS6GyhVfqjwl1FjZN4TxP6cCw0jP2w7V3Hf5uX7M0AZJ16vey9yE0ny7Sa59ZA==", + "license": "MIT", + "dependencies": { + "pako": "^1.0.6" + } + }, + "node_modules/@pdf-lib/upng": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@pdf-lib/upng/-/upng-1.0.1.tgz", + "integrity": "sha512-dQK2FUMQtowVP00mtIksrlZhdFXQZPC+taih1q4CvPZ5vqdxR/LKBaFg0oAfzd1GlHZXXSPdQfzQnt+ViGvEIQ==", + "license": "MIT", + "dependencies": { + "pako": "^1.0.10" + } + }, + "node_modules/@swc/counter": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@swc/counter/-/counter-0.1.3.tgz", + "integrity": "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==", + "license": "Apache-2.0" + }, + "node_modules/@swc/helpers": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.5.tgz", + "integrity": "sha512-KGYxvIOXcceOAbEk4bi/dVLEK9z8sZ0uBB3Il5b1rhfClSpcX0yfRO0KmTkqR2cnQDymwLB+25ZyMzICg/cm/A==", + "license": "Apache-2.0", + "dependencies": { + "@swc/counter": "^0.1.3", + "tslib": "^2.4.0" + } + }, + "node_modules/@types/node": { + "version": "20.14.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.12.tgz", + "integrity": "sha512-r7wNXakLeSsGT0H1AU863vS2wa5wBOK4bWMjZz2wj+8nBx+m5PeIn0k8AloSLpRuiwdRQZwarZqHE4FNArPuJQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/prop-types": { + "version": "15.7.15", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.15.tgz", + "integrity": "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/react": { + "version": "18.2.66", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.66.tgz", + "integrity": "sha512-OYTmMI4UigXeFMF/j4uv0lBBEbongSgptPrHBxqME44h9+yNov+oL6Z3ocJKo0WyXR84sQUNeyIp9MRfckvZpg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/prop-types": "*", + "@types/scheduler": "*", + "csstype": "^3.0.2" + } + }, + "node_modules/@types/react-dom": { + "version": "18.2.22", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.22.tgz", + "integrity": "sha512-fHkBXPeNtfvri6gdsMYyW+dW7RXFo6Ad09nLFK0VQWR7yGLai/Cyvyj696gbwYvBnhGtevUG9cET0pmUbMtoPQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/react": "*" + } + }, + "node_modules/@types/scheduler": { + "version": "0.26.0", + "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.26.0.tgz", + "integrity": "sha512-WFHp9YUJQ6CKshqoC37iOlHnQSmxNc795UhB26CyBBttrN9svdIrUjl/NjnNmfcwtncN0h/0PPAFWv9ovP8mLA==", + "dev": true, + "license": "MIT" + }, + "node_modules/busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001791", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001791.tgz", + "integrity": "sha512-yk0l/YSrOnFZk3UROpDLQD9+kC1l4meK/wed583AXrzoarMGJcbRi2Q4RaUYbKxYAsZ8sWmaSa/DsLmdBeI1vQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/client-only": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", + "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==", + "license": "MIT" + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/get-tsconfig": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.14.0.tgz", + "integrity": "sha512-yTb+8DXzDREzgvYmh6s9vHsSVCHeC0G3PI5bEXNBHtmshPnO+S5O7qgLEOn0I5QvMy6kpZN8K1NKGyilLb93wA==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/next": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/next/-/next-14.2.5.tgz", + "integrity": "sha512-0f8aRfBVL+mpzfBjYfQuLWh2WyAwtJXCRfkPF4UJ5qd2YwrHczsrSzXU4tRMV0OAxR8ZJZWPFn6uhSC56UTsLA==", + "deprecated": "This version has a security vulnerability. Please upgrade to a patched version. See https://nextjs.org/blog/security-update-2025-12-11 for more details.", + "license": "MIT", + "dependencies": { + "@next/env": "14.2.5", + "@swc/helpers": "0.5.5", + "busboy": "1.6.0", + "caniuse-lite": "^1.0.30001579", + "graceful-fs": "^4.2.11", + "postcss": "8.4.31", + "styled-jsx": "5.1.1" + }, + "bin": { + "next": "dist/bin/next" + }, + "engines": { + "node": ">=18.17.0" + }, + "optionalDependencies": { + "@next/swc-darwin-arm64": "14.2.5", + "@next/swc-darwin-x64": "14.2.5", + "@next/swc-linux-arm64-gnu": "14.2.5", + "@next/swc-linux-arm64-musl": "14.2.5", + "@next/swc-linux-x64-gnu": "14.2.5", + "@next/swc-linux-x64-musl": "14.2.5", + "@next/swc-win32-arm64-msvc": "14.2.5", + "@next/swc-win32-ia32-msvc": "14.2.5", + "@next/swc-win32-x64-msvc": "14.2.5" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.1.0", + "@playwright/test": "^1.41.2", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "sass": "^1.3.0" + }, + "peerDependenciesMeta": { + "@opentelemetry/api": { + "optional": true + }, + "@playwright/test": { + "optional": true + }, + "sass": { + "optional": true + } + } + }, + "node_modules/pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", + "license": "(MIT AND Zlib)" + }, + "node_modules/pdf-lib": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/pdf-lib/-/pdf-lib-1.17.1.tgz", + "integrity": "sha512-V/mpyJAoTsN4cnP31vc0wfNA1+p20evqqnap0KLoRUN0Yk/p3wN52DOEsL4oBFcLdb76hlpKPtzJIgo67j/XLw==", + "license": "MIT", + "dependencies": { + "@pdf-lib/standard-fonts": "^1.0.0", + "@pdf-lib/upng": "^1.0.1", + "pako": "^1.0.11", + "tslib": "^1.11.1" + } + }, + "node_modules/pdf-lib/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "license": "0BSD" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/pngjs": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-7.0.0.tgz", + "integrity": "sha512-LKWqWJRhstyYo9pGvgor/ivk2w94eSjE3RGVuzLGlr3NmD8bf7RcYGze1mNdEHRP6TRP6rMuDHk5t44hnTRyow==", + "license": "MIT", + "engines": { + "node": ">=14.19.0" + } + }, + "node_modules/postcss": { + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/react": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", + "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", + "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.0" + }, + "peerDependencies": { + "react": "^18.2.0" + } + }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, + "node_modules/scheduler": { + "version": "0.23.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", + "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/styled-jsx": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.1.tgz", + "integrity": "sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==", + "license": "MIT", + "dependencies": { + "client-only": "0.0.1" + }, + "engines": { + "node": ">= 12.0.0" + }, + "peerDependencies": { + "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/tsx": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.16.2.tgz", + "integrity": "sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "~0.21.5", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/typescript": { + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", + "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true, + "license": "MIT" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..0e8774a --- /dev/null +++ b/package.json @@ -0,0 +1,27 @@ +{ + "name": "competitor-research-dashboard", + "version": "1.0.0", + "private": true, + "scripts": { + "install": "node scripts/install.mjs", + "dev": "next dev", + "build": "next build", + "start": "next start", + "seed": "tsx scripts/seed.ts", + "typecheck": "tsc --noEmit" + }, + "dependencies": { + "next": "14.2.5", + "pdf-lib": "1.17.1", + "react": "18.2.0", + "react-dom": "18.2.0", + "pngjs": "7.0.0" + }, + "devDependencies": { + "@types/node": "20.14.12", + "@types/react": "18.2.66", + "@types/react-dom": "18.2.22", + "tsx": "4.16.2", + "typescript": "5.5.4" + } +} diff --git a/requirements.in b/requirements.in deleted file mode 100644 index 7381249..0000000 --- a/requirements.in +++ /dev/null @@ -1,12 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.11 -# by the following command: -# -# pip-compile requirements.in -# -Flask -flask_cors -requests -flask_limiter -ddtrace -lxml \ No newline at end of file diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index aced713..0000000 --- a/requirements.txt +++ /dev/null @@ -1,86 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.11 -# by the following command: -# -# pip-compile requirements.in -# -blinker==1.8.2 - # via flask -bytecode==0.15.1 - # via ddtrace -certifi==2024.8.30 - # via requests -charset-normalizer==3.4.0 - # via requests -click==8.1.7 - # via flask -ddtrace==2.14.2 - # via -r requirements.in -deprecated==1.2.14 - # via - # limits - # opentelemetry-api -envier==0.5.2 - # via ddtrace -flask==3.0.3 - # via - # -r requirements.in - # flask-cors - # flask-limiter -flask-cors==5.0.0 - # via -r requirements.in -flask-limiter==3.8.0 - # via -r requirements.in -idna==3.10 - # via requests -importlib-metadata==8.4.0 - # via opentelemetry-api -importlib-resources==6.4.5 - # via limits -itsdangerous==2.2.0 - # via flask -jinja2==3.1.4 - # via flask -limits==3.13.0 - # via flask-limiter -lxml==5.3.0 - # via -r requirements.in -markdown-it-py==3.0.0 - # via rich -markupsafe==3.0.1 - # via - # jinja2 - # werkzeug -mdurl==0.1.2 - # via markdown-it-py -opentelemetry-api==1.27.0 - # via ddtrace -ordered-set==4.1.0 - # via flask-limiter -packaging==24.1 - # via limits -protobuf==5.28.2 - # via ddtrace -pygments==2.18.0 - # via rich -requests==2.32.3 - # via -r requirements.in -rich==13.9.2 - # via flask-limiter -typing-extensions==4.12.2 - # via - # ddtrace - # flask-limiter - # limits -urllib3==2.2.3 - # via requests -werkzeug==3.0.4 - # via flask -wrapt==1.16.0 - # via - # ddtrace - # deprecated -xmltodict==0.14.1 - # via ddtrace -zipp==3.20.2 - # via importlib-metadata diff --git a/routes/ffxiv.py b/routes/ffxiv.py deleted file mode 100644 index b19a2ac..0000000 --- a/routes/ffxiv.py +++ /dev/null @@ -1,48 +0,0 @@ -from flask import Blueprint, render_template, request -import requests -import os -from utils.security import return_safe_html - -api_url = os.getenv("TEMP_API_URL", "http://api.saddlebagexchange.com/api") - -ffxiv_bp = Blueprint("ffxiv", __name__) - - -@ffxiv_bp.route("/ffxiv", methods=["GET", "POST"]) -def ffxiv(): - return render_template("ffxiv_index.html", len=len) - - -@ffxiv_bp.route("/ffxiv_itemnames", methods=["GET", "POST"]) -def ffxivitemnames(): - if request.method == "GET": - return render_template("ffxiv_itemnames.html") - elif request.method == "POST": - raw_items_names = requests.get( - "https://raw.githubusercontent.com/ffxiv-teamcraft/ffxiv-teamcraft/staging/libs/data/src/lib/json/items.json" - ).json() - item_ids = requests.get("https://universalis.app/api/marketable").json() - - resp_list = [ - {"id": id, "name": raw_items_names[str(id)]["en"]} for id in item_ids - ] - - return return_safe_html( - render_template( - "ffxiv_itemnames.html", - results=resp_list, - fieldnames=["id", "name"], - len=len, - ) - ) - - -# { -# "home_server": "Famfrit", -# "user_auctions": [ -# { "itemID": 4745, "price": 100, "desired_state": "below", "hq": true } -# ] -# } -@ffxiv_bp.route("/pricecheck", methods=["GET", "POST"]) -def ffxiv_pricecheck(): - return redirect("https://saddlebagexchange.com/price-sniper") diff --git a/routes/general.py b/routes/general.py deleted file mode 100644 index 2322425..0000000 --- a/routes/general.py +++ /dev/null @@ -1,21 +0,0 @@ -from flask import Blueprint, render_template, send_from_directory -from utils.security import return_safe_html - -general_bp = Blueprint("general", __name__) - - -@general_bp.route("/", methods=["GET", "POST"]) -def root(): - return return_safe_html(render_template("index.html")) - - -@general_bp.route("/favicon.ico", methods=["GET", "POST"]) -def favicon(): - return send_from_directory("templates", "chocobo.png") - - -@general_bp.route("/openapi-spec.json", methods=["GET", "POST"]) -def openapispec(): - with open("openapi-spec.json", "r") as file: - content = file.read() - return content diff --git a/routes/wow.py b/routes/wow.py deleted file mode 100644 index a69423d..0000000 --- a/routes/wow.py +++ /dev/null @@ -1,93 +0,0 @@ -from flask import Blueprint, render_template, request -import requests -import os -from utils.security import return_safe_html - -api_url = os.getenv("TEMP_API_URL", "http://api.saddlebagexchange.com/api") - -wow_bp = Blueprint("wow", __name__) - -NO_RATE_LIMIT = os.getenv("NO_RATE_LIMIT", "False").lower() in ("true", "1", "yes") - -@wow_bp.route("/wow", methods=["GET", "POST"]) -def wow(): - return render_template("wow_index.html", len=len) - - -@wow_bp.route("/itemnames", methods=["GET", "POST"]) -def itemnames(): - if request.method == "GET": - return render_template("itemnames.html") - elif request.method == "POST": - json_data = {} - response = requests.post( - f"{api_url}/wow/itemnames", - headers={"Accept": "application/json"}, - json=json_data, - ).json() - - resp_list = [{"id": k, "name": v} for k, v in response.items()] - - return return_safe_html( - render_template( - "itemnames.html", results=resp_list, fieldnames=["id", "name"], len=len - ) - ) - - -@wow_bp.route("/wowoutofstock", methods=["GET", "POST"]) -def wow_outofstock_api(): - if request.method == "GET": - return return_safe_html(render_template("wow_outofstock.html")) - elif request.method == "POST": - category = int(request.form.get("item_class")) - if category == -1: - include_cat = [] - else: - include_cat = [category] - json_data = { - "region": request.form.get("region"), - "salesPerDay": float(request.form.get("salesPerDay")), - "avgPrice": int(request.form.get("avgPrice")), - "minMarketValue": int(request.form.get("minMarketValue")), - "populationWP": int(request.form.get("populationWP")), - "populationBlizz": int(request.form.get("populationBlizz")), - "rankingWP": int(request.form.get("rankingWP")), - "includeCategories": include_cat, - "excludeCategories": [], - } - - response = requests.post( - f"{api_url}/wow/outofstock", - headers={"Accept": "application/json"}, - json=json_data, - ).json() - - if "data" not in response or len(response["data"]) == 0: - # @coderabbitai will need to move the logger function over so it can be used here - print( - f"Error no matching data with given inputs {json_data} response {response}" - ) - if NO_RATE_LIMIT: - return f"Error no matching data with given inputs {json_data} response {response}" - # send generic error message to remove XSS potential - return "error no matching results found matching search inputs" - response = response["data"] - - for row in response: - del row["itemID"] - del row["item_class"] - del row["item_subclass"] - del row["connectedRealmId"] - del row["itemQuality"] - - fieldnames = list(response[0].keys()) - - return return_safe_html( - render_template( - "wow_outofstock.html", - results=response, - fieldnames=fieldnames, - len=len, - ) - ) \ No newline at end of file diff --git a/run.sh b/run.sh deleted file mode 100755 index 96bd0aa..0000000 --- a/run.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -export FLASK_APP=app.py -export FLASK_RUN_PORT=8080 - -# http -sleep 1 && open -a Google\ Chrome "http://127.0.0.1:8080" & -flask run - -# # https -# sleep 1 && open -a Google\ Chrome "https://127.0.0.1:8080" & -# flask run --cert="certs/full_chain.crt" --key="certs/private.key" \ No newline at end of file diff --git a/scripts/install.mjs b/scripts/install.mjs new file mode 100644 index 0000000..6194fbd --- /dev/null +++ b/scripts/install.mjs @@ -0,0 +1,27 @@ +import fs from "node:fs/promises"; +import path from "node:path"; + +const repoRoot = process.cwd(); + +const directories = [ + path.join(repoRoot, "data"), + path.join(repoRoot, "outputs"), + path.join(repoRoot, "outputs", "competitor-dashboard-artifacts") +]; + +for (const directory of directories) { + await fs.mkdir(directory, { recursive: true }); +} + +for (const keepFile of [ + path.join(repoRoot, "data", ".gitkeep"), + path.join(repoRoot, "outputs", "competitor-dashboard-artifacts", ".gitkeep") +]) { + try { + await fs.access(keepFile); + } catch { + await fs.writeFile(keepFile, ""); + } +} + +console.log("[install] ensured local data and output directories"); diff --git a/scripts/seed.ts b/scripts/seed.ts new file mode 100644 index 0000000..5ad183a --- /dev/null +++ b/scripts/seed.ts @@ -0,0 +1,55 @@ +import fs from "node:fs/promises"; +import path from "node:path"; + +import { writeReportArtifacts } from "@/lib/competitor-dashboard/artifacts"; +import { artifactRootPath } from "@/lib/competitor-dashboard/paths"; +import { buildSeedData } from "@/lib/competitor-dashboard/seed-data"; +import { saveDashboardData } from "@/lib/competitor-dashboard/store"; + +async function main() { + console.log("[seed] building competitor dashboard demo data"); + + const seed = buildSeedData(); + const artifactRoot = artifactRootPath(); + + await fs.mkdir(artifactRoot, { recursive: true }); + + for (const report of seed.data.reports) { + const competitor = seed.data.competitors.find((candidate) => candidate.id === report.competitorId); + const run = seed.data.sweepRuns.find((candidate) => candidate.id === report.runId); + const findings = seed.data.findings.filter((finding) => finding.reportId === report.id); + const artifactPdf = seed.artifacts.find((artifact) => artifact.id === `${report.id}-pdf`); + const artifactPng = seed.artifacts.find((artifact) => artifact.id === `${report.id}-png`); + + if (!competitor || !run || !artifactPdf || !artifactPng) { + throw new Error(`Seed artifact inputs missing for report ${report.id}`); + } + + const { pdfRelativePath, pngRelativePath } = await writeReportArtifacts({ + artifactPdf, + artifactPng, + competitor, + report, + run, + findings + }); + + artifactPdf.relativePath = pdfRelativePath; + artifactPng.relativePath = pngRelativePath; + } + + await saveDashboardData(seed.data); + + console.log("[seed] wrote data file and artifacts"); + console.log(`[seed] data file contains ${seed.data.reports.length} reports`); + console.log(`[seed] findings: ${seed.data.findings.length}`); + console.log(`[seed] artifacts: ${seed.data.artifacts.length}`); + console.log( + `[seed] artifact root: ${path.relative(process.cwd(), artifactRoot).split(path.sep).join("/")}` + ); +} + +main().catch((error) => { + console.error("[seed] failed:", error); + process.exitCode = 1; +}); diff --git a/semgrep.config.yaml b/semgrep.config.yaml deleted file mode 100644 index 8d69f5a..0000000 --- a/semgrep.config.yaml +++ /dev/null @@ -1,42 +0,0 @@ -rules: -- id: nan-injection - message: Found user input going directly into typecast for bool(), float(), or complex(). This allows an - attacker to inject Python's not-a-number (NaN) into the typecast. This results in undefind behavior, - particularly when doing comparisons. Either cast to a different type, or add a guard checking for - all capitalizations of the string 'nan'. - languages: - - python - severity: ERROR - mode: taint - pattern-sources: - - pattern-either: - - pattern: flask.request.$SOMETHING.get(...) - - pattern: flask.request.$SOMETHING[...] - - patterns: - - pattern-inside: | - @$APP.route(...) - def $FUNC(..., $ROUTEVAR, ...): - ... - - pattern: $ROUTEVAR - pattern-sinks: - - pattern-either: - - pattern: float(...) - - pattern: bool(...) - - pattern: complex(...) - pattern-sanitizers: - - not_conflicting: true - pattern: $ANYTHING(...) - metadata: - references: - - https://discuss.python.org/t/nan-breaks-min-max-and-sorting-functions-a-solution/2868 - - https://blog.bitdiscovery.com/2021/12/python-nan-injection/ - category: security - cwe: - - 'CWE-704: Incorrect Type Conversion or Cast' - technology: - - flask - subcategory: - - vuln - impact: MEDIUM - likelihood: MEDIUM - confidence: MEDIUM diff --git a/templates/_header.html b/templates/_header.html deleted file mode 100644 index 890edde..0000000 --- a/templates/_header.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - Saddlebag Exchange Temp Home - - - - - - - - - - - - - - diff --git a/templates/_navbar.html b/templates/_navbar.html deleted file mode 100644 index 24c5c9b..0000000 --- a/templates/_navbar.html +++ /dev/null @@ -1,123 +0,0 @@ - - - diff --git a/templates/bestdeals.html b/templates/bestdeals.html deleted file mode 100644 index 04fa06b..0000000 --- a/templates/bestdeals.html +++ /dev/null @@ -1,123 +0,0 @@ -{% autoescape true %} - {% include '_header.html' %} - - - - {% include '_navbar.html' %} -
- -

WoW find the best deals, best discounts, big gold

- -
- {% if request.method == 'POST'%} - - - - {% for header in results[0].keys() %} - - {% endfor %} - - - - {% for row in results %} - - {% for index in range(0, len(fieldnames)) %} - - {% endfor %} - - {% endfor %} - -
{{header}}
{{row[fieldnames[index]]}}
- {% endif %} -
- -
-
- -
- - -
Search for deals on all items, Pets, Dragonflight, or Legacy items? ex: All
-
- -
- - -
Pick a region. ex: US
-
- -
- - -
Discount Percent ex: 90
-
- -
- - -
Minimum TSM Average Price ex: 1000
-
- -
- - -
Sales Per Day ex: 10
-
- -
- - -
Pick a category. ex: Armor
-
- - -
- -
- - - - - -{% endautoescape %} diff --git a/templates/chocobo.png b/templates/chocobo.png deleted file mode 100644 index 43b14fa..0000000 Binary files a/templates/chocobo.png and /dev/null differ diff --git a/templates/ffxiv_craftsim.html b/templates/ffxiv_craftsim.html deleted file mode 100644 index 16b374f..0000000 --- a/templates/ffxiv_craftsim.html +++ /dev/null @@ -1,332 +0,0 @@ -{% autoescape true %} -{% include '_header.html' %} - - - - {% include '_navbar.html' %} -
- -

Finds the best FFXIV items to craft!

-
- {% if request.method == 'POST'%} - - - - {% for header in results[0].keys() %} - - {% endfor %} - - - - {% for row in results %} - - {% for index in range(0, len(fieldnames)) %} - - {% endfor %} - - {% endfor %} - -
{{header}}
{{row[fieldnames[index]]}}
- {% endif %} -
- -
-
- -
- - -
Pick your home server. ex: Famfrit
-
- -
- - -
Filter for specific item type. ex: Orchestrion Components
-
- -
- - -
Select which "Disciples of the Hand" you want to search recipies for. ex: Carpenter
-
- -
- - -
Select which cost metric to use for profit calculations. ex: Costs: based on materials regional median sale price
-
- -
- - -
Select which revenue metric to use for profit calculations. ex: Revenue: based on current home server minimum listing prices
-
- -
- - -
Desired number of region wide sales per week in HQ or NQ. ex: 30.
-
- -
- - -
Desired minimum regional median sale price in HQ or NQ (filters out items that sell for less than this). ex: 100000.
-
- -
- - -
Desired maximum crafting cost (lower this if you are poor). ex: 1000000.
-
- -
- - -
Minimum recipe stars / difficulty. ex: 2.
-
- -
- - -
Minimum recipe lvl_lower_limit. ex: 2.
-
- -
- - -
Maximum recipe lvl_upper_limit. (lower this if you are an omnicrafter with all recipes unlocked) ex: 90.
-
- -
- - -
Minimum quantity created per craft. ex: 1.
-
- -
- - -
Hide expert level recipes that are not guarenteed to craft. ex: True
-
- - -
- -
- - - - - -{% endautoescape %} - - - - - - diff --git a/templates/ffxiv_craftsimconfig.html b/templates/ffxiv_craftsimconfig.html deleted file mode 100644 index 0c57a1c..0000000 --- a/templates/ffxiv_craftsimconfig.html +++ /dev/null @@ -1,329 +0,0 @@ -{% autoescape true %} -{% include '_header.html' %} - - - - {% include '_navbar.html' %} -
- -

Customized config for the best FFXIV items to craft!

-

- Creates the Json Data for the craftsim custom page. Letting you edit the items and HQ / NQ materials desired. -

-
- {% if request.method == 'POST'%} - - - - {% for header in results[0].keys() %} - - {% endfor %} - - - - {% for row in results %} - - {% for index in range(0, len(fieldnames)) %} - - {% endfor %} - - {% endfor %} - -
{{header}}
{{row[fieldnames[index]]}}
- {% endif %} -
- -
-
- -
- - -
Pick your home server. ex: Famfrit
-
- -
- - -
Filter for specific item type. ex: Orchestrion Components
-
- -
- - -
Select which "Disciples of the Hand" you want to search recipies for. ex: Carpenter
-
- -
- - -
Select which cost metric to use for profit calculations. ex: Costs: based on materials regional median sale price
-
- -
- - -
Select which revenue metric to use for profit calculations. ex: Revenue: based on current home server minimum listing prices
-
- -
- - -
Desired number of region wide sales per week in HQ or NQ. ex: 30.
-
- -
- - -
Desired minimum regional median sale price in HQ or NQ (filters out items that sell for less than this). ex: 100000.
-
- -
- - -
Desired maximum crafting cost (lower this if you are poor). ex: 1000000.
-
- -
- - -
Minimum recipe stars / difficulty. ex: 2.
-
- -
- - -
Minimum recipe lvl_lower_limit. ex: 2.
-
- -
- - -
Maximum recipe lvl_upper_limit. (lower this if you are an omnicrafter with all recipes unlocked) ex: 90.
-
- -
- - -
Minimum quantity created per craft. ex: 1.
-
- -
- - -
Hide expert level recipes that are not guarenteed to craft. ex: True
-
- - -
- -
- - - - - -{% endautoescape %} diff --git a/templates/ffxiv_craftsimcustom.html b/templates/ffxiv_craftsimcustom.html deleted file mode 100644 index 50f85b2..0000000 --- a/templates/ffxiv_craftsimcustom.html +++ /dev/null @@ -1,75 +0,0 @@ -{% autoescape true %} -{% include '_header.html' %} - - - - {% include '_navbar.html' %} -
- -

Customized input for the best FFXIV items to craft!

-

- Custom search of our craftsim, letting you change out items and HQ / NQ materials -

-
- {% if request.method == 'POST'%} - - - - {% for header in results[0].keys() %} - - {% endfor %} - - - - {% for row in results %} - - {% for index in range(0, len(fieldnames)) %} - - {% endfor %} - - {% endfor %} - -
{{header}}
{{row[fieldnames[index]]}}
- {% endif %} -
- - -
-
- - - - -
- -
- - - - - - - -{% endautoescape %} diff --git a/templates/ffxiv_index.html b/templates/ffxiv_index.html deleted file mode 100644 index 01d5b0c..0000000 --- a/templates/ffxiv_index.html +++ /dev/null @@ -1,41 +0,0 @@ -{% include '_header.html' %} - - - - {% include '_navbar.html' %} - -
- - -

Saddlebag Exchange FFXIV alpha site

-

Links to temporary pages on brand new searches.

- - diff --git a/templates/ffxiv_itemnames.html b/templates/ffxiv_itemnames.html deleted file mode 100644 index b70d007..0000000 --- a/templates/ffxiv_itemnames.html +++ /dev/null @@ -1,50 +0,0 @@ -{% autoescape true %} - -{% include '_header.html' %} - - - - {% include '_navbar.html' %} -
- -

FFXIV Item Names by Item ID

-
- {% if request.method == 'POST'%} - - - - {% for header in results[0].keys() %} - - {% endfor %} - - - - {% for row in results %} - - {% for index in range(0, len(fieldnames)) %} - - {% endfor %} - - {% endfor %} - -
{{header}}
{{row[fieldnames[index]]}}
- {% endif %} -
- -
-
- -
-
-
- - - - - - - -{% endautoescape %} diff --git a/templates/ffxiv_pricecheck.html b/templates/ffxiv_pricecheck.html deleted file mode 100644 index 8d3a4ce..0000000 --- a/templates/ffxiv_pricecheck.html +++ /dev/null @@ -1,78 +0,0 @@ -{% autoescape true %} - -{% include '_header.html' %} - - - - {% include '_navbar.html' %} -
- -

FFXIV Snipe Amazing Discounts!

-

- - Checkout the full guide here! - -

-
- {% if request.method == 'POST'%} - - - - {% for header in results[0].keys() %} - - {% endfor %} - - - - {% for row in results %} - - {% for index in range(0, len(fieldnames)) %} - - {% endfor %} - - {% endfor %} - -
{{header}}
{{row[fieldnames[index]]}}
- {% endif %} -
- - -
-
- - - - -
- -
- - - - - - - -{% endautoescape %} diff --git a/templates/ffxiv_sale_history.html b/templates/ffxiv_sale_history.html deleted file mode 100644 index 7224ab3..0000000 --- a/templates/ffxiv_sale_history.html +++ /dev/null @@ -1,71 +0,0 @@ -{% autoescape true %} - -{% include '_header.html' %} - - - - {% include '_navbar.html' %} -
- -

FFXIV See Full 7 Day Sale History.

- -
- {% if request.method == 'POST'%} - - - - {% for header in results[0].keys() %} - - {% endfor %} - - - - {% for row in results %} - - {% for index in range(0, len(fieldnames)) %} - - {% endfor %} - - {% endfor %} - -
{{header}}
{{row[fieldnames[index]]}}
- {% endif %} -
- -
-
- -
- - -
Pick your home region. ex: Europe
-
- -
- - -
The number related to an item ex: 39872 is Baked Eggplant
-
- - -
- -
- - - - - - - -{% endautoescape %} diff --git a/templates/ffxiv_scrip_exchange.html b/templates/ffxiv_scrip_exchange.html deleted file mode 100644 index e8a4e2b..0000000 --- a/templates/ffxiv_scrip_exchange.html +++ /dev/null @@ -1,161 +0,0 @@ -{% autoescape true %} - -{% include '_header.html' %} - - - - {% include '_navbar.html' %} -
- -

FFXIV See Orange or Purple Scrip Value.

- -
- {% if request.method == 'POST'%} - - - - {% for header in results[0].keys() %} - - {% endfor %} - - - - {% for row in results %} - - {% for index in range(0, len(fieldnames)) %} - - {% endfor %} - - {% endfor %} - -
{{header}}
{{row[fieldnames[index]]}}
- {% endif %} -
- -
-
- -
- - -
Pick your home server. ex: Famfrit
-
- -
- - -
Pick the scrip color. ex: Purple
-
- - -
- -
- - - - - - -{% endautoescape %} diff --git a/templates/ffxiv_server_history.html b/templates/ffxiv_server_history.html deleted file mode 100644 index 0c3da8f..0000000 --- a/templates/ffxiv_server_history.html +++ /dev/null @@ -1,148 +0,0 @@ -{% autoescape true %} - -{% include '_header.html' %} - - - - {% include '_navbar.html' %} -
- -

FFXIV whats the bestt server to sell on.

- -
- {% if request.method == 'POST'%} - - - - {% for header in results[0].keys() %} - - {% endfor %} - - - - {% for row in results %} - - {% for index in range(0, len(fieldnames)) %} - - {% endfor %} - - {% endfor %} - -
{{header}}
{{row[fieldnames[index]]}}
- {% endif %} -
- -
-
- -
- - -
Pick your home server. ex: Famfrit
-
- -
- - -
The number related to an item ex: 4745 is orange juice
-
- - -
- -
- - - - - - - -{% endautoescape %} diff --git a/templates/ffxiv_shoppinglist.html b/templates/ffxiv_shoppinglist.html deleted file mode 100644 index cf6a5b9..0000000 --- a/templates/ffxiv_shoppinglist.html +++ /dev/null @@ -1,175 +0,0 @@ -{% autoescape true %} - -{% include '_header.html' %} - - - - {% include '_navbar.html' %} -
- -

FFXIV find the best place to buy items

-

- Shows you where to get the best deals on items!
- - Check out our guide here if you are new to this. - -

-
- {% if request.method == 'POST'%} - - - - {% for header in results[0].keys() %} - - {% endfor %} - - - - {% for row in results %} - - {% for index in range(0, len(fieldnames)) %} - - {% endfor %} - - {% endfor %} - -
{{header}}
{{row[fieldnames[index]]}}
- {% endif %} -
- - - -
-
- -
- - -
Pick your home server. ex: Famfrit
-
- -
- - -
True will search all servers in all datacenters in your region.
-
- -
- -
- Paste in your shopping list json data here -
- -
- - -
- -
- - - - - - - -{% endautoescape %} diff --git a/templates/ffxivbestdeals.html b/templates/ffxivbestdeals.html deleted file mode 100644 index d1431f6..0000000 --- a/templates/ffxivbestdeals.html +++ /dev/null @@ -1,268 +0,0 @@ -{% autoescape true %} - -{% include '_header.html' %} - - - - {% include '_navbar.html' %} -
- -

FFXIV Best Deals earn gil!

- -
- {% if request.method == 'POST'%} - - - - {% for header in results[0].keys() %} - - {% endfor %} - - - - {% for row in results %} - - {% for index in range(0, len(fieldnames)) %} - - {% endfor %} - - {% endfor %} - -
{{header}}
{{row[fieldnames[index]]}}
- {% endif %} -
- -
-
- -
- - -
Pick your home server. ex: Famfrit
-
- -
- - -
Filter for specific item type. ex: Orchestrion Components
-
- -
- - -
Discount Percent (1-100) ex: 90
-
- -
- - -
Median Price desired minimum regional median price ex: 30000
-
- - -
- - -
Sales Amount weekly regional sales ex: 20
-
- -
- - -
Max Buy Pricet max desired purchase price ex: 10000
-
- - -
- -
- - - - - - - -{% endautoescape %} diff --git a/templates/index.html b/templates/index.html deleted file mode 100644 index 8734385..0000000 --- a/templates/index.html +++ /dev/null @@ -1,24 +0,0 @@ -{% include '_header.html' %} - - - - {% include '_navbar.html' %} - -
- - -

Saddlebag Exchange Alpha site

-

Links to temporary pages on brand new searches.

- - diff --git a/templates/itemnames.html b/templates/itemnames.html deleted file mode 100644 index 1c6e1f1..0000000 --- a/templates/itemnames.html +++ /dev/null @@ -1,50 +0,0 @@ -{% autoescape true %} - -{% include '_header.html' %} - - - - {% include '_navbar.html' %} -
- -

WoW Item Names by Item ID

-
- {% if request.method == 'POST'%} - - - - {% for header in results[0].keys() %} - - {% endfor %} - - - - {% for row in results %} - - {% for index in range(0, len(fieldnames)) %} - - {% endfor %} - - {% endfor %} - -
{{header}}
{{row[fieldnames[index]]}}
- {% endif %} -
- -
-
- -
-
-
- - - - - - - -{% endautoescape %} diff --git a/templates/megaitemnames.html b/templates/megaitemnames.html deleted file mode 100644 index e4f8131..0000000 --- a/templates/megaitemnames.html +++ /dev/null @@ -1,70 +0,0 @@ -{% autoescape true %} - -{% include '_header.html' %} - - - - {% include '_navbar.html' %} -
- -

For getting mega alerts item ids and potential prices

-
- {% if request.method == 'POST'%} - - - - {% for header in results[0].keys() %} - - {% endfor %} - - - - {% for row in results %} - - {% for index in range(0, len(fieldnames)) %} - - {% endfor %} - - {% endfor %} - -
{{header}}
{{row[fieldnames[index]]}}
- {% endif %} -
- -
-
- -
- - -
Pick a region. ex: US
-
- -
- - -
- ex: 70 or 90. -
-
- - -
- -
- - - - - - -{% endautoescape %} diff --git a/templates/oldscan.html b/templates/oldscan.html deleted file mode 100644 index 6bc214f..0000000 --- a/templates/oldscan.html +++ /dev/null @@ -1,378 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - Saddlebag Exchange Search - - - - - - - - - -
-
- -
- {% if request.method == 'POST'%} - - - - {% for header in results[0].keys() %} - - {% endfor %} - - - - {% for row in results %} - - {% for index in range(0, len(fieldnames)) %} - - {% endfor %} - - {% endfor %} - -
{{header}}
{{row[fieldnames[index]]}}
- {% endif %} -
- -
-

The time period to search over. ex: `24` is the past 24 hours. For more items to sell choose a higher number.

-
- - -
- -

Number of sales in that time. ex: `5` is 5 sales in that selected time period. For more items to sell choose a lower number.

-
- - -
- -

Desired R.O.I (return on investment): ex: `50` means that 50% of the revenue you get from a sale should be all profit (after tax). For more profit, choose a higher number from 1 to 100.

-
- - -
- -

The Home server of your character that you want to sell items on. ex: `Famfrit`

-
- - -
- -

Filter item category. ex: `Armor` will only show items from armor item types

-
- - -
- -

Desired Min Stack Size. ex: `10` is only show deals you can get in stacks of 10 or greater. For more items to sell choose a lower number.

-
- - -
- -

HQ only? Only search for hq prices?

-
- - -
- -

Desired Min Profit Amount. ex: `10000` is only show deals that yields 10000 gil profit or greater. For more items to sell choose a lower number.

-
- - -
- -

Desired Average Price Per Unit. ex: `10000` is only show deals that sell on average for 10000 gil or greater. For more items to sell choose a lower number.

-
- - -
- - - -

Region Wide Search: `True` will search all servers in all datacenters in your region. `False` will just search the local DC.

-
- - -
- -

Show Vendor Prices: `True` will compare market prices vs vendor prices on NQ items that can be purchased from vendors.

-
- - -
- -

Show Out of Stock: `False` will remove out of stock items from the list which show up as having 100% profit margins and 1 bil gil profit.

-
- - -
- - - -
- Go back to home page - -
- -
-
- - - - - - - - - - - diff --git a/templates/petexport.html b/templates/petexport.html deleted file mode 100644 index 528597a..0000000 --- a/templates/petexport.html +++ /dev/null @@ -1,113 +0,0 @@ -{% autoescape true %} - -{% include '_header.html' %} - - - - {% include '_navbar.html' %} -
- -

WoW find the best place to sell

-
- {% if request.method == 'POST'%} - - - - {% for header in results[0].keys() %} - - {% endfor %} - - - - {% for row in results %} - - {% for index in range(0, len(fieldnames)) %} - - {% endfor %} - - {% endfor %} - -
{{header}}
{{row[fieldnames[index]]}}
- {% endif %} -
- -
-
- -
- - -
Pick a region. ex: US
-
- -
- - - -
- -
- - -
populationWP. Pick a minimum server population size (via wowprogress). ex: 3000.
-
- -
- - -
populationBlizz. Pick a minimum server population size (via blizzard). only allowed values: 0,1,2,3,4.
-
- -
- - -
rankingWP. Pick a min wowprogress ranking. ex: 90.
-
- -
- - -
minPrice. exclude servers with a min price lower than this value. ex: 3000.
-
- -
- - -
maxQuantity. exclude servers with a min price lower than this value. ex: 100.
-
- - -
- -
- - - - - - - -{% endautoescape %} diff --git a/templates/petimport.html b/templates/petimport.html deleted file mode 100644 index 8d867cc..0000000 --- a/templates/petimport.html +++ /dev/null @@ -1,637 +0,0 @@ -{% autoescape true %} - -{% include '_header.html' %} - - - - {% include '_navbar.html' %} -
- -

For finding items to buy on other servers and sell on your home realm

- - -
- {% if request.method == 'POST'%} - - - - {% for header in results[0].keys() %} - - {% endfor %} - - - - {% for row in results %} - - {% for index in range(0, len(fieldnames)) %} - - {% endfor %} - - {% endfor %} - -
{{header}}
{{row[fieldnames[index]]}}
- {% endif %} -
- -
-
-
- - -
Search for pets or normal items? ex: Pets
-
- -
- - -
Pick a region. ex: US
-
- -
- - -
The Home server of your character that you want to sell items on. ex: Thrall
-
- -
- - -
maxPurchasePrice. ex: 10000
-
- -
- - -
avgPrice. ex: 1000
-
- -
- - -
salesPerDay. ex: 10
-
- -
- - -
ROI. ex: 20
-
- -
- - -
profitAmount. ex: 10
-
- - - -
- -
- - - - - - - -{% endautoescape %} diff --git a/templates/petmarketshare.html b/templates/petmarketshare.html deleted file mode 100644 index 1bdc80c..0000000 --- a/templates/petmarketshare.html +++ /dev/null @@ -1,457 +0,0 @@ -{% autoescape true %} - -{% include '_header.html' %} - - - - {% include '_navbar.html' %} -
- -

Estimated Regional Potential Pet Sale Revenue from TSM Stats

-
- {% if request.method == 'POST'%} - - - - {% for header in results[0].keys() %} - - {% endfor %} - - - - {% for row in results %} - - {% for index in range(0, len(fieldnames)) %} - - {% endfor %} - - {% endfor %} - -
{{header}}
{{row[fieldnames[index]]}}
- {% endif %} -
- -
-
-
- - -
Pick a region. ex: US
-
- -
- - -
The Home server of your main character. ex: Thrall
-
- -
- - -
minPrice. ex: 3000
-
- -
- - -
salesPerDay. ex: 1
-
- - -
- -
- - - - - - - -{% endautoescape %} diff --git a/templates/petnames.html b/templates/petnames.html deleted file mode 100644 index f8623b5..0000000 --- a/templates/petnames.html +++ /dev/null @@ -1,50 +0,0 @@ -{% autoescape true %} - -{% include '_header.html' %} - - - - {% include '_navbar.html' %} -
- -

WoW battle pet names by pet id

-
- {% if request.method == 'POST'%} - - - - {% for header in results[0].keys() %} - - {% endfor %} - - - - {% for row in results %} - - {% for index in range(0, len(fieldnames)) %} - - {% endfor %} - - {% endfor %} - -
{{header}}
{{row[fieldnames[index]]}}
- {% endif %} -
- -
-
- -
- -
- - - - - - - -{% endautoescape %} diff --git a/templates/petshoppinglist.html b/templates/petshoppinglist.html deleted file mode 100644 index ee7ea45..0000000 --- a/templates/petshoppinglist.html +++ /dev/null @@ -1,91 +0,0 @@ -{% autoescape true %} - -{% include '_header.html' %} - - - - {% include '_navbar.html' %} -
- -

WoW shopping list, find the cheapest price

-
- {% if request.method == 'POST'%} - - - - {% for header in results[0].keys() %} - - {% endfor %} - - - - {% for row in results %} - - {% for index in range(0, len(fieldnames)) %} - - {% endfor %} - - {% endfor %} - -
{{header}}
{{row[fieldnames[index]]}}
- {% endif %} -
- -
-
- -
- - - -
- - -
- - -
maxPurchasePrice. Pick the most amount of gold you want to spend. ex: 3000
-
- -
- - -
Pick a region. ex: US
-
- - -
- -
- - - - - - - -{% endautoescape %} diff --git a/templates/regionundercut.html b/templates/regionundercut.html deleted file mode 100644 index cfd4ea2..0000000 --- a/templates/regionundercut.html +++ /dev/null @@ -1,625 +0,0 @@ -{% autoescape true %} - -{% include '_header.html' %} - - - - {% include '_navbar.html' %} -
- -

WoW Detected Undercuts Region Wide

-

- Now on our main website here! -

-
- {% if request.method == 'POST'%} - - - - {% for header in results[0].keys() %} - - {% endfor %} - - - - {% for row in results %} - - {% for index in range(0, len(fieldnames)) %} - - {% endfor %} - - {% endfor %} - -
{{header}}
{{row[fieldnames[index]]}}
- {% endif %} -
- -

WoW listings Sold, Expired or Not Found

-
- {% if request.method == 'POST'%} - - - - {% for header_n in results_n[0].keys() %} - - {% endfor %} - - - - {% for row_n in results_n %} - - {% for index in range(0, len(fieldnames_n)) %} - - {% endfor %} - - {% endfor %} - -
{{header_n}}
{{row_n[fieldnames_n[index]]}}
- {% endif %} -
- -
-
- -
- - -
Pick a region. ex: US
-
- -
- - -
The Home server of your character that you want to sell items on. ex: Thrall

-
- - - - - - -
-
- - - - - - - -{% endautoescape %} diff --git a/templates/uploadtimers.html b/templates/uploadtimers.html deleted file mode 100644 index 9935575..0000000 --- a/templates/uploadtimers.html +++ /dev/null @@ -1,50 +0,0 @@ -{% autoescape true %} - -{% include '_header.html' %} - - - - {% include '_navbar.html' %} -
- -

WoW Auctionhouse API data update times each hour

-
- {% if request.method == 'POST'%} - - - - {% for header in results[0].keys() %} - - {% endfor %} - - - - {% for row in results %} - - {% for index in range(0, len(fieldnames)) %} - - {% endfor %} - - {% endfor %} - -
{{header}}
{{row[fieldnames[index]]}}
- {% endif %} -
- -
-
- -
- -
- - - - - - - -{% endautoescape %} diff --git a/templates/wow_index.html b/templates/wow_index.html deleted file mode 100644 index 5673d50..0000000 --- a/templates/wow_index.html +++ /dev/null @@ -1,48 +0,0 @@ -{% include '_header.html' %} - - - - {% include '_navbar.html' %} - -
- - -

Saddlebag Exchange WoW Alpha Site

-

Links to temporary pages on brand new searches.

- - diff --git a/templates/wow_outofstock.html b/templates/wow_outofstock.html deleted file mode 100644 index 52eb5dc..0000000 --- a/templates/wow_outofstock.html +++ /dev/null @@ -1,119 +0,0 @@ -{% autoescape true %} -{% include '_header.html' %} - - - - {% include '_navbar.html' %} -
-

WoW Out of Stock Items

- -
- {% if request.method == 'POST'%} - - - - {% for header in results[0].keys() %} - - {% endfor %} - - - - {% for row in results %} - - {% for index in range(0, len(fieldnames)) %} - - {% endfor %} - - {% endfor %} - -
{{header}}
{{row[fieldnames[index]]}}
- {% endif %} -
-
-
-
- - -
Select the region you are interested in.
-
-
- - -
Enter the average sales per day. Default is 0.2.
-
-
- - -
Enter the average price of the item. Default is 1000.
-
-
- - -
Specify the minimum market value. Default is 100000.
-
-
- - -
Enter the World Population metric. Default is 3000.
-
-
- - -
Enter the Blizzard Population metric. Default is 1.
-
-
- - -
Enter the World Population ranking. Default is 90.
-
-
- - -
Pick a category. Default is All.
-
- -
-
- - - - - -{% endautoescape %} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..e0d07bd --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "target": "ES2022", + "lib": ["dom", "dom.iterable", "es2022"], + "allowJs": false, + "skipLibCheck": true, + "strict": true, + "noEmit": true, + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve", + "incremental": true, + "plugins": [{ "name": "next" }], + "baseUrl": ".", + "paths": { + "@/*": ["./*"] + } + }, + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], + "exclude": ["node_modules"] +} diff --git a/types/pngjs.d.ts b/types/pngjs.d.ts new file mode 100644 index 0000000..f3c241a --- /dev/null +++ b/types/pngjs.d.ts @@ -0,0 +1,11 @@ +declare module "pngjs" { + export class PNG { + constructor(options: { width: number; height: number }); + width: number; + height: number; + data: Uint8Array; + static sync: { + write(png: PNG): Buffer; + }; + } +} diff --git a/utils/helpers.py b/utils/helpers.py deleted file mode 100644 index 8d46149..0000000 --- a/utils/helpers.py +++ /dev/null @@ -1,16 +0,0 @@ -def str_to_bool(bool_str): - """ - Convert a string representation of truth to True or False. - - True values are 'y', 'yes', 't', 'true', 'on', and '1'; - False values are 'n', 'no', 'f', 'false', 'off', and '0'. - Raises ValueError if 'bool_str' is anything else. - Case insensitive. - """ - bool_str = bool_str.lower() - if bool_str in ("y", "yes", "t", "true", "on", "1"): - return True - elif bool_str in ("n", "no", "f", "false", "off", "0"): - return False - else: - raise ValueError(f"Invalid truth value: '{bool_str}'") diff --git a/utils/old-functions.py b/utils/old-functions.py deleted file mode 100644 index cfabccf..0000000 --- a/utils/old-functions.py +++ /dev/null @@ -1,156 +0,0 @@ -#### FFXIV RESELLING SEARCH #### -# just used for initial test of temp flask pod not maintained - -# @app.route("/scan", methods=["GET", "POST"]) -# def scan(): -# if request.method == "GET": -# return render_template("oldscan.html") -# elif request.method == "POST": -# scan_hours = request.form.get("scan_hours") -# sale_amt = request.form.get("sale_amt") -# roi = request.form.get("roi") -# home_server = request.form.get("home_server") -# stack_size = request.form.get("stack_size") -# hq_only = request.form.get("hq_only") -# profit_amt = request.form.get("profit_amt") -# min_desired_avg_ppu = request.form.get("min_desired_avg_ppu") -# game_wide = request.form.get("game_wide") -# include_vendor = request.form.get("include_vendor") -# out_stock = request.form.get("out_stock") -# filters = [int(request.form.get("filters"))] -# headers = {"Accept": "application/json"} -# json_data = { -# "preferred_roi": int(roi), -# "min_profit_amount": int(profit_amt), -# "min_desired_avg_ppu": int(min_desired_avg_ppu), -# "min_stack_size": int(stack_size), -# "hours_ago": int(scan_hours), -# "min_sales": int(sale_amt), -# "hq": str_to_bool(hq_only), -# "home_server": home_server, -# "filters": filters, -# "region_wide": str_to_bool(game_wide), -# "include_vendor": str_to_bool(include_vendor), -# "show_out_stock": str_to_bool(out_stock), -# "universalis_list_uid": "", -# } -# response = requests.post( -# "http://api.saddlebagexchange.com/api/scan/", -# headers=headers, -# json=json_data, -# ).json() -# if "data" not in response: -# return f"Error no matching data with given inputs {response}" -# response = response["data"] -# fieldnames = list(response[0].keys()) -# return render_template( -# "oldscan.html", results=response, fieldnames=fieldnames, len=len -# ) - -### FFXIV best server #### - -# @app.route("/ffxivserverhistory", methods=["GET", "POST"]) -# def ffxivserverhistory(): -# if request.method == "GET": -# return return_safe_html(render_template("ffxiv_server_history.html")) -# elif request.method == "POST": -# json_data = { -# "home_server": request.form.get("home_server"), -# "item_id": int(request.form.get("item_id")), -# "initial_days": 7, -# "end_days": 0, -# "item_type": "all", -# } -# response = requests.post( -# "http://api.saddlebagexchange.com/history", -# headers={"Accept": "application/json"}, -# json=json_data, -# ).json() -# if "server_distribution" not in response: -# return "Error refresh the page or contact the devs on discord" -# fixed_response = [] -# for server, sale_count in response["server_distribution"].items(): -# fixed_response.append( -# { -# "Server": server, -# "Sale Count": sale_count, -# } -# ) -# fieldnames = list(fixed_response[0].keys()) -# return return_safe_html(render_template( -# "ffxiv_server_history.html", -# results=fixed_response, -# fieldnames=fieldnames, -# len=len, -# )) - -### FFXIV price check ### - -# @app.route("/pricecheck", methods=["GET", "POST"]) -# def ffxiv_pricecheck(): -# return redirect("https://saddlebagexchange.com/price-sniper") -# # DEPRECIATED -# if request.method == "GET": -# return return_safe_html(render_template("ffxiv_pricecheck.html")) -# elif request.method == "POST": -# json_data = json.loads(request.form.get("jsonData")) -# response = requests.post( -# f"{api_url}/pricecheck", -# headers={"Accept": "application/json"}, -# json=json_data, -# ).json() -# if "matching" not in response: -# return "Error no matching data" -# if len(response["matching"]) == 0: -# return "Error no matching data" -# fixed_response = [] -# for row in response["matching"]: -# fixed_response.append( -# { -# "minPrice": row["minPrice"], -# "itemName": row["itemName"], -# "server": row["server"], -# "dc": row["dc"], -# "desired_state": row["desired_state"], -# "hq": row["hq"], -# "quantity": row["minListingQuantity"], -# "item-data": f"https://saddlebagexchange.com/queries/item-data/{row['itemID']}", -# "uniLink": f"https://universalis.app/market/{row['itemID']}", -# } -# ) -# fieldnames = list(fixed_response[0].keys()) -# return return_safe_html( -# render_template( -# "ffxiv_pricecheck.html", -# results=fixed_response, -# fieldnames=fieldnames, -# len=len, -# ) -# ) - - -### SECURITY STUFF ### - -# @app.route("/2faca366-0ef0-4acb-9acc-3808e0470952.txt", methods=["GET", "POST"]) -# def probely(): -# return Response( -# "Probely", -# headers={ -# "Content-Disposition": "attachment; filename=2faca366-0ef0-4acb-9acc-3808e0470952.txt" -# }, -# ) -# # return "Probely" - -### SECURITY STUFF ### - -# @app.route( -# "/GitLab-DAST-Site-Validation-a8f90252-4e3a-488d-be6e-584993462fe1.txt", -# methods=["GET", "POST"], -# ) -# def gitlab(): -# return Response( -# "a8f90252-4e3a-488d-be6e-584993462fe1", -# headers={ -# "Content-Disposition": "attachment; filename=GitLab-DAST-Site-Validation-a8f90252-4e3a-488d-be6e-584993462fe1.txt" -# }, -# ) diff --git a/utils/security.py b/utils/security.py deleted file mode 100644 index 4343399..0000000 --- a/utils/security.py +++ /dev/null @@ -1,88 +0,0 @@ -from flask import Response -from lxml import html -import os - -NO_RATE_LIMIT = os.getenv("NO_RATE_LIMIT", False) - - -# Add security headers to the response -def add_security_headers(response: Response): - csp_policy = { - "default-src": ["'self'"], - "script-src": [ - "'self'", - "https://code.jquery.com", - "https://cdn.jsdelivr.net", - "https://pagead2.googlesyndication.com", - "cdn.datatables.net", - "cdnjs.cloudflare.com", - "www.googletagmanager.com", - "partner.googleadservices.com", - "tpc.googlesyndication.com", - ], - "style-src": [ - "'self'", - "https://cdn.jsdelivr.net", - "cdn.datatables.net", - "fonts.googleapis.com", - ], - "img-src": [ - "'self'", - "data:", - "https://pagead2.googlesyndication.com", - "https://saddlebagexchange.com", - ], - "font-src": [ - "'self'", - "fonts.gstatic.com", - ], - "connect-src": [ - "'self'", - "pagead2.googlesyndication.com", - "www.google-analytics.com", - ], - "frame-src": [ - "'self'", - "https://www.youtube.com", - "googleads.g.doubleclick.net", - "tpc.googlesyndication.com", - "www.google.com", - ], - } - csp_header_value = "; ".join( - [f"{key} {' '.join(value)}" for key, value in csp_policy.items()] - ) - response.headers["Content-Security-Policy"] = csp_header_value - - # Add other security headers - response.headers["X-Frame-Options"] = "same-origin" - response.headers["X-Content-Type-Options"] = "nosniff" - response.headers["Strict-Transport-Security"] = ( - "max-age=31536000; includeSubDomains" - ) - response.headers["Referrer-Policy"] = "no-referrer-when-downgrade" - response.headers["Cross-Origin-Resource-Policy"] = "same-origin" - response.headers["Cross-Origin-Opener-Policy"] = "same-origin" - response.headers["X-XSS-Protection"] = "0" - - response.headers["Content-Security-Policy-Report-Only"] = ( - "default-src 'self'; script-src 'self' https://cdn.example.com; " - "style-src 'self' https://cdn.example.com; img-src 'self' data: https://cdn.example.com;" - ) - - response.headers["Permissions-Policy"] = ( - "geolocation=(), camera=(), microphone=(), fullscreen=(), autoplay=(), payment=(), " - "encrypted-media=(), midi=(), accelerometer=(), gyroscope=(), magnetometer=()" - ) - return response - - -# Sanitize HTML content to prevent XSS -def return_safe_html(input_string): - # disable for security testing - if NO_RATE_LIMIT: - return input_string - document_root = html.fromstring(input_string) - cleaned_html = html.tostring(document_root, pretty_print=True) - # if `cleaned_html` differs from `input_string`, the input may contain malicious content. - return cleaned_html