@communecter/cocolight-api-client 1.0.181 → 1.0.182

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.181",
3
+ "version": "1.0.182",
4
4
  "description": "Client Axios simplifié pour l'API cocolight",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,5 +1,6 @@
1
1
  import { BaseEntity } from "./BaseEntity.js";
2
2
  import type { AnswerItemNormalized } from "./serverDataType/Answer.js";
3
+ import type { CommunInfo } from "./serverDataType/CommunInfo.js";
3
4
  import type { FormItemNormalized } from "./serverDataType/Form.js";
4
5
  type UploadInput = File | Blob | Buffer | import("stream").Readable;
5
6
  /**
@@ -243,6 +244,19 @@ export declare class Answer extends BaseEntity<AnswerItemNormalized> {
243
244
  */
244
245
  private _autoFormIdFromParent;
245
246
  form(): Promise<never>;
247
+ /**
248
+ * Fiche du **commun** rattaché à un outil : cette Answer EST la réponse AAP du commun
249
+ * (`communId = this.id`). `opts.formId` = **verrou de périmètre** (le serveur vérifie
250
+ * `answer.form === formId`, endpoint `auth: none`) : sans lui, la requête n'a pas de sens (le
251
+ * front ne l'émet pas). Fail-closed → **`null`** en HTTP 200 (jamais de 500) sur entrée invalide.
252
+ *
253
+ * @example
254
+ * const answer = await api.answer({ id: communId });
255
+ * const commun = await answer.getCommunInfo({ formId: communFormId }); // CommunInfo | null
256
+ */
257
+ getCommunInfo(opts?: {
258
+ formId?: string;
259
+ }): Promise<CommunInfo | null>;
246
260
  /**
247
261
  * Supprime cette Answer côté serveur via `DELETE_ELEMENT`
248
262
  * (`type=answers`, `id=this.id`).
@@ -2,6 +2,7 @@ import type { UpdateSettingsData, UpdateBlockDescriptionData, UpdateBlockInfoDat
2
2
  import type { CostumRuntimeContext } from "../costum/runtime.js";
3
3
  import type { TransformsMap } from "../types/entities.js";
4
4
  import type { CountryItem } from "./serverDataType/Country.js";
5
+ import type { ToolEnrichmentInput, ToolEnrichmentResult, CommunListItem } from "./serverDataType/ToolsCatalog.js";
5
6
  import type { ZoneItemNormalized, ZoneShapeItem, ZonirisShapeItem } from "./serverDataType/Zone.js";
6
7
  /**
7
8
  * Types pour les méthodes d'entité (organization, project, poi, event, badge, news)
@@ -2442,6 +2443,23 @@ export declare class BaseEntity<TServerData = any> {
2442
2443
  * @throws {Error}
2443
2444
  */
2444
2445
  costumEventRequestSubevents(data?: Partial<Omit<CostumEventRequestSubeventsData, "pathParams">>): Promise<unknown>;
2446
+ /**
2447
+ * Upsert de l'**enrichissement d'un outil** (`navigatorcriteria`, clé d'upsert = `name`).
2448
+ *
2449
+ * BEARER + gate admin serveur (`isInterfaceAdmin` → 401). Porté par `BaseEntity` (et **pas**
2450
+ * `Organization`) car le host du costum peut être un **projet** — `_withCostumContext` lit
2451
+ * `serverData.slug/id` du host. Deux subtilités byte-fidèles :
2452
+ * - `isOpenSource` booléen → stringifié `"true"/"false"` (forme historique, comparée `=== "true"`) ;
2453
+ * - **clé-absente ≠ chaîne-vide** : on n'émet QUE les clés présentes de `input` (une clé absente
2454
+ * laisse le champ inchangé serveur ; `""` l'efface) — ne jamais compléter les champs manquants.
2455
+ */
2456
+ saveToolEnrichment(input: ToolEnrichmentInput): Promise<ToolEnrichmentResult>;
2457
+ /**
2458
+ * Les `{id,title}` des **communs** rattachables (options du select), tri titre, cap 1000.
2459
+ * BEARER + gate admin, **même placement `BaseEntity`** que {@link saveToolEnrichment} (le host
2460
+ * costum peut être un projet). `formId` en argument positionnel. Retourne le tableau NU.
2461
+ */
2462
+ getCommunList(formId: string): Promise<CommunListItem[]>;
2445
2463
  /**
2446
2464
  * @param data
2447
2465
  * Paramètres de recherche (partiels — les valeurs manquantes sont complétées
@@ -1,5 +1,5 @@
1
1
  import type ApiClient from "../ApiClient.js";
2
- import type { DocumentListData, PersonRegisterData, AuthenticateUrlData, RefreshTokenUrlData, PasswordRecoveryData, PasswordResetData, ServerExchangeTokenData, ChangePasswordData, DeleteAccountData, UpdateSettingsData, UpdateBlockDescriptionData, UpdateBlockInfoData, UpdateBlockSocialData, UpdateBlockLocalityData, UpdateBlockSlugData, CheckData, ProfilImageData, ProfilBannerData, GetElementsAboutData, MulticonnectData, RelaunchInvitationData, GetNewsData, GetNewsByIdData, AddNewsData, AddImageNewsData, AddFileNewsData, DeleteNewsData, UpdateNewsData, ShareNewsData, GetCommentsData, AddCommentsData, DeleteCommentsData, UpdateCommentsData, SearchTagsData, ShowVoteData, GlobalAutocompleteData, CityAutocompleteData, CityAutocompleteByCountryData, SuggestionInputData, GetProjectsNoAdminData, GetProjectsAdminData, GetPoisNoAdminData, GetPoisAdminData, GlobalAutocompleteAdminCostumData, GetOrganizationsNoAdminData, GetOrganizationsAdminData, GetUserEligiblePlacesData, GetMembersNoAdminData, GetMembersAdminData, GetFriendsAdminData, GetSubscriptionsData, GetSubscriptionsAdminData, GetSubscribersData, GetSubscribersAdminData, GetContributorsNoAdminData, GetContributorsAdminData, GetBadgesData, GetBadgesFiltersData, ConnectData, CreateInvitationLinkData, ConnectByRefData, DisconnectData, GetElementsKeyData, GetFavorisData, DeleteFavorisData, AddFavorisData, AddOrganizationData, AddProjectData, AddPoiData, AddEventData, DeleteElementData, AddImageElementData, LinkValidateData, SearchMemberAutocompleteData, GetNotificationsData, GetNotificationsCountData, NotificationUpdateData, MarkNotificationAsReadData, ActivitypubSearchData, ActivitypubLinkData, ActivitypubGetCommunityData, GetBadgeData, AddBadgesData, AssignBadgesData, GetEventsData, SearchEventsCostumData, ShareEventsData, InviteMembersData, FollowData, GetCostumJsonData, GlobalAutocompleteCostumData, NavigatorGettlData, CostumEventRequestActorsData, CostumEventRequestSubeventsData, CostumEventRequestElementEventData, CostumEventRequestCategoriesData, CostumEventRequestDatesData, CostumEventRequestEventData, CostumEventRequestLinkTlToEventData, CostumEventRequestLoadContextTagData, GetGalleryData, GetAttendeesNoAdminData, GetAttendeesAdminData, CoformAnswersSearchData, CoformAnswersByIdData, GetCoformByIdData, CoformUploadAnswerFileData, DeleteCoformAnswerFileData, 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, PersonActivateData, ImportPreviewData, ExportElementsData, ImportElementsData, GeocodageData, ValidateGroupData, SetSourceData, ModerateData, NewsModerateData, CommentModerateData, UploadDocumentData, ZoneGetShapeData, ZoneGetZonirisData, CostumListValuesData, DirectoryProposalData, DirectoryProposalCountData, DirectoryProposalNewCounterData } from "./EndpointApi.types.js";
2
+ import type { DocumentListData, PersonRegisterData, AuthenticateUrlData, RefreshTokenUrlData, PasswordRecoveryData, PasswordResetData, ServerExchangeTokenData, ChangePasswordData, DeleteAccountData, UpdateSettingsData, UpdateBlockDescriptionData, UpdateBlockInfoData, UpdateBlockSocialData, UpdateBlockLocalityData, UpdateBlockSlugData, CheckData, ProfilImageData, ProfilBannerData, GetElementsAboutData, MulticonnectData, RelaunchInvitationData, GetNewsData, GetNewsByIdData, AddNewsData, AddImageNewsData, AddFileNewsData, DeleteNewsData, UpdateNewsData, ShareNewsData, GetCommentsData, AddCommentsData, DeleteCommentsData, UpdateCommentsData, SearchTagsData, ShowVoteData, GlobalAutocompleteData, CityAutocompleteData, CityAutocompleteByCountryData, SuggestionInputData, GetProjectsNoAdminData, GetProjectsAdminData, GetPoisNoAdminData, GetPoisAdminData, GlobalAutocompleteAdminCostumData, GetOrganizationsNoAdminData, GetOrganizationsAdminData, GetUserEligiblePlacesData, GetMembersNoAdminData, GetMembersAdminData, GetFriendsAdminData, GetSubscriptionsData, GetSubscriptionsAdminData, GetSubscribersData, GetSubscribersAdminData, GetContributorsNoAdminData, GetContributorsAdminData, GetBadgesData, GetBadgesFiltersData, ConnectData, CreateInvitationLinkData, ConnectByRefData, DisconnectData, GetElementsKeyData, GetFavorisData, DeleteFavorisData, AddFavorisData, AddOrganizationData, AddProjectData, AddPoiData, AddEventData, DeleteElementData, AddImageElementData, LinkValidateData, SearchMemberAutocompleteData, GetNotificationsData, GetNotificationsCountData, NotificationUpdateData, MarkNotificationAsReadData, ActivitypubSearchData, ActivitypubLinkData, ActivitypubGetCommunityData, GetBadgeData, AddBadgesData, AssignBadgesData, GetEventsData, SearchEventsCostumData, ShareEventsData, InviteMembersData, FollowData, GetCostumJsonData, GlobalAutocompleteCostumData, NavigatorGettlData, CostumEventRequestActorsData, CostumEventRequestSubeventsData, CostumEventRequestElementEventData, CostumEventRequestCategoriesData, CostumEventRequestDatesData, CostumEventRequestEventData, CostumEventRequestLinkTlToEventData, CostumEventRequestLoadContextTagData, GetGalleryData, GetAttendeesNoAdminData, GetAttendeesAdminData, CoformAnswersSearchData, CoformAnswersByIdData, GetCoformByIdData, CoformUploadAnswerFileData, DeleteCoformAnswerFileData, CoformGetAnswerFilesData, GetCoformCatalogsData, SaveCoformAnswerData, GetCoformAnswerHistoryData, GetCoformMultievalDataData, GetCoformCommontableContributorsData, AddVoteData, AddReportAbuseData, UpdatePathValueData, DeleteDocumentByContextData, DeleteDocumentByIdData, DemoteAdminData, CostumFilterCoformData, CostumFilterCoformByPathData, GetCountriesData, SearchZonesData, CoformAnswersByFormsData, CostumToolsCatalogData, CostumToolUsersData, CostumCommunInfoData, CostumSaveToolEnrichmentData, CostumCommunListData, GenerateAnswerFromFormData, FundingEnvelopeData, CoremuOperationData, CostumProjectActionRequestNewData, CostumProjectActionRequestSetStatusData, CostumProjectActionRequestSetDateData, CostumProjectActionRequestSetContributorsData, CostumProjectActionRequestCancelData, CostumProjectActionRequestArchiveData, LinkDiscourseAccountData, UnlinkDiscourseAccountData, DiscourseProfileData, DiscourseCheckEmailData, DiscourseDismissLinkData, LinkMediawikiAccountData, UnlinkMediawikiAccountData, GetMediawikiContributionsData, AddClassifiedData, PersonActivateData, ImportPreviewData, ExportElementsData, ImportElementsData, GeocodageData, ValidateGroupData, SetSourceData, ModerateData, NewsModerateData, CommentModerateData, UploadDocumentData, ZoneGetShapeData, ZoneGetZonirisData, CostumListValuesData, DirectoryProposalData, DirectoryProposalCountData, DirectoryProposalNewCounterData } from "./EndpointApi.types.js";
3
3
  /**
4
4
  * Classe EndpointApi générée automatiquement depuis endpoints-copie.json
5
5
  */
@@ -1268,6 +1268,53 @@ export declare class EndpointApi {
1268
1268
  * @throws {Error} - En cas d'erreur inattendue.
1269
1269
  */
1270
1270
  coformAnswersByForms(data: CoformAnswersByFormsData): Promise<any>;
1271
+ /**
1272
+ * Catalogue d'outils d'usage (liste paginee) : Liste paginee/recherchable/filtrable des outils agreges depuis les reponses coform.
1273
+ * Constant : COSTUM_TOOLS_CATALOG
1274
+ * @param data - Données envoyées à l'API
1275
+ * @returns Les données de réponse.
1276
+ * @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
1277
+ * @throws {Error} - En cas d'erreur inattendue.
1278
+ */
1279
+ costumToolsCatalog(data: CostumToolsCatalogData): Promise<any>;
1280
+ /**
1281
+ * Lieux utilisateurs d'un outil : Les lieux utilisateurs d'un outil (recherche par criteriaIds, jamais regex sur le nom).
1282
+ * Constant : COSTUM_TOOL_USERS
1283
+ * @param data - Données envoyées à l'API
1284
+ * @returns Les données de réponse.
1285
+ * @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
1286
+ * @throws {Error} - En cas d'erreur inattendue.
1287
+ */
1288
+ costumToolUsers(data: CostumToolUsersData): Promise<any>;
1289
+ /**
1290
+ * Fiche du commun rattache a un outil : Fiche du commun (reponse AAP) rattache a un outil. formId = verrou de perimetre (answer.form===formId).
1291
+ * Constant : COSTUM_COMMUN_INFO
1292
+ * @param data - Données envoyées à l'API
1293
+ * @returns Les données de réponse.
1294
+ * @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
1295
+ * @throws {Error} - En cas d'erreur inattendue.
1296
+ */
1297
+ costumCommunInfo(data: CostumCommunInfoData): Promise<any>;
1298
+ /**
1299
+ * Upsert de l'enrichissement d'un outil : Upsert d'un document navigatorcriteria par nom d'outil (cle absente=inchangee, chaine vide=effacee). Gate isInterfaceAdmin.
1300
+ * Constant : COSTUM_SAVE_TOOL_ENRICHMENT
1301
+ * @param data - Données envoyées à l'API
1302
+ * @returns Les données de réponse.
1303
+ * @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
1304
+ * @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
1305
+ * @throws {Error} - En cas d'erreur inattendue.
1306
+ */
1307
+ costumSaveToolEnrichment(data: CostumSaveToolEnrichmentData): Promise<any>;
1308
+ /**
1309
+ * Options du select de rattachement (communs) : {id,title} des communs pour le select de rattachement, tri titre, cap 1000. Gate isInterfaceAdmin.
1310
+ * Constant : COSTUM_COMMUN_LIST
1311
+ * @param data - Données envoyées à l'API
1312
+ * @returns Les données de réponse.
1313
+ * @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
1314
+ * @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
1315
+ * @throws {Error} - En cas d'erreur inattendue.
1316
+ */
1317
+ costumCommunList(data: CostumCommunListData): Promise<any>;
1271
1318
  /**
1272
1319
  * Generer une nouvelle reponse à partir d'un formulaire : Generer une nouvelle reponse à partir d'un formulaire
1273
1320
  * Constant : GENERATE_ANSWER_FROM_FORM
@@ -5929,6 +5929,177 @@ export interface CoformAnswersByFormsData {
5929
5929
  };
5930
5930
  [k: string]: unknown;
5931
5931
  }
5932
+ export interface CostumToolsCatalogData {
5933
+ /**
5934
+ * form des reponses (requis)
5935
+ */
5936
+ formId: string;
5937
+ /**
5938
+ * champ id du form dont les inputs sont les categories d'usage (requis)
5939
+ */
5940
+ step: string;
5941
+ /**
5942
+ * dot-path du lieu dans la reponse (requis, regex ^[a-zA-Z0-9_.]+$)
5943
+ */
5944
+ finderPath: string;
5945
+ /**
5946
+ * recherche, accent/casse-insensible serveur
5947
+ */
5948
+ name?: string;
5949
+ /**
5950
+ * {category?,usage?,isOpenSource?(boolean)}
5951
+ */
5952
+ filters?: {
5953
+ [k: string]: unknown;
5954
+ };
5955
+ /**
5956
+ * {champ:1|-1} ; defaut serveur {totalOccurrences:-1,title:1} ; whitelist totalOccurrences/title/usagesCount
5957
+ */
5958
+ sortBy?: {
5959
+ [k: string]: 1 | -1;
5960
+ };
5961
+ /**
5962
+ * skip, defaut 0
5963
+ */
5964
+ indexMin?: number;
5965
+ /**
5966
+ * limit, defaut 24, borne <=0||>200 => 24
5967
+ */
5968
+ indexStep?: number;
5969
+ /**
5970
+ * Slug du costum
5971
+ */
5972
+ costumSlug?: string;
5973
+ /**
5974
+ * ID du contexte costum (alias contextId)
5975
+ */
5976
+ costumId?: string;
5977
+ /**
5978
+ * Collection du host costum
5979
+ */
5980
+ costumType?: "projects" | "organizations";
5981
+ [k: string]: unknown;
5982
+ }
5983
+ export interface CostumToolUsersData {
5984
+ /**
5985
+ * (requis)
5986
+ */
5987
+ formId: string;
5988
+ /**
5989
+ * (requis)
5990
+ */
5991
+ step: string;
5992
+ /**
5993
+ * (requis)
5994
+ */
5995
+ finderPath: string;
5996
+ /**
5997
+ * JSON string[] serialise (requis)
5998
+ */
5999
+ criteriaIds: string;
6000
+ /**
6001
+ * JSON string[] serialise (optionnel)
6002
+ */
6003
+ inputKeys?: string;
6004
+ /**
6005
+ * Slug du costum
6006
+ */
6007
+ costumSlug?: string;
6008
+ /**
6009
+ * ID du contexte costum (alias contextId)
6010
+ */
6011
+ costumId?: string;
6012
+ /**
6013
+ * Collection du host costum
6014
+ */
6015
+ costumType?: "projects" | "organizations";
6016
+ [k: string]: unknown;
6017
+ }
6018
+ export interface CostumCommunInfoData {
6019
+ /**
6020
+ * _id de la reponse AAP du commun (requis)
6021
+ */
6022
+ communId: string;
6023
+ /**
6024
+ * form AAP des communs, verrou anti-IDOR (requis)
6025
+ */
6026
+ formId: string;
6027
+ /**
6028
+ * Slug du costum
6029
+ */
6030
+ costumSlug?: string;
6031
+ /**
6032
+ * ID du contexte costum (alias contextId)
6033
+ */
6034
+ costumId?: string;
6035
+ /**
6036
+ * Collection du host costum
6037
+ */
6038
+ costumType?: "projects" | "organizations";
6039
+ [k: string]: unknown;
6040
+ }
6041
+ export interface CostumSaveToolEnrichmentData {
6042
+ /**
6043
+ * nom EXACT de l'outil, cle d'upsert (requis)
6044
+ */
6045
+ name: string;
6046
+ /**
6047
+ * lien de l'outil
6048
+ */
6049
+ url?: string;
6050
+ /**
6051
+ * lien du commun, porte l'ancre #detail-un-commun.communId.<24hex>
6052
+ */
6053
+ urlTool?: string;
6054
+ /**
6055
+ * markdown
6056
+ */
6057
+ description?: string;
6058
+ /**
6059
+ * 'true'/'false' en STRING (forme historique) OU boolean cote SDK avant stringify
6060
+ */
6061
+ isOpenSource?: string;
6062
+ /**
6063
+ * docPath relatif de UPLOAD_DOCUMENT ou URL http(s)
6064
+ */
6065
+ imageTool?: string;
6066
+ /**
6067
+ * id du document uploade
6068
+ */
6069
+ imageToolId?: string;
6070
+ /**
6071
+ * Slug du costum
6072
+ */
6073
+ costumSlug?: string;
6074
+ /**
6075
+ * ID du contexte costum (alias contextId)
6076
+ */
6077
+ costumId?: string;
6078
+ /**
6079
+ * Collection du host costum
6080
+ */
6081
+ costumType?: "projects" | "organizations";
6082
+ [k: string]: unknown;
6083
+ }
6084
+ export interface CostumCommunListData {
6085
+ /**
6086
+ * form AAP des communs (requis)
6087
+ */
6088
+ formId: string;
6089
+ /**
6090
+ * Slug du costum
6091
+ */
6092
+ costumSlug?: string;
6093
+ /**
6094
+ * ID du contexte costum (alias contextId)
6095
+ */
6096
+ costumId?: string;
6097
+ /**
6098
+ * Collection du host costum
6099
+ */
6100
+ costumType?: "projects" | "organizations";
6101
+ [k: string]: unknown;
6102
+ }
5932
6103
  export interface GenerateAnswerFromFormData {
5933
6104
  action?: string;
5934
6105
  pathParams?: {
@@ -3,6 +3,7 @@ import type { Answer } from "./Answer.js";
3
3
  import type { PaginatorPage, PaginatorState } from "./BaseEntity.js";
4
4
  import type { CoformAnswersSearchData, DirectoryProposalCountData, DirectoryProposalData, DirectoryProposalNewCounterData } from "./EndpointApi.types.js";
5
5
  import type { CoformCommonTableContributor, FormItemNormalized } from "./serverDataType/Form.js";
6
+ import type { ToolsCatalogPage, ToolsCatalogParams, ToolUser, ToolUsersParams } from "./serverDataType/ToolsCatalog.js";
6
7
  /**
7
8
  * Une entrée de catalogue commonTable (une criteria agrégée cross-réponses).
8
9
  * `label`/`usage`/`usageKey`/`coeff`/`count` toujours présents (le backend
@@ -115,6 +116,27 @@ export declare class Form extends BaseEntity<FormItemNormalized> {
115
116
  getAnswers(data?: Partial<CoformAnswersSearchData>, options?: {
116
117
  restoredState?: PaginatorState;
117
118
  }): Promise<PaginatorPage<Answer>>;
119
+ /**
120
+ * Catalogue d'outils d'usage agrégé depuis les réponses coform de CE form (`formId = this.id`).
121
+ *
122
+ * Retourne la PAGE BRUTE `{ results, count:{total}, facets? }` — **pas** de moteur de pagination :
123
+ * les `ToolCatalogItem` sont des DTO plats (sans `collection`), que `_linkEntities` jetterait.
124
+ * Le scroll infini se pilote côté front via `count.total` et la longueur cumulée. `sortBy` absent
125
+ * ⇒ défaut serveur `{ totalOccurrences:-1, title:1 }`.
126
+ *
127
+ * @example
128
+ * const form = await api.form({ id: formId });
129
+ * const page = await form.toolsCatalog({ step, finderPath, indexMin: 0 });
130
+ * page.results; // ToolCatalogItem[]
131
+ * page.count.total; // nombre d'outils (arrêt du scroll)
132
+ */
133
+ toolsCatalog(params: ToolsCatalogParams): Promise<ToolsCatalogPage>;
134
+ /**
135
+ * Les lieux utilisateurs d'un outil (recherche par `criteriaIds`, jamais par regex sur le nom).
136
+ * Retourne le tableau NU (désenveloppe `{ results }`). Les tableaux `criteriaIds`/`inputKeys`
137
+ * sont sérialisés en JSON (le fil attend une string `string[]` sérialisée).
138
+ */
139
+ getToolUsers(params: ToolUsersParams): Promise<ToolUser[]>;
118
140
  /**
119
141
  * {@inheritDoc BaseEntity#answer}
120
142
  *
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Types de la **fiche du commun** rattaché à un outil (`Answer.getCommunInfo()`).
3
+ *
4
+ * Source de vérité : `modules/costum/controllers/actions/franceTierslieux/CommunInfoAction.php`.
5
+ * Endpoint `auth: none` verrouillé par `formId` (le serveur vérifie `answer.form === formId`) :
6
+ * sans lui, n'importe quel ObjectId lirait n'importe quelle réponse. Entrée invalide ⇒ `null` en
7
+ * HTTP 200 (fail-closed, jamais de 500).
8
+ */
9
+ /** Un poste financier — recalculé serveur, ne contient JAMAIS les `financer[]` (données nominatives). */
10
+ export interface CommunFundingPoste {
11
+ label: string;
12
+ target: number;
13
+ collected: number;
14
+ }
15
+ /**
16
+ * Fiche d'un commun. Le legacy émet **toujours les 8 clés** (défaut `""`/`[]`, cf.
17
+ * `cible-costum-francetierslieux-communinfo.md`) → tous les champs sont REQUIS (jamais `undefined`).
18
+ * Le front les lit sans garde (`commun.email`, `commun.tags.length`, `commun.description`).
19
+ */
20
+ export interface CommunInfo {
21
+ /** communId = l'`_id` (24hex) de l'answer du commun */
22
+ id: string;
23
+ title: string;
24
+ /** markdown ; `""` si vide */
25
+ description: string;
26
+ /** `""` si vide */
27
+ email: string;
28
+ /** URL du canal de discussion (safeUrl `^https?://`), `""` si vide/invalide */
29
+ channelUrl: string;
30
+ /** libellé « site web » (safeUrl), `""` si vide/invalide */
31
+ toolUrl: string;
32
+ /** tableau dédupliqué, `[]` si aucun */
33
+ tags: string[];
34
+ /** postes financiers recalculés serveur, `[]` si aucun */
35
+ postes: CommunFundingPoste[];
36
+ }
@@ -0,0 +1,130 @@
1
+ /**
2
+ * Types du **catalogue d'outils d'usage** (module `toolsCatalog` de site-json).
3
+ *
4
+ * Source de vérité : les actions legacy `FrancetierslieuxController` (module costum),
5
+ * `controllers/actions/franceTierslieux/{ToolsCatalogListAction,ToolUsersAction,navigator/SaveCriteriaAction}.php`.
6
+ * Un « outil » n'est PAS une entité : c'est une AGRÉGATION de réponses coform regroupées par nom
7
+ * normalisé + l'enrichissement éditorial (`navigatorcriteria`). Les DTO sont donc **plats** (aucun
8
+ * champ `collection`) : `BaseEntity._linkEntities` les jetterait — d'où le retour de page BRUT.
9
+ *
10
+ * ⚠ Optionalité **load-bearing** (le front les lit sans garde) : cf. doc `35-sdk-tools-catalog.md`
11
+ * et le rapport d'analyse. Ne pas relâcher un champ requis sans casser le `tsc` de site-json.
12
+ */
13
+ /** Un outil agrégé — une ligne de `ToolsCatalogPage.results`.
14
+ * ⚠ Byte-truth : `id/title/normalizedName/originalNames[]` + `category/categoriesList/usagesList` dérivent
15
+ * de CLÉS de tableau PHP → pour un nom d'outil/label NUMÉRIQUE (donnée dégénérée, ex. valeurs radio 0/1/2)
16
+ * le fil porte des NOMBRES. Le type reste `string` (les vrais outils ont des noms texte ; c'est le contrat
17
+ * attendu par site-json) ; la coercion est documentée dans la fiche `cible-…-toolscatalog.md`. */
18
+ export interface ToolCatalogItem {
19
+ /** nom normalisé (clé stable entre pages) */
20
+ id: string;
21
+ title: string;
22
+ normalizedName: string;
23
+ originalNames: string[];
24
+ /** `categoriesList[0]` ou `""` */
25
+ category: string;
26
+ categoriesList: string[];
27
+ usagesList: string[];
28
+ usagesCount: number;
29
+ totalOccurrences: number;
30
+ /** cascade d'image ; `""` si aucune (jamais `undefined`) */
31
+ image: string;
32
+ /** fusion d'AFFICHAGE `url ?: urlTool` (conserve l'ancre). NE PAS pré-remplir un éditeur avec. */
33
+ url?: string;
34
+ /** `navigatorcriteria.url` BRUT (ce que l'admin a saisi) — pour le prefill éditeur */
35
+ urlOwn?: string;
36
+ /** `navigatorcriteria.urlTool` BRUT (lien du commun, avec l'ancre `#detail-un-commun.communId.<24hex>`) */
37
+ urlTool?: string;
38
+ description?: string;
39
+ /** booléen (le fil legacy stocke `"true"/"false"` en string, reconverti serveur) */
40
+ isOpenSource: boolean;
41
+ /** 24hex minuscule extrait de l'ancre, ou `""` si aucun (jamais `undefined`) */
42
+ communId: string;
43
+ criteriaIds: string[];
44
+ inputKeys?: string[];
45
+ idAnswers: string[];
46
+ }
47
+ /** Facettes calculées sur le catalogue COMPLET (pas la page) — ne se vident pas au scroll. */
48
+ export interface ToolsCatalogFacets {
49
+ categories: string[];
50
+ usages: string[];
51
+ /** co-occurrence catégorie → usages */
52
+ usagesByCategory?: Record<string, string[]>;
53
+ }
54
+ /** Page BRUTE de `Form.toolsCatalog()` — pas de moteur de pagination (DTO plats). */
55
+ export interface ToolsCatalogPage {
56
+ results: ToolCatalogItem[];
57
+ /** `count.total` = nombre d'OUTILS (après filtres, avant page) — pilote l'arrêt du scroll infini */
58
+ count: {
59
+ total: number;
60
+ };
61
+ facets?: ToolsCatalogFacets;
62
+ }
63
+ /** Un lieu utilisateur d'un outil — une ligne du retour de `Form.getToolUsers()`.
64
+ * Le legacy émet TOUJOURS les 13 clés (défaut `""`/`0`), cf. fiche `cible-…-toolusers.md`. */
65
+ export interface ToolUser {
66
+ answerId: string;
67
+ criteriaId: string;
68
+ /** nom de l'outil de l'entrée (`entry.criteria`) */
69
+ criteria: string;
70
+ placeName: string;
71
+ /** id 24hex de l'entité-lieu, ou `""` */
72
+ placeId: string;
73
+ /** type de l'entité-lieu (`organizations|projects|events|poi|citoyens`), ou `""` */
74
+ placeType: string;
75
+ placeSlug?: string;
76
+ image?: string;
77
+ /** `love` | `happySmile` | `neutral` | `sad` | `cry` */
78
+ happiness?: string;
79
+ note: number;
80
+ /** commentaire libre de l'entrée, ou `""` */
81
+ comment: string;
82
+ category: string;
83
+ usage: string;
84
+ }
85
+ /** Entrée d'upsert de `BaseEntity.saveToolEnrichment()`. Sémantique **clé-absente ≠ chaîne-vide** :
86
+ * ne pas injecter de défaut / ne pas coercer `undefined → ""` (sinon `urlTool` efface un lien légitime). */
87
+ export interface ToolEnrichmentInput {
88
+ /** nom EXACT de l'outil — clé d'upsert */
89
+ name: string;
90
+ url?: string;
91
+ urlTool?: string;
92
+ description?: string;
93
+ /** booléen côté SDK ; la méthode stringifie en `"true"/"false"` (forme historique) à l'envoi */
94
+ isOpenSource?: boolean;
95
+ imageTool?: string;
96
+ imageToolId?: string;
97
+ }
98
+ /** Retour de `saveToolEnrichment()` — forme historique partagée avec les vues legacy `listTools`.
99
+ * `msg` est du FR en dur côté PHP : à conserver pour le diagnostic, jamais à afficher tel quel. */
100
+ export interface ToolEnrichmentResult {
101
+ results: boolean;
102
+ msg: string;
103
+ data?: unknown;
104
+ name?: string;
105
+ }
106
+ /** Option du select de rattachement — une ligne du retour de `BaseEntity.getCommunList()`. */
107
+ export interface CommunListItem {
108
+ id: string;
109
+ title: string;
110
+ }
111
+ /** Paramètres de `Form.toolsCatalog()` (le `formId` vient de `this.id`). */
112
+ export interface ToolsCatalogParams {
113
+ step: string;
114
+ finderPath: string;
115
+ name?: string;
116
+ /** `{ category?, usage?, isOpenSource? (boolean) }` */
117
+ filters?: Record<string, unknown>;
118
+ /** défaut serveur `{ totalOccurrences: -1, title: 1 }` si absent */
119
+ sortBy?: Record<string, 1 | -1>;
120
+ indexMin?: number;
121
+ indexStep?: number;
122
+ }
123
+ /** Paramètres de `Form.getToolUsers()` (le `formId` vient de `this.id`). */
124
+ export interface ToolUsersParams {
125
+ step: string;
126
+ finderPath: string;
127
+ /** tableau brut ou déjà sérialisé — la méthode le sérialise en JSON si tableau */
128
+ criteriaIds: string | string[];
129
+ inputKeys?: string | string[];
130
+ }
@@ -521,6 +521,9 @@ export interface CostumFieldMap {
521
521
  };
522
522
  };
523
523
  institutBleu: {
524
+ events: {
525
+ description?: string;
526
+ };
524
527
  organizations: {
525
528
  acronym?: string;
526
529
  categoryThematic?: ("Action de l'Etat en mer" | "Environnement & Recherche et Innovation" | "Industrie et maintenance navale" | "Pêche et produits de la mer" | "Tourisme bleu et activités nautiques" | "Transport maritime & infrastructures portuaires" | "Energies Marines Renouvelables" | "Appui & soutien et accompagnement")[];
@@ -539,6 +542,19 @@ export interface CostumFieldMap {
539
542
  similarLink?: Record<string, unknown>;
540
543
  siret?: number;
541
544
  };
545
+ poi: {
546
+ auteurs?: string[];
547
+ coteDocument?: number;
548
+ date?: string;
549
+ echelle?: "Locale" | "Nationale" | "Régionale" | "Européen" | "International" | "Autre";
550
+ financementSource?: string;
551
+ financementType?: "Appels à projets" | "Appel à Manifestation d'Intérêt" | "Marché public" | "Subventions" | "Autre";
552
+ langue?: "FR" | "EN";
553
+ organisme?: string[];
554
+ territoires?: ("collection" | "where" | "distinct")[];
555
+ thematique?: ("Droit" | "Géographie" | "Biologie" | "Sociologie" | "Information-Communication" | "Ingénierie (Dispositifs de Répulsion Électrique individuel)" | "Sciences de gestion" | "Médecine" | "Innovation" | "Economie")[];
556
+ typeDocument?: "Mémoire" | "Rapport d'étude" | "Rapport" | "Extrait d'ouvrage" | "Ouvrage" | "Article" | "Autres" | "Article scientifique" | "Note de synthèse" | "Feuille de route" | "Magazine" | "Plan d'action";
557
+ };
542
558
  };
543
559
  journalInsoumisChambery: {
544
560
  events: {