Skip to content

Latest commit

 

History

History
81 lines (51 loc) · 2.82 KB

File metadata and controls

81 lines (51 loc) · 2.82 KB

← Back to Usage Guide Index

CORE_API_OVERVIEW

Sub‑TOC for the core public APIs of m7Fetch. Each entry links to a dedicated page with full method signatures, options, return shapes, and examples.


1) NET

  • The top‑level hub that composes the subsystems: HTTP, Specs, Modules, and Batch.
  • Covers constructor options, lifecycle, and how to pass defaults down to subsystems.

2) HTTP

  • Request helpers: get, post, put, patch, delete, head, options.
  • Request options (base URL, headers, json/urlencoded, timeout, signal).
  • Response formats: body | full | raw.
  • Roadmap slots: HTTP/2, streaming, retries/backoff.
  • specs.load(source, opts) and specs.call(apiId, operationId, args).
  • Parameter groups (path, query, headers, body) and format passthrough.
  • Multiple specs, IDs/namespacing, and operation resolution.
  • Type inference and dispatch for spec loading (e.g., x-type).
  • GET/POST retrieval and option forwarding to HTTP.
  • Extending with custom loaders.
  • modules.load(id, url) returns the module namespace (dynamic import()).
  • Registry semantics, caching, and invalidation patterns.
  • batch.run(loadList, onLoad, onFail, { awaitAll, limit }).
  • Item schema, handler contract (only false marks failure).
  • Context storage (context[id]), concurrency limits, and result maps.
  • Minimal coordinator used by BatchLoader.
  • require(ids), wrapper(id, handler), loaded/failed/success.
  • Callback rules and polling patterns.
  • Enumerated/validated fetch option sets (e.g., mode, cache, credentials, referrerPolicy).
  • How validation interacts with HTTP.FETCH_DEFAULTS.
  • Shapes for HTTP responses (by format) and batch results.
  • Recommended typings/JSDoc for public methods.
  • Future: .d.ts bundles.

10) ERRORS

  • Error taxonomy and codes (e.g., E_BATCH_DUP_ID, E_HTTP_UNSUPPORTED_METHOD).
  • Guidance for structured logs and observability.
  • Custom batch handlers, HTTP debug hooks, and spec loader extensions.
  • Integration points for metrics/telemetry.
  • API stability policy, deprecation paths, and migration notes.

See also