{ "openapi": "3.1.0", "info": { "title": "API Documentation", "version": "1.0.0" }, "tags": [ { "name": "auth, email, verify" }, { "name": "auth, eula, localization, deepl" }, { "name": "auth, login" }, { "name": "auth, passkeys" }, { "name": "auth, password, reset" }, { "name": "auth, password-reset" }, { "name": "auth, refresh" }, { "name": "auth, register" }, { "name": "auth, logout, revoke" }, { "name": "auth, upgrade" }, { "name": "clients, joinaunion, visit_info, config" }, { "name": "clients, joinaunion, visit_info, generate" }, { "name": "clients, joinaunion, visit_info, manage" }, { "name": "joinaunion, widget" }, { "name": "warframe.modules" }, { "name": "warframe.warframes" }, { "name": "warframe.weapons" }, { "name": "config" }, { "name": "health" }, { "name": "localization" }, { "name": "monitor" }, { "name": "localization, monitor" }, { "name": "monitor, visit" } ], "paths": { "/v1/auth/emailverify": { "get": { "summary": "Verify email via GET (legacy browser link).", "description": "Handles legacy verification links issued before the code-based flow.\n Reads the token from the query string, performs verification,\n and redirects the user to the application.", "tags": [ "auth, email, verify" ], "parameters": [], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } }, "put": { "summary": "Verify a user email address.", "description": "Verifies ownership of a user email address using a 12-character verification code.\nOn success, the user account is transitioned to an active state and\nthe email verification timestamp is recorded.", "tags": [ "auth, email, verify" ], "parameters": [], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/auth/emailverify/resend": { "put": { "summary": "Resend a 12-character email verification code.", "description": "Allows a pending user to request a new email verification token.\nThis endpoint is intentionally non-enumerating and returns success even when\nthe email is unknown or not eligible for resend.", "tags": [ "auth, email, verify" ], "parameters": [ { "name": "app_key", "in": "query", "required": false, "description": "", "schema": { "type": "string" } }, { "name": "email", "in": "query", "required": false, "description": "", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/auth/eula": { "get": { "summary": "Fetch the current End User License Agreement (EULA) with dynamic localization support.", "description": "Returns the latest EULA document with multi-language resolution:\n1) If the current language is English, fetches the EULA text from the config table (name = \"eula\").\n2) If the selected language is not English, checks the localization table for slug = \"eula\" and lang = currently_selected_language.\n3) If there is a valid localized EULA, returns that.\n4) If not cached, translates the base English EULA via DeepL, saves the translated record in the localizations table, and returns it.", "tags": [ "auth, eula, localization, deepl" ], "parameters": [ { "name": "lang", "in": "query", "required": false, "description": "Optional language code (e.g. en_ca, can_fr, fr, es)", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/auth/login": { "post": { "summary": "Authenticate a user for an application and issue tokens.", "description": "Authenticates a user against an application-scoped context using a\nusername or email and plaintext password. On success, issues an\naccess and refresh token pair scoped to the application.", "tags": [ "auth, login" ], "parameters": [], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/auth/passkeys": { "delete": { "summary": "Revoke one of the authenticated user's passkeys.", "description": "Marks the application-scoped credential as revoked so it cannot be used for\nfuture passkey authentication. Existing bearer sessions remain unchanged.", "tags": [ "auth, passkeys" ], "parameters": [], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } }, "get": { "summary": "List the authenticated user's passkeys.", "description": "Returns non-secret metadata for active and revoked passkeys belonging to the\nauthenticated user within the resolved application. Public keys and raw\nassertions are not returned.", "tags": [ "auth, passkeys" ], "parameters": [ { "name": "app_key", "in": "query", "required": true, "description": "Application key used to resolve scope", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/auth/passkeys/login/options": { "post": { "summary": "Create a short-lived passkey authentication ceremony.", "description": "Creates discoverable-credential WebAuthn authentication options for the\nresolved application. The response is bound to the configured origin and RP\nID and is intentionally not cacheable.", "tags": [ "auth, passkeys" ], "parameters": [], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/auth/passkeys/login/verify": { "post": { "summary": "Verify a passkey assertion and issue bearer tokens.", "description": "Consumes a one-time authentication ceremony and verifies the signed\nassertion, origin, RP ID, credential ownership, revocation state, and\nauthenticator counter. On success it issues the same access and refresh\ntoken shape used by password login and Google OAuth.", "tags": [ "auth, passkeys" ], "parameters": [], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/auth/passkeys/register/options": { "post": { "summary": "Create a short-lived passkey registration ceremony.", "description": "Creates browser-safe WebAuthn registration options for the authenticated\nuser and binds the ceremony to the resolved application, origin, RP ID,\nuser, challenge, and one-time ceremony identifier.", "tags": [ "auth, passkeys" ], "parameters": [], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/auth/passkeys/register/verify": { "post": { "summary": "Verify and store a newly registered passkey.", "description": "Consumes a registration ceremony, verifies the WebAuthn attestation against\nthe authenticated user and application context, and stores only durable\ncredential metadata and the public key. Private keys and raw assertions are\nnever persisted.", "tags": [ "auth, passkeys" ], "parameters": [], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/auth/passreset/complete": { "put": { "summary": "Complete a password reset with a code.", "description": "Consumes a valid six-character password reset code and sets a new password.\nLegacy long tokens remain accepted during the transition. When app_key\nis supplied, the token must belong to that application's scope; legacy\nunscoped tokens remain compatible when app_key is omitted.\nOn success, all existing auth tokens are revoked.", "tags": [ "auth, password, reset" ], "parameters": [], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/auth/passreset/initiate": { "put": { "summary": "Initiate a password reset flow.", "description": "Initiates a password reset request for a user identified by email.\nThis endpoint is intentionally non-enumerating: it always returns\na success response regardless of whether the email exists.\n\nOn success, the API sends a short-lived reset code by email. The code is\nnever included in the API response, and mail delivery failures are recorded\nby the mail audit path without revealing account existence. No clickable URL\nis included, so email-provider click tracking cannot redirect the user to\nan unrelated landing page.", "tags": [ "auth, password-reset" ], "parameters": [], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/auth/passreset/verify": { "put": { "summary": "Verify a password reset code.", "description": "Validates a six-character password reset code without changing user state. Legacy\nlong tokens remain accepted during the transition. When\napp_key is supplied, the token must belong to that application's scope;\nlegacy unscoped tokens remain compatible when app_key is omitted.\nUsed by clients to confirm token validity before submitting\na new password.", "tags": [ "auth, password, reset" ], "parameters": [], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/auth/refresh": { "put": { "summary": "Rotate refresh token and issue new authentication tokens.", "description": "Accepts a valid refresh token and rotates it, issuing a new access\ntoken and a new refresh token scoped to the same user and application.\n\nThe old refresh token is revoked as part of the rotation process.", "tags": [ "auth, refresh" ], "parameters": [], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/auth/register": { "put": { "summary": "Register a new user for an application.", "description": "Creates a new user identity and local authentication credentials,\nassociates the user with an application, and enforces password\nsecurity rules. The user is created in a pending state until\nemail verification is completed.", "tags": [ "auth, register" ], "parameters": [ { "name": "app_key", "in": "query", "required": false, "description": "", "schema": { "type": "string" } }, { "name": "username", "in": "query", "required": false, "description": "", "schema": { "type": "string" } }, { "name": "email", "in": "query", "required": false, "description": "", "schema": { "type": "string" } }, { "name": "password", "in": "query", "required": false, "description": "", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/auth/token": { "delete": { "summary": "Revoke an authentication token.", "description": "Explicitly revokes an access or refresh token. Used for logout,\nsecurity events, or credential changes. Revocation is immediate.", "tags": [ "auth, logout, revoke" ], "parameters": [], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/auth/upgrade": { "put": { "summary": "Upgrade an OAuth-only account to a full local account.", "description": "Upgrades a Google-authenticated account by adding a username and local\npassword credentials. This sets the user status to 'active' and allows\nsubsequent password-based logins.", "tags": [ "auth, upgrade" ], "parameters": [], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/clients/joinaunion/visit_info/config": { "get": { "summary": "Retrieve unique column values from joinaunion.visit_info table.", "description": "Queries the joinaunion.visit_info table for distinct, non-null values of a specified column.\nRequires authentication and returns the requested column name, unique values list, and query timestamp.", "tags": [ "clients, joinaunion, visit_info, config" ], "parameters": [ { "name": "column", "in": "query", "required": true, "description": "Column name from joinaunion.visit_info (e.g., city, country, region, location_source, device_id, user_id, request_method, note)", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/clients/joinaunion/visit_info/generate": { "post": { "summary": "Generate a clean, synthetic visit-history dataset for Joinaunion.", "description": "This administrative endpoint creates plausible browsing journeys for the\nJoinaunion site and stores one visit_info row for every page reached. It is\nintended for development, demonstrations, analytics testing, and other\ncontrolled data-generation workflows; it does not represent real users or\nreal traffic. Every generated journey starts at the Home page and follows\na randomized walk through dynamically discovered website pages (queried from\nnon-endpoint visit notes in joinaunion.visit_info, cached in process memory\nand Redis, or falling back to standard site pages).\n\nBefore inserting data, the endpoint deletes every existing visit_info row\nwhose location_source matches loc_src. Reusing the same loc_src therefore\nreplaces the previous generated dataset and keeps repeated runs clean.\nThe endpoint writes GET-style visits with a generated device_id, timestamp,\ngeographic coordinates, city, country, region, location_source, page note,\nand a generated user_id.\n\nJourney behavior:\n- The requested number of journeys (num_recs) is generated exactly. Each journey\n contains at least two page visits so it is visible as a browsing journey.\n- Available pages are discovered dynamically from joinaunion.visit_info notes,\n cached in Redis and Node local memory with a 24-hour TTL, and fall back to\n standard pages if empty.\n- The first 20% of journeys use new device IDs. After that, devices are reused\n with 70% probability while newly created IDs are added to the cache.\n- Journeys are distributed chronologically across the resolved [start_at, end_at]\n time window. When unspecified, timestamps default to a 1-month window prior\n to execution.\n- Each page visit advances by 1 to 30 seconds. A journey ends if all unique\n pages have been visited, if total time spent on the site reaches 20 minutes,\n if total time spent on any single page reaches 10 minutes, or according to\n a progressive termination probability (5% for the first page plus double the\n triangle sum of completed pages: 1 page: 5%, 2 pages: 11%, 3 pages: 17%,\n 4 pages: 25%, 5 pages: 35%, etc.).\n- Places are selected from the offline `@countrystatecity/countries`\n dataset. Cities provide generated names and base coordinates for any\n supported country and region, with a random offset of up to 0.25 degrees\n in each direction for realistic-looking visits. The geographic location\n (latitude, longitude, city, country, region) is fixed per journey so all\n records within a given journey share the same location.", "tags": [ "clients, joinaunion, visit_info, generate" ], "parameters": [], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/clients/joinaunion/visit_info/manage": { "get": { "summary": "Retrieve unique device journeys by location source.", "description": "Returns a list of unique devices from joinaunion.visit_info along with their\nbrowsing journeys, pages visited, stay durations, page-touch counts, and city\ninformation, filtered by location_source (defaults to \"generated\").\n\nA journey begins at the home page and continues until touch_time exceeds the\nprevious touch time for that device by more than 5 minutes. Duplicate views\nof the same page within a single journey are aggregated into a single entry\nwith total duration summed and the number of touches recorded.", "tags": [ "clients, joinaunion, visit_info, manage" ], "parameters": [ { "name": "source", "in": "query", "required": false, "description": "Location source filter (defaults to 'generated')", "schema": { "type": "string", "default": "generated" } } ], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } }, "post": { "summary": "Query and aggregate joinaunion.visit_info records with dynamic output shape.", "description": "Queries joinaunion.visit_info table, filtering by dataset/location_source, date range,\nsector, region, and custom column filters. Dynamically formats output based on the\nrequested output_shape object/fields, supporting column selection and a curated list of\naggregate functions (such as record count per group for heatmaps).", "tags": [ "clients, joinaunion, visit_info, manage" ], "parameters": [], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/clients/joinaunion/widget": { "put": { "summary": "Submit an inquiry or contact message via the JoinAUnion widget.", "description": "Processes incoming widget submissions from workers inquiring about union representation\nor workplace organizing. Validates the recipient, sender email, message content, province,\nand industry sector, records the inquiry in joinaunion.widget_answers, and delivers the formatted inquiry notification.", "tags": [ "joinaunion, widget" ], "parameters": [ { "name": "recipient", "in": "query", "required": false, "description": "", "schema": { "type": "string" } }, { "name": "email", "in": "query", "required": false, "description": "", "schema": { "type": "string" } }, { "name": "message", "in": "query", "required": false, "description": "", "schema": { "type": "string" } }, { "name": "province", "in": "query", "required": false, "description": "", "schema": { "type": "string" } }, { "name": "industry", "in": "query", "required": false, "description": "", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/warframe/modules": { "delete": { "summary": "Delete a module by mod_id.", "description": "Deletes a single Warframe module identified by the required mod_id query parameter.\n\nIf no matching record exists, the operation still succeeds and returns a null data payload.", "tags": [ "warframe.modules" ], "parameters": [ { "name": "mod_id", "in": "query", "required": true, "description": "Unique identifier of the module to delete", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } }, "get": { "summary": "Retrieve module list and optionally resolve a single module.", "description": "Returns a stable response containing:\n- A lightweight list of all modules\n- A single resolved module object\n\nResolution priority is:\n1) mod_id query parameters (first match wins)\n2) Exact name match if no mod_id is supplied\n\nIf no match is found, the module field is returned as an empty module DTO\nto preserve a stable response shape.", "tags": [ "warframe.modules" ], "parameters": [ { "name": "mod_id", "in": "query", "required": false, "description": "Module identifiers to resolve; first match wins (repeatable query param)", "schema": { "type": "string" } }, { "name": "name", "in": "query", "required": false, "description": "Exact module name to resolve if no mod_id is supplied", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } }, "put": { "summary": "Insert or update a Warframe module.", "description": "Performs a deterministic upsert-style operation on modules using\nthe following resolution order:\n\n1. Update by mod_id if provided\n2. Update by name if exactly one matching record exists\n3. Insert if name resolves to zero records\n4. Reject with conflict if name resolves to more than one record\n\nIf no mod_id or name is provided, the request is treated as an insert operation.", "tags": [ "warframe.modules" ], "parameters": [ { "name": "mod_id", "in": "query", "required": false, "description": "", "schema": { "type": "string" } }, { "name": "name", "in": "query", "required": false, "description": "", "schema": { "type": "string" } }, { "name": "description", "in": "query", "required": false, "description": "", "schema": { "type": "string" } }, { "name": "rarity", "in": "query", "required": false, "description": "", "schema": { "type": "string" } }, { "name": "polarity", "in": "query", "required": false, "description": "", "schema": { "type": "string" } }, { "name": "rank_max", "in": "query", "required": false, "description": "", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/warframe/warframes": { "delete": { "summary": "Delete a warframe by warframe_id.", "description": "Deletes a single warframe identified by the required warframe_id query parameter.\n\nIf no matching record exists, the operation still succeeds and returns a null data payload.", "tags": [ "warframe.warframes" ], "parameters": [ { "name": "warframe_id", "in": "query", "required": true, "description": "Unique identifier of the warframe to delete", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } }, "get": { "summary": "Fetch warframe list and optionally a single warframe by id.", "description": "Returns a lightweight list of warframes (id + name) and, if one or more\nwarframe_id query parameters are provided, also returns a single resolved\nwarframe object (the first match).", "tags": [ "warframe.warframes" ], "parameters": [ { "name": "warframe_id", "in": "query", "required": false, "description": "One or more warframe IDs to resolve (repeatable query param)", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } }, "put": { "summary": "Insert or update a warframe.", "description": "Performs a deterministic insert-or-update operation using the following\nresolution order:\n\n1. Update by warframe_id if provided (highest priority)\n2. Resolve by name:\n - class defaults to \"normal\" if not provided\n - 0 matches → insert\n - 1 match → update\n - 2+ matches → disambiguate by resolved class\n3. Insert if no identifier is resolvable\n\nIf multiple records still match after class disambiguation, the request\nis rejected with a conflict error.", "tags": [ "warframe.warframes" ], "parameters": [ { "name": "warframe_id", "in": "query", "required": false, "description": "", "schema": { "type": "string" } }, { "name": "name", "in": "query", "required": false, "description": "", "schema": { "type": "string" } }, { "name": "class", "in": "query", "required": false, "description": "", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/warframe/weapons": { "delete": { "summary": "Delete a weapon by identifier", "description": "Deletes a weapon record from the database using the provided weapon_id query parameter.\nThe handler extracts weapon_id from the query string, supporting both string and array forms,\nand normalizes it to a single string value.\n\nIf weapon_id is missing or invalid, the request is rejected with a 400 response.\nIf provided, the database delete operation is executed and the deleted row (if any) is returned.\n\nThe endpoint always responds with success: true when the operation executes, even if no matching\nrecord is found (data will be null in that case). This behavior ensures idempotency for repeated\ndelete requests on the same identifier.\n\nErrors during execution are logged and result in a 500 INTERNAL SERVER ERROR response.", "tags": [ "warframe.weapons" ], "parameters": [ { "name": "weapon_id", "in": "query", "required": true, "description": "Unique weapon identifier to delete", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } }, "get": { "summary": "Retrieve weapon list and optionally resolve a single weapon.", "description": "Returns a stable response containing:\n- A lightweight list of all weapons\n- A single resolved weapon object\n\nResolution order is:\n1) One or more weapon_id query parameters (first match wins)\n2) Exact name match\n - If multiple records share the same name, class is used\n - class defaults to \"normal\" when not provided\n3) No resolvable filters → empty weapon DTO\n\nThis endpoint is read-only and has no side effects.", "tags": [ "warframe.weapons" ], "parameters": [ { "name": "weapon_id", "in": "query", "required": false, "description": "Weapon identifiers to resolve; first match wins (repeatable query param)", "schema": { "type": "string" } }, { "name": "name", "in": "query", "required": false, "description": "Exact weapon name to resolve", "schema": { "type": "string" } }, { "name": "class", "in": "query", "required": false, "description": "Weapon class used when resolving by name (defaults to normal)", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } }, "put": { "summary": "Insert or update weapon records using identifier-driven resolution", "description": "Performs conditional insert or update operations based on the presence of identifying fields\nin the request body. The handler supports three mutually exclusive execution paths:\n\n1. UPDATE by weapon_id:\n - Triggered when weapon_id is present\n - Validates using weaponUpdateSchema\n - Updates the matching record\n - Rejects if no writable fields are provided\n\n2. RESOLVE by name (with optional class):\n - Triggered when name is present and weapon_id is absent\n - Default class is \"normal\" when not provided\n - Resolution logic:\n a. 0 matches → INSERT\n b. 1 match → UPDATE\n c. 2+ matches:\n - Filter by class\n - 0 matches → INSERT\n - 1 match → UPDATE\n - 2+ matches → 409 conflict (ambiguous)\n\n3. INSERT:\n - Triggered when neither weapon_id nor name is provided\n - Validates using weaponInsertSchema\n - Inserts new record\n\nAll writes use toWeaponWrite() for database normalization.\nAll responses map database rows through toWeaponDTO().\n\nValidation errors are enriched using overlayDto(), producing:\n- details (zod issues)\n- missing_fields (not provided in input)\n- empty_fields (provided but empty or null)\n\nThis endpoint is not a strict UPSERT; behavior depends on resolution rules and may insert new records.", "tags": [ "warframe.weapons" ], "parameters": [], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/config": { "delete": { "summary": "Delete a configuration record.", "description": "Deletes a configuration record using one of the following deterministic\nresolution strategies (highest priority first):\n\n1) uuid — deletes the exact record by UUID\n2) name + version — deletes the exact matching record\n3) name only — deletes the record ONLY if exactly one record exists\n\nAmbiguous deletes are rejected with 409 CONFLICT.\nMissing or invalid query combinations are rejected with 400.\n\nThis is an administrative endpoint and must be access-controlled\nby middleware at the routing layer.", "tags": [ "config" ], "parameters": [ { "name": "uuid", "in": "query", "required": false, "description": "Exact UUID of the config record to delete", "schema": { "type": "string" } }, { "name": "name", "in": "query", "required": false, "description": "Config name (used only if uuid not provided)", "schema": { "type": "string" } }, { "name": "version", "in": "query", "required": false, "description": "Config version (optional disambiguator for name)", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } }, "get": { "summary": "Fetch configuration records.", "description": "Deterministic, identifier-based retrieval of configuration records.\n\nResolution order:\n 1) id — fetch exact record by UUID\n 2) name + version — fetch exact record\n 3) name only — fetch ONLY if exactly one record exists\n 4) no query params — return all records\n\nInvalid or ambiguous queries are rejected with explicit errors.", "tags": [ "config" ], "parameters": [ { "name": "id", "in": "query", "required": false, "description": "Exact UUID of the config record", "schema": { "type": "string" } }, { "name": "name", "in": "query", "required": false, "description": "Configuration key name", "schema": { "type": "string" } }, { "name": "version", "in": "query", "required": false, "description": "Exact configuration version", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } }, "put": { "summary": "Create or update a configuration record.", "description": "Creates or updates a configuration record identified by (name, version).\nIf a matching record exists, its value is updated in place. Otherwise,\na new record is inserted.", "tags": [ "config" ], "parameters": [], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/health": { "get": { "summary": "Health index, schema enumerator, and aggregator using in-memory route metadata.", "description": "Provides a dynamic health index endpoint with automatic runtime schema\n generation for all child health endpoints.\n\n No Zod, no manual schemas, and no filesystem scanning are used. Instead,\n child endpoints are executed once (in internal mode) and their returned\n JSON structures are walked recursively to infer response schemas.\n\n Resolution behavior:\n\n 1) GET /v1/health\n → Returns only child endpoint names.\n\n 2) GET /v1/health?all\n → Executes each child endpoint ONCE and returns a generated\n response-schema tree for each.\n\n 3) GET /v1/health?complete\n → Executes all child endpoints and returns full health results.", "tags": [ "health" ], "parameters": [ { "name": "all", "in": "query", "required": false, "description": "Generate and return response schema metadata for all child health endpoints", "schema": { "type": "boolean" } }, { "name": "complete", "in": "query", "required": false, "description": "Execute all child health endpoints and return full results", "schema": { "type": "boolean" } } ], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/health/api": { "get": { "summary": "Basic API server health check (uptime only).", "description": "Provides a minimal API health endpoint reporting process uptime.\n\n Supports dual-mode execution:\n 1) Internal invocation by the /v1/health aggregator\n 2) External HTTP invocation via Express\n\n Internal mode:\n - Handler returns a HealthResponse object directly\n\n External mode:\n - Handler responds via res.json(HealthResponse)", "tags": [ "health" ], "parameters": [], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/health/database": { "get": { "summary": "CockroachDB health check for latency, version, and build metadata.", "description": "Provides a CockroachDB health endpoint reporting SQL latency, build metadata,\n version information, and connectivity status.\n\n Supports dual invocation modes:\n\n 1) External HTTP invocation via Express\n → Handler writes JSON directly to the Express response.\n\n 2) Internal invocation by the /v1/health aggregator\n → Handler receives a synthetic response object and MUST return a\n HealthResponse object instead of calling res.json().\n\n This dual-mode behavior enables:\n • Zero-latency child health execution\n • Hierarchical route metadata traversal\n • Parent → child aggregation for /v1/health?complete", "tags": [ "health" ], "parameters": [], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/health/memory": { "get": { "summary": "Memory health endpoint.", "description": "Provides runtime memory usage information for both the Node.js process\n and the underlying operating system.\n\n External HTTP requests receive a structured JSON health response suitable\n for health checks, diagnostics, and dashboards.\n\n Internal invocations (such as health aggregators) receive the same object\n directly as a return value, enabling efficient collection without HTTP\n loopback.", "tags": [ "health" ], "parameters": [], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/localization": { "delete": { "summary": "Delete a localization record.", "description": "Deletes a localization record using deterministic resolution:\n 1) id / uuid — deletes the exact record by UUID\n 2) slug + lang — deletes the exact matching record\n 3) slug only — deletes the record ONLY if exactly one record exists\n\nAmbiguous deletes are rejected with 409 CONFLICT.\nAutomatically dirties the in-memory cache of supported languages and slugnames.", "tags": [ "localization" ], "parameters": [ { "name": "id", "in": "query", "required": false, "description": "Exact UUID of the localization record to delete", "schema": { "type": "string" } }, { "name": "slug", "in": "query", "required": false, "description": "Localization slug identifier", "schema": { "type": "string" } }, { "name": "lang", "in": "query", "required": false, "description": "Language code (required to disambiguate if multiple languages exist for slug)", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } }, "get": { "summary": "Fetch localization records, list available translations, or resolve localized text.", "description": "Deterministic, identifier-based retrieval, translation metadata listing, and dynamic\nlanguage fallback resolution of localization strings with in-memory caching of supported\nlanguages and slugnames.\n\nResolution order:\n 1) id — fetch exact record by UUID\n 2) slug + lang — resolve localized text with dynamic language candidate fallback\n 3) slug only — return slug with comma-delimited list of supported language codes\n 4) lang only — return language code with comma-delimited list of supported slugnames\n 5) list — return all non-English translation metadata grouped by slug\n 6) slug + all — return all non-English records for the requested slug\n 7) no query params — returns 400 error (must provide either slug or lang as a minimum)\n\nList behavior:\n - /v1/localization?list returns all non-English translations.\n - /v1/localization?list&slug=username limits the response to that slug.\n - The list always includes every non-English language with a record,\n regardless of the selected language in the request.\n - English values are never included because they are provided by LocalizedText.", "tags": [ "localization" ], "parameters": [ { "name": "id", "in": "query", "required": false, "description": "Exact UUID of the localization record", "schema": { "type": "string" } }, { "name": "slug", "in": "query", "required": false, "description": "Localization slug identifier", "schema": { "type": "string" } }, { "name": "lang", "in": "query", "required": false, "description": "Language code or tag (e.g. en_ca, can_fr, en_us, eng, fr)", "schema": { "type": "string" } }, { "name": "list", "in": "query", "required": false, "description": "Return non-English translation metadata grouped by slug", "schema": { "type": "boolean" } }, { "name": "all", "in": "query", "required": false, "description": "Return all non-English records for the requested slug", "schema": { "type": "boolean" } } ], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } }, "put": { "summary": "Create or update a localization record.", "description": "Inserts or updates a localization record identified by (slug, lang).\nIf a matching record exists, its text, metadata, and timestamp are updated in place.\nOtherwise, a new localization record is inserted.\nAutomatically dirties the in-memory cache of supported languages and slugnames.", "tags": [ "localization" ], "parameters": [], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/monitor": { "get": { "summary": "Basic monitor endpoint returning an OK status.", "description": "Provides a minimal monitoring signal indicating that the API process\n is running and responsive.\n\n External HTTP requests receive a simple JSON object suitable for\n uptime monitoring, load balancer probes, and basic diagnostics.\n\n Internal invocations (such as monitoring aggregators or self-tests)\n receive the same object directly as a return value, avoiding HTTP\n loopback overhead.", "tags": [ "monitor" ], "parameters": [], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/monitor/lang": { "get": { "summary": "Monitor unique language count.", "description": "Returns the number of unique language values present in the localizations table.\nDefaults to a count of 2 if the database is unreachable.", "tags": [ "monitor" ], "parameters": [], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/monitor/localization": { "get": { "summary": "Resolve localized text with automatic server-side translation.", "description": "Fetches a localization record by slug and language.\nIf the record does not exist, it automatically attempts to generate a translation\nusing the provided fallback text (if available) or the base English source.\nThe resulting translation is persisted to the database and cached.", "tags": [ "localization, monitor" ], "parameters": [ { "name": "slug", "in": "query", "required": true, "description": "Localization slug identifier", "schema": { "type": "string" } }, { "name": "lang", "in": "query", "required": false, "description": "Target language code (defaults to X-Lang header or en_ca)", "schema": { "type": "string" } }, { "name": "fallback", "in": "query", "required": false, "description": "Optional fallback/source text to use for translation if slug is missing", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } }, "put": { "summary": "Create or update a localization record via monitor endpoint.", "description": "Inserts or updates a localization record identified by (slug, lang).\nThis endpoint is specifically used for persisting new translations generated by the client.\nIf a matching record exists, its text, metadata, and timestamp are updated in place.\nOtherwise, a new localization record is inserted.\nAutomatically dirties the in-memory cache of supported languages and slugnames.", "tags": [ "localization, monitor" ], "parameters": [], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/monitor/network": { "get": { "summary": "Network monitoring stub endpoint.", "description": "Provides a minimal network monitoring endpoint that confirms the API\n server is responsive.\n\n Supports dual-mode execution:\n\n 1) External HTTP invocation\n → Responds via res.json({ ok: true }).\n\n 2) Internal invocation (future monitoring aggregator)\n → Returns the payload object directly.\n\n Dual-mode support allows this endpoint to be incorporated into a\n high-speed monitoring or aggregation system without HTTP loopback.", "tags": [ "monitor" ], "parameters": [], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } }, "/v1/monitor/visit": { "post": { "summary": "Explicit visit reporting endpoint.", "description": "Allows clients (like the mobile app) to explicitly report page views\n or other significant user interactions that do not naturally trigger\n a backend request.\n\n The request is captured and recorded in the visit_info table with full\n geographic metadata (city, country, region, coordinates, location source).", "tags": [ "monitor, visit" ], "parameters": [], "responses": { "200": { "description": "Successful response" }, "400": { "description": "Bad request" }, "409": { "description": "Conflict" }, "500": { "description": "Internal server error" } } } } } }