Observed since 20 Oct, 19:19 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
2sucres-api
Wrapper Node.JS autour de l'API 2sucres
yarn add 2sucres-api
const apiFactory = require('2sucres-api')
const api = apiFactory(cookies, csrfToken)
const TOPIC_ID = 1
const MESSAGE_ID = 1
/**
* Récupère le nombre de messages d'un topic
* et l'indique dans le message original du topic
*/
async function run () {
const topic = await api.getTopic(TOPIC_ID)
const messageCount = topic.messageCount
await api.editMessage(MESSAGE_ID, `Le topic contient ${messageCount} message(s)`)
}
run().catch(err => {
// global error handling
console.error(err.stack)
process.exit(1)
})
Supprime les notifications
Supprime un topic
Édite un message
messageRécupère les informations d'un message par son id
Array.<message>Retourne la liste des messages d'une page d'un topic
Récupère la liste des notifications
Récupère la fin du topic
topicRécupère les informations d'un topic
Array.<topic>Récupère la liste des topics
Lock un topic
Poste un message
Poste un topic
Délock un topic
Met à jour le titre d'un topic
Supprime les notifications
Supprime un topic
Kind: global function
| Param | Type |
|---|---|
| topicId | number |
Édite un message
Kind: global function
| Param | Type |
|---|---|
| messageId | number |
| content | string |
messageRécupère les informations d'un message par son id
Kind: global function
| Param | Type |
|---|---|
| messageId | number |
Array.<message>Retourne la liste des messages d'une page d'un topic
Kind: global function
| Param | Type | Default |
|---|---|---|
| topicId | number | |
| page | number | 1 |
Récupère la liste des notifications
Kind: global function
| Param | Type | Default | Description |
|---|---|---|---|
| clear | boolean | false | si vrai, supprime les notifications après les avoir récupérées |
Récupère la fin du topic
Kind: global function
| Param | Type |
|---|---|
| topicId | number |
topicRécupère les informations d'un topic
Kind: global function
| Param | Type | Default |
|---|---|---|
| topicId | number | |
| page | number | 1 |
Array.<topic>Récupère la liste des topics
Kind: global function
| Param | Type | Default |
|---|---|---|
| page | number | 1 |
| forumId | number | 1 |
Lock un topic
Kind: global function
| Param | Type |
|---|---|
| topicId | number |
Poste un message
Kind: global function
| Param | Type |
|---|---|
| topicId | number |
| content | string |
Poste un topic
Kind: global function
| Param | Type |
|---|---|
| title | string |
| content | string |
| options | object |
Délock un topic
Kind: global function
| Param | Type |
|---|---|
| topicId | number |
Met à jour le titre d'un topic
Kind: global function
| Param | Type |
|---|---|
| topicId | number |
| title | string |
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
lodashEnvironment{
"local_name": "lodash",
"alias": false,
"peer_metadata": null
} | ^4.17.11 | runtime |
owEnvironment{
"local_name": "ow",
"alias": false,
"peer_metadata": null
} | ^0.8.0 | runtime |
chaiEnvironment{
"local_name": "chai",
"alias": false,
"peer_metadata": null
} | ^4.2.0 | development |
eslintEnvironment{
"local_name": "eslint",
"alias": false,
"peer_metadata": null
} | ^5.10.0 | development |
eslint-config-standardEnvironment{
"local_name": "eslint-config-standard",
"alias": false,
"peer_metadata": null
} | ^12.0.0 | development |
eslint-plugin-importEnvironment{
"local_name": "eslint-plugin-import",
"alias": false,
"peer_metadata": null
} | ^2.14.0 | development |
eslint-plugin-nodeEnvironment{
"local_name": "eslint-plugin-node",
"alias": false,
"peer_metadata": null
} | ^8.0.0 | development |
eslint-plugin-promiseEnvironment{
"local_name": "eslint-plugin-promise",
"alias": false,
"peer_metadata": null
} | ^4.0.1 | development |
eslint-plugin-standardEnvironment{
"local_name": "eslint-plugin-standard",
"alias": false,
"peer_metadata": null
} | ^4.0.0 | development |
jsdoc-to-markdownEnvironment{
"local_name": "jsdoc-to-markdown",
"alias": false,
"peer_metadata": null
} | ^4.0.1 | development |
leasotEnvironment{
"local_name": "leasot",
"alias": false,
"peer_metadata": null
} | ^6.6.2 | development |
mochaEnvironment{
"local_name": "mocha",
"alias": false,
"peer_metadata": null
} | ^5.2.0 | development |
pre-commitEnvironment{
"local_name": "pre-commit",
"alias": false,
"peer_metadata": null
} | ^1.2.2 | development |
Source distribution
{
"shasum": "e0cecc592542e8ed9757d38abffefa530737336e",
"integrity": "sha512-NTfnvVmRrmgCr4GMJAUxRu27O+KVRuFew8riFp/6YWbEVYt5TQMJcSkM1ofpcp3WXFHsRIzbWlaccUwdUk6vjg==",
"tarball": "https://registry.npmjs.org/2sucres-api/-/2sucres-api-1.0.0.tgz",
"fileCount": 34,
"unpackedSize": 263154,
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGXKwCRA9TVsSAnZWagAASxAP/isJd0TQZob/CUqO1K/Z\nGHuGle+OTLeJZf5iJCCdVQieOwDPC8rtL+NH8CCznaf/YE3vK/MZjY0lavDo\neoqX7O3/UdbAJZv0hBJagzAy+id+rjt4T+Tt5HwgSvNelpblTaxXFYNqP7Wu\nMZ+EZQPzYP+w7O5em0UXFMqu6SF+Ff8ADlRkc1B/3ul1wLirtnZiIFIX+GQq\nG3Z5vGYiynma0iv87fOVbnfyGD9CPdqJaImdYzC5JKxNYR9auLN+mxGTuPVO\nQQIB8Lfr6tiiCgH5JoGAYuwS+xp8t8uwa4iDODyGLVaqMveMcoAHdHnIiI4C\nt3lakJ3KL4bZM3O6h07Gn8Ok1zkzSxW+KINOnAf0Brt9cxQhCC8ePjttYqEx\nn7sra7ITL5pFEN4Nrur9FehXTpSa+QOa0dcC9BPYs3LrseSC1sceKkl3pU2H\nmj/YztcZf6NCXzUPa+eBddP50hHj3HiTnuUvE8lIjPdjw6VdV+PPhVc3Jw7v\n6N43IHQ2xOY6mVoTmneXVomWJEuOWlgDBQ5JRdqiLi7dhXQc0CCT+drcXBsg\neYMbDWBE776+JIc1V2daa/7oiK1Oi72HQCvgX4C/VAn1Xui8gPAEz+HxELK0\nbmRrxJzIT3rvM+FWjnNArceMe17nKVsStPgEnmGJfUxYYtZCP/+yYNtz8UcW\nRein\r\n=AJJ3\r\n-----END PGP SIGNATURE-----\r\n",
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEUCIQCE3awrpqnILYZhoGx59MNDg224Qwv7S2jAbeTgzKIDEgIgIQdshHpi+ngLFMuIAp9ml+qbqLZeEGjrYw0isnPnRgc="
}
]
}Observed since 20 Oct, 19:19 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:14bbcaabc6516450e6d90dfa355e710cbaaa3ccdc24c650d3cae2441242d5496