Map to @plone/client#
@plone/client is the JavaScript and TypeScript client for plone.restapi, used by Volto and Seven.
This page maps its functions, as of version 2.0.0-alpha.8, to the methods of plone-client, so you can move between the two.
Conventions#
|
plone-client |
|
|---|---|---|
Create a client |
|
|
Log in |
|
|
Call style |
A flat method on the client: |
A method on a manager: |
Names |
A verb and a noun: |
The noun is the manager, the verb is the method: |
Lists |
|
|
Arguments |
One object: |
The item first, then keyword arguments: |
Item |
|
|
Result |
A promise of |
The decoded JSON, directly |
Errors |
A rejected promise with |
An exception per status, with |
Execution |
Asynchronous |
Synchronous |
The rule of thumb: cli.getComments({ path }) in JavaScript is client.comments.list(path) in Python, and cli.createComment({ path, data }) is client.comments.create(path, …).
Content#
Service |
|
plone-client |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Search#
Service |
|
plone-client |
|---|---|---|
|
|
|
|
|
|
|
|
Workflow, history, and working copies#
Service |
|
plone-client |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Users, groups, and sharing#
Service |
|
plone-client |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Types and vocabularies#
Service |
|
plone-client |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Site administration#
Service |
|
plone-client |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Only in plone-client#
plone-client |
Does |
|---|---|
Conveniences built on |
|
The number of results of a search. |
|
Uploads, |
|
|
|
|
|
|
|
Addable types, and |
|
|
|
|
Only in @plone/client#
|
Does |
|---|---|
|
Sets a new password with the token from a reset email. |
|
Adds methods for add-on services to the client class. |
Comments, translations, aliases, and relations#
Service
@plone/clientplone-client
GET @commentsgetComments({ path })comments.list(ref)POST @commentscreateComment({ path, in_reply_to, data })comments.create(ref, text, reply_to=…)PATCH @comments/<id>updateComment({ path, comment_id, data })comments.update(ref, comment_id, text)DELETE @comments/<id>deleteComment({ path, comment_id })comments.delete(ref, comment_id)GET @translationsgetTranslation({ path })translations.get(ref)POST @translationslinkTranslation({ path, data })translations.link(ref, translation)DELETE @translationsunlinkTranslation({ path, data })translations.unlink(ref, language)GET @aliaseson the rootgetAllAliases()aliases.list()GET @aliaseson an itemgetAliases({ path })aliases.list(ref)POST @aliaseson an itemcreateAlias({ path, data })aliases.create(ref, aliases)POST @aliaseson the rootcreateAliases({ data })aliases.create_redirects(redirects)DELETE @aliasesdeleteAliases({ path, data })aliases.delete(ref, aliases)GET @relationsgetAllRelations(),getRelations({ source, relation, onlyBroken })relations.list(…)POST @relationscreateRelations({ data })relations.create(relations)DELETE @relationsdeleteRelations({ data })relations.delete(…)POST @relations/rebuildfixRelations({ data })relations.rebuild(flush=…)