Module: Magik::API

Defined in:
lib/magik/api.rb

Overview

REST APIs and webhooks in both directions, with auto pagination, filtering and sorting.

Implements: Phase 6 — API & Integration of docs/idea/00-build-spec.md.

Planned DSL surface, copied from the spec:

* `api :V1 do resource :name do index/show/create/update/destroy end end`
* `webhook :incoming, :name do verify_signature; on :event end`
* `webhook :outgoing, :name do fires_on; deliver_to; sign_with end`
* `auth: :bearer, :api_key, :jwt; rate limiting by plan`

Status: Not implemented — spec only. Every entry point below raises NotImplementedError. Nothing here reads config, touches a database or emits a byte of HTML.

See Also:

Constant Summary collapse

SPEC_PHASE =

The build-spec phase this subsystem implements.

Returns:

  • (String)
"Phase 6 — API & Integration"
DSL_SURFACE =

The DSL this subsystem will expose, verbatim from the spec.

Returns:

  • (Array<String>)
[
  "api :V1 do resource :name do index/show/create/update/destroy end end",
  "webhook :incoming, :name do verify_signature; on :event end",
  "webhook :outgoing, :name do fires_on; deliver_to; sign_with end",
  "auth: :bearer, :api_key, :jwt; rate limiting by plan"
].freeze
STATUS =

Implementation status of this subsystem.

Returns:

  • (String)
"Not implemented — spec only"

Class Method Summary collapse

Class Method Details

.define(*_args, **_options) ⇒ void

This method returns an undefined value.

Entry point for the API DSL.

Parameters:

  • _args (Array)

    ignored

  • _options (Hash)

    ignored

Raises:

  • (NotImplementedError)

    always, until Phase 6 lands



45
46
47
# File 'lib/magik/api.rb', line 45

def self.define(*_args, **_options)
  raise NotImplementedError, "Magik::API is spec-only; see docs/idea/00-build-spec.md"
end