@communecter/cocolight-api-client 1.0.67 → 1.0.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@communecter/cocolight-api-client",
3
- "version": "1.0.67",
3
+ "version": "1.0.68",
4
4
  "description": "Client Axios simplifié pour l'API cocolight",
5
5
  "repository": {
6
6
  "type": "git",
package/src/api/News.ts CHANGED
@@ -383,6 +383,7 @@ export class News extends BaseEntity<NewsItemNormalized> {
383
383
  * @param params - Paramètres de partage
384
384
  * @param params.childId - ID de l'entité cible (par défaut: utilisateur connecté)
385
385
  * @param params.childType - Type de l'entité cible (par défaut: "citoyens")
386
+ * @param params.comment - Commentaire optionnel accompagnant le partage
386
387
  * @returns Promise contenant la réponse de l'API après le partage
387
388
  * @throws {ApiError} Si la news n'a pas d'ID (404)
388
389
  * @throws {ApiError} Si l'utilisateur n'est pas connecté (400)
@@ -390,7 +391,7 @@ export class News extends BaseEntity<NewsItemNormalized> {
390
391
  * @throws {ApiError} Si on tente de partager sa propre news à soi-même (400)
391
392
  * @throws {ApiError} Si le type cible n'est pas valide (400)
392
393
  */
393
- async shareNews({ childId, childType }: { childId?: string, childType?: string } = {}){
394
+ async shareNews({ childId, childType, comment }: { childId?: string, childType?: string, comment?: string } = {}){
394
395
  // Validations préalables
395
396
  if (!this.id) {
396
397
  throw new ApiError(`${this.constructor.name} non enregistrée.`, 404);
@@ -427,7 +428,8 @@ export class News extends BaseEntity<NewsItemNormalized> {
427
428
  parentType: "news",
428
429
  connectType: "share",
429
430
  childType: targetType as "citoyens" | "projects" | "organizations",
430
- childId: targetId
431
+ childId: targetId,
432
+ comment
431
433
  };
432
434
 
433
435
  return await this.callIsConnected(() => this.endpointApi.shareNews(payload));
@@ -101,6 +101,7 @@ export declare class News extends BaseEntity<NewsItemNormalized> {
101
101
  * @param params - Paramètres de partage
102
102
  * @param params.childId - ID de l'entité cible (par défaut: utilisateur connecté)
103
103
  * @param params.childType - Type de l'entité cible (par défaut: "citoyens")
104
+ * @param params.comment - Commentaire optionnel accompagnant le partage
104
105
  * @returns Promise contenant la réponse de l'API après le partage
105
106
  * @throws {ApiError} Si la news n'a pas d'ID (404)
106
107
  * @throws {ApiError} Si l'utilisateur n'est pas connecté (400)
@@ -108,8 +109,9 @@ export declare class News extends BaseEntity<NewsItemNormalized> {
108
109
  * @throws {ApiError} Si on tente de partager sa propre news à soi-même (400)
109
110
  * @throws {ApiError} Si le type cible n'est pas valide (400)
110
111
  */
111
- shareNews({ childId, childType }?: {
112
+ shareNews({ childId, childType, comment }?: {
112
113
  childId?: string;
113
114
  childType?: string;
115
+ comment?: string;
114
116
  }): Promise<unknown>;
115
117
  }