@communecter/cocolight-api-client 1.0.150 → 1.0.152
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/cocolight-api-client.browser.js +1 -1
- package/dist/cocolight-api-client.cjs +1 -1
- package/dist/cocolight-api-client.mjs.js +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 +3 -2
- package/src/api/BaseEntity.ts +106 -5
- package/src/api/EndpointApi.ts +16 -1
- package/src/api/EndpointApi.types.ts +293 -202
- package/src/api/User.ts +13 -4
- package/src/api/UserApi.ts +16 -5
- package/src/costum/runtime.ts +65 -12
- package/src/endpoints.module.ts +370 -210
- package/types/api/BaseEntity.d.ts +56 -2
- package/types/api/EndpointApi.d.ts +10 -1
- package/types/api/EndpointApi.types.d.ts +91 -44
- package/types/api/User.d.ts +9 -2
- package/types/api/UserApi.d.ts +7 -1
- package/types/costum/runtime.d.ts +14 -5
- package/types/endpoints.module.d.ts +1634 -1086
|
@@ -1,4 +1,4 @@
|
|
|
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, 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, 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";
|
|
@@ -179,6 +179,18 @@ export type CostumContextFields = {
|
|
|
179
179
|
sourceKey: string[];
|
|
180
180
|
};
|
|
181
181
|
export type WithCostumContext<T> = T & CostumContextFields;
|
|
182
|
+
/**
|
|
183
|
+
* Bornes d'agenda acceptant un `Date` (coercé en ISO par la méthode avant l'envoi — le fil reste
|
|
184
|
+
* `type:string`). Partagé par `searchEventsCostum` et `getEvents`.
|
|
185
|
+
*/
|
|
186
|
+
type AgendaDateInputs = {
|
|
187
|
+
startDateUTC?: Date | string;
|
|
188
|
+
endDateUTC?: Date | string;
|
|
189
|
+
};
|
|
190
|
+
/** Entrée de `searchEventsCostum` : la request, mais les bornes acceptent un `Date`. */
|
|
191
|
+
export type SearchEventsCostumInput = Omit<Partial<SearchEventsCostumData>, keyof AgendaDateInputs> & AgendaDateInputs;
|
|
192
|
+
/** Entrée de `getEvents` : la request, mais les bornes acceptent un `Date`. */
|
|
193
|
+
export type GetEventsInput = Omit<Partial<GetEventsData>, keyof AgendaDateInputs> & AgendaDateInputs;
|
|
182
194
|
/**
|
|
183
195
|
* Une valeur distincte d'une thématique CoForm (retournée par `coformFilterByPath`).
|
|
184
196
|
*/
|
|
@@ -1546,10 +1558,13 @@ export declare class BaseEntity<TServerData = any> {
|
|
|
1546
1558
|
/**
|
|
1547
1559
|
* Récupérer les événements d'une entitée : liste des événements de l'entité ou elle est "organizer" ou "attendee".
|
|
1548
1560
|
* Constant : GET_EVENTS
|
|
1561
|
+
* `startDateUTC`/`endDateUTC` acceptent un `Date` ou une string ISO (un `Date` est coercé en ISO).
|
|
1562
|
+
* `recurrency` est typé `false` (garde parité, comme `searchEventsCostum`) : omettre (récurrents inclus
|
|
1563
|
+
* en mode calendrier) ou passer `false` (exclure) ; jamais `true` (le legacy `=== true` l'exclurait → divergence).
|
|
1549
1564
|
* @param data - Paramètres (partiels) de recherche/pagination.
|
|
1550
1565
|
* @returns - Les données de réponse.
|
|
1551
1566
|
*/
|
|
1552
|
-
getEvents(data?:
|
|
1567
|
+
getEvents(data?: GetEventsInput, options?: {
|
|
1553
1568
|
restoredState?: PaginatorState;
|
|
1554
1569
|
}): Promise<PaginatorPage<EventEntity>>;
|
|
1555
1570
|
/**
|
|
@@ -1983,6 +1998,45 @@ export declare class BaseEntity<TServerData = any> {
|
|
|
1983
1998
|
restoredState?: PaginatorState;
|
|
1984
1999
|
variant?: SearchCostumVariant;
|
|
1985
2000
|
}): Promise<PaginatorPage<any>>;
|
|
2001
|
+
/**
|
|
2002
|
+
* Agenda costum-aware : events scopés au costum (`source.key`) — pendant de `searchCostum` pour les events.
|
|
2003
|
+
* `_withCostumContext` injecte `costumSlug`/`contextId`/`contextType` + `sourceKey=[serverData.slug]` → les
|
|
2004
|
+
* events DU site/hôte costum (au lieu du filtre attendees/organizer FORCÉ de `getEvents`). À appeler sur
|
|
2005
|
+
* l'entité HÔTE du costum (ex. l'entité du déploiement). `sourceKey` surchargeable (agenda multi-sites / réseau).
|
|
2006
|
+
*
|
|
2007
|
+
* **Deux modes** (endpoint `/co2/search/agenda`), selon que tu passes une date ou non :
|
|
2008
|
+
*
|
|
2009
|
+
* 1. **CALENDRIER** — déclenché par `startDateUTC` et/ou `endDateUTC` (l'agenda d'une période) :
|
|
2010
|
+
* ramène **TOUT** ce qui matche la plage — ponctuels **+ récurrents** (`openingHours`, sauf `recurrency:false`) —
|
|
2011
|
+
* trié par **occurrence** (`startDateSort`/`startDateSortFormat` calculés côté serveur), résultat = **tableau**.
|
|
2012
|
+
* **Pas de pagination** serveur : une seule page (`next()`/`prev()` sans effet).
|
|
2013
|
+
* 2. **LISTE** — déclenché par l'**absence** de date (flux paginé) :
|
|
2014
|
+
* **ponctuels uniquement** (récurrents exclus), triés par `startDate` **décroissant** (plus récents d'abord),
|
|
2015
|
+
* paginés via `indexMin`/`indexStep` (défaut 30) — `next()`/`prev()` fonctionnent. (Backend : objet keyé `_id`,
|
|
2016
|
+
* hydraté en tableau d'`Event` côté lib.)
|
|
2017
|
+
*
|
|
2018
|
+
* Le scope costum (`sourceKey`) s'applique dans les **deux** modes.
|
|
2019
|
+
*
|
|
2020
|
+
* `recurrency` est typé `false` (garde parité) : **omettre** (mode calendrier → récurrents inclus) ou passer
|
|
2021
|
+
* `false` (exclure) ; **jamais `true`** — le legacy fait un test strict `=== true` qui exclurait les récurrents
|
|
2022
|
+
* (divergence), valeur donc interdite au type **et** à l'AJV.
|
|
2023
|
+
*
|
|
2024
|
+
* `startDateUTC`/`endDateUTC` acceptent un **`Date` ou une string ISO** : un `Date` est coercé en ISO
|
|
2025
|
+
* (`toISOString()`) avant l'envoi (le fil reste `type:string`). Évite le piège de l'ISO partielle
|
|
2026
|
+
* (`"2026-06-01"` n'est pas un `date-time` AJV valide).
|
|
2027
|
+
*
|
|
2028
|
+
// Mode CALENDRIER — agenda du mois, avec de vrais Date
|
|
2029
|
+
* const debut = new Date("2026-06-01T00:00:00Z");
|
|
2030
|
+
* const page = await org.searchEventsCostum({ startDateUTC: debut, endDateUTC: new Date("2026-06-30T23:59:59Z") });
|
|
2031
|
+
* page.results.forEach((e) => console.log(e.serverData.name, e.serverData.startDateSort));
|
|
2032
|
+
*
|
|
2033
|
+
// Mode LISTE — flux paginé (ponctuels, du plus récent)
|
|
2034
|
+
* let p = await org.searchEventsCostum({ indexStep: 20 });
|
|
2035
|
+
* if (p.hasNext) p = await p.next();
|
|
2036
|
+
*/
|
|
2037
|
+
searchEventsCostum(data?: SearchEventsCostumInput, options?: {
|
|
2038
|
+
restoredState?: PaginatorState;
|
|
2039
|
+
}): Promise<PaginatorPage<EventEntity>>;
|
|
1986
2040
|
/**
|
|
1987
2041
|
* @param data
|
|
1988
2042
|
* 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, 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, ShareEventsData, InviteEventData, FollowData, GetCostumJsonData, GlobalAutocompleteCostumData, NavigatorGettlData, CostumEventRequestActorsData, CostumEventRequestSubeventsData, CostumEventRequestElementEventData, CostumEventRequestCategoriesData, CostumEventRequestDatesData, CostumEventRequestEventData, CostumEventRequestLinkTlToEventData, CostumEventRequestLoadContextTagData, GetGalleryData, GetAttendeesNoAdminData, GetAttendeesAdminData, CoformAnswersSearchData, CoformAnswersByIdData, GetCoformByIdData, CoformUploadAnswerFileData, CoformGetAnswerFilesData, GetCoformCatalogsData, SaveCoformAnswerData, GetCoformAnswerHistoryData, GetCoformMultievalDataData, GetCoformCommontableContributorsData, AddVoteData, AddReportAbuseData, UpdatePathValueData, DeleteDocumentByContextData, DeleteDocumentByIdData, DemoteAdminData, CostumFilterCoformData, CostumFilterCoformByPathData, GetCountriesData, SearchZonesData, CoformAnswersByFormsData, GenerateAnswerFromFormData, FundingEnvelopeData, CoremuOperationData, CostumProjectActionRequestNewData, CostumProjectActionRequestSetStatusData, CostumProjectActionRequestSetDateData, CostumProjectActionRequestSetContributorsData, CostumProjectActionRequestCancelData, CostumProjectActionRequestArchiveData, LinkDiscourseAccountData, UnlinkDiscourseAccountData, DiscourseProfileData, DiscourseCheckEmailData, DiscourseDismissLinkData, LinkMediawikiAccountData, UnlinkMediawikiAccountData, GetMediawikiContributionsData, AddClassifiedData, 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, InviteEventData, FollowData, GetCostumJsonData, GlobalAutocompleteCostumData, NavigatorGettlData, CostumEventRequestActorsData, CostumEventRequestSubeventsData, CostumEventRequestElementEventData, CostumEventRequestCategoriesData, CostumEventRequestDatesData, CostumEventRequestEventData, CostumEventRequestLinkTlToEventData, CostumEventRequestLoadContextTagData, GetGalleryData, GetAttendeesNoAdminData, GetAttendeesAdminData, CoformAnswersSearchData, CoformAnswersByIdData, GetCoformByIdData, CoformUploadAnswerFileData, CoformGetAnswerFilesData, GetCoformCatalogsData, SaveCoformAnswerData, GetCoformAnswerHistoryData, GetCoformMultievalDataData, GetCoformCommontableContributorsData, AddVoteData, AddReportAbuseData, UpdatePathValueData, DeleteDocumentByContextData, DeleteDocumentByIdData, DemoteAdminData, CostumFilterCoformData, CostumFilterCoformByPathData, GetCountriesData, SearchZonesData, CoformAnswersByFormsData, GenerateAnswerFromFormData, FundingEnvelopeData, CoremuOperationData, CostumProjectActionRequestNewData, CostumProjectActionRequestSetStatusData, CostumProjectActionRequestSetDateData, CostumProjectActionRequestSetContributorsData, CostumProjectActionRequestCancelData, CostumProjectActionRequestArchiveData, LinkDiscourseAccountData, UnlinkDiscourseAccountData, DiscourseProfileData, DiscourseCheckEmailData, DiscourseDismissLinkData, LinkMediawikiAccountData, UnlinkMediawikiAccountData, GetMediawikiContributionsData, AddClassifiedData, PersonActivateData } from "./EndpointApi.types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Classe EndpointApi générée automatiquement depuis endpoints-copie.json
|
|
5
5
|
*/
|
|
@@ -843,6 +843,15 @@ export declare class EndpointApi {
|
|
|
843
843
|
* @throws {Error} - En cas d'erreur inattendue.
|
|
844
844
|
*/
|
|
845
845
|
getEvents(data: GetEventsData): Promise<any>;
|
|
846
|
+
/**
|
|
847
|
+
* Recherche d'events scopée costum (agenda) : Agenda costum-aware : events filtrés par sourceKey/costum + plage de dates. Même endpoint /co2/search/agenda que GET_EVENTS, mais surface costum (PAS le filtre attendees/organizer forcé de GET_EVENTS). Réponse = cible-co2-search-agenda.
|
|
848
|
+
* Constant : SEARCH_EVENTS_COSTUM
|
|
849
|
+
* @param data - Données envoyées à l'API
|
|
850
|
+
* @returns Les données de réponse.
|
|
851
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
852
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
853
|
+
*/
|
|
854
|
+
searchEventsCostum(data: SearchEventsCostumData): Promise<any>;
|
|
846
855
|
/**
|
|
847
856
|
* Partager un événement : Partage un événement avec d’autres utilisateurs ou entités.
|
|
848
857
|
* Constant : SHARE_EVENTS
|
|
@@ -2588,7 +2588,7 @@ export interface AddOrganizationData {
|
|
|
2588
2588
|
* Rôle principal de l’organisation
|
|
2589
2589
|
*/
|
|
2590
2590
|
role: "admin" | "member";
|
|
2591
|
-
tags?: string[];
|
|
2591
|
+
tags?: "" | string[];
|
|
2592
2592
|
/**
|
|
2593
2593
|
* Email de l’organisation
|
|
2594
2594
|
*/
|
|
@@ -2612,18 +2612,12 @@ export interface AddOrganizationData {
|
|
|
2612
2612
|
isOpenEdition: boolean;
|
|
2613
2613
|
[k: string]: unknown;
|
|
2614
2614
|
};
|
|
2615
|
-
|
|
2616
|
-
* Coordonnées géographiques
|
|
2617
|
-
*/
|
|
2618
|
-
geo?: {
|
|
2615
|
+
geo?: "" | {
|
|
2619
2616
|
"@type"?: "GeoCoordinates";
|
|
2620
2617
|
latitude: string | number;
|
|
2621
2618
|
longitude: string | number;
|
|
2622
2619
|
};
|
|
2623
|
-
|
|
2624
|
-
* Position géographique GeoJSON
|
|
2625
|
-
*/
|
|
2626
|
-
geoPosition?: {
|
|
2620
|
+
geoPosition?: "" | {
|
|
2627
2621
|
/**
|
|
2628
2622
|
* Type GeoJSON (doit être 'Point')
|
|
2629
2623
|
*/
|
|
@@ -2638,7 +2632,7 @@ export interface AddOrganizationData {
|
|
|
2638
2632
|
/**
|
|
2639
2633
|
* Indicateur pour forcer la conversion en float côté serveur
|
|
2640
2634
|
*/
|
|
2641
|
-
float
|
|
2635
|
+
float?: true;
|
|
2642
2636
|
[k: string]: unknown;
|
|
2643
2637
|
};
|
|
2644
2638
|
/**
|
|
@@ -2655,7 +2649,7 @@ export interface AddOrganizationData {
|
|
|
2655
2649
|
tags: string[];
|
|
2656
2650
|
};
|
|
2657
2651
|
};
|
|
2658
|
-
address?: {
|
|
2652
|
+
address?: "" | {
|
|
2659
2653
|
"@type": "PostalAddress";
|
|
2660
2654
|
addressCountry: string;
|
|
2661
2655
|
codeInsee: string;
|
|
@@ -2885,7 +2879,7 @@ export interface AddProjectData {
|
|
|
2885
2879
|
* Visibilité (true/false)
|
|
2886
2880
|
*/
|
|
2887
2881
|
public: boolean;
|
|
2888
|
-
tags?: string[];
|
|
2882
|
+
tags?: "" | string[];
|
|
2889
2883
|
/**
|
|
2890
2884
|
* Description courte
|
|
2891
2885
|
*/
|
|
@@ -2909,18 +2903,12 @@ export interface AddProjectData {
|
|
|
2909
2903
|
crowdfunding?: boolean;
|
|
2910
2904
|
[k: string]: unknown;
|
|
2911
2905
|
};
|
|
2912
|
-
|
|
2913
|
-
* Coordonnées géographiques
|
|
2914
|
-
*/
|
|
2915
|
-
geo?: {
|
|
2906
|
+
geo?: "" | {
|
|
2916
2907
|
"@type"?: "GeoCoordinates";
|
|
2917
2908
|
latitude: string | number;
|
|
2918
2909
|
longitude: string | number;
|
|
2919
2910
|
};
|
|
2920
|
-
|
|
2921
|
-
* Position géographique GeoJSON
|
|
2922
|
-
*/
|
|
2923
|
-
geoPosition?: {
|
|
2911
|
+
geoPosition?: "" | {
|
|
2924
2912
|
/**
|
|
2925
2913
|
* Type GeoJSON (doit être 'Point')
|
|
2926
2914
|
*/
|
|
@@ -2935,10 +2923,10 @@ export interface AddProjectData {
|
|
|
2935
2923
|
/**
|
|
2936
2924
|
* Indicateur pour forcer la conversion en float côté serveur
|
|
2937
2925
|
*/
|
|
2938
|
-
float
|
|
2926
|
+
float?: true;
|
|
2939
2927
|
[k: string]: unknown;
|
|
2940
2928
|
};
|
|
2941
|
-
address?: {
|
|
2929
|
+
address?: "" | {
|
|
2942
2930
|
"@type": "PostalAddress";
|
|
2943
2931
|
addressCountry: string;
|
|
2944
2932
|
codeInsee: string;
|
|
@@ -3018,23 +3006,17 @@ export interface AddPoiData {
|
|
|
3018
3006
|
* Description
|
|
3019
3007
|
*/
|
|
3020
3008
|
description?: string;
|
|
3021
|
-
tags?: string[];
|
|
3009
|
+
tags?: "" | string[];
|
|
3022
3010
|
/**
|
|
3023
3011
|
* URLs externes associées
|
|
3024
3012
|
*/
|
|
3025
3013
|
urls?: string[];
|
|
3026
|
-
|
|
3027
|
-
* Coordonnées géographiques
|
|
3028
|
-
*/
|
|
3029
|
-
geo?: {
|
|
3014
|
+
geo?: "" | {
|
|
3030
3015
|
"@type"?: "GeoCoordinates";
|
|
3031
3016
|
latitude: string | number;
|
|
3032
3017
|
longitude: string | number;
|
|
3033
3018
|
};
|
|
3034
|
-
|
|
3035
|
-
* Position géographique GeoJSON
|
|
3036
|
-
*/
|
|
3037
|
-
geoPosition?: {
|
|
3019
|
+
geoPosition?: "" | {
|
|
3038
3020
|
/**
|
|
3039
3021
|
* Type GeoJSON (doit être 'Point')
|
|
3040
3022
|
*/
|
|
@@ -3049,10 +3031,10 @@ export interface AddPoiData {
|
|
|
3049
3031
|
/**
|
|
3050
3032
|
* Indicateur pour forcer la conversion en float côté serveur
|
|
3051
3033
|
*/
|
|
3052
|
-
float
|
|
3034
|
+
float?: true;
|
|
3053
3035
|
[k: string]: unknown;
|
|
3054
3036
|
};
|
|
3055
|
-
address?: {
|
|
3037
|
+
address?: "" | {
|
|
3056
3038
|
"@type": "PostalAddress";
|
|
3057
3039
|
addressCountry: string;
|
|
3058
3040
|
codeInsee: string;
|
|
@@ -3323,18 +3305,12 @@ export interface AddEventData {
|
|
|
3323
3305
|
}[];
|
|
3324
3306
|
})
|
|
3325
3307
|
];
|
|
3326
|
-
|
|
3327
|
-
* Coordonnées géographiques
|
|
3328
|
-
*/
|
|
3329
|
-
geo?: {
|
|
3308
|
+
geo?: "" | {
|
|
3330
3309
|
"@type"?: "GeoCoordinates";
|
|
3331
3310
|
latitude: string | number;
|
|
3332
3311
|
longitude: string | number;
|
|
3333
3312
|
};
|
|
3334
|
-
|
|
3335
|
-
* Position géographique GeoJSON
|
|
3336
|
-
*/
|
|
3337
|
-
geoPosition?: {
|
|
3313
|
+
geoPosition?: "" | {
|
|
3338
3314
|
/**
|
|
3339
3315
|
* Type GeoJSON (doit être 'Point')
|
|
3340
3316
|
*/
|
|
@@ -3349,7 +3325,7 @@ export interface AddEventData {
|
|
|
3349
3325
|
/**
|
|
3350
3326
|
* Indicateur pour forcer la conversion en float côté serveur
|
|
3351
3327
|
*/
|
|
3352
|
-
float
|
|
3328
|
+
float?: true;
|
|
3353
3329
|
[k: string]: unknown;
|
|
3354
3330
|
};
|
|
3355
3331
|
address?: "" | {
|
|
@@ -3743,9 +3719,9 @@ export interface GetEventsData {
|
|
|
3743
3719
|
countType?: unknown[];
|
|
3744
3720
|
fediverse: boolean;
|
|
3745
3721
|
/**
|
|
3746
|
-
*
|
|
3722
|
+
* GARDE PARITÉ legacy (identique à SEARCH_EVENTS_COSTUM) : seule valeur autorisée `false` (= exclure les récurrents) OU champ omis (= inclure, défaut). NE JAMAIS envoyer `true` — le legacy teste STRICTEMENT $recurrency === true (AgendaAction.php:65) qui échoue sur la string POST → exclut les récurrents, alors que notre backend les inclurait (divergence assumée). En interdisant `true`, omis→inclus et false→exclus se comportent pareil sur les 2 serveurs.
|
|
3747
3723
|
*/
|
|
3748
|
-
recurrency?:
|
|
3724
|
+
recurrency?: false;
|
|
3749
3725
|
filters?: {
|
|
3750
3726
|
$or?: Record<string, unknown>;
|
|
3751
3727
|
/**
|
|
@@ -3756,6 +3732,77 @@ export interface GetEventsData {
|
|
|
3756
3732
|
};
|
|
3757
3733
|
[k: string]: unknown;
|
|
3758
3734
|
}
|
|
3735
|
+
export interface SearchEventsCostumData {
|
|
3736
|
+
searchType: "events"[];
|
|
3737
|
+
indexMin: number;
|
|
3738
|
+
indexStep: number;
|
|
3739
|
+
/**
|
|
3740
|
+
* Date de début (UTC)
|
|
3741
|
+
*/
|
|
3742
|
+
startDateUTC?: string;
|
|
3743
|
+
/**
|
|
3744
|
+
* Date de fin (UTC)
|
|
3745
|
+
*/
|
|
3746
|
+
endDateUTC?: string;
|
|
3747
|
+
/**
|
|
3748
|
+
* Nom ou terme
|
|
3749
|
+
*/
|
|
3750
|
+
name?: string;
|
|
3751
|
+
/**
|
|
3752
|
+
* Type d’événement
|
|
3753
|
+
*/
|
|
3754
|
+
type?: "workshop" | "competition" | "concert" | "contest" | "conference" | "debate" | "exhibition" | "festival" | "crowdfunding" | "fair" | "course" | "protest" | "market" | "film" | "getTogether" | "meeting" | "spectacle" | "internship" | "stand" | "others";
|
|
3755
|
+
/**
|
|
3756
|
+
* Liste des localités ciblées
|
|
3757
|
+
*/
|
|
3758
|
+
locality?: {
|
|
3759
|
+
/**
|
|
3760
|
+
* This interface was referenced by `undefined`'s JSON-Schema definition
|
|
3761
|
+
* via the `patternProperty` "^[^\s]+$".
|
|
3762
|
+
*/
|
|
3763
|
+
[k: string]: {
|
|
3764
|
+
[k: string]: unknown;
|
|
3765
|
+
};
|
|
3766
|
+
};
|
|
3767
|
+
count?: boolean;
|
|
3768
|
+
countType?: unknown[];
|
|
3769
|
+
fediverse: boolean;
|
|
3770
|
+
/**
|
|
3771
|
+
* GARDE PARITÉ legacy : seule valeur autorisée `false` (= exclure les récurrents) OU champ omis (= inclure, défaut). NE JAMAIS envoyer `true` — le legacy teste STRICTEMENT $recurrency === true (AgendaAction.php:65) qui échoue sur la string POST → exclut les récurrents, alors que notre backend les inclurait (divergence assumée). En interdisant `true`, omis→inclus et false→exclus se comportent pareil sur les 2 serveurs.
|
|
3772
|
+
*/
|
|
3773
|
+
recurrency?: false;
|
|
3774
|
+
/**
|
|
3775
|
+
* Filtres Mongo additionnels (buildFilters).
|
|
3776
|
+
*/
|
|
3777
|
+
filters?: {
|
|
3778
|
+
[k: string]: unknown;
|
|
3779
|
+
};
|
|
3780
|
+
/**
|
|
3781
|
+
* Scope costum : events dont source.keys/reference.costum ∈ sourceKey (agenda multi-sites/réseau). Auto-injecté = [slug de l’entité] si absent.
|
|
3782
|
+
*/
|
|
3783
|
+
sourceKey?: string[];
|
|
3784
|
+
/**
|
|
3785
|
+
* Filtre par tags ($in, ou $all via options.tags.verb).
|
|
3786
|
+
*/
|
|
3787
|
+
searchTags?: string[];
|
|
3788
|
+
/**
|
|
3789
|
+
* Events liés (links.<type>.<id>).
|
|
3790
|
+
*/
|
|
3791
|
+
links?: {
|
|
3792
|
+
type: string;
|
|
3793
|
+
id: string;
|
|
3794
|
+
[k: string]: unknown;
|
|
3795
|
+
}[];
|
|
3796
|
+
subType?: string;
|
|
3797
|
+
category?: string;
|
|
3798
|
+
section?: string | string[];
|
|
3799
|
+
contextId?: string;
|
|
3800
|
+
contextType?: string;
|
|
3801
|
+
costumSlug?: string;
|
|
3802
|
+
costumId?: string;
|
|
3803
|
+
costumType?: string;
|
|
3804
|
+
[k: string]: unknown;
|
|
3805
|
+
}
|
|
3759
3806
|
export interface ShareEventsData {
|
|
3760
3807
|
/**
|
|
3761
3808
|
* ID de l’événement à partager
|
package/types/api/User.d.ts
CHANGED
|
@@ -295,9 +295,16 @@ export declare class User extends BaseEntity<UserItemNormalized> {
|
|
|
295
295
|
* const org = await tl.organization({ name: "Mon TL", manageModel: "Association", buildingSurfaceArea: "120" });
|
|
296
296
|
* await org.save();
|
|
297
297
|
*
|
|
298
|
-
*
|
|
298
|
+
* Deux formes :
|
|
299
|
+
* - `me.costum(slug)` : slug d'un costum du registry (autocomplété) OU n'importe quel slug (`string`) —
|
|
300
|
+
* le backend reste l'autorité de validité (`found`). Slug hors registry sans champ → inc1b (résolution live).
|
|
301
|
+
* - `me.costum(entity)` : ouvre un scope FIELDLESS depuis une entité DÉJÀ CHARGÉE (org/projet/event qui porte
|
|
302
|
+
* un costum), zéro fetch — `source.key` = slug de l'entité. Cas « créer sous ce site nu ».
|
|
303
|
+
*
|
|
304
|
+
* @param arg - slug (`KnownCostumSlug | string`) OU une entité chargée porteuse d'un costum.
|
|
299
305
|
*/
|
|
300
|
-
costum(slug: KnownCostumSlug): Promise<CostumScope>;
|
|
306
|
+
costum(slug: KnownCostumSlug | (string & {})): Promise<CostumScope>;
|
|
307
|
+
costum(entity: BaseEntity): Promise<CostumScope>;
|
|
301
308
|
/**
|
|
302
309
|
* {@inheritDoc BaseEntity#badge}
|
|
303
310
|
*
|
package/types/api/UserApi.d.ts
CHANGED
|
@@ -44,14 +44,20 @@ export declare class UserApi {
|
|
|
44
44
|
* @param params.username - Nom d'utilisateur.
|
|
45
45
|
* @param params.email - Adresse email.
|
|
46
46
|
* @param params.pwd - Mot de passe.
|
|
47
|
+
* @param params.costumSlug - (option) slug du costum de déploiement → estampille `source.key` du citoyen
|
|
48
|
+
* côté backend (port Person::insert). `costumId`/`costumType` = entité porteuse (requis si le slug n'est
|
|
49
|
+
* pas un doc `costum`, ex. un site porté par une org).
|
|
47
50
|
* @returns Réponse brute de l'API.
|
|
48
51
|
* @throws {ApiResponseError} Si l'API retourne un échec (`result === false`).
|
|
49
52
|
*/
|
|
50
|
-
register({ name, username, email, pwd }: {
|
|
53
|
+
register({ name, username, email, pwd, costumSlug, costumId, costumType }: {
|
|
51
54
|
name: string;
|
|
52
55
|
username: string;
|
|
53
56
|
email: string;
|
|
54
57
|
pwd: string;
|
|
58
|
+
costumSlug?: string;
|
|
59
|
+
costumId?: string;
|
|
60
|
+
costumType?: string;
|
|
55
61
|
}): Promise<any>;
|
|
56
62
|
/**
|
|
57
63
|
* Lance une procédure de récupération de mot de passe.
|
|
@@ -62,12 +62,12 @@ export interface CostumFormDescriptor {
|
|
|
62
62
|
* et n'altère jamais l'état partagé — chaque entité reçoit son propre `_costumCtx`.
|
|
63
63
|
*/
|
|
64
64
|
export declare class CostumScope {
|
|
65
|
-
readonly slug: KnownCostumSlug;
|
|
65
|
+
readonly slug: KnownCostumSlug | (string & {});
|
|
66
66
|
private readonly user;
|
|
67
67
|
private readonly module;
|
|
68
68
|
private readonly costumId;
|
|
69
69
|
private readonly costumType;
|
|
70
|
-
constructor(user: BaseEntity, slug: KnownCostumSlug, module: CostumExtensionModule, costumId: string, costumType: string);
|
|
70
|
+
constructor(user: BaseEntity, slug: KnownCostumSlug | (string & {}), module: CostumExtensionModule, costumId: string, costumType: string);
|
|
71
71
|
/** Construit le `CostumRuntimeContext` pour une collection donnée (null si le costum ne la couvre pas). */
|
|
72
72
|
contextFor(collection: Collection): CostumRuntimeContext | null;
|
|
73
73
|
/** Crée une entité de `collection` sous ce costum (presets appliqués, surchargeables par `data`). */
|
|
@@ -93,7 +93,16 @@ export declare class CostumScope {
|
|
|
93
93
|
*/
|
|
94
94
|
export declare function resolveCostumCtxFromSource(sourceKey: string | undefined | null, collection: Collection): CostumRuntimeContext | null;
|
|
95
95
|
/**
|
|
96
|
-
*
|
|
97
|
-
* (
|
|
96
|
+
* Ouvre un scope costum FIELDLESS depuis une entité DÉJÀ CHARGÉE (zéro fetch) : `costumSlug` = slug de
|
|
97
|
+
* l'entité (= `source.key` posé par le backend), `costumId/costumType` = l'entité porteuse. Pendant runtime
|
|
98
|
+
* exact de `_withCostumContext` (BaseEntity), pour la voie « entité tenue » (un site nu sans form). Le
|
|
99
|
+
* backend re-gate `found` sur l'existence d'un costum sur l'entité → un site sans costum n'estampille rien.
|
|
98
100
|
*/
|
|
99
|
-
export declare function
|
|
101
|
+
export declare function costumScopeFromEntity(user: BaseEntity, entity: BaseEntity): CostumScope;
|
|
102
|
+
/**
|
|
103
|
+
* Résout un `CostumScope` par SLUG pour un user connecté.
|
|
104
|
+
* - slug à champs (meta + loader) → charge le module généré (code-split via dynamic import).
|
|
105
|
+
* - slug CONNU sans loader (fieldless) → scope d'identité nu (`collections:{}`).
|
|
106
|
+
* - slug HORS registry → résolution LIVE via `slug/getinfo` (contextId/contextType) → scope nu (tier 3b).
|
|
107
|
+
*/
|
|
108
|
+
export declare function resolveCostumScope(user: BaseEntity, slug: KnownCostumSlug | (string & {})): Promise<CostumScope>;
|