@communecter/cocolight-api-client 1.0.62 → 1.0.64
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 +2 -2
- 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 +1 -0
- package/src/api/Comment.ts +52 -1
- package/src/api/EndpointApi.ts +33 -1
- package/src/api/EndpointApi.types.ts +50 -0
- package/src/api/News.ts +52 -1
- package/src/endpoints.module.ts +8 -1
- package/types/api/Comment.d.ts +21 -0
- package/types/api/EndpointApi.d.ts +21 -1
- package/types/api/EndpointApi.types.d.ts +46 -0
- package/types/api/News.d.ts +21 -0
- package/types/endpoints.module.d.ts +460 -0
|
@@ -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, 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, GetMembersNoAdminData, GetMembersAdminData, GetFriendsAdminData, GetSubscriptionsData, GetSubscriptionsAdminData, GetSubscribersData, GetSubscribersAdminData, GetContributorsNoAdminData, GetContributorsAdminData, GetBadgesData, GetBadgesFiltersData, ConnectData, DisconnectData, GetElementsKeyData, GetFavorisData, DeleteFavorisData, AddFavorisData, AddOrganizationData, AddProjectData, AddPoiData, AddEventData, DeletePoiData, DeleteEventData, DeleteElementData, AddImageElementData, LinkValidateData, SearchMemberAutocompleteData, GetNotificationsData, GetNotificationsCountData, NotificationUpdateData, MarkNotificationAsReadData, ActivitypubSearchData, ActivitypubLinkData, ActivitypubGetCommunityData, GetBadgeData, AddBadgesData, AssignBadgesData, GetEventsData, ShareEventsData, InviteEventData, FollowData, GetCostumJsonData, GlobalAutocompleteCostumData, CostumEventRequestActorsData, CostumEventRequestSubeventsData, CostumEventRequestElementEventData, CostumEventRequestCategoriesData, CostumEventRequestDatesData, CostumEventRequestEventData, CostumEventRequestLinkTlToEventData, CostumEventRequestLoadContextTagData, GetGalleryData, GetAttendeesNoAdminData, GetAttendeesAdminData, CoformAnswersSearchData, CoformAnswersByIdData } from "./EndpointApi.types.js";
|
|
2
|
+
import type { PersonRegisterData, AuthenticateUrlData, RefreshTokenUrlData, PasswordRecoveryData, ServerExchangeTokenData, ChangePasswordData, DeleteAccountData, UpdateSettingsData, UpdateBlockDescriptionData, UpdateBlockInfoData, UpdateBlockSocialData, UpdateBlockLocalityData, UpdateBlockSlugData, CheckData, ProfilImageData, 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, GetMembersNoAdminData, GetMembersAdminData, GetFriendsAdminData, GetSubscriptionsData, GetSubscriptionsAdminData, GetSubscribersData, GetSubscribersAdminData, GetContributorsNoAdminData, GetContributorsAdminData, GetBadgesData, GetBadgesFiltersData, ConnectData, DisconnectData, GetElementsKeyData, GetFavorisData, DeleteFavorisData, AddFavorisData, AddOrganizationData, AddProjectData, AddPoiData, AddEventData, DeletePoiData, DeleteEventData, DeleteElementData, AddImageElementData, LinkValidateData, SearchMemberAutocompleteData, GetNotificationsData, GetNotificationsCountData, NotificationUpdateData, MarkNotificationAsReadData, ActivitypubSearchData, ActivitypubLinkData, ActivitypubGetCommunityData, GetBadgeData, AddBadgesData, AssignBadgesData, GetEventsData, ShareEventsData, InviteEventData, FollowData, GetCostumJsonData, GlobalAutocompleteCostumData, CostumEventRequestActorsData, CostumEventRequestSubeventsData, CostumEventRequestElementEventData, CostumEventRequestCategoriesData, CostumEventRequestDatesData, CostumEventRequestEventData, CostumEventRequestLinkTlToEventData, CostumEventRequestLoadContextTagData, GetGalleryData, GetAttendeesNoAdminData, GetAttendeesAdminData, CoformAnswersSearchData, CoformAnswersByIdData, AddVoteData, AddReportAbuseData } from "./EndpointApi.types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Classe EndpointApi générée automatiquement depuis endpoints-copie.json
|
|
5
5
|
*/
|
|
@@ -999,5 +999,25 @@ export declare class EndpointApi {
|
|
|
999
999
|
* @throws {Error} - En cas d'erreur inattendue.
|
|
1000
1000
|
*/
|
|
1001
1001
|
coformAnswersById(data: CoformAnswersByIdData): Promise<any>;
|
|
1002
|
+
/**
|
|
1003
|
+
* Voter sur un élément (commentaire ou news) : Permet de voter sur un commentaire ou une news en spécifiant un statut de vote
|
|
1004
|
+
* Constant : ADD_VOTE
|
|
1005
|
+
* @param data - Données envoyées à l'API
|
|
1006
|
+
* @returns Les données de réponse.
|
|
1007
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1008
|
+
* @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
|
|
1009
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1010
|
+
*/
|
|
1011
|
+
addVote(data: AddVoteData): Promise<any>;
|
|
1012
|
+
/**
|
|
1013
|
+
* Signaler un abus sur un élément (commentaire ou news) : Permet de signaler un abus sur un commentaire ou une news en spécifiant une raison et un commentaire
|
|
1014
|
+
* Constant : ADD_REPORT_ABUSE
|
|
1015
|
+
* @param data - Données envoyées à l'API
|
|
1016
|
+
* @returns Les données de réponse.
|
|
1017
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1018
|
+
* @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
|
|
1019
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1020
|
+
*/
|
|
1021
|
+
addReportAbuse(data: AddReportAbuseData): Promise<any>;
|
|
1002
1022
|
}
|
|
1003
1023
|
export default EndpointApi;
|
|
@@ -4385,3 +4385,49 @@ export interface CoformAnswersByIdData {
|
|
|
4385
4385
|
fields?: string[];
|
|
4386
4386
|
[k: string]: unknown;
|
|
4387
4387
|
}
|
|
4388
|
+
export interface AddVoteData {
|
|
4389
|
+
/**
|
|
4390
|
+
* ID de l'élément (commentaire ou news) sur lequel voter
|
|
4391
|
+
*/
|
|
4392
|
+
id: string;
|
|
4393
|
+
/**
|
|
4394
|
+
* Type de collection concernée
|
|
4395
|
+
*/
|
|
4396
|
+
collection: "comments" | "news";
|
|
4397
|
+
/**
|
|
4398
|
+
* Type d'action à effectuer (vote)
|
|
4399
|
+
*/
|
|
4400
|
+
action: "vote";
|
|
4401
|
+
details: {
|
|
4402
|
+
/**
|
|
4403
|
+
* Statut du vote (ex: 'like', 'dislike', etc.)
|
|
4404
|
+
*/
|
|
4405
|
+
status: string;
|
|
4406
|
+
};
|
|
4407
|
+
[k: string]: unknown;
|
|
4408
|
+
}
|
|
4409
|
+
export interface AddReportAbuseData {
|
|
4410
|
+
/**
|
|
4411
|
+
* ID de l'élément (commentaire ou news) à signaler
|
|
4412
|
+
*/
|
|
4413
|
+
id: string;
|
|
4414
|
+
/**
|
|
4415
|
+
* Type de collection concernée
|
|
4416
|
+
*/
|
|
4417
|
+
collection: "comments" | "news";
|
|
4418
|
+
/**
|
|
4419
|
+
* Type d'action à effectuer (signalement d'abus)
|
|
4420
|
+
*/
|
|
4421
|
+
action: "reportAbuse";
|
|
4422
|
+
details: {
|
|
4423
|
+
/**
|
|
4424
|
+
* Raison du signalement (requis)
|
|
4425
|
+
*/
|
|
4426
|
+
reason: string;
|
|
4427
|
+
/**
|
|
4428
|
+
* Commentaire expliquant le signalement (optionelle)
|
|
4429
|
+
*/
|
|
4430
|
+
comment?: string;
|
|
4431
|
+
};
|
|
4432
|
+
[k: string]: unknown;
|
|
4433
|
+
}
|
package/types/api/News.d.ts
CHANGED
|
@@ -74,4 +74,25 @@ export declare class News extends BaseEntity<NewsItemNormalized> {
|
|
|
74
74
|
* @throws {Error} - En cas d'erreur inattendue.
|
|
75
75
|
*/
|
|
76
76
|
getComments(): Promise<Comment[]>;
|
|
77
|
+
/**
|
|
78
|
+
* Ajoute un vote sur cette news
|
|
79
|
+
*
|
|
80
|
+
* @param status - Statut du vote (ex: 'like', 'dislike', 'love', etc.)
|
|
81
|
+
* @returns Promise contenant la réponse de l'API après l'ajout du vote
|
|
82
|
+
* @throws {ApiError} Si la news n'a pas d'ID (non enregistrée)
|
|
83
|
+
*/
|
|
84
|
+
addVote(status: string): Promise<unknown>;
|
|
85
|
+
/**
|
|
86
|
+
* Signale un abus sur cette news
|
|
87
|
+
*
|
|
88
|
+
* @param params - Paramètres du signalement
|
|
89
|
+
* @param params.reason - Raison du signalement
|
|
90
|
+
* @param params.comment - Commentaire expliquant le signalement (optionnel)
|
|
91
|
+
* @returns Promise contenant la réponse de l'API après le signalement
|
|
92
|
+
* @throws {ApiError} Si la news n'a pas d'ID (non enregistrée)
|
|
93
|
+
*/
|
|
94
|
+
addReportAbuse({ reason, comment }: {
|
|
95
|
+
reason: string;
|
|
96
|
+
comment?: string;
|
|
97
|
+
}): Promise<unknown>;
|
|
77
98
|
}
|