WSF API Documentation

website·Indexed 30 days ago

https://divine-software.github.io/ghostly/

API documentation for WSF, featuring modules for web services (@divine/web-service), URI handling and database protocols (@divine/uri, including SQLite, Postgres, MySQL, JDBC, and TDS), and JSX parsing for HTML and XML (@divine/x4e).

Tokens
101.7K
Snippets
683
Records
1.1K
Agent score
75%

What's inside WSF

  1. Overview of @divine/uri.YAMLParser

    The YAMLParser class handles YAML content using the yaml library and StringParser. It supports the following media types: application/yaml, application/x-yaml, text/vnd.yaml, text/x-yaml, and text/yaml.

    Important Note: When parsing a multi-document YAML file, only the first document is returned by default. To access all documents, use the FIELDS property.

  2. Overview of MultiPartParser

    The MultiPartParser class handles MIME multipart messages and multipart/form-data HTML forms. When parsing, it returns a MultiPartData object. Files encountered during parsing are wrapped as CacheURI objects; these temporary files should be cleaned up by calling the finalize function from the @divine/uri module.
  3. Overview of the AuthScheme base class

    The AuthScheme class is the base class for all authentication scheme subclasses in the @divine/uri module. While subclasses can be constructed manually, it is generally recommended to use the static create method to instantiate a scheme from an authentication header or a registered authentication name.

    Known authentication schemes include:

    • BasicAuthScheme (Authentication name: "Basic")
    • BearerAuthScheme (Authentication name: "Bearer")
  4. Overview of the divine_uri.URI class

    The divine_uri.URI class is the base class for all URI subclasses in the WSF framework. It defines a basic API for resources that can be described by a URI, integrating pluggable parsers, serializers, encoders, decoders, and authentication methods. It supports standard URLs (like file: and http:) as well as non-URL URIs such as database connections.
  5. Overview of divine_uri.Parser

    The divine_uri.Parser class serves as the base class for all parser subclasses. While it can be instantiated manually, it is primarily used via its static parse and serialize methods to handle serialization and deserialization of data based on specific media types.
  6. Overview of WSF Database SQL Query capabilities

    The Web Service Framework (WSF) provides a consistent API for executing SQL queries across a wide range of SQL databases. The framework abstracts the complexities of connection management, connection pooling, transaction management, and deadlock handling. Crucially, it is designed to protect against SQL injection vulnerabilities by default.
  7. Overview of CORSFilter for CORS handling

    CORSFilter is a helper class that implements the WebFilter interface. It provides a default CORS implementation where all origins, methods, and headers are allowed for 10 minutes, while credentials are disallowed by default. To customize the CORS policy, developers should extend CORSFilter and override its protected methods.
  8. Overview of divine_uri classes and interfaces

    The divine_uri namespace provides a comprehensive set of tools for URI and data handling:

    • URI Handling: URI, HTTPURI, FileURI, DatabaseURI, CacheURI.
    • Parsing: JSONParser, YAMLParser, TOMLParser, CSVParser, FormParser, MultiPartParser, EventStreamParser.
    • Encoding: Base64Encoder, ZlibEncoder, QuotedPrintableEncoder, IdentityEncoder.
    • Authentication: AuthScheme, BasicAuthScheme, BearerAuthScheme, BasicCredentials, BearerCredentials.
    • Database: DBQuery, DBResult, DBError, DBMetadata.
    • Interfaces: Credentials, Metadata, Selector, Finalizable.
  9. Overview of Ghostly v2 features and dependencies

    Ghostly v2 introduces several core architectural changes: it is now powered by Playwright, allowing the use of Chromium (default), Firefox, or WebKit browsers. Both the @divine/ghostly-engine and @divine/ghostly-runtime modules now include full TypeScript definitions. Additionally, Ghostly v2 supports 'attachments', enabling templates to produce secondary results (such as CSV files) during model initialization alongside primary output.
  10. Overview of divine_uri.StringParser

    The StringParser class (part of the @divine/uri module) is a specialized parser that converts between text and bytes. It is primarily used for the text/plain media type and serves as a foundation for other string-based parsers. It supports the following media type parameters:

    • charset: The character set to use (defaults to utf8).
    • x-bom: Determines whether to add a byte-order-mark during serialization (default is absent).
  11. Overview of HTTPURI for web service access

    The HTTPURI class is a subclass of URI used to handle http: and https: protocols for accessing web services. It handles redirects automatically. To customize the handler, you can use addSelector to attach the following selectors:

    • HTTPParamsSelector: For general handler configuration.
    • AuthSelector: For providing authentication credentials.
    • HeadersSelector: For adding custom HTTP headers.