@communecter/cocolight-api-client 1.0.141 → 1.0.143

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.141",
3
+ "version": "1.0.143",
4
4
  "description": "Client Axios simplifié pour l'API cocolight",
5
5
  "repository": {
6
6
  "type": "git",
package/src/ApiClient.ts CHANGED
@@ -1658,14 +1658,14 @@ export default class ApiClient extends EventEmitter {
1658
1658
  /**
1659
1659
  * Liste des champs de date à normaliser.
1660
1660
  */
1661
- private _dateFields = ["modified", "created", "updated", "birthDate", "lastLoginDate", "startDate", "endDate", "date", "issuedOn"];
1661
+ private _dateFields = ["modified", "created", "updated", "birthDate", "lastLoginDate", "startDate", "endDate", "date", "issuedOn", "equip_maj_date", "inst_date_creation", "inst_enqu_date"];
1662
1662
 
1663
1663
  /**
1664
1664
  * Liste des champs numériques à normaliser (le backend les renvoie en string
1665
1665
  * via x-www-form-urlencoded ; sans cette coercion, JSON.stringify diff
1666
1666
  * produit des faux positifs dans `hasChanges()`).
1667
1667
  */
1668
- private _numberFields = ["buildingSurfaceArea", "siteSurfaceArea", "credits", "min", "max", "timeSpent"];
1668
+ private _numberFields = ["buildingSurfaceArea", "siteSurfaceArea", "credits", "min", "max", "timeSpent", "equip_surf", "equip_larg", "equip_long"];
1669
1669
 
1670
1670
  /**
1671
1671
  * Normalise récursivement un objet, un tableau ou une valeur simple.
@@ -1504,6 +1504,18 @@ export class BaseEntity<TServerData = any> {
1504
1504
  normalized = { ...normalized, value: "" };
1505
1505
  }
1506
1506
 
1507
+ // R7 — value: [] (array vide) en $set simple (sans arrayForm/pull) → on envoie "".
1508
+ // Raison : en form-urlencoded un array vide n'émet AUCUN paramètre `value`, donc le
1509
+ // backend fait `$_POST["value"]` (accès direct) → "Undefined index: value" / 500.
1510
+ // Et de toute façon le backend traite un array vide comme un effacement
1511
+ // (`!empty([])` === false → `$unset`). On envoie donc "" (sans setType) → $unset.
1512
+ if (Array.isArray(normalized.value) && normalized.value.length === 0
1513
+ && !normalized.arrayForm && !normalized.pull) {
1514
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1515
+ const { setType, ...rest } = normalized;
1516
+ normalized = { ...rest, value: "" };
1517
+ }
1518
+
1507
1519
  return normalized;
1508
1520
  }
1509
1521
 
@@ -2,7 +2,7 @@
2
2
  import { ApiAuthenticationError } from "../error.js";
3
3
 
4
4
  import type ApiClient from "../ApiClient.js";
5
- import type { PersonRegisterData, AuthenticateUrlData, RefreshTokenUrlData, PasswordRecoveryData, ServerExchangeTokenData, ChangePasswordData, DeleteAccountData, UpdateSettingsData, UpdateBlockDescriptionData, UpdateBlockInfoData, UpdateBlockSocialData, UpdateBlockLocalityData, UpdateBlockSlugData, CheckData, ProfilImageData, ProfilBannerData, GetElementsAboutData, MulticonnectData, GetNewsData, GetNewsByIdData, AddNewsData, AddImageNewsData, AddFileNewsData, DeleteNewsData, UpdateNewsData, ShareNewsData, GetCommentsData, AddCommentsData, DeleteCommentsData, UpdateCommentsData, SearchTagsData, ShowVoteData, GlobalAutocompleteData, CityAutocompleteData, CityAutocompleteByCountryData, SuggestionInputData, GetProjectsNoAdminData, GetProjectsAdminData, GetPoisNoAdminData, GetPoisAdminData, GetOrganizationsNoAdminData, GetOrganizationsAdminData, GetMembersNoAdminData, GetMembersAdminData, GetFriendsAdminData, GetSubscriptionsData, GetSubscriptionsAdminData, GetSubscribersData, GetSubscribersAdminData, GetContributorsNoAdminData, GetContributorsAdminData, GetBadgesData, GetBadgesFiltersData, ConnectData, DisconnectData, GetElementsKeyData, GetFavorisData, DeleteFavorisData, AddFavorisData, AddOrganizationData, AddProjectData, AddPoiData, AddEventData, DeletePoiData, DeleteEventData, DeleteElementData, AddImageElementData, LinkValidateData, SearchMemberAutocompleteData, GetNotificationsData, GetNotificationsCountData, NotificationUpdateData, MarkNotificationAsReadData, ActivitypubSearchData, ActivitypubLinkData, ActivitypubGetCommunityData, GetBadgeData, AddBadgesData, AssignBadgesData, GetEventsData, ShareEventsData, InviteEventData, FollowData, GetCostumJsonData, GlobalAutocompleteCostumData, NavigatorGettlData, CostumEventRequestActorsData, CostumEventRequestSubeventsData, CostumEventRequestElementEventData, CostumEventRequestCategoriesData, CostumEventRequestDatesData, CostumEventRequestEventData, CostumEventRequestLinkTlToEventData, CostumEventRequestLoadContextTagData, GetGalleryData, GetAttendeesNoAdminData, GetAttendeesAdminData, CoformAnswersSearchData, CoformAnswersByIdData, GetCoformByIdData, CoformUploadAnswerFileData, CoformGetAnswerFilesData, SaveCoformAnswerData, AddVoteData, AddReportAbuseData, UpdatePathValueData, DeleteDocumentByContextData, DeleteDocumentByIdData, DemoteAdminData, CostumFilterCoformData, CostumFilterCoformByPathData, GetCountriesData, SearchZonesData, CoformAnswersByFormsData, GenerateAnswerFromFormData, FundingEnvelopeData, CoremuOperationData, CostumProjectActionRequestNewData, CostumProjectActionRequestSetStatusData, CostumProjectActionRequestSetDateData, CostumProjectActionRequestSetContributorsData, CostumProjectActionRequestCancelData, CostumProjectActionRequestArchiveData, LinkDiscourseAccountData, UnlinkDiscourseAccountData, DiscourseProfileData, DiscourseCheckEmailData, DiscourseDismissLinkData, LinkMediawikiAccountData, UnlinkMediawikiAccountData, GetMediawikiContributionsData, AddClassifiedData } from "./EndpointApi.types.js";
5
+ import type { PersonRegisterData, AuthenticateUrlData, RefreshTokenUrlData, PasswordRecoveryData, ServerExchangeTokenData, ChangePasswordData, DeleteAccountData, UpdateSettingsData, UpdateBlockDescriptionData, UpdateBlockInfoData, UpdateBlockSocialData, UpdateBlockLocalityData, UpdateBlockSlugData, CheckData, ProfilImageData, ProfilBannerData, GetElementsAboutData, MulticonnectData, GetNewsData, GetNewsByIdData, AddNewsData, AddImageNewsData, AddFileNewsData, DeleteNewsData, UpdateNewsData, ShareNewsData, GetCommentsData, AddCommentsData, DeleteCommentsData, UpdateCommentsData, SearchTagsData, ShowVoteData, GlobalAutocompleteData, CityAutocompleteData, CityAutocompleteByCountryData, SuggestionInputData, GetProjectsNoAdminData, GetProjectsAdminData, GetPoisNoAdminData, GetPoisAdminData, GetOrganizationsNoAdminData, GetOrganizationsAdminData, GetUserEligiblePlacesData, GetMembersNoAdminData, GetMembersAdminData, GetFriendsAdminData, GetSubscriptionsData, GetSubscriptionsAdminData, GetSubscribersData, GetSubscribersAdminData, GetContributorsNoAdminData, GetContributorsAdminData, GetBadgesData, GetBadgesFiltersData, ConnectData, DisconnectData, GetElementsKeyData, GetFavorisData, DeleteFavorisData, AddFavorisData, AddOrganizationData, AddProjectData, AddPoiData, AddEventData, DeletePoiData, DeleteEventData, DeleteElementData, AddImageElementData, LinkValidateData, SearchMemberAutocompleteData, GetNotificationsData, GetNotificationsCountData, NotificationUpdateData, MarkNotificationAsReadData, ActivitypubSearchData, ActivitypubLinkData, ActivitypubGetCommunityData, GetBadgeData, AddBadgesData, AssignBadgesData, GetEventsData, ShareEventsData, InviteEventData, FollowData, GetCostumJsonData, GlobalAutocompleteCostumData, NavigatorGettlData, CostumEventRequestActorsData, CostumEventRequestSubeventsData, CostumEventRequestElementEventData, CostumEventRequestCategoriesData, CostumEventRequestDatesData, CostumEventRequestEventData, CostumEventRequestLinkTlToEventData, CostumEventRequestLoadContextTagData, GetGalleryData, GetAttendeesNoAdminData, GetAttendeesAdminData, CoformAnswersSearchData, CoformAnswersByIdData, GetCoformByIdData, CoformUploadAnswerFileData, CoformGetAnswerFilesData, GetCoformCatalogsData, SaveCoformAnswerData, GetCoformAnswerHistoryData, GetCoformMultievalDataData, GetCoformCommontableContributorsData, AddVoteData, AddReportAbuseData, UpdatePathValueData, DeleteDocumentByContextData, DeleteDocumentByIdData, DemoteAdminData, CostumFilterCoformData, CostumFilterCoformByPathData, GetCountriesData, SearchZonesData, CoformAnswersByFormsData, GenerateAnswerFromFormData, FundingEnvelopeData, CoremuOperationData, CostumProjectActionRequestNewData, CostumProjectActionRequestSetStatusData, CostumProjectActionRequestSetDateData, CostumProjectActionRequestSetContributorsData, CostumProjectActionRequestCancelData, CostumProjectActionRequestArchiveData, LinkDiscourseAccountData, UnlinkDiscourseAccountData, DiscourseProfileData, DiscourseCheckEmailData, DiscourseDismissLinkData, LinkMediawikiAccountData, UnlinkMediawikiAccountData, GetMediawikiContributionsData, AddClassifiedData } from "./EndpointApi.types.js";
6
6
 
7
7
  /**
8
8
  * Classe EndpointApi générée automatiquement depuis endpoints-copie.json
@@ -747,6 +747,22 @@ export class EndpointApi {
747
747
  return this.callIsConnected("GET_ORGANIZATIONS_ADMIN", data);
748
748
  }
749
749
 
750
+ /**
751
+ * Récupérer les lieux éligibles d'un utilisateur : Récupère les organisations memberOf de l'utilisateur filtrées par filters arbitraires (tags, etc.) et notSourceKey configurables. Utilisé par la vue collaborative coform/place pour pré-filtrer côté serveur les lieux éligibles à un formulaire.
752
+ * Constant : GET_USER_ELIGIBLE_PLACES
753
+ * @param data - Données envoyées à l'API
754
+ * @returns Les données de réponse.
755
+ * @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
756
+ * @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
757
+ * @throws {Error} - En cas d'erreur inattendue.
758
+ */
759
+ async getUserEligiblePlaces(data: GetUserEligiblePlacesData): Promise<any> {
760
+ if (!data || typeof data !== "object") {
761
+ throw new TypeError("Le paramètre data doit être un objet.");
762
+ }
763
+ return this.callIsConnected("GET_USER_ELIGIBLE_PLACES", data);
764
+ }
765
+
750
766
  /**
751
767
  * Récupérer les membres non administrables : Récupère les membres d’une organisation sans droits d’admin.
752
768
  * Constant : GET_MEMBERS_NO_ADMIN
@@ -1702,6 +1718,21 @@ export class EndpointApi {
1702
1718
  return this.callIsConnected("COFORM_GET_ANSWER_FILES", data);
1703
1719
  }
1704
1720
 
1721
+ /**
1722
+ * Récupérer les catalogues collaboratifs commonTable d'un formulaire : Pour les inputs de type tpls.forms.evaluation.commonTableV2, retourne en un seul appel le catalogue agrégé des criterias (besoins/solutions) déclarées par tous les répondants pour chaque inputKey demandé, avec un compteur de répondants par criteriaId.
1723
+ * Constant : GET_COFORM_CATALOGS
1724
+ * @param data - Données envoyées à l'API
1725
+ * @returns Les données de réponse.
1726
+ * @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
1727
+ * @throws {Error} - En cas d'erreur inattendue.
1728
+ */
1729
+ async getCoformCatalogs(data: GetCoformCatalogsData): Promise<any> {
1730
+ if (!data || typeof data !== "object") {
1731
+ throw new TypeError("Le paramètre data doit être un objet.");
1732
+ }
1733
+ return this.call("GET_COFORM_CATALOGS", data);
1734
+ }
1735
+
1705
1736
  /**
1706
1737
  * Sauvegarder une réponse de formulaire CoForm : Enregistre ou met à jour les réponses d'un utilisateur pour un formulaire CoForm
1707
1738
  * Constant : SAVE_COFORM_ANSWER
@@ -1718,6 +1749,54 @@ export class EndpointApi {
1718
1749
  return this.callIsConnected("SAVE_COFORM_ANSWER", data);
1719
1750
  }
1720
1751
 
1752
+ /**
1753
+ * Récupérer l'historique des modifications d'une réponse coform : Retourne l'historique des modifications (create + update) d'une réponse coform partagée, depuis la collection answerChanges. Trié du plus récent au plus ancien, limité à 200 entrées. Auth: l'utilisateur doit être propriétaire OU autorisé via canAdminAnswer (admin du parent du form, admin/membre du finder selon membersCanEditSharedAnswer, ou form publicCanEditSharedAnswer).
1754
+ * Constant : GET_COFORM_ANSWER_HISTORY
1755
+ * @param data - Données envoyées à l'API
1756
+ * @returns Les données de réponse.
1757
+ * @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
1758
+ * @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
1759
+ * @throws {Error} - En cas d'erreur inattendue.
1760
+ */
1761
+ async getCoformAnswerHistory(data: GetCoformAnswerHistoryData): Promise<any> {
1762
+ if (!data || typeof data !== "object") {
1763
+ throw new TypeError("Le paramètre data doit être un objet.");
1764
+ }
1765
+ return this.callIsConnected("GET_COFORM_ANSWER_HISTORY", data);
1766
+ }
1767
+
1768
+ /**
1769
+ * Récupérer les données agrégées d'évaluation multiple (radar) d'une réponse coform : Pour une réponse coform partagée comportant des inputs radioNew avec activeMultieval=true, retourne les datasets agrégés (1 par utilisateur contributeur) pour chaque step. Lecture tolérante : priorité au format canonical `value`, fallback sur le format legacy `answer` '{idx}_{slug}'. Auth : owner OU canAdminAnswer.
1770
+ * Constant : GET_COFORM_MULTIEVAL_DATA
1771
+ * @param data - Données envoyées à l'API
1772
+ * @returns Les données de réponse.
1773
+ * @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
1774
+ * @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
1775
+ * @throws {Error} - En cas d'erreur inattendue.
1776
+ */
1777
+ async getCoformMultievalData(data: GetCoformMultievalDataData): Promise<any> {
1778
+ if (!data || typeof data !== "object") {
1779
+ throw new TypeError("Le paramètre data doit être un objet.");
1780
+ }
1781
+ return this.callIsConnected("GET_COFORM_MULTIEVAL_DATA", data);
1782
+ }
1783
+
1784
+ /**
1785
+ * Récupérer les contributeurs d'une ligne de commonTable : Pour un input commonTable et une liste de criteriaIds (= une ligne du tableau, qui peut agréger plusieurs criterias dédupés via groupKey côté React), retourne la liste des contributions individuelles avec l'auteur, sa solution, sa satisfaction et sa note.
1786
+ * Constant : GET_COFORM_COMMONTABLE_CONTRIBUTORS
1787
+ * @param data - Données envoyées à l'API
1788
+ * @returns Les données de réponse.
1789
+ * @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
1790
+ * @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
1791
+ * @throws {Error} - En cas d'erreur inattendue.
1792
+ */
1793
+ async getCoformCommontableContributors(data: GetCoformCommontableContributorsData): Promise<any> {
1794
+ if (!data || typeof data !== "object") {
1795
+ throw new TypeError("Le paramètre data doit être un objet.");
1796
+ }
1797
+ return this.callIsConnected("GET_COFORM_COMMONTABLE_CONTRIBUTORS", data);
1798
+ }
1799
+
1721
1800
  /**
1722
1801
  * Voter sur un élément (commentaire ou news) : Permet de voter sur un commentaire ou une news en spécifiant un statut de vote
1723
1802
  * Constant : ADD_VOTE
@@ -1644,6 +1644,86 @@ export interface GetOrganizationsAdminData {
1644
1644
  }
1645
1645
 
1646
1646
 
1647
+ export interface GetUserEligiblePlacesData {
1648
+ /**
1649
+ * Nom ou terme recherché
1650
+ */
1651
+ name?: string;
1652
+ /**
1653
+ * Types d'entités à inclure dans la recherche
1654
+ */
1655
+ searchType: string[];
1656
+ /**
1657
+ * Index minimum pour la pagination
1658
+ */
1659
+ indexMin: number;
1660
+ /**
1661
+ * Index de fin global pour la pagination
1662
+ */
1663
+ indexMax?: number;
1664
+ /**
1665
+ * Nombre d'éléments à récupérer (limite de pagination)
1666
+ */
1667
+ indexStep: number;
1668
+ /**
1669
+ * Configuration des plages de résultats pour chaque type de recherche
1670
+ */
1671
+ ranges?: {
1672
+ /**
1673
+ * This interface was referenced by `undefined`'s JSON-Schema definition
1674
+ * via the `patternProperty` "^[^\s]+$".
1675
+ */
1676
+ [k: string]: {
1677
+ indexMin: number;
1678
+ indexMax: number;
1679
+ };
1680
+ };
1681
+ searchBy?: "ALL";
1682
+ /**
1683
+ * Type initial de la recherche, vide par défaut
1684
+ */
1685
+ initType?: string;
1686
+ /**
1687
+ * Indique si les types doivent être comptés dans les résultats
1688
+ */
1689
+ count?: boolean;
1690
+ /**
1691
+ * Liste des types à compter dans les résultats
1692
+ */
1693
+ countType?: string[];
1694
+ /**
1695
+ * true = désactive le filtrage automatique par sourceKey du contexte (cf. SearchNew.php). Configurable dynamiquement selon la config du finder du formulaire.
1696
+ */
1697
+ notSourceKey: boolean;
1698
+ /**
1699
+ * Filtres MongoDB arbitraires : tags, source.key, links.members.{id}, etc. Les valeurs peuvent être une string (match exact), un tableau (any-of), ou un objet ($exists/$in/$ne/etc).
1700
+ */
1701
+ filters: {
1702
+ [k: string]: unknown;
1703
+ };
1704
+ /**
1705
+ * Localité vide ou spécifique
1706
+ */
1707
+ locality?: string;
1708
+ /**
1709
+ * Indique si la recherche doit s'étendre au Fediverse
1710
+ */
1711
+ fediverse?: boolean;
1712
+ pathParams?: {
1713
+ /**
1714
+ * Type d'entité
1715
+ */
1716
+ type: "citoyens" | "organizations";
1717
+ /**
1718
+ * ID de l'utilisateur ou de l'entité
1719
+ */
1720
+ id: string;
1721
+ [k: string]: unknown;
1722
+ };
1723
+ [k: string]: unknown;
1724
+ }
1725
+
1726
+
1647
1727
  export interface GetMembersNoAdminData {
1648
1728
  /**
1649
1729
  * Nom ou terme recherché
@@ -3281,6 +3361,162 @@ export interface AddPoiData {
3281
3361
  streetAddress?: string;
3282
3362
  };
3283
3363
  scope?: "";
3364
+ /**
3365
+ * Catégorie du POI
3366
+ */
3367
+ categorie?: string;
3368
+ /**
3369
+ * Type d'équipement
3370
+ */
3371
+ equip_type_name?: string;
3372
+ /**
3373
+ * Nom de l'institution associée
3374
+ */
3375
+ inst_nom?: string;
3376
+ /**
3377
+ * Accessibilité handicapé
3378
+ */
3379
+ inst_acc_handi_bool?: boolean;
3380
+ /**
3381
+ * Transport
3382
+ */
3383
+ inst_trans_bool?: boolean;
3384
+ /**
3385
+ * Famille du type d'équipement
3386
+ */
3387
+ equip_type_famille?: string;
3388
+ /**
3389
+ * Date de création de l'institution
3390
+ */
3391
+ inst_date_creation?: string;
3392
+ /**
3393
+ * Date de l'enquête
3394
+ */
3395
+ inst_enqu_date?: string;
3396
+ /**
3397
+ * Date de mise à jour
3398
+ */
3399
+ equip_maj_date?: string;
3400
+ /**
3401
+ * Nature de l'équipement
3402
+ */
3403
+ equip_nature?: string;
3404
+ /**
3405
+ * Type de sol
3406
+ */
3407
+ equip_sol?: string;
3408
+ /**
3409
+ * Surface
3410
+ */
3411
+ equip_surf?: number;
3412
+ /**
3413
+ * Éclairage
3414
+ */
3415
+ equip_eclair?: boolean;
3416
+ /**
3417
+ * Nom de l'APS
3418
+ */
3419
+ aps_name?: string[];
3420
+ /**
3421
+ * Accessibilité libre
3422
+ */
3423
+ equip_acc_libre?: boolean;
3424
+ /**
3425
+ * Type d'accessibilité handicapé
3426
+ */
3427
+ inst_acc_handi_type?: string;
3428
+ /**
3429
+ * Type de transport
3430
+ */
3431
+ inst_trans_type?: string;
3432
+ /**
3433
+ * Participation
3434
+ */
3435
+ inst_part_bool?: boolean;
3436
+ /**
3437
+ * Type de participation
3438
+ */
3439
+ inst_part_type?: string[];
3440
+ /**
3441
+ * Nom du propriétaire de l'équipement
3442
+ */
3443
+ equip_prop_nom?: string;
3444
+ /**
3445
+ * Type du propriétaire de l'équipement
3446
+ */
3447
+ equip_prop_type?: string;
3448
+ /**
3449
+ * Type de gestion de l'équipement
3450
+ */
3451
+ equip_gest_type?: string;
3452
+ /**
3453
+ * Accessibilité pour personnes à mobilité réduite
3454
+ */
3455
+ equip_pmr_acc?: boolean;
3456
+ /**
3457
+ * Chemin pour personnes à mobilité réduite
3458
+ */
3459
+ equip_pmr_chem?: boolean;
3460
+ /**
3461
+ * Douche pour personnes à mobilité réduite
3462
+ */
3463
+ equip_pmr_douche?: boolean;
3464
+ /**
3465
+ * Sanitaire pour personnes à mobilité réduite
3466
+ */
3467
+ equip_pmr_sanit?: boolean;
3468
+ /**
3469
+ * Tribune pour personnes à mobilité réduite
3470
+ */
3471
+ equip_pmr_trib?: boolean;
3472
+ /**
3473
+ * Vestiaire pour personnes à mobilité réduite
3474
+ */
3475
+ equip_pmr_vest?: boolean;
3476
+ /**
3477
+ * Aire de repos pour personnes à mobilité réduite
3478
+ */
3479
+ equip_pshs_aire?: boolean;
3480
+ /**
3481
+ * Chemin pour personnes à mobilité réduite
3482
+ */
3483
+ equip_pshs_chem?: boolean;
3484
+ /**
3485
+ * Sanitaire pour personnes à mobilité réduite
3486
+ */
3487
+ equip_pshs_sanit?: boolean;
3488
+ /**
3489
+ * Tribune pour personnes à mobilité réduite
3490
+ */
3491
+ equip_pshs_trib?: boolean;
3492
+ /**
3493
+ * Vestiaire pour personnes à mobilité réduite
3494
+ */
3495
+ equip_pshs_vest?: boolean;
3496
+ /**
3497
+ * Signalisation pour personnes à mobilité réduite
3498
+ */
3499
+ equip_pshs_sign?: boolean;
3500
+ /**
3501
+ * Largeur de l'équipement
3502
+ */
3503
+ equip_larg?: number;
3504
+ /**
3505
+ * Longueur de l'équipement
3506
+ */
3507
+ equip_long?: number;
3508
+ /**
3509
+ * Douche
3510
+ */
3511
+ equip_douche?: boolean;
3512
+ /**
3513
+ * Type de localisation de l'équipement
3514
+ */
3515
+ equip_loc_type?: string[];
3516
+ /**
3517
+ * Utilisateur de l'équipement
3518
+ */
3519
+ equip_utilisateur?: string[];
3284
3520
  [k: string]: unknown;
3285
3521
  }
3286
3522
 
@@ -5460,6 +5696,14 @@ export interface GetCoformByIdData {
5460
5696
  * ID du formulaire parent à récupérer
5461
5697
  */
5462
5698
  parentFormId: string;
5699
+ /**
5700
+ * Optionnel : ID d'un élément (lieu) pour la vue collaborative par lieu. Avec elementType, l'access info pointe sur la réponse partagée du lieu plutôt que sur la réponse personnelle du user.
5701
+ */
5702
+ elementId?: string;
5703
+ /**
5704
+ * Type de l'élément (collection MongoDB). Requis si elementId fourni.
5705
+ */
5706
+ elementType?: "organizations" | "projects" | "events" | "poi" | "citoyens";
5463
5707
  [k: string]: unknown;
5464
5708
  }
5465
5709
 
@@ -5528,6 +5772,19 @@ export interface CoformGetAnswerFilesData {
5528
5772
  }
5529
5773
 
5530
5774
 
5775
+ export interface GetCoformCatalogsData {
5776
+ /**
5777
+ * ID du formulaire parent
5778
+ */
5779
+ formId: string;
5780
+ /**
5781
+ * Tableau JSON sérialisé des fieldKey des inputs commonTable concernés. Ex: ["abc123","def456"]
5782
+ */
5783
+ inputKeys: string;
5784
+ [k: string]: unknown;
5785
+ }
5786
+
5787
+
5531
5788
  export interface SaveCoformAnswerData {
5532
5789
  /**
5533
5790
  * ID du formulaire parent
@@ -5553,6 +5810,45 @@ export interface SaveCoformAnswerData {
5553
5810
  }
5554
5811
 
5555
5812
 
5813
+ export interface GetCoformAnswerHistoryData {
5814
+ /**
5815
+ * ID de la réponse dont on veut l'historique
5816
+ */
5817
+ answerId: string;
5818
+ [k: string]: unknown;
5819
+ }
5820
+
5821
+
5822
+ export interface GetCoformMultievalDataData {
5823
+ /**
5824
+ * ID de la réponse
5825
+ */
5826
+ answerId: string;
5827
+ /**
5828
+ * Optionnel : si fourni, ne retourne que la step spécifiée. Sinon, toutes les steps avec multi-eval.
5829
+ */
5830
+ stepKey?: string;
5831
+ [k: string]: unknown;
5832
+ }
5833
+
5834
+
5835
+ export interface GetCoformCommontableContributorsData {
5836
+ /**
5837
+ * ID du formulaire parent
5838
+ */
5839
+ formId: string;
5840
+ /**
5841
+ * Clé originale de l'input commonTable (sans préfixe yesOrNo)
5842
+ */
5843
+ inputKey: string;
5844
+ /**
5845
+ * Tableau JSON sérialisé des criteriaIds correspondant à la ligne agrégée (commonTable peut dédupliquer plusieurs criterias sous un même usage côté React). Ex: ["criteria1778265370227"]
5846
+ */
5847
+ criteriaIds: string;
5848
+ [k: string]: unknown;
5849
+ }
5850
+
5851
+
5556
5852
  export interface AddVoteData {
5557
5853
  /**
5558
5854
  * ID de l'élément (commentaire ou news) sur lequel voter
package/src/api/Form.ts CHANGED
@@ -4,7 +4,7 @@ import { ApiError } from "../error.js";
4
4
  import type { Answer } from "./Answer.js";
5
5
  import type { PaginatorPage, PaginatorState } from "./BaseEntity.js";
6
6
  import type { CoformAnswersSearchData } from "./EndpointApi.types.js";
7
- import type { FormItemNormalized } from "./serverDataType/Form.js";
7
+ import type { CoformCommonTableContributor, FormItemNormalized } from "./serverDataType/Form.js";
8
8
 
9
9
  export class Form extends BaseEntity<FormItemNormalized> {
10
10
  static override entityType = "forms";
@@ -157,4 +157,46 @@ export class Form extends BaseEntity<FormItemNormalized> {
157
157
  const entity = await this.entity("answers", payload);
158
158
  return entity as Answer;
159
159
  }
160
+
161
+ /**
162
+ * Récupère la liste des contributeurs d'une table commune (commonTable) de CE formulaire.
163
+ *
164
+ * Pour un input `commonTable` et une ligne du tableau (un ou plusieurs `criteriaIds`
165
+ * dédupés côté React via `groupKey`), retourne les contributions individuelles
166
+ * (auteur, solution, satisfaction, note).
167
+ *
168
+ * Constant : GET_COFORM_COMMONTABLE_CONTRIBUTORS
169
+ * (POST /survey/coform/getcommontablecontributors, auth bearer).
170
+ *
171
+ * @param params.inputKey - Clé originale de l'input commonTable (sans préfixe yesOrNo).
172
+ * @param params.criteriaIds - criteriaIds de la ligne agrégée : tableau `string[]`
173
+ * (sérialisé automatiquement) ou string JSON déjà sérialisée.
174
+ * @returns La liste des contributions (une entrée par contribution).
175
+ * @throws {ApiError} si le Form n'a pas d'id.
176
+ *
177
+ * @example
178
+ * const form = await org.form({ id: "6925e2b05dd63b02ca70d6d9" });
179
+ * const contributors = await form.getCommonTableContributors({
180
+ * inputKey: "usagesEtSolutions",
181
+ * criteriaIds: ["criteria1778265370227"],
182
+ * });
183
+ */
184
+ async getCommonTableContributors(
185
+ params: { inputKey: string; criteriaIds: string | string[] }
186
+ ): Promise<CoformCommonTableContributor[]> {
187
+ const formId = this.id;
188
+ if (!formId) throw new ApiError("Form sans id, impossible de récupérer les contributeurs.", 400);
189
+
190
+ const criteriaIds = Array.isArray(params.criteriaIds)
191
+ ? JSON.stringify(params.criteriaIds)
192
+ : params.criteriaIds;
193
+
194
+ const res = (await this.endpointApi.getCoformCommontableContributors({
195
+ formId,
196
+ inputKey: params.inputKey,
197
+ criteriaIds
198
+ })) as { data?: { contributors?: CoformCommonTableContributor[] } };
199
+
200
+ return res?.data?.contributors ?? [];
201
+ }
160
202
  }