@communecter/cocolight-api-client 1.0.200 → 1.0.202

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.
@@ -979,9 +979,9 @@ export interface ShareNewsData {
979
979
  export interface GetCommentsData {
980
980
  pathParams?: {
981
981
  /**
982
- * Type de l'élément
982
+ * Type (collection) de l'élément commenté — les dix types commentables
983
983
  */
984
- type: "news";
984
+ type: "citoyens" | "organizations" | "projects" | "events" | "poi" | "news" | "answers" | "forms" | "classifieds" | "actions";
985
985
  /**
986
986
  * ID de l'élément dont on veut récupérer les commentaires
987
987
  */
@@ -990,6 +990,24 @@ export interface GetCommentsData {
990
990
  };
991
991
  [k: string]: unknown;
992
992
  }
993
+ export interface GetCommentsByPathData {
994
+ pathParams?: {
995
+ /**
996
+ * Type (collection) de l'élément commenté — les dix types commentables
997
+ */
998
+ type: "citoyens" | "organizations" | "projects" | "events" | "poi" | "news" | "answers" | "forms" | "classifieds" | "actions";
999
+ /**
1000
+ * ID de l'élément dont on veut récupérer les commentaires
1001
+ */
1002
+ id: string;
1003
+ /**
1004
+ * Chemin du fil (une question d'un formulaire) : segments [A-Za-z0-9_-] séparés par des points
1005
+ */
1006
+ path: string;
1007
+ [k: string]: unknown;
1008
+ };
1009
+ [k: string]: unknown;
1010
+ }
993
1011
  export interface AddCommentsData {
994
1012
  /**
995
1013
  * ID du commentaire parent (optionnel) ou chaîne vide
@@ -1004,9 +1022,9 @@ export interface AddCommentsData {
1004
1022
  */
1005
1023
  contextId: string;
1006
1024
  /**
1007
- * Type de l'élément auquel le commentaire est associé
1025
+ * Type (collection) de l'élément auquel le commentaire est associé — requis, sans défaut (un défaut serait INJECTÉ par AJV)
1008
1026
  */
1009
- contextType: "news";
1027
+ contextType: "citoyens" | "organizations" | "projects" | "events" | "poi" | "news" | "answers" | "forms" | "classifieds" | "actions";
1010
1028
  /**
1011
1029
  * Valeur de l'argument (optionnel)
1012
1030
  */
@@ -1053,6 +1071,25 @@ export interface AddCommentsData {
1053
1071
  * Contexte costum : collection de l'entité porteuse (organizations | projects | events | citoyens). Facultatif, complète costumSlug.
1054
1072
  */
1055
1073
  costumType?: string;
1074
+ /**
1075
+ * Images du commentaire : identifiants des documents téléversés (UPLOAD_DOCUMENT, folder `comments`). `countImages` : le legacy l'écrit en chaîne. Omis à l'update → le serveur retire les images ($unset).
1076
+ */
1077
+ mediaImg?: {
1078
+ /**
1079
+ * Nombre d'images (entier ou chaîne, parité legacy)
1080
+ */
1081
+ countImages?: number | string;
1082
+ /**
1083
+ * Identifiants des documents (24 hex)
1084
+ *
1085
+ * @maxItems 5
1086
+ */
1087
+ images: [] | [string] | [string, string] | [string, string, string] | [string, string, string, string] | [string, string, string, string, string];
1088
+ };
1089
+ /**
1090
+ * Le texte est en markdown. Recalculé par le serveur à chaque écriture : absent → faux (le legacy perd la mise en forme)
1091
+ */
1092
+ markdownActive?: boolean;
1056
1093
  [k: string]: unknown;
1057
1094
  }
1058
1095
  export interface DeleteCommentsData {
@@ -1070,6 +1107,9 @@ export interface UpdateCommentsData {
1070
1107
  * ID du commentaire à mettre à jour
1071
1108
  */
1072
1109
  id: string;
1110
+ /**
1111
+ * Liste blanche : text (requis), mentions, mediaImg, markdownActive. Le serveur RETIRE mentions et mediaImg s'ils manquent, et remet markdownActive à faux.
1112
+ */
1073
1113
  params: {
1074
1114
  /**
1075
1115
  * Nouveau texte du commentaire
@@ -1101,10 +1141,109 @@ export interface UpdateCommentsData {
1101
1141
  */
1102
1142
  count: number;
1103
1143
  }[];
1144
+ /**
1145
+ * Images du commentaire : identifiants des documents téléversés (UPLOAD_DOCUMENT, folder `comments`). `countImages` : le legacy l'écrit en chaîne. Omis à l'update → le serveur retire les images ($unset).
1146
+ */
1147
+ mediaImg?: {
1148
+ /**
1149
+ * Nombre d'images (entier ou chaîne, parité legacy)
1150
+ */
1151
+ countImages?: number | string;
1152
+ /**
1153
+ * Identifiants des documents (24 hex)
1154
+ *
1155
+ * @maxItems 5
1156
+ */
1157
+ images: [] | [string] | [string, string] | [string, string, string] | [string, string, string, string] | [string, string, string, string, string];
1158
+ };
1159
+ /**
1160
+ * Le texte est en markdown. Recalculé par le serveur à chaque écriture : absent → faux (le legacy perd la mise en forme)
1161
+ */
1162
+ markdownActive?: boolean;
1104
1163
  [k: string]: unknown;
1105
1164
  };
1106
1165
  [k: string]: unknown;
1107
1166
  }
1167
+ export interface GetDiscussionsData {
1168
+ /**
1169
+ * Ne sert qu'à demander `all` (jamais implicite, charge tout le parc). Les trois autres se déduisent du périmètre ; ne pas le passer « pour être explicite »
1170
+ */
1171
+ depth?: "rail" | "fils" | "fil" | "all";
1172
+ /**
1173
+ * Porteur `type:id` (mode fils)
1174
+ */
1175
+ carrier?: string;
1176
+ /**
1177
+ * Porteur, forme éclatée (avec carrierId)
1178
+ */
1179
+ carrierType?: "citoyens" | "organizations" | "projects" | "events" | "cities" | "poi" | "classifieds";
1180
+ carrierId?: string;
1181
+ /**
1182
+ * Un fil précis (mode fil), avec contextId
1183
+ */
1184
+ contextType?: "citoyens" | "organizations" | "projects" | "events" | "poi" | "news" | "answers" | "forms" | "classifieds" | "actions";
1185
+ contextId?: string;
1186
+ /**
1187
+ * Le fil d'une question (mode fil) ; absent → le fil RACINE
1188
+ */
1189
+ path?: string;
1190
+ /**
1191
+ * Défaut serveur 200, borné à 1000
1192
+ */
1193
+ limit?: number;
1194
+ /**
1195
+ * Rendre les porteurs et fils VIERGES (défaut serveur 1). En chaîne : tout paramètre posté sous une autre forme est refusé (bad-request)
1196
+ */
1197
+ includeEmpty?: "0" | "1";
1198
+ [k: string]: unknown;
1199
+ }
1200
+ export interface MarkCommentsSeenData {
1201
+ contextType: "citoyens" | "organizations" | "projects" | "events" | "poi" | "news" | "answers" | "forms" | "classifieds" | "actions";
1202
+ contextId: string;
1203
+ /**
1204
+ * Le fil d'une question ; absent, vide ou "0" → le fil racine. SANS défaut : un path injecté élargirait le marquage
1205
+ */
1206
+ path?: string;
1207
+ /**
1208
+ * Les messages AFFICHÉS, et eux seuls (500 au plus par appel). Un identifiant d'un autre fil ne marque rien
1209
+ *
1210
+ * @minItems 1
1211
+ * @maxItems 500
1212
+ */
1213
+ ids?: [string, ...string[]];
1214
+ [k: string]: unknown;
1215
+ }
1216
+ export interface GetDiscussionSpaceData {
1217
+ /**
1218
+ * Liste blanche : la seule nature d'espace aujourd'hui
1219
+ */
1220
+ contextType: "answers";
1221
+ /**
1222
+ * Identifiant du commun (minuscules ; le serveur accepte aussi des majuscules et les ramène)
1223
+ */
1224
+ contextId: string;
1225
+ /**
1226
+ * "0" : ne pas fabriquer les fils où personne n'a écrit (défaut serveur : rendus). En chaîne, sans défaut
1227
+ */
1228
+ includeEmpty?: "0" | "1";
1229
+ [k: string]: unknown;
1230
+ }
1231
+ export interface CreateDiscussionData {
1232
+ contextType: "answers";
1233
+ /**
1234
+ * Identifiant du commun
1235
+ */
1236
+ contextId: string;
1237
+ /**
1238
+ * Borne sur la saisie brute ; le serveur juge le texte nettoyé (bad-name)
1239
+ */
1240
+ name: string;
1241
+ /**
1242
+ * Publique · admins de l'appel, déposant et référents · admins de l'appel
1243
+ */
1244
+ audience: "authorAll" | "authorAdmin" | "private";
1245
+ [k: string]: unknown;
1246
+ }
1108
1247
  export interface SearchTagsData {
1109
1248
  pathParams?: {
1110
1249
  /**
@@ -7800,9 +7939,9 @@ export interface UploadDocumentData {
7800
7939
  folderId?: string;
7801
7940
  pathParams?: {
7802
7941
  /**
7803
- * Type (collection) de l'élément porteur
7942
+ * Type (collection) de l'élément porteur ; `comments` = image d'un commentaire, téléversée depuis la personne connectée (ownerId = me.id) AVANT le message qui la porte (mediaImg.images)
7804
7943
  */
7805
- folder: "citoyens" | "projects" | "organizations" | "events" | "poi" | "classifieds";
7944
+ folder: "citoyens" | "projects" | "organizations" | "events" | "poi" | "classifieds" | "comments";
7806
7945
  /**
7807
7946
  * ID de l'élément porteur (doit exister)
7808
7947
  */
@@ -1,5 +1,4 @@
1
1
  import { BaseEntity } from "./BaseEntity.js";
2
- import type { Comment } from "./Comment.js";
3
2
  import type { AddNewsData, UpdateNewsData } from "./EndpointApi.types.js";
4
3
  import type { NewsItemNormalized } from "./serverDataType/News.js";
5
4
  export declare class News extends BaseEntity<NewsItemNormalized> {
@@ -60,20 +59,6 @@ export declare class News extends BaseEntity<NewsItemNormalized> {
60
59
  * Constant : DELETE_NEWS
61
60
  */
62
61
  delete(): Promise<void>;
63
- /**
64
- * Créer une instance de commentaire pour cette news.
65
- * @param commentData - Données du commentaire.
66
- * @returns Instance de Comment.
67
- */
68
- comment(commentData?: Record<string, any>): Promise<Comment>;
69
- /**
70
- * Récupérer les commentaires : Récupère la liste de commentaires selon plusieurs critères.
71
- * Constant : GET_COMMENTS
72
- * @returns - Les données de réponse.
73
- * @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
74
- * @throws {Error} - En cas d'erreur inattendue.
75
- */
76
- getComments(): Promise<Comment[]>;
77
62
  /**
78
63
  * Ajoute un vote sur cette news
79
64
  *
@@ -153,6 +153,10 @@ export interface CostumFieldMap {
153
153
  };
154
154
  };
155
155
  associationEkilibre: {
156
+ citoyens: {
157
+ othersTypepro?: string;
158
+ typepro?: string | string[];
159
+ };
156
160
  organizations: {
157
161
  affiliate?: string | boolean;
158
162
  affiliateTo?: string;
@@ -2040,6 +2044,10 @@ export interface CostumFieldMap {
2040
2044
  };
2041
2045
  };
2042
2046
  sportSanteBienetre: {
2047
+ citoyens: {
2048
+ othersTypepro?: string;
2049
+ typepro?: string;
2050
+ };
2043
2051
  events: {
2044
2052
  description?: string;
2045
2053
  duration?: string | number;