-
Notifications
You must be signed in to change notification settings - Fork 117
Basic REST API #599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Basic REST API #599
Conversation
This commit introduces a new Message Area Web API that provides read-only access to public message areas and their messages in JSON format. The API includes endpoints for listing conferences, areas within conferences, messages in specific areas, and retrieving details of individual messages. Additionally, a test script is added to validate the API functionality. Documentation for the API is also included to guide users on its usage and configuration.
This commit updates the Message Area Web API to include a log message when the API is disabled by configuration. It also refines the configuration template to document the Message Area JSON API, clarifying its purpose and default settings. Additionally, minor formatting adjustments were made in the bbs.js file for improved readability.
This commit adds log messages to the test script, guiding users on how to test the Message Area API with the API disabled. It enhances error handling by providing clearer instructions for ensuring the web server is running during tests.
…i.js This commit enhances the error handling in the test script by providing clearer error messages and instructions for users to ensure the web server is running. Additionally, it adds a call to execute the tests automatically, improving the usability of the testing process.
This commit introduces the ability to include message replies in the Message Area Web API responses when requested. It adds validation for path parameters in the list areas and messages handlers, ensuring proper error responses for invalid requests. Additionally, the timestamp formatting is centralized using a new helper method, improving consistency across the API. Updates to the API documentation reflect these changes, including new query parameters for including replies.
…Web API This commit introduces methods to determine if conferences and areas are exposed based on configuration settings. It adds functionality to filter exposed conferences and areas in API responses, enhancing access control. The API documentation is updated to reflect the new configuration options for controlling exposure, including include/exclude patterns for areas. Additionally, the test script is updated with instructions for testing the new configuration features.
This commit enhances the documentation for the Message Area Web API by providing comprehensive details on endpoints, responses, error handling, and configuration options. It includes examples for usage with curl and JavaScript, ensuring clarity for users. Additionally, the legacy documentation file for the Message Area Web API is removed as its content has been integrated into the web server documentation.
@chilledtonic Apologies as I haven't had much time with this stuff lately. Give me a bit to look over, and think about how to best tackle merging your work with the changes in the ActivityPub branch. Problem is, that branch isn't complete and I don't have time right now, but it changes a lot of web related work. Without yet having looked at the code, I think the main change might have to be in the pathing, so something like /webapi/v1/... or something. |
Could this be utilized in building a web front end (login, read, post)? |
@robbiew looks like it. Before I can merge this, I really do need it to be synced up with the "Activity Pub" branch, however, as there are a LOT of web related changes there and I intend to make that the new master (with AP turned off by default, though) |
Our server needed a basic, read-only web view for users unfamiliar with terminal-land. So I've implemented a basic Read-Only Web API. I understand that activity-pub support is incoming, but it will likely be too heavy for our uses. Would this be a welcome PR, or should I fork Enigma?
PR: Document Message Area Web API
Added complete docs for the Message Area Web API in
core/message_area_web.js
. This covers the RESTful JSON API that gives read-only access to public message areas.What's covered
Four main endpoints:
GET /api/v1/message-areas/conferences
GET /api/v1/message-areas/conferences/:confTag/areas
GET /api/v1/message-areas/areas/:areaTag/messages
GET /api/v1/message-areas/messages/:messageUuid
Key features:
exposedConfAreas
Config options:
Includes JSON response formats, usage examples with curl/JavaScript, and implementation details. This enables web/mobile app integration and external system access while keeping things secure.