@communecter/cocolight-api-client 1.0.156 → 1.0.157
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/dist/2766.cocolight-api-client.browser.js +1 -1
- package/dist/2766.cocolight-api-client.cjs +1 -1
- package/dist/6012.cocolight-api-client.browser.js +1 -1
- package/dist/6012.cocolight-api-client.cjs +1 -1
- package/dist/cocolight-api-client.browser.js +1 -1
- package/dist/cocolight-api-client.cjs +1 -1
- package/dist/cocolight-api-client.vite.mjs.js +1 -1
- package/dist/cocolight-api-client.vite.mjs.js.map +1 -1
- package/package.json +1 -1
- package/types/api/Answer.d.ts +27 -9
- package/types/api/BaseEntity.d.ts +75 -0
- package/types/api/EndpointApi.d.ts +51 -3
- package/types/api/EndpointApi.types.d.ts +112 -1
- package/types/api/User.d.ts +20 -0
- package/types/costum/types.d.ts +0 -2
- package/types/endpoints.module.d.ts +3039 -1009
- package/types/index.d.ts +1 -0
- package/types/utils/adminImportExport.d.ts +29 -0
package/package.json
CHANGED
package/types/api/Answer.d.ts
CHANGED
|
@@ -277,13 +277,16 @@ export declare class Answer extends BaseEntity<AnswerItemNormalized> {
|
|
|
277
277
|
/**
|
|
278
278
|
* {@inheritDoc BaseEntity#deleteFile}
|
|
279
279
|
*
|
|
280
|
-
* Override
|
|
281
|
-
* `
|
|
282
|
-
* `
|
|
283
|
-
*
|
|
280
|
+
* Override Answer : appelle l'endpoint coform **answer-authorisé**
|
|
281
|
+
* `DELETE_COFORM_ANSWER_FILE` (`{formId, answerId, docId}`) plutôt que le
|
|
282
|
+
* `DELETE_DOCUMENT_BY_ID` générique (qui opère par docId nu, sans contexte
|
|
283
|
+
* d'autorisation). Le backend vérifie ainsi le droit d'éditer CETTE réponse
|
|
284
|
+
* (propriétaire OU `canAdminAnswer`) — même périmètre d'auth que l'upload,
|
|
285
|
+
* sans dépendre du `canEdit` générique du document.
|
|
284
286
|
*
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
+
* Après succès : **cleanup local** — retire le `docId` des structures uploader
|
|
288
|
+
* normalisées `{updateDate, files: {docId: docPath}}` dans `serverData.answers`
|
|
289
|
+
* et `_draftData.answers`. Le caller n'a pas besoin de refetch.
|
|
287
290
|
*
|
|
288
291
|
* @example
|
|
289
292
|
* const files = await answer.getFiles({ subKey: "sf.input", docType: "image" });
|
|
@@ -291,6 +294,20 @@ export declare class Answer extends BaseEntity<AnswerItemNormalized> {
|
|
|
291
294
|
* // answer.serverData.answers[sf][input].files[files[0].docId] === undefined
|
|
292
295
|
*/
|
|
293
296
|
deleteFile(docId: string): Promise<void>;
|
|
297
|
+
/**
|
|
298
|
+
* Supprime PLUSIEURS fichiers uploader en une seule opération, par batches
|
|
299
|
+
* parallèles (défaut 4 simultanés) — MIROIR exact du batching d'upload de
|
|
300
|
+
* `processUploads` (réutilise `_uploadInBatches`). Chaque suppression passe
|
|
301
|
+
* par `deleteFile` (endpoint answer-authorisé + cleanup local).
|
|
302
|
+
*
|
|
303
|
+
* Best-effort : une suppression échouée (ex. fichier déjà supprimé côté
|
|
304
|
+
* serveur) est loguée mais n'interrompt PAS les autres. Conçue pour la
|
|
305
|
+
* réconciliation au save (fichiers retirés du formulaire) : le caller fait
|
|
306
|
+
* **un seul appel** au lieu d'une boucle de requêtes.
|
|
307
|
+
*
|
|
308
|
+
* @param docIds - liste des docId à supprimer (vide → no-op).
|
|
309
|
+
*/
|
|
310
|
+
deleteFiles(docIds: readonly string[]): Promise<void>;
|
|
294
311
|
/**
|
|
295
312
|
* Walk `answers[subFormId][inputId]` et retire `docId` des structures
|
|
296
313
|
* `{updateDate, files: {docId: docPath}}` (format canonique uploader).
|
|
@@ -355,13 +372,14 @@ export declare class Answer extends BaseEntity<AnswerItemNormalized> {
|
|
|
355
372
|
* chaque step.
|
|
356
373
|
*
|
|
357
374
|
* Constant : `GET_COFORM_MULTIEVAL_DATA` (POST
|
|
358
|
-
* `/survey/coform/getmultievaldata`, auth
|
|
359
|
-
*
|
|
375
|
+
* `/survey/coform/getmultievaldata`, auth none — radar lisible déconnecté).
|
|
376
|
+
* Lecture publique du radar agrégé ; l'identité des contributeurs est
|
|
377
|
+
* renvoyée telle quelle (anonymisation pour visiteurs anonymes à ajouter
|
|
378
|
+
* si besoin).
|
|
360
379
|
*
|
|
361
380
|
* @param opts.stepKey - Optionnel : filtrer aux datasets d'une seule
|
|
362
381
|
* step. Sinon retourne toutes les steps.
|
|
363
382
|
* @throws {ApiError} 400 si Answer sans id.
|
|
364
|
-
* @throws {ApiAuthenticationError} si non connecté.
|
|
365
383
|
*
|
|
366
384
|
* @example
|
|
367
385
|
* const data = await answer.getMultiEvalData();
|
|
@@ -1731,6 +1731,81 @@ export declare class BaseEntity<TServerData = any> {
|
|
|
1731
1731
|
isAdmin?: "" | "admin";
|
|
1732
1732
|
roles?: string[];
|
|
1733
1733
|
}>): Promise<unknown>;
|
|
1734
|
+
/**
|
|
1735
|
+
* Contexte costum de CETTE entité (résolu de son `source.key`) — requis par l'import/export admin.
|
|
1736
|
+
* @throws {ApiError} si l'entité n'est pas rattachée à un costum.
|
|
1737
|
+
* @private
|
|
1738
|
+
*/
|
|
1739
|
+
private _requireCostumCtx;
|
|
1740
|
+
/**
|
|
1741
|
+
* PRÉVISUALISE un import (GEOCODAGE / Import::Geocodage) : géocode + valide chaque ligne SANS rien
|
|
1742
|
+
* insérer. À appeler AVANT `importElements` pour montrer à l'utilisateur les adresses résolues et les
|
|
1743
|
+
* erreurs/warnings, puis confirmer. `data` est JSON-encodé en interne ; la réponse (map par rowIndex)
|
|
1744
|
+
* est normalisée en tableau ordonné. (Le géocodage ne dépend pas du type d'élément.)
|
|
1745
|
+
*
|
|
1746
|
+
* @param rows - Lignes à prévisualiser (objets plats `{ name, address?, … }`).
|
|
1747
|
+
* @returns `{ rows: [{ rowIndex, success, data?, warnings?, msgErrorAddress? }] }`.
|
|
1748
|
+
*/
|
|
1749
|
+
previewImport(rows: Array<Record<string, unknown>>): Promise<{
|
|
1750
|
+
rows: Array<{
|
|
1751
|
+
rowIndex: string;
|
|
1752
|
+
success: boolean;
|
|
1753
|
+
data?: Record<string, unknown>;
|
|
1754
|
+
warnings?: string[];
|
|
1755
|
+
msgErrorAddress?: string;
|
|
1756
|
+
}>;
|
|
1757
|
+
}>;
|
|
1758
|
+
/**
|
|
1759
|
+
* Importe en masse des éléments SOUS le costum de cette entité (IMPORT_ELEMENTS / importData).
|
|
1760
|
+
* Méthode de haut niveau à PRÉFÉRER à `endpointApi.importElements`. `costumSlug/costumId/costumType`
|
|
1761
|
+
* sont dérivés du `_costumCtx` (source.key) — pas de paramètre costum à fournir. Les lignes sont
|
|
1762
|
+
* découpées en lots (`chunkSize`) pour la progression ; `data` est JSON-encodé en interne. Le backend
|
|
1763
|
+
* (re)vérifie + déduplique (update si le nom existe déjà) + insère + relie au costum.
|
|
1764
|
+
*
|
|
1765
|
+
* @param type - Collection cible (poi/organizations/projects/events/citoyens).
|
|
1766
|
+
* @param rows - Lignes à importer (objets plats `{ name, …champs }`).
|
|
1767
|
+
* @param opts.chunkSize - Taille de lot (def. 50). @param opts.onProgress - `(current,total)` par lot.
|
|
1768
|
+
* @returns `{ result, elements (par rowIndex), attributesWithTypes, progress, summary:{created,updated,errors} }`.
|
|
1769
|
+
*/
|
|
1770
|
+
importElements(type: "poi" | "organizations" | "projects" | "events" | "citoyens", rows: Array<Record<string, unknown>>, opts?: {
|
|
1771
|
+
chunkSize?: number;
|
|
1772
|
+
onProgress?: (current: number, total: number) => void;
|
|
1773
|
+
}): Promise<{
|
|
1774
|
+
result: boolean;
|
|
1775
|
+
elements: Record<string, unknown>;
|
|
1776
|
+
attributesWithTypes: Record<string, unknown>;
|
|
1777
|
+
progress: {
|
|
1778
|
+
current: number;
|
|
1779
|
+
total: number;
|
|
1780
|
+
};
|
|
1781
|
+
summary: {
|
|
1782
|
+
created: number;
|
|
1783
|
+
updated: number;
|
|
1784
|
+
errors: number;
|
|
1785
|
+
};
|
|
1786
|
+
}>;
|
|
1787
|
+
/** Agrège la réponse d'import en `{créés, mis à jour, erreurs}` pour l'UI. @private */
|
|
1788
|
+
private _summarizeImport;
|
|
1789
|
+
/**
|
|
1790
|
+
* Exporte les éléments du costum de cette entité (EXPORT_ELEMENTS / getCsvAdmin). Méthode haut niveau.
|
|
1791
|
+
* Scope automatiquement sur `source.key` = costum de l'entité (`_costumCtx.slug`). RÉSERVÉ aux
|
|
1792
|
+
* super-admins côté backend (gater l'UI via `me.isSuperAdmin()`). Renvoie `{ results, fields }` ;
|
|
1793
|
+
* utiliser le helper `toCsv(results, fields)` pour produire le CSV téléchargeable.
|
|
1794
|
+
*
|
|
1795
|
+
* @param params.searchType - Types/collections à exporter (+ name/filters/fields/labels/multicolumn optionnels).
|
|
1796
|
+
* @returns `{ results, fields }`.
|
|
1797
|
+
*/
|
|
1798
|
+
exportElements(params: {
|
|
1799
|
+
searchType: string[];
|
|
1800
|
+
name?: string;
|
|
1801
|
+
filters?: Record<string, unknown>;
|
|
1802
|
+
fields?: string[];
|
|
1803
|
+
labels?: Record<string, unknown>;
|
|
1804
|
+
multicolumn?: boolean;
|
|
1805
|
+
}): Promise<{
|
|
1806
|
+
results: unknown[];
|
|
1807
|
+
fields: unknown;
|
|
1808
|
+
}>;
|
|
1734
1809
|
/** UUID v4 compatible browser + Node (`crypto.randomUUID()` si dispo, sinon fallback). @private */
|
|
1735
1810
|
private _uuidV4;
|
|
1736
1811
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type ApiClient from "../ApiClient.js";
|
|
2
|
-
import type { DocumentListData, 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, 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, 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 } from "./EndpointApi.types.js";
|
|
2
|
+
import type { DocumentListData, 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, 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 } from "./EndpointApi.types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Classe EndpointApi générée automatiquement depuis endpoints-copie.json
|
|
5
5
|
*/
|
|
@@ -1046,6 +1046,16 @@ export declare class EndpointApi {
|
|
|
1046
1046
|
* @throws {Error} - En cas d'erreur inattendue.
|
|
1047
1047
|
*/
|
|
1048
1048
|
coformUploadAnswerFile(data: CoformUploadAnswerFileData): Promise<any>;
|
|
1049
|
+
/**
|
|
1050
|
+
* Supprimer un fichier d'une réponse CoForm : Supprime un document (image/fichier) attaché à une réponse CoForm, identifié par son docId, après contrôle d'accès answer-side (owner ou Coform::canAdminAnswer). Pendant suppression de COFORM_UPLOAD_ANSWER_FILE.
|
|
1051
|
+
* Constant : DELETE_COFORM_ANSWER_FILE
|
|
1052
|
+
* @param data - Données envoyées à l'API
|
|
1053
|
+
* @returns Les données de réponse.
|
|
1054
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1055
|
+
* @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
|
|
1056
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1057
|
+
*/
|
|
1058
|
+
deleteCoformAnswerFile(data: DeleteCoformAnswerFileData): Promise<any>;
|
|
1049
1059
|
/**
|
|
1050
1060
|
* Récupérer les fichiers d'une réponse CoForm : Récupère la liste des fichiers uploadés pour un input spécifique dans une réponse CoForm. Utilisé pour récupérer les fichiers de l'ancien système qui n'ont que 'updateDate' sans la clé 'files'.
|
|
1051
1061
|
* Constant : COFORM_GET_ANSWER_FILES
|
|
@@ -1086,12 +1096,11 @@ export declare class EndpointApi {
|
|
|
1086
1096
|
*/
|
|
1087
1097
|
getCoformAnswerHistory(data: GetCoformAnswerHistoryData): Promise<any>;
|
|
1088
1098
|
/**
|
|
1089
|
-
* 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}'.
|
|
1099
|
+
* 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}'. Lecture publique du radar agrégé (visible déconnecté) ; l'identité des contributeurs (userId/userName/userSlug) est renvoyée telle quelle — anonymisation pour visiteurs anonymes à ajouter si besoin.
|
|
1090
1100
|
* Constant : GET_COFORM_MULTIEVAL_DATA
|
|
1091
1101
|
* @param data - Données envoyées à l'API
|
|
1092
1102
|
* @returns Les données de réponse.
|
|
1093
1103
|
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1094
|
-
* @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
|
|
1095
1104
|
* @throws {Error} - En cas d'erreur inattendue.
|
|
1096
1105
|
*/
|
|
1097
1106
|
getCoformMultievalData(data: GetCoformMultievalDataData): Promise<any>;
|
|
@@ -1394,5 +1403,44 @@ export declare class EndpointApi {
|
|
|
1394
1403
|
* @throws {Error} - En cas d'erreur inattendue.
|
|
1395
1404
|
*/
|
|
1396
1405
|
personActivate(data: PersonActivateData): Promise<any>;
|
|
1406
|
+
/**
|
|
1407
|
+
* Prévisualiser un import (table de contrôle) : Construit la table d'affichage [name, address, warnings, msgError] d'une liste d'éléments déjà vérifiés (Import::createArrayList), pour prévisualiser un import avant insertion.
|
|
1408
|
+
* Constant : IMPORT_PREVIEW
|
|
1409
|
+
* @param data - Données envoyées à l'API
|
|
1410
|
+
* @returns Les données de réponse.
|
|
1411
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1412
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1413
|
+
*/
|
|
1414
|
+
importPreview(data: ImportPreviewData): Promise<any>;
|
|
1415
|
+
/**
|
|
1416
|
+
* Exporter des éléments (CSV admin) : Recherche admin et renvoie {results, fields} prêt pour un parser CSV (Csv::getCsvAdmin). Réservé aux super-admins (sinon {results:[],fields:[]}). Les events sont reshapés forme-carte (getSimpleEventById).
|
|
1417
|
+
* Constant : EXPORT_ELEMENTS
|
|
1418
|
+
* @param data - Données envoyées à l'API
|
|
1419
|
+
* @returns Les données de réponse.
|
|
1420
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1421
|
+
* @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
|
|
1422
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1423
|
+
*/
|
|
1424
|
+
exportElements(data: ExportElementsData): Promise<any>;
|
|
1425
|
+
/**
|
|
1426
|
+
* Importer des éléments en masse : Import en masse d'éléments (Import::importData) : typage microformat, déduplication par nom, save + lien au costum. `data` = JSON encodé d'un tableau de lignes.
|
|
1427
|
+
* Constant : IMPORT_ELEMENTS
|
|
1428
|
+
* @param data - Données envoyées à l'API
|
|
1429
|
+
* @returns Les données de réponse.
|
|
1430
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1431
|
+
* @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
|
|
1432
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1433
|
+
*/
|
|
1434
|
+
importElements(data: ImportElementsData): Promise<any>;
|
|
1435
|
+
/**
|
|
1436
|
+
* Géocoder/valider des lignes d'import (preview) : Géocode + valide chaque ligne SANS insérer (Import::Geocodage) : résout l'adresse par code postal (cities), renvoie success/data/msgErrorAddress par ligne. Étape de prévisualisation avant import. `data` = JSON encodé d'un tableau de lignes.
|
|
1437
|
+
* Constant : GEOCODAGE
|
|
1438
|
+
* @param data - Données envoyées à l'API
|
|
1439
|
+
* @returns Les données de réponse.
|
|
1440
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1441
|
+
* @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
|
|
1442
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1443
|
+
*/
|
|
1444
|
+
geocodage(data: GeocodageData): Promise<any>;
|
|
1397
1445
|
}
|
|
1398
1446
|
export default EndpointApi;
|
|
@@ -3428,7 +3428,7 @@ export interface LinkValidateData {
|
|
|
3428
3428
|
/**
|
|
3429
3429
|
* Type de validation
|
|
3430
3430
|
*/
|
|
3431
|
-
linkOption?: "isInviting" | "toBeValidated" | "isAdminPending";
|
|
3431
|
+
linkOption?: "isInviting" | "isAdminInviting" | "toBeValidated" | "isAdminPending";
|
|
3432
3432
|
[k: string]: unknown;
|
|
3433
3433
|
}
|
|
3434
3434
|
export interface SearchMemberAutocompleteData {
|
|
@@ -5119,6 +5119,21 @@ export interface CoformUploadAnswerFileData {
|
|
|
5119
5119
|
};
|
|
5120
5120
|
[k: string]: unknown;
|
|
5121
5121
|
}
|
|
5122
|
+
export interface DeleteCoformAnswerFileData {
|
|
5123
|
+
/**
|
|
5124
|
+
* ID du formulaire parent (contrôle d'accès).
|
|
5125
|
+
*/
|
|
5126
|
+
formId: string;
|
|
5127
|
+
/**
|
|
5128
|
+
* ID de la réponse propriétaire du fichier.
|
|
5129
|
+
*/
|
|
5130
|
+
answerId: string;
|
|
5131
|
+
/**
|
|
5132
|
+
* ID MongoDB du document à supprimer.
|
|
5133
|
+
*/
|
|
5134
|
+
docId: string;
|
|
5135
|
+
[k: string]: unknown;
|
|
5136
|
+
}
|
|
5122
5137
|
export interface CoformGetAnswerFilesData {
|
|
5123
5138
|
/**
|
|
5124
5139
|
* ID de la réponse CoForm
|
|
@@ -5964,3 +5979,99 @@ export interface PersonActivateData {
|
|
|
5964
5979
|
validationKey: string;
|
|
5965
5980
|
[k: string]: unknown;
|
|
5966
5981
|
}
|
|
5982
|
+
export interface ImportPreviewData {
|
|
5983
|
+
/**
|
|
5984
|
+
* Liste d'éléments vérifiés à prévisualiser.
|
|
5985
|
+
*/
|
|
5986
|
+
list: {
|
|
5987
|
+
name?: string;
|
|
5988
|
+
address?: {
|
|
5989
|
+
streetAddress?: string;
|
|
5990
|
+
postalCode?: string;
|
|
5991
|
+
addressLocality?: string;
|
|
5992
|
+
addressCountry?: string;
|
|
5993
|
+
[k: string]: unknown;
|
|
5994
|
+
};
|
|
5995
|
+
warnings?: string[];
|
|
5996
|
+
msgError?: string;
|
|
5997
|
+
[k: string]: unknown;
|
|
5998
|
+
}[];
|
|
5999
|
+
[k: string]: unknown;
|
|
6000
|
+
}
|
|
6001
|
+
export interface ExportElementsData {
|
|
6002
|
+
/**
|
|
6003
|
+
* Types/collections à exporter (events, organizations, projects, poi, citoyens, NGO…).
|
|
6004
|
+
*
|
|
6005
|
+
* @minItems 1
|
|
6006
|
+
*/
|
|
6007
|
+
searchType: [string, ...string[]];
|
|
6008
|
+
/**
|
|
6009
|
+
* Terme de recherche optionnel.
|
|
6010
|
+
*/
|
|
6011
|
+
name?: string;
|
|
6012
|
+
/**
|
|
6013
|
+
* Ordre/sélection des colonnes.
|
|
6014
|
+
*/
|
|
6015
|
+
fields?: string[];
|
|
6016
|
+
/**
|
|
6017
|
+
* Libellés de colonnes {indexFieldString: label}.
|
|
6018
|
+
*/
|
|
6019
|
+
labels?: {
|
|
6020
|
+
[k: string]: unknown;
|
|
6021
|
+
};
|
|
6022
|
+
/**
|
|
6023
|
+
* Si défini (≠ faux PHP), colonnes de 1er niveau seulement.
|
|
6024
|
+
*/
|
|
6025
|
+
multicolumn?: {
|
|
6026
|
+
[k: string]: unknown;
|
|
6027
|
+
};
|
|
6028
|
+
/**
|
|
6029
|
+
* Colonnes de contributeurs par rôle.
|
|
6030
|
+
*/
|
|
6031
|
+
roles?: string[];
|
|
6032
|
+
/**
|
|
6033
|
+
* Filtres de recherche.
|
|
6034
|
+
*/
|
|
6035
|
+
filters?: {
|
|
6036
|
+
[k: string]: unknown;
|
|
6037
|
+
};
|
|
6038
|
+
/**
|
|
6039
|
+
* Restreint l'export à ces source.key (scope costum). Posé automatiquement par BaseEntity.exportElements.
|
|
6040
|
+
*/
|
|
6041
|
+
sourceKey?: string[];
|
|
6042
|
+
[k: string]: unknown;
|
|
6043
|
+
}
|
|
6044
|
+
export interface ImportElementsData {
|
|
6045
|
+
/**
|
|
6046
|
+
* Tableau de lignes encodé en JSON (chaque ligne : {name, ...champs, rowIndex?}).
|
|
6047
|
+
*/
|
|
6048
|
+
data: string;
|
|
6049
|
+
/**
|
|
6050
|
+
* Collection cible.
|
|
6051
|
+
*/
|
|
6052
|
+
typeElement: "poi" | "organizations" | "projects" | "events" | "citoyens";
|
|
6053
|
+
/**
|
|
6054
|
+
* Id de l'élément costum parent (rattachement/lien).
|
|
6055
|
+
*/
|
|
6056
|
+
costumId?: string;
|
|
6057
|
+
/**
|
|
6058
|
+
* Type de l'élément costum parent.
|
|
6059
|
+
*/
|
|
6060
|
+
costumType?: string;
|
|
6061
|
+
/**
|
|
6062
|
+
* Slug costum -> source.key.
|
|
6063
|
+
*/
|
|
6064
|
+
costumSlug?: string;
|
|
6065
|
+
/**
|
|
6066
|
+
* Taille totale (progression).
|
|
6067
|
+
*/
|
|
6068
|
+
totalSize?: string;
|
|
6069
|
+
[k: string]: unknown;
|
|
6070
|
+
}
|
|
6071
|
+
export interface GeocodageData {
|
|
6072
|
+
/**
|
|
6073
|
+
* Tableau de lignes encodé en JSON ({name, address?, hotRowIndex?, latitude?, longitude?}).
|
|
6074
|
+
*/
|
|
6075
|
+
data: string;
|
|
6076
|
+
[k: string]: unknown;
|
|
6077
|
+
}
|
package/types/api/User.d.ts
CHANGED
|
@@ -59,6 +59,26 @@ export declare class User extends BaseEntity<UserItemNormalized> {
|
|
|
59
59
|
get isActingUser(): boolean;
|
|
60
60
|
/** @returns {"citoyens"} */
|
|
61
61
|
getEntityType(): "citoyens";
|
|
62
|
+
/**
|
|
63
|
+
* Rôles de l'utilisateur (depuis `serverData.roles`, présent sur `me` après authenticate/meInfo —
|
|
64
|
+
* `ME_PROJECTION` garde `roles` et exclut `pwd`/tokens). Vide si non chargé ou profil public.
|
|
65
|
+
*/
|
|
66
|
+
get roles(): Record<string, unknown>;
|
|
67
|
+
/**
|
|
68
|
+
* Super-admin global STRICT (`roles.superAdmin === true`) — équivalent legacy `Role::isUserSuperAdmin`,
|
|
69
|
+
* et c'est le gate RÉEL de l'export admin (`exportElements`). N'inclut PAS `adminPlatform`.
|
|
70
|
+
*/
|
|
71
|
+
isSuperAdmin(): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Admin de plateforme (`roles.adminPlatform === true`). NB : rôle hors-legacy (absent du PHP) mais
|
|
74
|
+
* HONORÉ par le backend comme super-admin (cf. isUserSuperAdmin/deleteElement) ; posé en base, pas par le code.
|
|
75
|
+
*/
|
|
76
|
+
isAdminPlatform(): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Accès admin plateforme large : `superAdmin || adminPlatform` (= `isUserSuperAdmin` backend général,
|
|
79
|
+
* celui de la suppression). Pour gater l'UI ; l'export reste sur `isSuperAdmin()` strict.
|
|
80
|
+
*/
|
|
81
|
+
canPlatformAdmin(): boolean;
|
|
62
82
|
/**
|
|
63
83
|
* Récupère le profil complet de l'utilisateur.
|
|
64
84
|
* Si l'utilisateur est connecté, on appelle le endpoint ME_INFO_URL,
|
package/types/costum/types.d.ts
CHANGED
|
@@ -216,7 +216,6 @@ export interface CostumFieldMap {
|
|
|
216
216
|
place?: string;
|
|
217
217
|
};
|
|
218
218
|
organizations: {
|
|
219
|
-
extraActivity?: string[];
|
|
220
219
|
formLocality?: string;
|
|
221
220
|
location?: string;
|
|
222
221
|
similarLink?: string;
|
|
@@ -497,7 +496,6 @@ export interface CostumFieldMap {
|
|
|
497
496
|
lakou: {
|
|
498
497
|
organizations: {
|
|
499
498
|
buildingSurfaceArea?: number;
|
|
500
|
-
extraActivity?: string[];
|
|
501
499
|
extraManageModel?: string;
|
|
502
500
|
extraTypePlace?: string;
|
|
503
501
|
formLocality?: string;
|