ffl_core.api.extensions¶
Source: apps/ffl_core/ffl_core/api/extensions.py · 13 endpoint(s)
Generated by
make api-docs— do not edit by hand.
disable_notice¶
GET /api/method/ffl_core.api.extensions.disable_notice
Auth (derived from code): Roles: System Manager
What turning this extension off will interrupt, in the extension's own words.
| arg | type | required | default | description |
|---|---|---|---|---|
extension |
string | yes | — | POS Extension id. |
Returns: str: one sentence from the manifest's disable_notice callable (dotted path), or "" when the extension declares none — the page then flips the switch without a dialog.
apps/ffl_core/ffl_core/api/extensions.py:125
fetch_update¶
POST /api/method/ffl_core.api.extensions.fetch_update
Auth (derived from code): Roles: System Manager
Download the newer version the update service offers for an extension
(the page's Update button), check it, and describe it like an upload.
The package must be what the service announced (latest_sha256 from
extensions/updates.check), for this extension and version, and this POS
must be able to run it, and it must come from the publisher of the one
installed (an id clash with a sideloaded fork is not an update);
install_upload(sha256, id) then upgrades.
| arg | type | required | default | description |
|---|---|---|---|---|
extension |
string | yes | — | POS Extension id. |
Returns: dict: the inspect_upload shape (filename is <id>-<version>.zip) plus source: {"type": "update-service", "version"}.
apps/ffl_core/ffl_core/api/extensions.py:405
inspect_git¶
POST /api/method/ffl_core.api.extensions.inspect_git
Auth (derived from code): Roles: System Manager
Clone a public git repository at a branch or tag, lint it, and describe it like an upload.
The clone is shallow, over https only, with no credentials, and gives up
after 60 seconds; a private repository fails at once (download its zip
and upload that instead). The tree is packed into an upload by its sha256,
exactly as inspect_upload keeps a zip — install_upload installs or
upgrades it.
| arg | type | required | default | description |
|---|---|---|---|---|
url |
string | yes | — | https:// |
ref |
string | yes | — | branch or tag name. |
Returns: dict: the inspect_upload shape (filename is <url>@<ref>) plus source: {"type": "git", "url", "ref", "commit"}.
apps/ffl_core/ffl_core/api/extensions.py:378
inspect_upload¶
POST /api/method/ffl_core.api.extensions.inspect_upload
Auth (derived from code): Roles: System Manager
Take an uploaded extension zip (multipart field file), lint it, and describe it.
Nothing is installed: the zip is kept under the site's private files by
its sha256 until install_upload is called or it is replaced.
Returns: dict: the lint report (ok, findings, permissions, app_id, title, version, publisher…) plus sha256, high_risk, on_bench / installed_on_site / baked for that id, and upgrade: None when the id is not on this server, else {"from", "to", "allowed", "reason", "permissions_added", "permissions_removed", "release_notes"} (the package's notes for versions after from up to to, newest first, as one markdown text). An id whose last upgrade did not finish is not allowed until it is rolled back; reason says so.
apps/ffl_core/ffl_core/api/extensions.py:343
install_on_site¶
POST /api/method/ffl_core.api.extensions.install_on_site
Auth (derived from code): Roles: System Manager
Install an extension that is on the bench but not on this site (background job).
| arg | type | required | default | description |
|---|---|---|---|---|
extension |
string | yes | — | POS Extension id. |
Returns: dict: {"extension": id, "job_state": "Installing"} — poll list_extensions.
apps/ffl_core/ffl_core/api/extensions.py:210
install_upload¶
POST /api/method/ffl_core.api.extensions.install_upload
Auth (derived from code): Roles: System Manager
Stage an inspected upload and hand it to the store's agent (background job).
| arg | type | required | default | description |
|---|---|---|---|---|
sha256 |
string | yes | — | the upload reference returned by inspect_upload. |
confirm_id |
string | yes | — | must equal the extension id — the typed confirmation ("you are installing unreviewed code"). The page's Update sends it itself (the manager confirms in its dialog). |
Returns: dict: {"extension": id, "job_state": "Staging", "mode": "install" | "upgrade"} — poll list_extensions. An install appears as Staged, then Installing once the agent restarts the store; an upgrade (the id is on this server and the package is a newer version from upload or git) as Staged, then Upgrading. A same-id package that may not upgrade it is refused with the reason, and nothing starts while another extension is being installed, upgraded or removed, or the store is waiting to restart.
apps/ffl_core/ffl_core/api/extensions.py:471
list_extensions¶
GET /api/method/ffl_core.api.extensions.list_extensions
Auth (derived from code): Roles: System Manager
The registry as the Extensions page shows it.
Returns: dict: {"core_version": str, "extensions": [row...], "incompatible": int, "busy": int, "busy_states": [str], "restart": {"pending": dict | None, "done": dict | None}, "update_service": bool} — each row is a POS Extension with permissions / manifest decoded, high_risk (the permissions the page paints red) and effective (bool: switched on AND installed here AND compatible — what the extension actually does; enabled is only the store's switch) and update (None, or {"version", "compatible", "reason", "requires_core"}: the newer version the update service offers). busy_states: the job states that lock a row. update_service: an update source is set up on this site (else no update is ever offered).
apps/ffl_core/ffl_core/api/extensions.py:84
refresh¶
POST /api/method/ffl_core.api.extensions.refresh
Auth (derived from code): Roles: System Manager
Re-read the bench and the site (ffl_core.extensions.registry.sync), ask the
update service what is newer (ffl_core.extensions.updates.check), then list.
Returns: dict: same shape as list_extensions, plus sync — the sync summary ({"created": [...], "updated": [...], "unchanged": [...], "removed": [...], "reset": [...]} — reset lists rows whose stuck job was marked Failed) — and updates: {"checked": bool, "offered": {id: version}, "error"?: True}.
apps/ffl_core/ffl_core/api/extensions.py:105
release_notes¶
GET /api/method/ffl_core.api.extensions.release_notes
Auth (derived from code): Roles: System Manager
The extension's own release notes (its change_log folder), newest first.
| arg | type | required | default | description |
|---|---|---|---|---|
extension |
string | yes | — | POS Extension id. |
Returns: list: [[version, markdown], ...] — the same reader (and the same pre-release file-name rule) as the core's What's New; [] when the extension ships none.
apps/ffl_core/ffl_core/api/extensions.py:269
set_enabled¶
POST /api/method/ffl_core.api.extensions.set_enabled
Auth (derived from code): Roles: System Manager
Turn an installed extension on or off for this store.
| arg | type | required | default | description |
|---|---|---|---|---|
extension |
string | yes | — | POS Extension id. |
enabled |
int | str | yes | — |
Returns: dict: the updated row (same shape as a list_extensions row).
apps/ffl_core/ffl_core/api/extensions.py:157
uninstall_from_site¶
POST /api/method/ffl_core.api.extensions.uninstall_from_site
Auth (derived from code): Roles: System Manager
Back up the database, then remove the extension from this site (background job).
The code stays on the bench (removing it is docs/self-hosting.md#extensions / the agent); the extension's own before_uninstall hook cleans what it added to core.
| arg | type | required | default | description |
|---|---|---|---|---|
extension |
string | yes | — | POS Extension id. |
confirm_id |
string | yes | — | must equal extension — the typed confirmation. |
Returns: dict: {"extension": id, "job_state": "Uninstalling"} — poll list_extensions.
apps/ffl_core/ffl_core/api/extensions.py:238
uninstall_preview¶
GET /api/method/ffl_core.api.extensions.uninstall_preview
Auth (derived from code): Roles: System Manager
What uninstalling removes from this site, so the confirmation can say so.
| arg | type | required | default | description |
|---|---|---|---|---|
extension |
string | yes | — | POS Extension id. |
Returns: dict: {"doctypes": [{"name", "rows", "child"}], "custom_fields": int, "roles": [str], "modules": [str], "records": int, "blocked": bool} — every DocType of the app's modules (what remove_app drops) with row counts, the custom fields it added to core DocTypes, the roles it created, and blocked when any of its tables still hold records (then the only way out is turning it off — uninstall_from_site refuses).
apps/ffl_core/ffl_core/api/extensions.py:292
upload_failure¶
GET /api/method/ffl_core.api.extensions.upload_failure
Auth (derived from code): Roles: System Manager
Why a staged upload failed where no registry row says so (the page shows it after Install / Upgrade).
An install whose code never reached the registry has no row; an upgrade refused because the store was busy, or because the id's last upgrade did not finish, leaves its row as it was.
| arg | type | required | default | description |
|---|---|---|---|---|
sha256 |
string | yes | — | the upload reference. |
Returns: dict | None: {"app", "message"} or None.
apps/ffl_core/ffl_core/api/extensions.py:509