adonisrc.ts when you configure it: node ace list attract shows
them, and node ace <name> --help explains each.
attract:check
The config, the site answering, its key accepted, and the clocks agreeing.
attract:sweep
Call every read the site offers with this app’s key, and report what broke.
attract:store-key · attract:forget-key
The key in the database: store it after the site accepts it, or delete it.
REPL: loadAttract()
The client in
node ace repl, to try a call against the real site.1, so a script or CI step sees it failed.
Check the site
Terminal
Terminal
Config
config/attract.ts names the site, and its URL and key are well formed (with the key in the
database: the row is there and opens).Reachable
The site answers a public read.
Key accepted
One call with the key. A key whose scopes can’t list pages is a warning, not a fail: the site
still accepted it.
Clock
This server’s clock against the site’s. Signed requests allow 5 minutes: past that, a key that
signs fails; past a minute, a warning.
Sweep every read
Terminal
Terminal
403 (any 4xx is an
answer), so it isn’t broken.
Broken is an answer the SDK can’t read, a 5xx or no answer at all: report it.
Store or forget the key
With the key in the database (Key in the database):Terminal
attract:check. Run it again to replace the key.
The key’s signing secret,
fss_…. Left out, it is asked for, hidden, whenever the signing mode
isn’t none.Terminal
--force
skips the question). The key keeps working on the site until you revoke it there, in the CMS under
API Keys.
Try calls in the REPL
node ace repl is a Node REPL with your app booted. The package adds loadAttract(), which puts the
default site’s client in a site variable:
REPL
.ls lists every helper the REPL has, loadAttract among them.
Commands of your own
Any job your app does against the site can be a command of its own:Terminal
commands/latest_posts.ts
startApp: true
Boots the app first, so the container and the package’s client are there.
@inject() on run()
Takes the
SiteClient (or SiteClients, or your own services) as arguments.exitCode = 1
On a refusal, after
this.logger.error(…), so a script or CI step sees it failed.Next: jobs, cache and health
Queue jobs and schedules, cached answers, and a readiness check.