* * `type` is `text`, `password` or `url`. Anything typed into a `password` field is stored through * {@see Credentials} and never sent back to the client — {@see \PlugixaCrm\Modules\Integrations\Http\IntegrationsController} * returns a placeholder instead, because a settings screen that renders a stored API key is a * key readable by anybody who can open the browser's devtools on a shared machine. */ public function settings_schema(): array; /** * Store a connection. * * MUST BE IDEMPOTENT, AND MUST NOT START WORK. This is a save button, and a save button gets * pressed twice. Until 3.36.0 the WooCommerce connector started its historical import from here, * and `Backfill::start()` enqueues under the dedupe key `backfill` — which {@see * \PlugixaCrm\Modules\Integrations\Repositories\JobRepository::enqueue()} collapses only onto a * job that is still PENDING. So once the first import had finished, every later save walked all * 200,000 orders again, silently, on the site of whoever had just corrected a typo. * * Work that a human is asking for belongs behind a button that says so — see * {@see IntegrationActionsInterface}. * * @param array $input Values matching {@see settings_schema()}. * * @return true|WP_Error An error message a human can act on, never a code alone. */ public function connect( array $input ): bool|WP_Error; /** * Forget the connection. * * MUST NOT DELETE SYNCED DATA. Disconnecting is "stop talking to them", not "undo everything you * learned" — somebody reconnecting an hour later after rotating a key expects their contacts to * still be there. Deleting the links is what {@see \PlugixaCrm\Modules\Integrations\Repositories\LinkRepository::forget_integration()} * is for, and it is a separate, explicit action. */ public function disconnect(): void; }