@communecter/cocolight-api-client 1.0.169 → 1.0.171
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/4402.cocolight-api-client.browser.js +1 -1
- package/dist/4402.cocolight-api-client.cjs +1 -1
- package/dist/601.cocolight-api-client.browser.js +1 -1
- package/dist/601.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/ApiClient.d.ts +7 -1
- package/types/api/BaseEntity.d.ts +52 -2
- package/types/api/EndpointApi.d.ts +19 -1
- package/types/api/EndpointApi.types.d.ts +122 -0
- package/types/api/serverDataType/Zone.d.ts +54 -0
- package/types/costum/runtime.d.ts +4 -0
- package/types/costum/types.d.ts +5 -6
- package/types/endpoints.module.d.ts +1298 -1
- package/types/index.d.ts +1 -0
package/package.json
CHANGED
package/types/ApiClient.d.ts
CHANGED
|
@@ -36,6 +36,12 @@ export interface ApiClientOptions {
|
|
|
36
36
|
*/
|
|
37
37
|
mode?: "legacy" | "clean";
|
|
38
38
|
tokenStorageStrategy?: TokenStorageStrategy | null;
|
|
39
|
+
/**
|
|
40
|
+
* Ignore les schémas costum BUNDLÉS et ne résout que par `getcostumjson` (cf. `setCostumForceLive`).
|
|
41
|
+
* À activer quand la config costum évolue en base plus vite que les artefacts publiés — sans quoi
|
|
42
|
+
* un artefact périmé masque indéfiniment les champs réels. Contrepartie : plus de démarrage à froid.
|
|
43
|
+
*/
|
|
44
|
+
costumForceLive?: boolean;
|
|
39
45
|
}
|
|
40
46
|
/**
|
|
41
47
|
* Structure des données pour les appels d'endpoint
|
|
@@ -96,7 +102,7 @@ export default class ApiClient extends EventEmitter {
|
|
|
96
102
|
private _refreshToken;
|
|
97
103
|
private _setUserId;
|
|
98
104
|
private _mode;
|
|
99
|
-
constructor({ baseURL, accessToken, refreshToken, refreshUrl, endpoints, timeout, debug, maxRetries, circuitBreakerThreshold, circuitBreakerResetTime, fromJSONValue, mode, tokenStorageStrategy }: ApiClientOptions);
|
|
105
|
+
constructor({ baseURL, accessToken, refreshToken, refreshUrl, endpoints, timeout, debug, maxRetries, circuitBreakerThreshold, circuitBreakerResetTime, fromJSONValue, mode, tokenStorageStrategy, costumForceLive }: ApiClientOptions);
|
|
100
106
|
/**
|
|
101
107
|
* Sets the access token for the API client and updates the authorization header.
|
|
102
108
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { UpdateSettingsData, UpdateBlockDescriptionData, UpdateBlockInfoData, UpdateBlockSocialData, UpdateBlockLocalityData, GetNewsData, GetGalleryData, GlobalAutocompleteCostumData, CostumEventRequestActorsData, CostumEventRequestSubeventsData, CostumEventRequestDatesData, CostumEventRequestElementEventData, CostumEventRequestCategoriesData, CostumEventRequestEventData, CostumEventRequestLinkTlToEventData, CostumEventRequestLoadContextTagData, GetOrganizationsAdminData, GetOrganizationsNoAdminData, GetProjectsAdminData, GetProjectsNoAdminData, GetPoisAdminData, GetPoisNoAdminData, GetSubscribersData, GetBadgesData, CoformAnswersSearchData, SearchMemberAutocompleteData, GetEventsData, SearchEventsCostumData, CostumFilterCoformData, CostumFilterCoformByPathData, GetCountriesData, SearchZonesData, CoformAnswersByFormsData, FundingEnvelopeData, CoremuOperationData, UpdatePathValueData } from "./EndpointApi.types.js";
|
|
1
|
+
import type { UpdateSettingsData, UpdateBlockDescriptionData, UpdateBlockInfoData, UpdateBlockSocialData, UpdateBlockLocalityData, GetNewsData, GetGalleryData, GlobalAutocompleteCostumData, CostumEventRequestActorsData, CostumEventRequestSubeventsData, CostumEventRequestDatesData, CostumEventRequestElementEventData, CostumEventRequestCategoriesData, CostumEventRequestEventData, CostumEventRequestLinkTlToEventData, CostumEventRequestLoadContextTagData, GetOrganizationsAdminData, GetOrganizationsNoAdminData, GetProjectsAdminData, GetProjectsNoAdminData, GetPoisAdminData, GetPoisNoAdminData, GetSubscribersData, GetBadgesData, CoformAnswersSearchData, SearchMemberAutocompleteData, GetEventsData, SearchEventsCostumData, CostumFilterCoformData, CostumFilterCoformByPathData, GetCountriesData, SearchZonesData, ZoneGetShapeData, ZoneGetZonirisData, CoformAnswersByFormsData, FundingEnvelopeData, CoremuOperationData, UpdatePathValueData } from "./EndpointApi.types.js";
|
|
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 { ZoneItemNormalized } from "./serverDataType/Zone.js";
|
|
5
|
+
import type { ZoneItemNormalized, ZoneShapeItem, ZonirisShapeItem } from "./serverDataType/Zone.js";
|
|
6
6
|
/**
|
|
7
7
|
* Types pour les méthodes d'entité (organization, project, poi, event, badge, news)
|
|
8
8
|
* Permettent soit de récupérer une entité existante (GET), soit de créer une nouvelle instance (CREATE)
|
|
@@ -2577,6 +2577,56 @@ export declare class BaseEntity<TServerData = any> {
|
|
|
2577
2577
|
* @throws {ApiError} Si `countryCode` ou `level` sont absents
|
|
2578
2578
|
*/
|
|
2579
2579
|
searchZone(data: SearchZonesData): Promise<ZoneItemNormalized[]>;
|
|
2580
|
+
/**
|
|
2581
|
+
* Récupère les **contours géographiques** (`geoShape`) des zones ou des communes.
|
|
2582
|
+
*
|
|
2583
|
+
* Complémentaire de {@link searchZone} : `searchZone` (`/co2/search/getzone`) projette
|
|
2584
|
+
* `geoShape` DEHORS, cet endpoint-ci est le seul, avec {@link getZoniris}, à le renvoyer.
|
|
2585
|
+
*
|
|
2586
|
+
* Trois branches côté serveur, pilotées par `level` :
|
|
2587
|
+
* - `level` **numérique** (`"1"`…`"6"`) → collection `zones`, filtre `{countryCode, level}` ;
|
|
2588
|
+
* - `level: "QPV"` → collection `zones`, filtre `{type:"QPV"}` (le `countryCode` est ignoré) ;
|
|
2589
|
+
* - `level: "cities"` → collection `cities`, via le tableau `cities` de l'EPCI si
|
|
2590
|
+
* `parentLevel: "5"`, sinon `{country, level4?}`.
|
|
2591
|
+
*
|
|
2592
|
+
* ⚠️ **Volumétrie** : sans `parentId`/`parentLevel`, `countryCode:"FR", level:"cities"` renvoie
|
|
2593
|
+
* ~65 Mo et `level:"QPV"` ~9,4 Mo. Toujours borner par un parent.
|
|
2594
|
+
*
|
|
2595
|
+
* ⚠️ `parentId` n'est pris en compte que si `parentLevel` est fourni **et non vide au sens de
|
|
2596
|
+
* PHP** : `parentLevel: "0"` désactive le filtre parent.
|
|
2597
|
+
*
|
|
2598
|
+
* @param data - Filtres. `countryCode` et `level` sont obligatoires.
|
|
2599
|
+
* @returns Les documents complets, aplatis en tableau (`{ id, …doc }`) par le normaliseur du
|
|
2600
|
+
* client ; `[]` si aucun résultat ; `null` si `level` ne résout aucune branche.
|
|
2601
|
+
* @throws {ApiError} Si `countryCode` ou `level` sont absents.
|
|
2602
|
+
*
|
|
2603
|
+
* @example
|
|
2604
|
+
* const epcis = await organization.getZoneShape({ countryCode: "RE", level: "5" });
|
|
2605
|
+
* epcis?.[0].geoShape; // { type: "Polygon", coordinates: [...] }
|
|
2606
|
+
*/
|
|
2607
|
+
getZoneShape(data: ZoneGetShapeData): Promise<ZoneShapeItem[] | null>;
|
|
2608
|
+
/**
|
|
2609
|
+
* Récupère les **contours géographiques thématiques** de la collection `zoniris`
|
|
2610
|
+
* (IRIS, grands quartiers, bassins de vie), `geoShape` inclus.
|
|
2611
|
+
*
|
|
2612
|
+
* Le serveur exige **au moins un filtre identifiant** parmi `cityId`, `insee`, `countryCode`,
|
|
2613
|
+
* `spec`, `shapeType`, `name` — la collection compte plus de 49 000 documents et n'est jamais
|
|
2614
|
+
* renvoyée en entier. `level` **ne compte pas** comme filtre identifiant : il ne fait
|
|
2615
|
+
* qu'affiner (`level:"6"` seul sélectionnerait les 49 400 IRIS). La précondition est vérifiée
|
|
2616
|
+
* ici, avant l'appel réseau ; côté serveur elle se traduirait par `{result:false}`, donc par
|
|
2617
|
+
* une `ApiResponseError("missing parameters")`.
|
|
2618
|
+
*
|
|
2619
|
+
* `name` est une recherche insensible à la casse **et aux accents** (regex non ancrée).
|
|
2620
|
+
*
|
|
2621
|
+
* @param data - Filtres (au moins un identifiant).
|
|
2622
|
+
* @returns Les documents complets, aplatis en tableau (`{ id, …doc }`) ; `[]` si aucun résultat.
|
|
2623
|
+
* @throws {ApiError} Si aucun filtre identifiant n'est fourni.
|
|
2624
|
+
*
|
|
2625
|
+
* @example
|
|
2626
|
+
* const bassins = await organization.getZoniris({ cityId: "54c0965cf6b95c141800a518" });
|
|
2627
|
+
* bassins.length; // 7 bassins de vie de Saint-Paul (La Réunion)
|
|
2628
|
+
*/
|
|
2629
|
+
getZoniris(data?: ZoneGetZonirisData): Promise<ZonirisShapeItem[]>;
|
|
2580
2630
|
/**
|
|
2581
2631
|
* Récupère la liste de tous les pays (endpoint public, sans authentification).
|
|
2582
2632
|
*
|
|
@@ -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, GlobalAutocompleteAdminCostumData, 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, ValidateGroupData, SetSourceData, ModerateData, NewsModerateData, CommentModerateData, UploadDocumentData } 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, GlobalAutocompleteAdminCostumData, 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, ValidateGroupData, SetSourceData, ModerateData, NewsModerateData, CommentModerateData, UploadDocumentData, ZoneGetShapeData, ZoneGetZonirisData } from "./EndpointApi.types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Classe EndpointApi générée automatiquement depuis endpoints-copie.json
|
|
5
5
|
*/
|
|
@@ -1512,5 +1512,23 @@ export declare class EndpointApi {
|
|
|
1512
1512
|
* @throws {Error} - En cas d'erreur inattendue.
|
|
1513
1513
|
*/
|
|
1514
1514
|
uploadDocument(data: UploadDocumentData): Promise<any>;
|
|
1515
|
+
/**
|
|
1516
|
+
* Recuperer les contours geographiques (geoShape) des zones ou des communes : Recupere les documents COMPLETS (geoShape inclus) de la collection `zones` ou `cities` selon `level`. Trois branches (modules/citizenToolKit/controllers/zone/GetZoneShapeAction.php:11-59, mappee sur 'getshape' dans modules/co2/controllers/ZoneController.php:44) : (1) `level` numerique -> zones {countryCode, level} ; (2) `level="QPV"` -> zones {type:'QPV'} (le filtre countryCode est ECRASE) ; (3) `level="cities"` -> cities, via le tableau `cities` de l'EPCI si `parentLevel=5`, sinon {country, level4?}. Endpoint PUBLIC (aucune auth). Reponses potentiellement TRES volumineuses : `countryCode=FR&level=cities` sans parent renvoie ~65 Mo. Toujours borner avec `parentId`/`parentLevel`.
|
|
1517
|
+
* Constant : ZONE_GET_SHAPE
|
|
1518
|
+
* @param data - Données envoyées à l'API
|
|
1519
|
+
* @returns Les données de réponse.
|
|
1520
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1521
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1522
|
+
*/
|
|
1523
|
+
zoneGetShape(data: ZoneGetShapeData): Promise<any>;
|
|
1524
|
+
/**
|
|
1525
|
+
* Recuperer les contours geographiques thematiques (zoniris) : Lecture FILTREE de la collection `zoniris` (IRIS, grands quartiers, bassins de vie) : documents COMPLETS, `geoShape` inclus, sous forme de map keyee par _id. modules/citizenToolKit/controllers/zone/GetZonirisAction.php, mappee sur 'getzoniris' dans modules/co2/controllers/ZoneController.php. Endpoint PUBLIC (aucune auth). AU MOINS UN filtre IDENTIFIANT est requis cote serveur (cityId, insee, countryCode, spec, shapeType ou name) : la collection compte plus de 49 000 documents (~21 Mo) et n'est jamais renvoyee en entier. `level` NE COMPTE PAS comme filtre identifiant, il ne fait qu'affiner (level='6' seul selectionnerait les 49 400 IRIS). Sans filtre identifiant : {result:false, msg:'missing parameters'}.
|
|
1526
|
+
* Constant : ZONE_GET_ZONIRIS
|
|
1527
|
+
* @param data - Données envoyées à l'API
|
|
1528
|
+
* @returns Les données de réponse.
|
|
1529
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1530
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1531
|
+
*/
|
|
1532
|
+
zoneGetZoniris(data: ZoneGetZonirisData): Promise<any>;
|
|
1515
1533
|
}
|
|
1516
1534
|
export default EndpointApi;
|
|
@@ -3113,6 +3113,12 @@ export interface AddProjectData {
|
|
|
3113
3113
|
* Site web
|
|
3114
3114
|
*/
|
|
3115
3115
|
url?: string | "";
|
|
3116
|
+
/**
|
|
3117
|
+
* Réseaux sociaux — objet keyé par plateforme (facebook/twitter/instagram/mastodon/telegram/…). dataBinding projet legacy `socialNetwork` (Project.php). La clé OBJET ENTIER manquait à Project là où Organization la déclare (Organization.php:82) : un client qui l'envoyait la voyait retirée à l'extraction, donc perdue en silence. Les réseaux un par un (`facebook`…) restent portés par UPDATE_BLOCK_SOCIAL.
|
|
3118
|
+
*/
|
|
3119
|
+
socialNetwork?: {
|
|
3120
|
+
[k: string]: string;
|
|
3121
|
+
};
|
|
3116
3122
|
preferences?: {
|
|
3117
3123
|
/**
|
|
3118
3124
|
* Open data (true/false)
|
|
@@ -6450,3 +6456,119 @@ export interface UploadDocumentData {
|
|
|
6450
6456
|
};
|
|
6451
6457
|
[k: string]: unknown;
|
|
6452
6458
|
}
|
|
6459
|
+
/**
|
|
6460
|
+
* Filtres lus dans $_POST par GetZoneShapeAction. Schema FERME (`additionalProperties:false`) : le legacy injecte les valeurs telles quelles dans le filtre Mongo, un `parentId[$ne]=` y passe donc un operateur NoSQL (exploit verifie live). Typer tous les filtres en `string` interdit structurellement au client d'emettre cette forme.
|
|
6461
|
+
*/
|
|
6462
|
+
export interface ZoneGetShapeData {
|
|
6463
|
+
/**
|
|
6464
|
+
* Code pays ISO (ex 'FR', 'RE'). Filtre `zones.countryCode` sur les branches numeriques, `cities.country` sur la branche `cities` (les deux collections ne nomment PAS le pays pareil, GetZoneShapeAction.php:15 vs :39). IGNORE sur la branche QPV, ou le filtre est ecrase par {type:'QPV'} (:19-21).
|
|
6465
|
+
*/
|
|
6466
|
+
countryCode: string;
|
|
6467
|
+
/**
|
|
6468
|
+
* SCALAIRE (contrairement a SEARCH_ZONES ou c'est un tableau). Trois formes : (a) niveau administratif numerique '1'..'6' -> collection `zones` ; (b) 'QPV' -> zones {type:'QPV'} ; (c) 'cities' -> collection `cities`. Toute autre valeur ne resout aucune branche : le legacy renvoie alors le corps litteral `null` (HTTP 200). Le test PHP est `is_numeric()`, plus large que /^[0-9]+$/ (' 4' passe, '4 ' non).
|
|
6469
|
+
*/
|
|
6470
|
+
level: string;
|
|
6471
|
+
/**
|
|
6472
|
+
* ID (24 hex) du parent servant a borner la requete. N'est pris en compte QUE si `parentLevel` est fourni ET non vide au sens de PHP — attention, `parentLevel="0"` est vide pour `!empty()`, le filtre parent est alors DESACTIVE. Selon la branche : {level<parentLevel>: parentId} sur les zones (nom de champ construit dynamiquement, :27), {level5: parentId} sur les QPV (nom EN DUR, :23 — et level5 pointe alors une COMMUNE), _id de l'EPCI sur la branche cities+parentLevel=5 (:32), {level4: parentId} sinon (:52).
|
|
6473
|
+
*/
|
|
6474
|
+
parentId?: string;
|
|
6475
|
+
/**
|
|
6476
|
+
* Niveau du parent ('1'..'5', ou 'cities'). Sert (a) de garde pour activer `parentId`, (b) de SUFFIXE du nom de champ Mongo sur la branche zones ('level'.parentLevel) : `parentLevel=cities` donne le champ `levelcities`, qui ne matche rien. La valeur '5' (comparaison PHP lache, donc '5.0' aussi) declenche le passage par le tableau `cities` de l'EPCI. ⚠️ Sur la branche `cities`, `parentId` ET `parentLevel` sont OBLIGATOIRES : sans eux la requete n'est pas bornee (36 798 communes avec leurs contours pour la France) et l'action renvoie `[]` sans rien lire — cf. BUG-L-213.
|
|
6477
|
+
*/
|
|
6478
|
+
parentLevel?: string;
|
|
6479
|
+
/**
|
|
6480
|
+
* VERSION LEGERE, optionnelle. Toute valeur non vide (au sens de PHP : ni '', ni '0') active une projection sur les seuls champs utiles a une carte — `_id`, `name`, `geoShape`, `level`, `type`, `insee`, `geo`, `geoPosition`. Le DEFAUT reste le document ENTIER, byte-identique au legacy. Gains mesures : QPV 9,4 Mo -> 425 Ko (96 %), communes d'un departement 834 Ko -> 349 Ko (59 %). ATTENTION, le gain depend de OU est le gras : sur les EPCI il n'est que de 4 %, parce que le contour EST la charge utile — `light` retire les metadonnees, pas la geometrie.
|
|
6481
|
+
*/
|
|
6482
|
+
light?: string;
|
|
6483
|
+
/**
|
|
6484
|
+
* Slug du costum courant. Injecte automatiquement par `BaseEntity._withCostumContext`. Ignore par les deux actions legacy (elles ne lisent que leurs propres filtres) mais transmis pour homogeneite avec le reste du contrat.
|
|
6485
|
+
*/
|
|
6486
|
+
costumSlug?: string;
|
|
6487
|
+
/**
|
|
6488
|
+
* ID du costum courant (ObjectId 24 hex). Alias historique de `contextId`. Injecte par `_withCostumContext`.
|
|
6489
|
+
*/
|
|
6490
|
+
costumId?: string;
|
|
6491
|
+
/**
|
|
6492
|
+
* Collection portant le costum. Alias historique de `contextType`. Injecte par `_withCostumContext`.
|
|
6493
|
+
*/
|
|
6494
|
+
costumType?: "citoyens" | "organizations" | "projects" | "events" | "poi" | "badges" | "news" | "comments" | "answers" | "forms" | "classifieds" | "actions";
|
|
6495
|
+
/**
|
|
6496
|
+
* Mode edition du costum (boolean, string ou number).
|
|
6497
|
+
*/
|
|
6498
|
+
costumEditMode?: ("true" | "false") | (0 | 1) | boolean;
|
|
6499
|
+
/**
|
|
6500
|
+
* ID de l'entite portant le contexte costum (ObjectId 24 hex). Injecte par `_withCostumContext`.
|
|
6501
|
+
*/
|
|
6502
|
+
contextId?: string;
|
|
6503
|
+
/**
|
|
6504
|
+
* Collection de l'entite portant le contexte costum. Injecte par `_withCostumContext`.
|
|
6505
|
+
*/
|
|
6506
|
+
contextType?: "citoyens" | "organizations" | "projects" | "events" | "poi" | "badges" | "news" | "comments" | "answers" | "forms" | "classifieds" | "actions";
|
|
6507
|
+
/**
|
|
6508
|
+
* Cles de source du costum. Injecte par `_withCostumContext` (defaut : [slug du costum courant]). Sans effet sur ces deux actions.
|
|
6509
|
+
*/
|
|
6510
|
+
sourceKey?: string[];
|
|
6511
|
+
[k: string]: unknown;
|
|
6512
|
+
}
|
|
6513
|
+
/**
|
|
6514
|
+
* Filtres lus dans $_POST par GetZonirisAction (methode `postString` :34-38 : les tableaux sont rejetes cote serveur, les chaines vides ignorees). Schema FERME (`additionalProperties:false`) et tous les filtres typables en `string` : la lib ne peut donc pas emettre de notation a crochets. AUCUN champ n'est `required` au sens JSON Schema, mais au moins un filtre identifiant est exige par le serveur (voir description de l'endpoint) — la facade `BaseEntity.getZoniris` verifie cette precondition avant l'appel.
|
|
6515
|
+
*/
|
|
6516
|
+
export interface ZoneGetZonirisData {
|
|
6517
|
+
/**
|
|
6518
|
+
* FILTRE IDENTIFIANT. _id (24 hex, en STRING) de la commune de rattachement, tel que stocke dans `zoniris.cityId`. Ex '54c0965cf6b95c141800a518' (Saint-Paul, La Reunion) -> 7 bassins de vie.
|
|
6519
|
+
*/
|
|
6520
|
+
cityId?: string;
|
|
6521
|
+
/**
|
|
6522
|
+
* FILTRE IDENTIFIANT. Code INSEE de la commune (ex '97415'). Egalite stricte sur la chaine.
|
|
6523
|
+
*/
|
|
6524
|
+
insee?: string;
|
|
6525
|
+
/**
|
|
6526
|
+
* FILTRE IDENTIFIANT. Code pays ISO (ex 'RE', 'FR'). Attention : la majorite des documents `zoniris` (les IRIS de niveau 6) n'ont PAS de countryCode et sont donc invisibles a ce filtre.
|
|
6527
|
+
*/
|
|
6528
|
+
countryCode?: string;
|
|
6529
|
+
/**
|
|
6530
|
+
* FILTRE IDENTIFIANT. Identifiant du lot d'import (ex 'bassins_vie_saintpaul').
|
|
6531
|
+
*/
|
|
6532
|
+
spec?: string;
|
|
6533
|
+
/**
|
|
6534
|
+
* FILTRE IDENTIFIANT. Type de forme (ex 'BassinVie').
|
|
6535
|
+
*/
|
|
6536
|
+
shapeType?: string;
|
|
6537
|
+
/**
|
|
6538
|
+
* FILTRE IDENTIFIANT. Recherche INSENSIBLE A LA CASSE ET AUX ACCENTS sur le nom : le serveur construit une MongoRegex via SearchNew::accentToRegex (avec preg_quote), donc une sous-chaine non ancree — 'saint' matche 'Saint Paul centre'.
|
|
6539
|
+
*/
|
|
6540
|
+
name?: string;
|
|
6541
|
+
/**
|
|
6542
|
+
* AFFINE UNIQUEMENT, ne se suffit pas a lui-meme (une requete portant seulement `level` renvoie {result:false}). Compare a `zoniris.level`, qui est un TABLEAU DE CHAINES : '6' pour les IRIS, '8' pour les bassins de vie.
|
|
6543
|
+
*/
|
|
6544
|
+
level?: string;
|
|
6545
|
+
/**
|
|
6546
|
+
* Slug du costum courant. Injecte automatiquement par `BaseEntity._withCostumContext`. Ignore par les deux actions legacy (elles ne lisent que leurs propres filtres) mais transmis pour homogeneite avec le reste du contrat.
|
|
6547
|
+
*/
|
|
6548
|
+
costumSlug?: string;
|
|
6549
|
+
/**
|
|
6550
|
+
* ID du costum courant (ObjectId 24 hex). Alias historique de `contextId`. Injecte par `_withCostumContext`.
|
|
6551
|
+
*/
|
|
6552
|
+
costumId?: string;
|
|
6553
|
+
/**
|
|
6554
|
+
* Collection portant le costum. Alias historique de `contextType`. Injecte par `_withCostumContext`.
|
|
6555
|
+
*/
|
|
6556
|
+
costumType?: "citoyens" | "organizations" | "projects" | "events" | "poi" | "badges" | "news" | "comments" | "answers" | "forms" | "classifieds" | "actions";
|
|
6557
|
+
/**
|
|
6558
|
+
* Mode edition du costum (boolean, string ou number).
|
|
6559
|
+
*/
|
|
6560
|
+
costumEditMode?: ("true" | "false") | (0 | 1) | boolean;
|
|
6561
|
+
/**
|
|
6562
|
+
* ID de l'entite portant le contexte costum (ObjectId 24 hex). Injecte par `_withCostumContext`.
|
|
6563
|
+
*/
|
|
6564
|
+
contextId?: string;
|
|
6565
|
+
/**
|
|
6566
|
+
* Collection de l'entite portant le contexte costum. Injecte par `_withCostumContext`.
|
|
6567
|
+
*/
|
|
6568
|
+
contextType?: "citoyens" | "organizations" | "projects" | "events" | "poi" | "badges" | "news" | "comments" | "answers" | "forms" | "classifieds" | "actions";
|
|
6569
|
+
/**
|
|
6570
|
+
* Cles de source du costum. Injecte par `_withCostumContext` (defaut : [slug du costum courant]). Sans effet sur ces deux actions.
|
|
6571
|
+
*/
|
|
6572
|
+
sourceKey?: string[];
|
|
6573
|
+
[k: string]: unknown;
|
|
6574
|
+
}
|
|
@@ -27,4 +27,58 @@ export interface ZoneItemJson {
|
|
|
27
27
|
translateId: string;
|
|
28
28
|
[key: string]: unknown;
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Élément renvoyé par `ZONE_GET_SHAPE` (`/co2/zone/getshape`).
|
|
32
|
+
*
|
|
33
|
+
* Sur le réseau, le legacy renvoie une **map keyée par l'`_id` hexadécimal** de documents
|
|
34
|
+
* `zones` ou `cities` **complets** (aucune projection). Le normaliseur du client
|
|
35
|
+
* (`ApiClient._transformData`) reconvertit cette map en tableau et pose la clé d'origine
|
|
36
|
+
* dans `id` — d'où la présence simultanée de `id` (string) et `_id`.
|
|
37
|
+
*
|
|
38
|
+
* Les documents des deux collections sont hétérogènes (zone administrative, EPCI, QPV,
|
|
39
|
+
* commune) : **toutes** les propriétés sont optionnelles hors `id`. Attention, le champ
|
|
40
|
+
* pays s'appelle `countryCode` dans `zones` et `country` dans `cities`.
|
|
41
|
+
*/
|
|
42
|
+
export interface ZoneShapeItem {
|
|
43
|
+
/** `_id` hexadécimal du document — clé de la map réseau, promue en champ par `_transformData`. */
|
|
44
|
+
id: string;
|
|
45
|
+
_id?: IdObject | ObjectID;
|
|
46
|
+
name?: string;
|
|
47
|
+
/** Niveau(x) administratif(s). Stocké en TABLEAU DE CHAÎNES en base (`["6"]`, `["1","3","4"]`
|
|
48
|
+
* pour les DOM), parfois en chaîne nue selon l'import. Ne jamais coercer en nombre. */
|
|
49
|
+
level?: string[] | string;
|
|
50
|
+
/** `"QPV"` sur les quartiers prioritaires (c'est le filtre de la branche QPV). */
|
|
51
|
+
type?: string;
|
|
52
|
+
/** Champ pays des documents `zones`. */
|
|
53
|
+
countryCode?: string;
|
|
54
|
+
/** Champ pays des documents `cities` (les deux collections ne le nomment pas pareil). */
|
|
55
|
+
country?: string;
|
|
56
|
+
insee?: string;
|
|
57
|
+
geo?: GeoCoordinates;
|
|
58
|
+
geoPosition?: GeoPosition;
|
|
59
|
+
/**
|
|
60
|
+
* Contour géographique : **géométrie GeoJSON NUE** (`{type, coordinates}`), pas une Feature.
|
|
61
|
+
* Volontairement NON TYPÉ (`unknown`) : la donnée réelle mélange `Polygon`, `MultiPolygon`,
|
|
62
|
+
* `Point`, `LineString`, et des coordonnées tantôt `double` tantôt `string`. Absent de
|
|
63
|
+
* beaucoup de documents (1 981 zones sur 52 915 en portent un).
|
|
64
|
+
*/
|
|
65
|
+
geoShape?: unknown;
|
|
66
|
+
[key: string]: unknown;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Élément renvoyé par `ZONE_GET_ZONIRIS` (`/co2/zone/getzoniris`) : document complet de la
|
|
70
|
+
* collection `zoniris` (IRIS, grands quartiers, bassins de vie). Même forme réseau que
|
|
71
|
+
* {@link ZoneShapeItem} (map keyée par `_id`, aplatie en tableau par le client).
|
|
72
|
+
*/
|
|
73
|
+
export interface ZonirisShapeItem extends ZoneShapeItem {
|
|
74
|
+
/** Identifiant du lot d'import (ex. `"bassins_vie_saintpaul"`). */
|
|
75
|
+
spec?: string;
|
|
76
|
+
/** Type de forme (ex. `"BassinVie"`). */
|
|
77
|
+
shapeType?: string;
|
|
78
|
+
/** `_id` (en STRING) de la commune de rattachement. */
|
|
79
|
+
cityId?: string;
|
|
80
|
+
cityName?: string;
|
|
81
|
+
codeIris?: string;
|
|
82
|
+
typeIris?: string;
|
|
83
|
+
}
|
|
30
84
|
export {};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { CostumExtensionModule, CostumExtensionField, KnownCostumSlug, Collection } from "./types.js";
|
|
2
2
|
import type { BaseEntity } from "../api/BaseEntity.js";
|
|
3
|
+
/** Active/désactive FORCE-LIVE (cf. `COSTUM_FORCE_LIVE`). */
|
|
4
|
+
export declare function setCostumForceLive(actif: boolean): void;
|
|
5
|
+
/** État courant de FORCE-LIVE. */
|
|
6
|
+
export declare function isCostumForceLive(): boolean;
|
|
3
7
|
/**
|
|
4
8
|
* Invalide le cache costum live — d'UN slug (ex. après avoir modifié ce costum en base), ou de TOUT
|
|
5
9
|
* (`invalidateCostumCache()`). Le prochain accès refetchera `getcostumjson` (C2e). Sans effet sur le bundle.
|
package/types/costum/types.d.ts
CHANGED
|
@@ -328,14 +328,14 @@ export interface CostumFieldMap {
|
|
|
328
328
|
};
|
|
329
329
|
equipementsSportifs974: {
|
|
330
330
|
poi: {
|
|
331
|
-
aps_name?: string
|
|
331
|
+
aps_name?: string;
|
|
332
332
|
categorie?: string;
|
|
333
333
|
equip_acc_libre?: boolean;
|
|
334
334
|
equip_douche?: boolean;
|
|
335
335
|
equip_eclair?: boolean;
|
|
336
336
|
equip_gest_type?: string;
|
|
337
337
|
equip_larg?: number;
|
|
338
|
-
equip_loc_type?: string
|
|
338
|
+
equip_loc_type?: string;
|
|
339
339
|
equip_long?: number;
|
|
340
340
|
equip_maj_date?: string;
|
|
341
341
|
equip_nature?: string;
|
|
@@ -357,14 +357,14 @@ export interface CostumFieldMap {
|
|
|
357
357
|
equip_surf?: number;
|
|
358
358
|
equip_type_famille?: string;
|
|
359
359
|
equip_type_name?: string;
|
|
360
|
-
equip_utilisateur?: string
|
|
360
|
+
equip_utilisateur?: string;
|
|
361
361
|
inst_acc_handi_bool?: boolean;
|
|
362
362
|
inst_acc_handi_type?: string;
|
|
363
363
|
inst_date_creation?: string;
|
|
364
364
|
inst_enqu_date?: string;
|
|
365
365
|
inst_nom?: string;
|
|
366
366
|
inst_part_bool?: boolean;
|
|
367
|
-
inst_part_type?: string
|
|
367
|
+
inst_part_type?: string;
|
|
368
368
|
inst_trans_bool?: boolean;
|
|
369
369
|
inst_trans_type?: string;
|
|
370
370
|
};
|
|
@@ -933,14 +933,13 @@ export interface CostumFieldMap {
|
|
|
933
933
|
personInChargeName?: string;
|
|
934
934
|
personInChargeTelephone?: number;
|
|
935
935
|
personInChargeTitle?: "Président" | "Maire.sse" | "Chef.fe d'entreprise" | "Chef.fe d'établissement" | "Autre...";
|
|
936
|
-
recepisseDeclaration?: string;
|
|
937
936
|
representativeCivility?: string;
|
|
938
937
|
representativeEmail?: string;
|
|
939
938
|
representativeFirstName?: string;
|
|
940
939
|
representativeName?: string;
|
|
941
940
|
representativeTelephone?: number;
|
|
942
941
|
representativeTitle?: "Président" | "Maire.sse" | "Chef.fe d'entreprise" | "Chef.fe d'établissement" | "Autre...";
|
|
943
|
-
responsableCivilePro?: string
|
|
942
|
+
responsableCivilePro?: Record<string, unknown>;
|
|
944
943
|
responsableSameAsRepresent?: boolean;
|
|
945
944
|
sextionInfo?: Record<string, unknown>;
|
|
946
945
|
sextionInfoRepresentant?: Record<string, unknown>;
|