@communecter/cocolight-api-client 1.0.146 → 1.0.148
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 +1 -1
- package/src/api/BaseEntity.ts +57 -0
- package/src/api/EndpointApi.ts +16 -33
- package/src/api/EndpointApi.types.ts +67 -64
- package/src/api/Event.ts +17 -0
- package/src/api/Organization.ts +20 -0
- package/src/api/Poi.ts +17 -0
- package/src/api/Project.ts +20 -0
- package/src/api/User.ts +12 -1
- package/src/api/UserApi.ts +30 -0
- package/src/endpoints.module.ts +56 -87
- package/types/api/BaseEntity.d.ts +30 -0
- package/types/api/EndpointApi.d.ts +10 -21
- package/types/api/EndpointApi.types.d.ts +65 -60
- package/types/api/Event.d.ts +14 -0
- package/types/api/Organization.d.ts +17 -0
- package/types/api/Poi.d.ts +14 -0
- package/types/api/Project.d.ts +17 -0
- package/types/api/UserApi.d.ts +18 -0
- package/types/endpoints.module.d.ts +523 -417
|
@@ -648,6 +648,36 @@ export declare class BaseEntity<TServerData = any> {
|
|
|
648
648
|
* await news.deleteFile(imageDocId);
|
|
649
649
|
*/
|
|
650
650
|
deleteFile(docId: string): Promise<void>;
|
|
651
|
+
/**
|
|
652
|
+
* Vide les objets réactifs et marque l'entité comme supprimée (tombstone),
|
|
653
|
+
* sans casser la réactivité. Pattern partagé par tous les `delete()`.
|
|
654
|
+
*
|
|
655
|
+
* Après appel : `serverData`/`draftData` vidés et `_isDeleted = true` → toute
|
|
656
|
+
* opération serveur ultérieure lève le tombstone (cf. `_checkNotDeleted`).
|
|
657
|
+
* @protected
|
|
658
|
+
*/
|
|
659
|
+
protected _markDeletedLocally(): void;
|
|
660
|
+
/**
|
|
661
|
+
* Suppression générique d'un élément via `DELETE_ELEMENT`
|
|
662
|
+
* (`/co2/element/delete/type/{type}/id/{id}`).
|
|
663
|
+
*
|
|
664
|
+
* **Garde client** : `isAuthorOrAdmin({ checkHierarchy })` — auteur (`creator`)
|
|
665
|
+
* OU administrateur (lien direct, ou via la hiérarchie parent org/projet
|
|
666
|
+
* résolue par `_isAdminViaHierarchy`). Le serveur reste la source de vérité.
|
|
667
|
+
*
|
|
668
|
+
* Après succès : `serverData`/`draftData` vidés + `_isDeleted = true`
|
|
669
|
+
* (via `_markDeletedLocally`).
|
|
670
|
+
*
|
|
671
|
+
* @param type - Type d'élément backend (typiquement `this.getEntityType()`).
|
|
672
|
+
* @param reason - Raison transmise au backend (audit).
|
|
673
|
+
* @param options.checkHierarchy - Propage la vérif admin à la hiérarchie parent. Défaut `true`.
|
|
674
|
+
* @throws {ApiError} 400 si l'entité n'a pas d'id.
|
|
675
|
+
* @throws {ApiError} 403 si ni auteur ni admin (selon la garde).
|
|
676
|
+
* @protected
|
|
677
|
+
*/
|
|
678
|
+
protected _deleteViaElement(type: string, reason: string, { checkHierarchy }?: {
|
|
679
|
+
checkHierarchy?: boolean;
|
|
680
|
+
}): Promise<void>;
|
|
651
681
|
/**
|
|
652
682
|
* Met à jour un champ unique (ou multi-fields via `updatePartial`) sur cette
|
|
653
683
|
* entité via `UPDATE_PATH_VALUE`.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type ApiClient from "../ApiClient.js";
|
|
2
|
-
import type { PersonRegisterData, AuthenticateUrlData, RefreshTokenUrlData, PasswordRecoveryData, ServerExchangeTokenData, ChangePasswordData, DeleteAccountData, UpdateSettingsData, UpdateBlockDescriptionData, UpdateBlockInfoData, UpdateBlockSocialData, UpdateBlockLocalityData, UpdateBlockSlugData, CheckData, ProfilImageData, ProfilBannerData, GetElementsAboutData, MulticonnectData, GetNewsData, GetNewsByIdData, AddNewsData, AddImageNewsData, AddFileNewsData, DeleteNewsData, UpdateNewsData, ShareNewsData, GetCommentsData, AddCommentsData, DeleteCommentsData, UpdateCommentsData, SearchTagsData, ShowVoteData, GlobalAutocompleteData, CityAutocompleteData, CityAutocompleteByCountryData, SuggestionInputData, GetProjectsNoAdminData, GetProjectsAdminData, GetPoisNoAdminData, GetPoisAdminData, GetOrganizationsNoAdminData, GetOrganizationsAdminData, GetUserEligiblePlacesData, GetMembersNoAdminData, GetMembersAdminData, GetFriendsAdminData, GetSubscriptionsData, GetSubscriptionsAdminData, GetSubscribersData, GetSubscribersAdminData, GetContributorsNoAdminData, GetContributorsAdminData, GetBadgesData, GetBadgesFiltersData, ConnectData, DisconnectData, GetElementsKeyData, GetFavorisData, DeleteFavorisData, AddFavorisData, AddOrganizationData, AddProjectData, AddPoiData, AddEventData,
|
|
2
|
+
import type { PersonRegisterData, AuthenticateUrlData, RefreshTokenUrlData, PasswordRecoveryData, ServerExchangeTokenData, ChangePasswordData, DeleteAccountData, UpdateSettingsData, UpdateBlockDescriptionData, UpdateBlockInfoData, UpdateBlockSocialData, UpdateBlockLocalityData, UpdateBlockSlugData, CheckData, ProfilImageData, ProfilBannerData, GetElementsAboutData, MulticonnectData, GetNewsData, GetNewsByIdData, AddNewsData, AddImageNewsData, AddFileNewsData, DeleteNewsData, UpdateNewsData, ShareNewsData, GetCommentsData, AddCommentsData, DeleteCommentsData, UpdateCommentsData, SearchTagsData, ShowVoteData, GlobalAutocompleteData, CityAutocompleteData, CityAutocompleteByCountryData, SuggestionInputData, GetProjectsNoAdminData, GetProjectsAdminData, GetPoisNoAdminData, GetPoisAdminData, GetOrganizationsNoAdminData, GetOrganizationsAdminData, GetUserEligiblePlacesData, GetMembersNoAdminData, GetMembersAdminData, GetFriendsAdminData, GetSubscriptionsData, GetSubscriptionsAdminData, GetSubscribersData, GetSubscribersAdminData, GetContributorsNoAdminData, GetContributorsAdminData, GetBadgesData, GetBadgesFiltersData, ConnectData, DisconnectData, GetElementsKeyData, GetFavorisData, DeleteFavorisData, AddFavorisData, AddOrganizationData, AddProjectData, AddPoiData, AddEventData, 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";
|
|
3
3
|
/**
|
|
4
4
|
* Classe EndpointApi générée automatiquement depuis endpoints-copie.json
|
|
5
5
|
*/
|
|
@@ -671,26 +671,6 @@ export declare class EndpointApi {
|
|
|
671
671
|
* @throws {Error} - En cas d'erreur inattendue.
|
|
672
672
|
*/
|
|
673
673
|
addEvent(data: AddEventData): Promise<any>;
|
|
674
|
-
/**
|
|
675
|
-
* Supprimer un POI : Supprime un POI existant.
|
|
676
|
-
* Constant : DELETE_POI
|
|
677
|
-
* @param data - Données envoyées à l'API
|
|
678
|
-
* @returns Les données de réponse.
|
|
679
|
-
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
680
|
-
* @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
|
|
681
|
-
* @throws {Error} - En cas d'erreur inattendue.
|
|
682
|
-
*/
|
|
683
|
-
deletePoi(data: DeletePoiData): Promise<any>;
|
|
684
|
-
/**
|
|
685
|
-
* Supprimer un événement : Supprime un événement spécifique.
|
|
686
|
-
* Constant : DELETE_EVENT
|
|
687
|
-
* @param data - Données envoyées à l'API
|
|
688
|
-
* @returns Les données de réponse.
|
|
689
|
-
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
690
|
-
* @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
|
|
691
|
-
* @throws {Error} - En cas d'erreur inattendue.
|
|
692
|
-
*/
|
|
693
|
-
deleteEvent(data: DeleteEventData): Promise<any>;
|
|
694
674
|
/**
|
|
695
675
|
* Supprimer un élément : Supprime un élément existant.
|
|
696
676
|
* Constant : DELETE_ELEMENT
|
|
@@ -1386,5 +1366,14 @@ export declare class EndpointApi {
|
|
|
1386
1366
|
* @throws {Error} - En cas d'erreur inattendue.
|
|
1387
1367
|
*/
|
|
1388
1368
|
addClassified(data: AddClassifiedData): Promise<any>;
|
|
1369
|
+
/**
|
|
1370
|
+
* Activation d’un compte (lien email) : Valide l’adresse email d’un compte via le lien reçu par email. validationKey = sha256(user + email). Retire roles.tobeactivated et pose le consentement preferences.sendMail.source (port ActivateAction + Person::validateEmailAccount/validateUser).
|
|
1371
|
+
* Constant : PERSON_ACTIVATE
|
|
1372
|
+
* @param data - Données envoyées à l'API
|
|
1373
|
+
* @returns Les données de réponse.
|
|
1374
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1375
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1376
|
+
*/
|
|
1377
|
+
personActivate(data: PersonActivateData): Promise<any>;
|
|
1389
1378
|
}
|
|
1390
1379
|
export default EndpointApi;
|
|
@@ -2627,22 +2627,6 @@ export interface AddOrganizationData {
|
|
|
2627
2627
|
float: true;
|
|
2628
2628
|
[k: string]: unknown;
|
|
2629
2629
|
};
|
|
2630
|
-
costum?: {
|
|
2631
|
-
bannerImageUrl?: string;
|
|
2632
|
-
bannerLogoUrl?: string;
|
|
2633
|
-
bannerText?: string;
|
|
2634
|
-
/**
|
|
2635
|
-
* Pour bien indiquer que l'orga est un commune transparente
|
|
2636
|
-
*/
|
|
2637
|
-
transparentCommune?: boolean;
|
|
2638
|
-
/**
|
|
2639
|
-
* Pour bien indiquer que l'orga est un centre ville
|
|
2640
|
-
*/
|
|
2641
|
-
cocity?: boolean;
|
|
2642
|
-
slug?: string;
|
|
2643
|
-
typeCocity?: string;
|
|
2644
|
-
[k: string]: unknown;
|
|
2645
|
-
};
|
|
2646
2630
|
/**
|
|
2647
2631
|
* Thématiques de l’organisation
|
|
2648
2632
|
*/
|
|
@@ -2866,15 +2850,6 @@ export interface AddOrganizationData {
|
|
|
2866
2850
|
* Description longue (markdown supporté)
|
|
2867
2851
|
*/
|
|
2868
2852
|
description?: string;
|
|
2869
|
-
/**
|
|
2870
|
-
* Source d'insertion (costum)
|
|
2871
|
-
*/
|
|
2872
|
-
source?: {
|
|
2873
|
-
insertOrign?: string;
|
|
2874
|
-
keys?: string[];
|
|
2875
|
-
key?: string;
|
|
2876
|
-
[k: string]: unknown;
|
|
2877
|
-
};
|
|
2878
2853
|
/**
|
|
2879
2854
|
* Tag principal (ex: TiersLieux)
|
|
2880
2855
|
*/
|
|
@@ -2891,10 +2866,6 @@ export interface AddOrganizationData {
|
|
|
2891
2866
|
* Type d'entité du costum (ex: projects)
|
|
2892
2867
|
*/
|
|
2893
2868
|
costumType?: string;
|
|
2894
|
-
/**
|
|
2895
|
-
* Mode édition costum
|
|
2896
|
-
*/
|
|
2897
|
-
costumEditMode?: boolean;
|
|
2898
2869
|
[k: string]: unknown;
|
|
2899
2870
|
}
|
|
2900
2871
|
export interface AddProjectData {
|
|
@@ -3015,6 +2986,18 @@ export interface AddProjectData {
|
|
|
3015
2986
|
streetAddress?: string;
|
|
3016
2987
|
};
|
|
3017
2988
|
scope: "";
|
|
2989
|
+
/**
|
|
2990
|
+
* Slug du costum d'origine
|
|
2991
|
+
*/
|
|
2992
|
+
costumSlug?: string;
|
|
2993
|
+
/**
|
|
2994
|
+
* ID Mongo du costum d'origine
|
|
2995
|
+
*/
|
|
2996
|
+
costumId?: string;
|
|
2997
|
+
/**
|
|
2998
|
+
* Type d'entité du costum (ex: projects)
|
|
2999
|
+
*/
|
|
3000
|
+
costumType?: string;
|
|
3018
3001
|
[k: string]: unknown;
|
|
3019
3002
|
}
|
|
3020
3003
|
export interface AddPoiData {
|
|
@@ -3277,14 +3260,17 @@ export interface AddPoiData {
|
|
|
3277
3260
|
*/
|
|
3278
3261
|
equip_utilisateur?: string[];
|
|
3279
3262
|
/**
|
|
3280
|
-
*
|
|
3263
|
+
* Slug du costum d'origine
|
|
3281
3264
|
*/
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3265
|
+
costumSlug?: string;
|
|
3266
|
+
/**
|
|
3267
|
+
* ID Mongo du costum d'origine
|
|
3268
|
+
*/
|
|
3269
|
+
costumId?: string;
|
|
3270
|
+
/**
|
|
3271
|
+
* Type d'entité du costum (ex: projects)
|
|
3272
|
+
*/
|
|
3273
|
+
costumType?: string;
|
|
3288
3274
|
[k: string]: unknown;
|
|
3289
3275
|
}
|
|
3290
3276
|
export interface AddEventData {
|
|
@@ -3585,34 +3571,18 @@ export interface AddEventData {
|
|
|
3585
3571
|
streetAddress?: string;
|
|
3586
3572
|
};
|
|
3587
3573
|
scope: "";
|
|
3588
|
-
[k: string]: unknown;
|
|
3589
|
-
}
|
|
3590
|
-
export interface DeletePoiData {
|
|
3591
3574
|
/**
|
|
3592
|
-
*
|
|
3575
|
+
* Slug du costum d'origine
|
|
3593
3576
|
*/
|
|
3594
|
-
|
|
3595
|
-
pathParams?: {
|
|
3596
|
-
/**
|
|
3597
|
-
* ID de l'élément à supprimer
|
|
3598
|
-
*/
|
|
3599
|
-
id: string;
|
|
3600
|
-
[k: string]: unknown;
|
|
3601
|
-
};
|
|
3602
|
-
[k: string]: unknown;
|
|
3603
|
-
}
|
|
3604
|
-
export interface DeleteEventData {
|
|
3577
|
+
costumSlug?: string;
|
|
3605
3578
|
/**
|
|
3606
|
-
*
|
|
3579
|
+
* ID Mongo du costum d'origine
|
|
3607
3580
|
*/
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
id: string;
|
|
3614
|
-
[k: string]: unknown;
|
|
3615
|
-
};
|
|
3581
|
+
costumId?: string;
|
|
3582
|
+
/**
|
|
3583
|
+
* Type d'entité du costum (ex: projects)
|
|
3584
|
+
*/
|
|
3585
|
+
costumType?: string;
|
|
3616
3586
|
[k: string]: unknown;
|
|
3617
3587
|
}
|
|
3618
3588
|
export interface DeleteElementData {
|
|
@@ -3880,6 +3850,18 @@ export interface AddBadgesData {
|
|
|
3880
3850
|
name?: string;
|
|
3881
3851
|
};
|
|
3882
3852
|
};
|
|
3853
|
+
/**
|
|
3854
|
+
* Slug du costum d'origine
|
|
3855
|
+
*/
|
|
3856
|
+
costumSlug?: string;
|
|
3857
|
+
/**
|
|
3858
|
+
* ID Mongo du costum d'origine
|
|
3859
|
+
*/
|
|
3860
|
+
costumId?: string;
|
|
3861
|
+
/**
|
|
3862
|
+
* Type d'entité du costum (ex: projects)
|
|
3863
|
+
*/
|
|
3864
|
+
costumType?: string;
|
|
3883
3865
|
[k: string]: unknown;
|
|
3884
3866
|
}
|
|
3885
3867
|
export interface AssignBadgesData {
|
|
@@ -6105,5 +6087,28 @@ export interface AddClassifiedData {
|
|
|
6105
6087
|
streetAddress?: string;
|
|
6106
6088
|
};
|
|
6107
6089
|
scope: "";
|
|
6090
|
+
/**
|
|
6091
|
+
* Slug du costum d'origine
|
|
6092
|
+
*/
|
|
6093
|
+
costumSlug?: string;
|
|
6094
|
+
/**
|
|
6095
|
+
* ID Mongo du costum d'origine
|
|
6096
|
+
*/
|
|
6097
|
+
costumId?: string;
|
|
6098
|
+
/**
|
|
6099
|
+
* Type d'entité du costum (ex: projects)
|
|
6100
|
+
*/
|
|
6101
|
+
costumType?: string;
|
|
6102
|
+
[k: string]: unknown;
|
|
6103
|
+
}
|
|
6104
|
+
export interface PersonActivateData {
|
|
6105
|
+
/**
|
|
6106
|
+
* Identifiant (_id) du compte à activer
|
|
6107
|
+
*/
|
|
6108
|
+
user: string;
|
|
6109
|
+
/**
|
|
6110
|
+
* Clé de validation = sha256(user + email)
|
|
6111
|
+
*/
|
|
6112
|
+
validationKey: string;
|
|
6108
6113
|
[k: string]: unknown;
|
|
6109
6114
|
}
|
package/types/api/Event.d.ts
CHANGED
|
@@ -15,6 +15,20 @@ export declare class Event extends BaseEntity<EventItemNormalized> {
|
|
|
15
15
|
_add: (payload: Record<string, any>) => Promise<void>;
|
|
16
16
|
_update: (payload: Record<string, any>) => Promise<boolean>;
|
|
17
17
|
addEvent(data?: Partial<AddEventData>): Promise<unknown>;
|
|
18
|
+
/**
|
|
19
|
+
* Supprime cet événement via `DELETE_ELEMENT` (`type=events`).
|
|
20
|
+
*
|
|
21
|
+
* **Garde** : auteur de l'événement (`serverData.creator`) OU administrateur
|
|
22
|
+
* de l'organisation/projet organisateur (via `serverData.organizer` × hiérarchie).
|
|
23
|
+
* cf. {@link BaseEntity#_deleteViaElement}.
|
|
24
|
+
*
|
|
25
|
+
* Après succès : données vidées + `_isDeleted = true`.
|
|
26
|
+
*
|
|
27
|
+
* @param reason - Raison transmise au backend (audit). Défaut `"delete event"`.
|
|
28
|
+
* @throws {ApiError} 400 si l'événement n'a pas d'id.
|
|
29
|
+
* @throws {ApiError} 403 si ni auteur ni admin de l'organisateur.
|
|
30
|
+
*/
|
|
31
|
+
delete(reason?: string): Promise<void>;
|
|
18
32
|
getOrganizations(): Promise<never>;
|
|
19
33
|
getProjects(): Promise<never>;
|
|
20
34
|
getEvents(): Promise<never>;
|
|
@@ -156,6 +156,23 @@ export declare class Organization extends BaseEntity<OrganizationItemNormalized>
|
|
|
156
156
|
* @throws {ApiError} - Si l'utilisateur n'est pas connecté ou si l'entité n'est pas enregistrée.
|
|
157
157
|
*/
|
|
158
158
|
addOrganization(data: AddOrganizationData): Promise<unknown>;
|
|
159
|
+
/**
|
|
160
|
+
* Supprime cette organisation via `DELETE_ELEMENT` (`type=organizations`).
|
|
161
|
+
*
|
|
162
|
+
* **Garde** : auteur (`serverData.creator`) OU administrateur direct de l'org
|
|
163
|
+
* (`userContext.links.memberOf[id].isAdmin`). Pas de hiérarchie parent (une org
|
|
164
|
+
* est racine). cf. {@link BaseEntity#_deleteViaElement}.
|
|
165
|
+
*
|
|
166
|
+
* ⚠️ **Destructif** : supprime l'organisation et potentiellement ses rattachements
|
|
167
|
+
* (projets/events/membres) côté serveur. À utiliser avec précaution.
|
|
168
|
+
*
|
|
169
|
+
* Après succès : données vidées + `_isDeleted = true`.
|
|
170
|
+
*
|
|
171
|
+
* @param reason - Raison transmise au backend (audit). Défaut `"delete organization"`.
|
|
172
|
+
* @throws {ApiError} 400 si l'org n'a pas d'id.
|
|
173
|
+
* @throws {ApiError} 403 si ni auteur ni admin.
|
|
174
|
+
*/
|
|
175
|
+
delete(reason?: string): Promise<void>;
|
|
159
176
|
getOrganizations(): Promise<never>;
|
|
160
177
|
/**
|
|
161
178
|
* {@inheritDoc BaseEntity#getProjects}
|
package/types/api/Poi.d.ts
CHANGED
|
@@ -49,6 +49,20 @@ export declare class Poi extends BaseEntity<PoiItemNormalized> {
|
|
|
49
49
|
*/
|
|
50
50
|
protected _invokeCustomFieldHandler(methodName: string, value: any, fieldName: string): Promise<any>;
|
|
51
51
|
addPoi(data?: Partial<AddPoiData>): Promise<unknown>;
|
|
52
|
+
/**
|
|
53
|
+
* Supprime ce POI via `DELETE_ELEMENT` (`type=poi`).
|
|
54
|
+
*
|
|
55
|
+
* **Garde** : auteur du POI (`serverData.creator`) OU administrateur de
|
|
56
|
+
* l'organisation/projet parent (via `serverData.parent` × hiérarchie).
|
|
57
|
+
* cf. {@link BaseEntity#_deleteViaElement}.
|
|
58
|
+
*
|
|
59
|
+
* Après succès : données vidées + `_isDeleted = true`.
|
|
60
|
+
*
|
|
61
|
+
* @param reason - Raison transmise au backend (audit). Défaut `"delete poi"`.
|
|
62
|
+
* @throws {ApiError} 400 si le POI n'a pas d'id.
|
|
63
|
+
* @throws {ApiError} 403 si ni auteur ni admin du parent.
|
|
64
|
+
*/
|
|
65
|
+
delete(reason?: string): Promise<void>;
|
|
52
66
|
getOrganizations(): Promise<never>;
|
|
53
67
|
getProjects(): Promise<never>;
|
|
54
68
|
getEvents(): Promise<never>;
|
package/types/api/Project.d.ts
CHANGED
|
@@ -32,6 +32,23 @@ export declare class Project extends BaseEntity<ProjectItemNormalized> {
|
|
|
32
32
|
* @throws {ApiError} - Si l'utilisateur n'est pas connecté ou si l'entité n'est pas enregistrée.
|
|
33
33
|
*/
|
|
34
34
|
addProject(data?: Partial<AddProjectData>): Promise<unknown>;
|
|
35
|
+
/**
|
|
36
|
+
* Supprime ce projet via `DELETE_ELEMENT` (`type=projects`).
|
|
37
|
+
*
|
|
38
|
+
* **Garde** : auteur (`serverData.creator`) OU administrateur — direct
|
|
39
|
+
* (`links.projects[id].isAdmin`) ou de l'organisation parente (via
|
|
40
|
+
* `serverData.parent` × hiérarchie). cf. {@link BaseEntity#_deleteViaElement}.
|
|
41
|
+
*
|
|
42
|
+
* ⚠️ **Destructif** : supprime le projet et potentiellement ses rattachements
|
|
43
|
+
* (actions/events/membres) côté serveur. À utiliser avec précaution.
|
|
44
|
+
*
|
|
45
|
+
* Après succès : données vidées + `_isDeleted = true`.
|
|
46
|
+
*
|
|
47
|
+
* @param reason - Raison transmise au backend (audit). Défaut `"delete project"`.
|
|
48
|
+
* @throws {ApiError} 400 si le projet n'a pas d'id.
|
|
49
|
+
* @throws {ApiError} 403 si ni auteur ni admin.
|
|
50
|
+
*/
|
|
51
|
+
delete(reason?: string): Promise<void>;
|
|
35
52
|
getOrganizations(): Promise<never>;
|
|
36
53
|
/**
|
|
37
54
|
* {@inheritDoc BaseEntity#getProjects}
|
package/types/api/UserApi.d.ts
CHANGED
|
@@ -61,4 +61,22 @@ export declare class UserApi {
|
|
|
61
61
|
* @throws {ApiResponseError} Si l'API retourne un échec (`result === false`).
|
|
62
62
|
*/
|
|
63
63
|
recoverPassword(email: string): Promise<any>;
|
|
64
|
+
/**
|
|
65
|
+
* Active (valide l'email) un compte via le lien reçu par email.
|
|
66
|
+
*
|
|
67
|
+
* Endpoint public (aucune authentification requise). La `validationKey`
|
|
68
|
+
* correspond à `sha256(user + email)`. En cas de succès, le rôle
|
|
69
|
+
* `tobeactivated` est retiré et le consentement `sendMail.source` posé.
|
|
70
|
+
*
|
|
71
|
+
* @param params
|
|
72
|
+
* @param params.user - Identifiant (`_id`) du compte à activer.
|
|
73
|
+
* @param params.validationKey - Clé de validation = `sha256(user + email)`.
|
|
74
|
+
* @returns Réponse brute de l'API (`{ result: true, msg: string }`).
|
|
75
|
+
* @throws {ApiError} En cas de mise en file (offline/circuit breaker).
|
|
76
|
+
* @throws {ApiResponseError} Si l'API retourne un échec (`result === false`).
|
|
77
|
+
*/
|
|
78
|
+
activateAccount({ user, validationKey }: {
|
|
79
|
+
user: string;
|
|
80
|
+
validationKey: string;
|
|
81
|
+
}): Promise<any>;
|
|
64
82
|
}
|