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": "a21d0045e5504257953ce2406995a27fee57c542",
"integrity": "sha512-hcEeNCX2/ex1ON3GyQI04uGmRi/ZQybKHpJRo0/Q0Xa2eIuIUYsw+SFQ33DsqQt8asfNX2Xol+jU7cnsFVfkLQ==",
"tarball": "https://registry.npmjs.org/2sucres-api/-/2sucres-api-1.0.1.tgz",
"fileCount": 34,
"unpackedSize": 263150,
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGXLlCRA9TVsSAnZWagAAEPkP/jA6QS4smstZHy1yIXKv\nPSU2w0BTIVlwPIMYlG48U9sX4kuTs9Km0/XhaZbGj/DIvgboT2iBPdGKYTXX\npmlXb43UwJF41hS+52dI/Oj7KC6lAxClFj6NVVXRL55U9BKel5xyimssB4Ov\n0n9rQUcclpM7g7YtB6wMABIlqDfgh2xhZhwuk9bs478gzy5xcllOBFBZsRtw\n5ysgoa8eehgFEWjpVkaWd2PtKW86JyLUapJzVcvUJth3S00wtleqZhb6JMer\nbfDke2tnV09ycvijCDn4o0vHB/m7T6UU0y4NAaNFlJ8uWMC3oSApUERZnZvy\n/qwANUNP+esUUxzb+dyZ8e6KT1iemJm8dXxFxtot9430tKuo4dURK6AosCBQ\ni1pMpZS9UFO+G1CHxBMbXOhgEI86d4/ces9QrOFsdDhFFIrBoNasAiVpZXaF\n/MF1D+JhfbXfi4H1GBk+b5McoANpzHmR0xkdGEXn8EsyfNocdbtYmWw18LAE\nKoC+kkloD14M2faMbh5LkBHo1KxK8iahWxjRYZqX3A6/lA6Xiej4lcMoYI1Q\nkmNrYmcoqggqpMKPEBgSLNv1ge7AdFqFsw2OEudoyMhhkkS7QwTodOTIHbfJ\n4QIGRHihFBr4Ty7mXTnKSCeXeUmBvNQt/Gpwo63HU/xfcR+vCEW7MDoH974g\npnWh\r\n=wj0U\r\n-----END PGP SIGNATURE-----\r\n",
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEYCIQCyWcH8NvgY90WhUJe5nLEDeUE0e1o6QNWkwwir8oqAJwIhALJMhBNGAUG4lI/BqhKKWeRABU3fp4PGqZwojBbBK+yW"
}
]
}Observed since 20 Oct, 19:19 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:40c99d07c1d3f08dc3988d79c341caba5b8f3ef22bcbc7caf662c11297aca35a