@communecter/cocolight-api-client 1.0.54 → 1.0.56
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/401.cocolight-api-client.browser.js +1 -0
- package/dist/401.cocolight-api-client.cjs +1 -0
- package/dist/401.cocolight-api-client.mjs.js +1 -0
- package/dist/588.cocolight-api-client.browser.js +1 -0
- package/dist/588.cocolight-api-client.cjs +1 -0
- package/dist/588.cocolight-api-client.mjs.js +1 -0
- package/dist/593.cocolight-api-client.browser.js +1 -0
- package/dist/593.cocolight-api-client.cjs +1 -0
- package/dist/593.cocolight-api-client.mjs.js +1 -0
- package/dist/839.cocolight-api-client.browser.js +1 -0
- package/dist/839.cocolight-api-client.cjs +1 -0
- package/dist/839.cocolight-api-client.mjs.js +1 -0
- package/dist/cocolight-api-client.browser.js +3 -3
- 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 +29 -17
- package/src/{Api.js → Api.ts} +85 -95
- package/src/{ApiClient.js → ApiClient.ts} +436 -247
- package/src/EJSONType.ts +103 -0
- package/src/api/{Badge.js → Badge.ts} +56 -45
- package/src/api/BaseEntity.ts +3890 -0
- package/src/api/Comment.ts +200 -0
- package/src/api/{EndpointApi.js → EndpointApi.ts} +363 -297
- package/src/api/EndpointApi.types.ts +4609 -0
- package/src/api/EntityRegistry.ts +203 -0
- package/src/api/Event.ts +332 -0
- package/src/api/News.ts +331 -0
- package/src/api/{Organization.js → Organization.ts} +155 -119
- package/src/api/{Poi.js → Poi.ts} +68 -60
- package/src/api/{Project.js → Project.ts} +150 -127
- package/src/api/{User.js → User.ts} +321 -256
- package/src/api/UserApi.ts +148 -0
- package/src/api/serverDataType/Comment.ts +88 -0
- package/src/api/serverDataType/Event.ts +80 -0
- package/src/api/serverDataType/News.ts +138 -0
- package/src/api/serverDataType/Organization.ts +80 -0
- package/src/api/serverDataType/Project.ts +71 -0
- package/src/api/serverDataType/User.ts +103 -0
- package/src/api/serverDataType/common.ts +80 -0
- package/src/endpoints.module.ts +2621 -0
- package/src/error.ts +86 -0
- package/src/index.ts +86 -0
- package/src/mixin/UserMixin.ts +4 -0
- package/src/types/api-responses.ts +217 -0
- package/src/types/entities.ts +22 -0
- package/src/types/error-guards.ts +230 -0
- package/src/types/index.ts +39 -0
- package/src/types/payloads.ts +21 -0
- package/src/types/transforms.ts +110 -0
- package/src/utils/{FileOfflineStorageStrategy.node.js → FileOfflineStorageStrategy.node.ts} +15 -12
- package/src/utils/{FileStorageStrategy.node.js → FileStorageStrategy.node.ts} +16 -39
- package/src/utils/MultiServerFileStorageStrategy.node.ts +67 -0
- package/src/utils/MultiServerTokenStorageStrategy.ts +139 -0
- package/src/utils/{OfflineClientManager.js → OfflineClientManager.ts} +82 -86
- package/src/utils/OfflineQueueStorageStrategy.ts +47 -0
- package/src/utils/TokenStorage.ts +77 -0
- package/src/utils/compat.ts +12 -0
- package/src/utils/createDefaultMultiServerTokenStorageStrategy.ts +35 -0
- package/src/utils/{createDefaultOfflineStrategy.js → createDefaultOfflineStrategy.ts} +8 -3
- package/src/utils/createDefaultTokenStorageStrategy.ts +33 -0
- package/src/utils/{reactive.js → reactive.ts} +49 -40
- package/src/utils/stream-utils.node.ts +12 -0
- package/types/Api.d.ts +38 -82
- package/types/Api.d.ts.map +1 -0
- package/types/ApiClient.d.ts +244 -184
- package/types/ApiClient.d.ts.map +1 -0
- package/types/EJSONType.d.ts +48 -22
- package/types/EJSONType.d.ts.map +1 -0
- package/types/api/Badge.d.ts +20 -20
- package/types/api/Badge.d.ts.map +1 -0
- package/types/api/BaseEntity.d.ts +751 -446
- package/types/api/BaseEntity.d.ts.map +1 -0
- package/types/api/Comment.d.ts +36 -0
- package/types/api/EndpointApi.d.ts +347 -295
- package/types/api/EndpointApi.d.ts.map +1 -0
- package/types/api/EndpointApi.types.d.ts +3914 -4133
- package/types/api/EntityRegistry.d.ts +18 -16
- package/types/api/EntityRegistry.d.ts.map +1 -0
- package/types/api/Event.d.ts +119 -35
- package/types/api/Event.d.ts.map +1 -0
- package/types/api/News.d.ts +52 -20
- package/types/api/News.d.ts.map +1 -0
- package/types/api/Organization.d.ts +165 -49
- package/types/api/Organization.d.ts.map +1 -0
- package/types/api/Poi.d.ts +51 -22
- package/types/api/Poi.d.ts.map +1 -0
- package/types/api/Project.d.ts +151 -52
- package/types/api/Project.d.ts.map +1 -0
- package/types/api/User.d.ts +222 -93
- package/types/api/User.d.ts.map +1 -0
- package/types/api/UserApi.d.ts +60 -9
- package/types/api/UserApi.d.ts.map +1 -0
- package/types/api/serverDataType/Comment.d.ts +83 -0
- package/types/api/serverDataType/Event.d.ts +67 -0
- package/types/api/serverDataType/News.d.ts +130 -0
- package/types/api/serverDataType/Organization.d.ts +65 -0
- package/types/api/serverDataType/Organization.d.ts.map +1 -0
- package/types/api/serverDataType/Project.d.ts +58 -0
- package/types/api/serverDataType/Project.d.ts.map +1 -0
- package/types/api/serverDataType/User.d.ts +86 -0
- package/types/api/serverDataType/User.d.ts.map +1 -0
- package/types/api/serverDataType/common.d.ts +71 -0
- package/types/api/serverDataType/common.d.ts.map +1 -0
- package/types/endpoints.module.d.ts +6922 -1215
- package/types/endpoints.module.d.ts.map +1 -0
- package/types/error.d.ts +25 -51
- package/types/error.d.ts.map +1 -0
- package/types/index.d.ts +55 -48
- package/types/index.d.ts.map +1 -0
- package/types/mixin/UserMixin.d.ts +1 -1
- package/types/mixin/UserMixin.d.ts.map +1 -0
- package/types/types/api-responses.d.ts +190 -0
- package/types/types/api-responses.d.ts.map +1 -0
- package/types/types/entities.d.ts +17 -0
- package/types/types/entities.d.ts.map +1 -0
- package/types/types/error-guards.d.ts +99 -0
- package/types/types/error-guards.d.ts.map +1 -0
- package/types/types/index.d.ts +7 -0
- package/types/types/payloads.d.ts +17 -0
- package/types/types/payloads.d.ts.map +1 -0
- package/types/types/transforms.d.ts +79 -0
- package/types/types/transforms.d.ts.map +1 -0
- package/types/utils/FileOfflineStorageStrategy.node.d.ts +10 -9
- package/types/utils/FileOfflineStorageStrategy.node.d.ts.map +1 -0
- package/types/utils/FileStorageStrategy.node.d.ts +9 -20
- package/types/utils/FileStorageStrategy.node.d.ts.map +1 -0
- package/types/utils/MultiServerFileStorageStrategy.node.d.ts +13 -18
- package/types/utils/MultiServerFileStorageStrategy.node.d.ts.map +1 -0
- package/types/utils/MultiServerTokenStorageStrategy.d.ts +30 -51
- package/types/utils/MultiServerTokenStorageStrategy.d.ts.map +1 -0
- package/types/utils/OfflineClientManager.d.ts +52 -88
- package/types/utils/OfflineClientManager.d.ts.map +1 -0
- package/types/utils/OfflineQueueStorageStrategy.d.ts +12 -9
- package/types/utils/OfflineQueueStorageStrategy.d.ts.map +1 -0
- package/types/utils/TokenStorage.d.ts +20 -70
- package/types/utils/TokenStorage.d.ts.map +1 -0
- package/types/utils/compat.d.ts +4 -0
- package/types/utils/compat.d.ts.map +1 -0
- package/types/utils/createDefaultMultiServerTokenStorageStrategy.d.ts +2 -11
- package/types/utils/createDefaultMultiServerTokenStorageStrategy.d.ts.map +1 -0
- package/types/utils/createDefaultOfflineStrategy.d.ts +2 -3
- package/types/utils/createDefaultOfflineStrategy.d.ts.map +1 -0
- package/types/utils/createDefaultTokenStorageStrategy.d.ts +2 -12
- package/types/utils/createDefaultTokenStorageStrategy.d.ts.map +1 -0
- package/types/utils/reactive.d.ts +10 -16
- package/types/utils/reactive.d.ts.map +1 -0
- package/types/utils/stream-utils.node.d.ts +3 -2
- package/types/utils/stream-utils.node.d.ts.map +1 -0
- package/dist/123.cocolight-api-client.browser.js +0 -1
- package/dist/123.cocolight-api-client.cjs +0 -1
- package/dist/22.cocolight-api-client.mjs.js +0 -1
- package/dist/339.cocolight-api-client.mjs.js +0 -1
- package/dist/394.cocolight-api-client.browser.js +0 -1
- package/dist/394.cocolight-api-client.cjs +0 -1
- package/dist/405.cocolight-api-client.browser.js +0 -1
- package/dist/405.cocolight-api-client.cjs +0 -1
- package/dist/774.cocolight-api-client.mjs.js +0 -1
- package/dist/790.cocolight-api-client.mjs.js +0 -1
- package/dist/931.cocolight-api-client.browser.js +0 -1
- package/dist/931.cocolight-api-client.cjs +0 -1
- package/src/EJSONType.js +0 -53
- package/src/api/BaseEntity.js +0 -2828
- package/src/api/EntityRegistry.js +0 -152
- package/src/api/Event.js +0 -226
- package/src/api/News.js +0 -244
- package/src/api/UserApi.js +0 -81
- package/src/endpoints.module.js +0 -5
- package/src/error.js +0 -121
- package/src/index.js +0 -97
- package/src/mixin/UserMixin.js +0 -8
- package/src/utils/MultiServerFileStorageStrategy.node.js +0 -87
- package/src/utils/MultiServerTokenStorageStrategy.js +0 -188
- package/src/utils/OfflineQueueStorageStrategy.js +0 -51
- package/src/utils/TokenStorage.js +0 -153
- package/src/utils/createDefaultMultiServerTokenStorageStrategy.js +0 -51
- package/src/utils/createDefaultTokenStorageStrategy.js +0 -49
- package/src/utils/stream-utils.node.js +0 -10
package/types/api/Project.d.ts
CHANGED
|
@@ -1,49 +1,72 @@
|
|
|
1
|
-
|
|
1
|
+
import { BaseEntity } from "./BaseEntity.js";
|
|
2
|
+
import type { PaginatorPage } from "./BaseEntity.js";
|
|
3
|
+
import type { AddProjectData, GetContributorsAdminData, GetContributorsNoAdminData } from "./EndpointApi.types.js";
|
|
4
|
+
import type { Organization } from "./Organization.js";
|
|
5
|
+
import type { User } from "./User.js";
|
|
6
|
+
import type { ProjectTransforms } from "../types/transforms.js";
|
|
7
|
+
type ProjectItemNormalized = import("./serverDataType/Project.js").ProjectItemNormalized;
|
|
8
|
+
export declare class Project extends BaseEntity<ProjectItemNormalized> {
|
|
2
9
|
static entityType: string;
|
|
10
|
+
static entityTag: string;
|
|
3
11
|
static SCHEMA_CONSTANTS: string[];
|
|
4
|
-
static ADD_BLOCKS: Map<
|
|
5
|
-
static UPDATE_BLOCKS: Map<
|
|
6
|
-
defaultFields:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
getPois(data?:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
12
|
+
static ADD_BLOCKS: Map<"PROFIL_IMAGE" | "ADD_PROJECT", "updateImageProfil" | "addProject">;
|
|
13
|
+
static UPDATE_BLOCKS: Map<"UPDATE_BLOCK_DESCRIPTION" | "UPDATE_BLOCK_INFO" | "UPDATE_BLOCK_SOCIAL" | "UPDATE_BLOCK_LOCALITY" | "UPDATE_BLOCK_SLUG" | "PROFIL_IMAGE", "updateImageProfil" | "updateDescription" | "updateSocial" | "updateLocality" | "updateInfo" | "updateSlug">;
|
|
14
|
+
defaultFields: Record<string, any>;
|
|
15
|
+
removeFields: string[];
|
|
16
|
+
transforms: ProjectTransforms;
|
|
17
|
+
_add: (payload: Record<string, any>) => Promise<void>;
|
|
18
|
+
_update: (payload: Record<string, any>) => Promise<boolean>;
|
|
19
|
+
/**
|
|
20
|
+
* Ajoute un projet.
|
|
21
|
+
*
|
|
22
|
+
* @param data - Données du projet à ajouter.
|
|
23
|
+
* @returns - Résultat de l'ajout du projet.
|
|
24
|
+
* @throws {ApiError} - Si l'utilisateur n'est pas connecté ou si l'entité n'est pas enregistrée.
|
|
25
|
+
*/
|
|
26
|
+
addProject(data?: Partial<AddProjectData>): Promise<unknown>;
|
|
27
|
+
getOrganizations(): Promise<never>;
|
|
28
|
+
/**
|
|
29
|
+
* {@inheritDoc BaseEntity#getProjects}
|
|
30
|
+
*
|
|
31
|
+
* Récupère les projets du projet.
|
|
32
|
+
*/
|
|
33
|
+
getProjects(data?: Parameters<BaseEntity<ProjectItemNormalized>["getProjects"]>[0]): Promise<PaginatorPage<Project>>;
|
|
34
|
+
getEvents(): Promise<never>;
|
|
35
|
+
/**
|
|
36
|
+
* {@inheritDoc BaseEntity#getPois}
|
|
37
|
+
*
|
|
38
|
+
* Récupère les points d'intérêt d'un projet.
|
|
39
|
+
*/
|
|
40
|
+
getPois(data?: Parameters<BaseEntity<ProjectItemNormalized>["getPois"]>[0]): Promise<PaginatorPage<import("./Poi.js").Poi>>;
|
|
41
|
+
/**
|
|
42
|
+
* {@inheritDoc BaseEntity#getBadgesIssuer}
|
|
43
|
+
*
|
|
44
|
+
* Récupère les émetteurs de badges d'un projet.
|
|
45
|
+
*/
|
|
46
|
+
getBadgesIssuer(data?: Parameters<BaseEntity<ProjectItemNormalized>["getBadgesIssuer"]>[0]): Promise<PaginatorPage<import("./Badge.js").Badge>>;
|
|
47
|
+
/**
|
|
48
|
+
* {@inheritDoc BaseEntity#getNews}
|
|
49
|
+
*
|
|
50
|
+
* Récupère les actualités d'un projet.
|
|
51
|
+
*/
|
|
52
|
+
getNews(data?: Parameters<BaseEntity<ProjectItemNormalized>["getNews"]>[0]): Promise<import("./News.js").News[]>;
|
|
53
|
+
/**
|
|
54
|
+
* {@inheritDoc BaseEntity#getSubscribers}
|
|
55
|
+
*
|
|
56
|
+
* Récupère les abonnés d'un projet.
|
|
57
|
+
*/
|
|
58
|
+
getSubscribers(data?: Parameters<BaseEntity<ProjectItemNormalized>["getSubscribers"]>[0]): Promise<PaginatorPage<User>>;
|
|
36
59
|
/**
|
|
37
60
|
* Récupérer les contributeurs d'un projet.
|
|
38
61
|
* Constant : GET_CONTRIBUTORS_ADMIN / GET_CONTRIBUTORS_NO_ADMIN
|
|
39
|
-
* @param
|
|
40
|
-
* @param
|
|
41
|
-
* @param
|
|
42
|
-
* @param
|
|
43
|
-
* @param
|
|
44
|
-
* @param
|
|
45
|
-
* @param
|
|
46
|
-
* @returns
|
|
62
|
+
* @param data - Paramètres (partiels) de recherche/pagination.
|
|
63
|
+
* @param options - Options supplémentaires.
|
|
64
|
+
* @param options.toBeValidated - Indique si les contributeurs doivent être validés.
|
|
65
|
+
* @param options.isAdmin - Indique si l'utilisateur est admin.
|
|
66
|
+
* @param options.isInviting - Indique si l'utilisateur est en attente d'invitation.
|
|
67
|
+
* @param options.roles - Liste des rôles à filtrer.
|
|
68
|
+
* @param isNext - Indique si c'est une recherche suivante (pagination).
|
|
69
|
+
* @returns - Un objet contenant le nombre de contributeurs et la liste des contributeurs.
|
|
47
70
|
* @throws {ApiResponseError} - Si une erreur se produit lors de la récupération des contributeurs.
|
|
48
71
|
*
|
|
49
72
|
* @example
|
|
@@ -63,19 +86,95 @@ export class Project extends BaseEntity {
|
|
|
63
86
|
* const invitingContributors = await project.getContributors({}, { isInviting: true });
|
|
64
87
|
*
|
|
65
88
|
*/
|
|
66
|
-
getContributors(data?:
|
|
67
|
-
toBeValidated
|
|
68
|
-
isAdmin
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
89
|
+
getContributors(data?: Partial<GetContributorsAdminData | GetContributorsNoAdminData>, options?: {
|
|
90
|
+
toBeValidated?: boolean;
|
|
91
|
+
isAdmin?: boolean;
|
|
92
|
+
isAdminPending?: boolean;
|
|
93
|
+
isInviting?: boolean;
|
|
94
|
+
roles?: any[];
|
|
95
|
+
}): Promise<PaginatorPage<User | Organization>>;
|
|
96
|
+
/**
|
|
97
|
+
* {@inheritDoc BaseEntity#getGallery}
|
|
98
|
+
*
|
|
99
|
+
* Récupère la galerie d'un projet.
|
|
100
|
+
*/
|
|
101
|
+
getGallery(data?: Parameters<BaseEntity<ProjectItemNormalized>["getGallery"]>[0]): Promise<Record<string, any>>;
|
|
72
102
|
/**
|
|
103
|
+
* {@inheritDoc BaseEntity#project}
|
|
104
|
+
*
|
|
73
105
|
* Crée une instance de projet et récupère son profil si nécessaire.
|
|
106
|
+
*/
|
|
107
|
+
project(projectData?: Parameters<BaseEntity<ProjectItemNormalized>["project"]>[0]): Promise<Project>;
|
|
108
|
+
/**
|
|
109
|
+
* {@inheritDoc BaseEntity#poi}
|
|
110
|
+
*
|
|
111
|
+
* Crée une instance de POI et la récupère si nécessaire.
|
|
112
|
+
*/
|
|
113
|
+
poi(poiData?: Parameters<BaseEntity<ProjectItemNormalized>["poi"]>[0]): Promise<import("./Poi.js").Poi>;
|
|
114
|
+
/**
|
|
115
|
+
* {@inheritDoc BaseEntity#event}
|
|
116
|
+
*
|
|
117
|
+
* Crée une instance d'événement et la récupère si nécessaire.
|
|
118
|
+
*/
|
|
119
|
+
event(eventData?: Parameters<BaseEntity<ProjectItemNormalized>["event"]>[0]): Promise<import("./Event.js").Event>;
|
|
120
|
+
/**
|
|
121
|
+
* {@inheritDoc BaseEntity#badge}
|
|
122
|
+
*
|
|
123
|
+
* Crée une instance de badge et la récupère si nécessaire.
|
|
124
|
+
*/
|
|
125
|
+
badge(badgeData?: Parameters<BaseEntity<ProjectItemNormalized>["badge"]>[0]): Promise<import("./Badge.js").Badge>;
|
|
126
|
+
/**
|
|
127
|
+
* {@inheritDoc BaseEntity#news}
|
|
128
|
+
*
|
|
129
|
+
* Crée une instance de news et la récupère si nécessaire.
|
|
130
|
+
*/
|
|
131
|
+
news(newsData?: Parameters<BaseEntity<ProjectItemNormalized>["news"]>[0]): Promise<import("./News.js").News>;
|
|
132
|
+
/**
|
|
133
|
+
* ───────────────────────────────
|
|
134
|
+
* Lien utilisateur ↔ projet
|
|
135
|
+
* (rejoindre, valider, quitter, devenir admin)
|
|
136
|
+
* ───────────────────────────────
|
|
137
|
+
*/
|
|
138
|
+
/**
|
|
139
|
+
* {@inheritDoc BaseEntity#requestToJoin}
|
|
140
|
+
*
|
|
141
|
+
* Envoie une demande pour rejoindre le projet en tant que contributeur.
|
|
142
|
+
* L'action est soumise à validation par un administrateur du projet.
|
|
143
|
+
*/
|
|
144
|
+
requestToJoin(): Promise<unknown>;
|
|
145
|
+
/**
|
|
146
|
+
* {@inheritDoc BaseEntity#requestToJoinAdmin}
|
|
147
|
+
*
|
|
148
|
+
* Envoie une demande pour devenir administrateur du projet.
|
|
149
|
+
* L'action est soumise à validation par un administrateur existant.
|
|
150
|
+
*/
|
|
151
|
+
requestToJoinAdmin(): Promise<unknown>;
|
|
152
|
+
/**
|
|
153
|
+
* {@inheritDoc BaseEntity#acceptInvitation}
|
|
154
|
+
*
|
|
155
|
+
* Accepte une invitation à rejoindre le projet.
|
|
156
|
+
* Cette action valide un lien en attente avec l'option `isInviting`.
|
|
157
|
+
*/
|
|
158
|
+
acceptInvitation(): Promise<unknown>;
|
|
159
|
+
/**
|
|
160
|
+
* {@inheritDoc BaseEntity#leave}
|
|
161
|
+
*
|
|
162
|
+
* Quitte le projet, que ce soit en tant que contributeur ou administrateur.
|
|
163
|
+
* Cette action supprime le lien entre l'utilisateur et le projet.
|
|
164
|
+
*/
|
|
165
|
+
leave(): Promise<unknown>;
|
|
166
|
+
/**
|
|
167
|
+
* {@inheritDoc BaseEntity#follow}
|
|
168
|
+
*
|
|
169
|
+
* Suivre un projet.
|
|
170
|
+
* Cette action permet à l'utilisateur de suivre le projet.
|
|
171
|
+
*/
|
|
172
|
+
follow(): Promise<unknown>;
|
|
173
|
+
/**
|
|
174
|
+
* {@inheritDoc BaseEntity#unfollow}
|
|
74
175
|
*
|
|
75
|
-
*
|
|
76
|
-
* @returns {Promise<Project>} Une promesse qui résout l'objet Projet créé.
|
|
77
|
-
* @throws {Error} Si une erreur se produit lors de la création du projet.
|
|
176
|
+
* Se désabonne d'un projet.
|
|
78
177
|
*/
|
|
79
|
-
|
|
178
|
+
unfollow(): Promise<unknown>;
|
|
80
179
|
}
|
|
81
|
-
|
|
180
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Project.d.ts","sourceRoot":"","sources":["../../src/api/Project.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,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
1
|
-
|
|
2
|
-
|
|
1
|
+
import { BaseEntity } from "./BaseEntity.js";
|
|
2
|
+
import type { Badge } from "./Badge.js";
|
|
3
|
+
import type { PaginatorPage } from "./BaseEntity.js";
|
|
4
|
+
import type { ChangePasswordData, DeleteAccountData, GetSubscriptionsAdminData, GetSubscriptionsData, GetOrganizationsNoAdminData, GetOrganizationsAdminData, GetFriendsAdminData } from "./EndpointApi.types.js";
|
|
5
|
+
import type { Organization } from "./Organization.js";
|
|
6
|
+
type ApiClient = import("../ApiClient.js").default;
|
|
7
|
+
type UserItemNormalized = import("./serverDataType/User.js").UserItemNormalized;
|
|
8
|
+
export declare class User extends BaseEntity<UserItemNormalized> {
|
|
9
|
+
static entityType: "citoyens";
|
|
10
|
+
static entityTag: string;
|
|
3
11
|
static SCHEMA_CONSTANTS: string[];
|
|
4
|
-
static UPDATE_BLOCKS: Map<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* Crée une instance de User.
|
|
8
|
-
*
|
|
9
|
-
* @param {ApiClient} apiClient - Le client API connecté.
|
|
10
|
-
* @param {Object} data - Données initiales (peuvent inclure `id`, `slug`, etc.).
|
|
11
|
-
* @param {string} [data.id] - ID de l'utilisateur.
|
|
12
|
-
* @param {string} [data.slug] - Slug de l'utilisateur.
|
|
13
|
-
* @param {Object} deps - Dépendances injectées.
|
|
14
|
-
* @param {function|object} deps.EndpointApi - Classe ou instance de EndpointApi.
|
|
15
|
-
* @param {function} deps.Organization - Classe Organization.
|
|
16
|
-
* @param {function} deps.Project - Classe Project.
|
|
17
|
-
* @param {function} deps.Event - Classe Events.
|
|
18
|
-
* @param {function} deps.Poi - Classe Poi.
|
|
19
|
-
* @param {function} deps.Badge - Classe Badge.
|
|
20
|
-
* @param {function} deps.News - Classe News.
|
|
21
|
-
*
|
|
22
|
-
* @throws {ApiError} - Si des dépendances nécessaires sont manquantes ou invalides.
|
|
23
|
-
*/
|
|
24
|
-
constructor(parent: any, data?: {
|
|
25
|
-
id?: string;
|
|
26
|
-
slug?: string;
|
|
27
|
-
}, deps?: {
|
|
28
|
-
EndpointApi: Function | object;
|
|
29
|
-
Organization: Function;
|
|
30
|
-
Project: Function;
|
|
31
|
-
Event: Function;
|
|
32
|
-
Poi: Function;
|
|
33
|
-
Badge: Function;
|
|
34
|
-
News: Function;
|
|
35
|
-
});
|
|
36
|
-
defaultFields: {
|
|
37
|
-
typeElement: string;
|
|
38
|
-
};
|
|
12
|
+
static UPDATE_BLOCKS: Map<"UPDATE_BLOCK_DESCRIPTION" | "UPDATE_BLOCK_INFO" | "UPDATE_BLOCK_SOCIAL" | "UPDATE_BLOCK_LOCALITY" | "UPDATE_BLOCK_SLUG" | "PROFIL_IMAGE", "updateImageProfil" | "updateDescription" | "updateSocial" | "updateLocality" | "updateInfo" | "updateSlug">;
|
|
13
|
+
defaultFields: Record<string, any>;
|
|
14
|
+
removeFields: string[];
|
|
39
15
|
transforms: {
|
|
40
16
|
github: (val: any, full: any) => any;
|
|
41
17
|
gitlab: (val: any, full: any) => any;
|
|
@@ -47,117 +23,238 @@ export class User extends BaseEntity {
|
|
|
47
23
|
telegram: (val: any, full: any) => any;
|
|
48
24
|
signal: (val: any, full: any) => any;
|
|
49
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* Crée une instance de `User`.
|
|
28
|
+
*
|
|
29
|
+
* @param parent
|
|
30
|
+
* L'ApiClient, une entité parente, ou tout objet exposant `apiClient`.
|
|
31
|
+
* @param {{ id?: string, slug?: string }} data Données initiales (il faut au moins `id` OU `slug`).
|
|
32
|
+
* @param {{
|
|
33
|
+
* EndpointApi: EndpointApiDep,
|
|
34
|
+
* Organization: typeof import("./Organization.js").Organization,
|
|
35
|
+
* Project: typeof import("./Project.js").Project,
|
|
36
|
+
* Event: typeof import("./Event.js").Event,
|
|
37
|
+
* Poi: typeof import("./Poi.js").Poi,
|
|
38
|
+
* Badge: typeof import("./Badge.js").Badge,
|
|
39
|
+
* News: typeof import("./News.js").News
|
|
40
|
+
* }} deps
|
|
41
|
+
* @throws {ApiError} Si `EndpointApi` n'est pas injecté, ou si `id`/`slug` manquent,
|
|
42
|
+
* ou si une des classes dépendantes n'est pas injectée.
|
|
43
|
+
*/
|
|
44
|
+
constructor(parent: ApiClient | any, data: {
|
|
45
|
+
id?: string;
|
|
46
|
+
slug?: string;
|
|
47
|
+
}, deps: {
|
|
48
|
+
EndpointApi: any;
|
|
49
|
+
Organization: typeof import("./Organization.js").Organization;
|
|
50
|
+
Project: typeof import("./Project.js").Project;
|
|
51
|
+
Event: typeof import("./Event.js").Event;
|
|
52
|
+
Poi: typeof import("./Poi.js").Poi;
|
|
53
|
+
Badge: typeof import("./Badge.js").Badge;
|
|
54
|
+
News: typeof import("./News.js").News;
|
|
55
|
+
Comment: typeof import("./Comment.js").Comment;
|
|
56
|
+
});
|
|
50
57
|
get slug(): any;
|
|
58
|
+
get isMe(): boolean;
|
|
51
59
|
get parentIsMe(): boolean;
|
|
52
60
|
get isActingUser(): boolean;
|
|
61
|
+
/** @returns {"citoyens"} */
|
|
62
|
+
getEntityType(): "citoyens";
|
|
63
|
+
/**
|
|
64
|
+
* Récupère le profil complet de l'utilisateur.
|
|
65
|
+
* Si l'utilisateur est connecté, on appelle le endpoint ME_INFO_URL,
|
|
66
|
+
* sinon, on peut imaginer appeler un endpoint public.
|
|
67
|
+
*
|
|
68
|
+
* @returns Le profil complet.
|
|
69
|
+
*/
|
|
70
|
+
get(): Promise<Record<string, any>>;
|
|
53
71
|
/**
|
|
54
72
|
* Changer le mot de passe : Permet de changer le mot de passe d'un utilisateur.
|
|
55
73
|
* Constant : CHANGE_PASSWORD
|
|
74
|
+
* @param data - Données envoyées à l'API
|
|
75
|
+
* @returns - Les données de réponse.
|
|
76
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
77
|
+
* @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
|
|
78
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
56
79
|
*/
|
|
57
|
-
changePassword(data
|
|
80
|
+
changePassword(data: ChangePasswordData): Promise<unknown>;
|
|
58
81
|
/**
|
|
59
82
|
* Supprimer un compte : Permet de supprimer un compte utilisateur.
|
|
60
83
|
* Constant : DELETE_ACCOUNT
|
|
84
|
+
* @param data - Données envoyées à l'API
|
|
85
|
+
* @returns - Les données de réponse.
|
|
86
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
87
|
+
* @throws {ApiAuthenticationError} - En cas d'erreur d'authentification.
|
|
88
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
89
|
+
*/
|
|
90
|
+
delete(data: DeleteAccountData): Promise<unknown>;
|
|
91
|
+
/**
|
|
92
|
+
* Sauvegarde les modifications de l'utilisateur en appelant les endpoints correspondants.
|
|
93
|
+
* Seul l'utilisateur connecté peut se modifier lui-même.
|
|
94
|
+
*
|
|
95
|
+
* @returns - Données serveur mises à jour si applicable.
|
|
96
|
+
* @throws {ApiError} - Si l'utilisateur n'est pas autorisé.
|
|
61
97
|
*/
|
|
62
|
-
|
|
63
|
-
_add()
|
|
98
|
+
save(): Promise<Record<string, any>>;
|
|
99
|
+
_add: () => Promise<never>;
|
|
64
100
|
/**
|
|
65
101
|
* Met à jour les blocs modifiés de l'utilisateur via les constantes de schéma définies.
|
|
66
102
|
*
|
|
67
|
-
* @param
|
|
68
|
-
* @returns
|
|
103
|
+
* @param payload - Données courantes à comparer et envoyer.
|
|
104
|
+
* @returns - Indique s'il y a eu une modification réelle.
|
|
105
|
+
* @throws {ApiError} - Si l'utilisateur n'est pas autorisé à effectuer cette action.
|
|
69
106
|
*/
|
|
70
|
-
_update(payload: any)
|
|
107
|
+
_update: (payload: Record<string, any>) => Promise<boolean>;
|
|
108
|
+
static fromServerData(data: any, parent: any, deps: any): User;
|
|
71
109
|
/**
|
|
110
|
+
* {@inheritDoc BaseEntity#updateSettings}
|
|
111
|
+
*
|
|
72
112
|
* Mettre à jour les paramètres utilisateur : Mise à jour des paramètres spécifiques d'un utilisateur.
|
|
73
|
-
* Constant : UPDATE_SETTINGS
|
|
74
|
-
* @param {Object} data - Données à mettre à jour.
|
|
75
|
-
* @param {"birthDate"|"email"|"locality"|"phone"|"directory"} data.type - Type de paramètre à mettre à jour.
|
|
76
|
-
* @param {"private"|"public"|"mask"} data.value - Nouvelle valeur du paramètre.
|
|
77
|
-
* @returns {Promise<void>} - Résultat de la mise à jour.
|
|
78
113
|
*/
|
|
79
|
-
updateSettings(data
|
|
80
|
-
type: "birthDate" | "email" | "locality" | "phone" | "directory";
|
|
81
|
-
value: "private" | "public" | "mask";
|
|
82
|
-
}): Promise<void>;
|
|
114
|
+
updateSettings(data: Parameters<BaseEntity<UserItemNormalized>["updateSettings"]>[0]): Promise<unknown>;
|
|
83
115
|
/**
|
|
116
|
+
* {@inheritDoc BaseEntity#updateDescription}
|
|
117
|
+
*
|
|
84
118
|
* Mettre à jour la description d'un élément : Permet de mettre à jour la description courte et complète d'un élément.
|
|
85
|
-
* Constant : UPDATE_BLOCK_DESCRIPTION
|
|
86
119
|
*/
|
|
87
|
-
updateDescription(data
|
|
120
|
+
updateDescription(data: Parameters<BaseEntity<UserItemNormalized>["updateDescription"]>[0]): Promise<unknown>;
|
|
88
121
|
/**
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}): Promise<any>;
|
|
122
|
+
* {@inheritDoc BaseEntity#updateInfo}
|
|
123
|
+
*
|
|
124
|
+
* Mettre à jour les informations d'un élément : Permet de mettre à jour les informations générales d'un élément (nom, contacts, etc.).
|
|
125
|
+
*/
|
|
126
|
+
updateInfo(data: Parameters<BaseEntity<UserItemNormalized>["updateInfo"]>[0]): Promise<unknown>;
|
|
95
127
|
/**
|
|
128
|
+
* {@inheritDoc BaseEntity#updateSocial}
|
|
129
|
+
*
|
|
130
|
+
* Mettre à jour les réseaux sociaux d'un élément : Permet de mettre à jour les liens vers les réseaux sociaux d'un élément.
|
|
131
|
+
*/
|
|
132
|
+
updateSocial(data: Parameters<BaseEntity<UserItemNormalized>["updateSocial"]>[0]): Promise<unknown>;
|
|
133
|
+
/**
|
|
134
|
+
* {@inheritDoc BaseEntity#updateLocality}
|
|
135
|
+
*
|
|
136
|
+
* Mettre à jour les localités d'un élément : Permet de mettre à jour l'adresse et les informations géographiques d'un élément.
|
|
137
|
+
*/
|
|
138
|
+
updateLocality(data: Parameters<BaseEntity<UserItemNormalized>["updateLocality"]>[0]): Promise<unknown>;
|
|
139
|
+
/**
|
|
140
|
+
* {@inheritDoc BaseEntity#updateSlug}
|
|
141
|
+
*
|
|
142
|
+
* Mettre à jour le slug d'un élément : Permet de mettre à jour le slug pour une URL simplifiée.
|
|
143
|
+
*/
|
|
144
|
+
updateSlug(data: Parameters<BaseEntity<UserItemNormalized>["updateSlug"]>[0]): Promise<unknown>;
|
|
145
|
+
/**
|
|
146
|
+
* {@inheritDoc BaseEntity#updateImageProfil}
|
|
147
|
+
*
|
|
96
148
|
* Mettre à jour l'image de profil : Permet de mettre à jour l'image de profil d'un utilisateur ou d'une entité.
|
|
97
|
-
* Constant : PROFIL_IMAGE
|
|
98
149
|
*/
|
|
99
|
-
updateImageProfil(
|
|
100
|
-
profil_avatar: any;
|
|
101
|
-
}): Promise<any>;
|
|
150
|
+
updateImageProfil(data: Parameters<BaseEntity<UserItemNormalized>["updateImageProfil"]>[0]): Promise<unknown>;
|
|
102
151
|
/**
|
|
152
|
+
* {@inheritDoc BaseEntity#getOrganizations}
|
|
153
|
+
* @param [data]
|
|
154
|
+
*
|
|
103
155
|
* Récupérer les organisations d'un utilisateur : Récupère la liste des organisations auxquelles l'utilisateur appartient.
|
|
104
156
|
* Constant : GET_ORGANIZATIONS_ADMIN | GET_ORGANIZATIONS_NO_ADMIN
|
|
105
157
|
*/
|
|
106
|
-
getOrganizations(data?:
|
|
158
|
+
getOrganizations(data?: Partial<GetOrganizationsAdminData | GetOrganizationsNoAdminData>): Promise<PaginatorPage<Organization>>;
|
|
107
159
|
/**
|
|
160
|
+
* {@inheritDoc BaseEntity#getProjects}
|
|
161
|
+
*
|
|
108
162
|
* Récupérer les projets d'un utilisateur : Récupère la liste des projets auxquels l'utilisateur contribue.
|
|
109
|
-
* Constant : GET_PROJECTS_ADMIN | GET_PROJECTS_NO_ADMIN
|
|
110
163
|
*/
|
|
111
|
-
getProjects(data?:
|
|
164
|
+
getProjects(data?: Parameters<BaseEntity<UserItemNormalized>["getProjects"]>[0]): Promise<PaginatorPage<import("./Project.js").Project>>;
|
|
112
165
|
/**
|
|
166
|
+
* {@inheritDoc BaseEntity#getPois}
|
|
167
|
+
*
|
|
113
168
|
* Récupérer les POIs
|
|
114
|
-
* Constant : GET_POIS_NO_ADMIN / GET_POIS_ADMIN
|
|
115
169
|
*/
|
|
116
|
-
getPois(data?:
|
|
170
|
+
getPois(data?: Parameters<BaseEntity<UserItemNormalized>["getPois"]>[0]): Promise<PaginatorPage<import("./Poi.js").Poi>>;
|
|
117
171
|
/**
|
|
172
|
+
* {@inheritDoc BaseEntity#getNews}
|
|
173
|
+
*
|
|
118
174
|
* Récupérer les actualités : Récupère la liste des actualités liées à l'utilisateur.
|
|
119
|
-
* Constant : GET_NEWS
|
|
120
175
|
*/
|
|
121
|
-
getNews(data?:
|
|
176
|
+
getNews(data?: Parameters<BaseEntity<UserItemNormalized>["getNews"]>[0]): Promise<import("./News.js").News[]>;
|
|
122
177
|
/**
|
|
123
178
|
* Récupérer les amis administrables : Récupère les amis administrée par l’utilisateur.
|
|
124
179
|
* Constant : GET_FRIENDS_ADMIN
|
|
125
180
|
* question : qui peut voir la liste d'amis, seulement l'utilisateur connecté ? ou tous les utilisateurs connectés ?
|
|
126
181
|
* actuellement, c'est tous les utilisateurs connectés
|
|
127
182
|
*/
|
|
128
|
-
getFriends(data?:
|
|
183
|
+
getFriends(data?: Partial<GetFriendsAdminData>): Promise<PaginatorPage<User>>;
|
|
129
184
|
/**
|
|
130
185
|
* Récupérer les suivis
|
|
131
186
|
* Constant : GET_SUBSCRIPTIONS / GET_SUBSCRIPTIONS_ADMIN
|
|
132
187
|
*/
|
|
133
|
-
getSubscriptions(data?:
|
|
188
|
+
getSubscriptions(data?: Partial<GetSubscriptionsAdminData | GetSubscriptionsData>): Promise<PaginatorPage<BaseEntity<any>>>;
|
|
134
189
|
/**
|
|
190
|
+
* {@inheritDoc BaseEntity#getSubscribers}
|
|
191
|
+
*
|
|
135
192
|
* Récupérer les abonnés
|
|
136
|
-
* Constant : GET_SUBSCRIBERS
|
|
137
193
|
*/
|
|
138
|
-
getSubscribers(data?:
|
|
194
|
+
getSubscribers(data?: Parameters<BaseEntity<UserItemNormalized>["getSubscribers"]>[0]): Promise<PaginatorPage<User>>;
|
|
139
195
|
/**
|
|
140
196
|
* Obtenir la liste des événements
|
|
141
197
|
* Constant : GET_EVENTS
|
|
142
198
|
* TODO : il n'est pas fait encore pour GET_EVENTS_ADMIN / GET_EVENTS_NO_ADMIN comme les autres dans endpointApi
|
|
143
199
|
*/
|
|
144
200
|
/**
|
|
201
|
+
* {@inheritDoc BaseEntity#getBadgesIssuer}
|
|
202
|
+
*
|
|
145
203
|
* Liste des badges créés par l'utilisateur
|
|
146
|
-
* Constant : GET_BADGES
|
|
147
204
|
*/
|
|
148
|
-
getBadgesIssuer(data?:
|
|
205
|
+
getBadgesIssuer(data?: Parameters<BaseEntity<UserItemNormalized>["getBadgesIssuer"]>[0]): Promise<PaginatorPage<Badge>>;
|
|
149
206
|
/**
|
|
150
207
|
* Liste des badges associés à l'utilisateur
|
|
151
208
|
*
|
|
152
209
|
* TODO : documenté le fonctionnement et sont utilisation avec un exemple
|
|
153
210
|
*/
|
|
154
|
-
getBadges(filter?:
|
|
211
|
+
getBadges(filter?: Record<string, any>): Promise<Badge[]>;
|
|
155
212
|
/**
|
|
213
|
+
* {@inheritDoc BaseEntity#getGallery}
|
|
214
|
+
*
|
|
156
215
|
* Récupérer la galerie de l'utilisateur
|
|
157
|
-
* Constant : GET_GALLERY
|
|
158
216
|
*/
|
|
159
|
-
getGallery(data?:
|
|
160
|
-
user(userData:
|
|
217
|
+
getGallery(data?: Parameters<BaseEntity<UserItemNormalized>["getGallery"]>[0]): Promise<Record<string, any>>;
|
|
218
|
+
user(userData: {
|
|
219
|
+
id?: string;
|
|
220
|
+
slug?: string;
|
|
221
|
+
}): Promise<User>;
|
|
222
|
+
/**
|
|
223
|
+
* {@inheritDoc BaseEntity#organization}
|
|
224
|
+
*
|
|
225
|
+
* Crée une instance d'organisation et récupère son profil si nécessaire.
|
|
226
|
+
*/
|
|
227
|
+
organization(organizationData?: Parameters<BaseEntity<UserItemNormalized>["organization"]>[0]): Promise<Organization>;
|
|
228
|
+
/**
|
|
229
|
+
* {@inheritDoc BaseEntity#project}
|
|
230
|
+
*
|
|
231
|
+
* Crée une instance de projet et récupère son profil si nécessaire.
|
|
232
|
+
*/
|
|
233
|
+
project(projectData?: Parameters<BaseEntity<UserItemNormalized>["project"]>[0]): Promise<import("./Project.js").Project>;
|
|
234
|
+
/**
|
|
235
|
+
* {@inheritDoc BaseEntity#news}
|
|
236
|
+
*
|
|
237
|
+
* Crée une instance de news et la récupère si nécessaire.
|
|
238
|
+
*/
|
|
239
|
+
news(newsData?: Parameters<BaseEntity<UserItemNormalized>["news"]>[0]): Promise<import("./News.js").News>;
|
|
240
|
+
/**
|
|
241
|
+
* {@inheritDoc BaseEntity#poi}
|
|
242
|
+
*
|
|
243
|
+
* Crée une instance de POI et la récupère si nécessaire.
|
|
244
|
+
*/
|
|
245
|
+
poi(poiData?: Parameters<BaseEntity<UserItemNormalized>["poi"]>[0]): Promise<import("./Poi.js").Poi>;
|
|
246
|
+
/**
|
|
247
|
+
* {@inheritDoc BaseEntity#event}
|
|
248
|
+
*
|
|
249
|
+
* Crée une instance d'événement et la récupère si nécessaire.
|
|
250
|
+
*/
|
|
251
|
+
event(eventData?: Parameters<BaseEntity<UserItemNormalized>["event"]>[0]): Promise<import("./Event.js").Event>;
|
|
252
|
+
/**
|
|
253
|
+
* {@inheritDoc BaseEntity#badge}
|
|
254
|
+
*
|
|
255
|
+
* Crée une instance de badge et la récupère si nécessaire.
|
|
256
|
+
*/
|
|
257
|
+
badge(badgeData?: Parameters<BaseEntity<UserItemNormalized>["badge"]>[0]): Promise<Badge>;
|
|
161
258
|
/**
|
|
162
259
|
* ───────────────────────────────
|
|
163
260
|
* Lien utilisateur ↔ utilisateur (ami)
|
|
@@ -168,36 +265,68 @@ export class User extends BaseEntity {
|
|
|
168
265
|
* Envoie une demande d'amitié à cet utilisateur.
|
|
169
266
|
* L'utilisateur ciblé devra valider la demande pour établir la relation.
|
|
170
267
|
*
|
|
171
|
-
* @returns
|
|
268
|
+
* @returns - Résultat de la requête.
|
|
172
269
|
* @throws {ApiError} - Si l'utilisateur n'est pas connecté ou si l'action est interdite.
|
|
173
270
|
*/
|
|
174
|
-
sendFriendRequest(): Promise<
|
|
271
|
+
sendFriendRequest(): Promise<unknown>;
|
|
175
272
|
/**
|
|
176
273
|
* Accepte une demande d'amitié envoyée par cet utilisateur.
|
|
177
274
|
* Cette action établit un lien entre les deux utilisateurs.
|
|
178
275
|
*
|
|
179
|
-
* @returns
|
|
276
|
+
* @returns - Résultat de la validation du lien.
|
|
180
277
|
* @throws {ApiError} - Si aucune invitation n'est en attente ou si l'action est interdite.
|
|
181
278
|
*/
|
|
182
|
-
acceptFriendRequest(): Promise<
|
|
279
|
+
acceptFriendRequest(): Promise<unknown>;
|
|
183
280
|
/**
|
|
184
281
|
* Supprime la relation d'amitié avec cet utilisateur.
|
|
185
282
|
* Cette action annule tout lien existant entre les deux profils.
|
|
186
283
|
*
|
|
187
|
-
* @returns
|
|
284
|
+
* @returns - Résultat de la suppression.
|
|
188
285
|
* @throws {ApiError} - Si aucune relation n'existe.
|
|
189
286
|
*/
|
|
190
|
-
removeFriend(): Promise<
|
|
191
|
-
requestToJoin():
|
|
192
|
-
requestToJoinAdmin():
|
|
193
|
-
acceptInvitation():
|
|
194
|
-
leave():
|
|
287
|
+
removeFriend(): Promise<unknown>;
|
|
288
|
+
requestToJoin(): Promise<never>;
|
|
289
|
+
requestToJoinAdmin(): Promise<never>;
|
|
290
|
+
acceptInvitation(): Promise<never>;
|
|
291
|
+
leave(): Promise<never>;
|
|
292
|
+
/**
|
|
293
|
+
* Suivre un utilisateur
|
|
294
|
+
* Cette action permet à l'utilisateur connecté de suivre un autre utilisateur.
|
|
295
|
+
* Elle nécessite que l'utilisateur soit connecté.
|
|
296
|
+
*
|
|
297
|
+
* @returns - Résultat de la requête.
|
|
298
|
+
* @throws {ApiError} - Si l'utilisateur n'est pas connecté ou si l'action est interdite.
|
|
299
|
+
*/
|
|
300
|
+
follow(): Promise<unknown>;
|
|
301
|
+
/**
|
|
302
|
+
* Se désabonner d'un utilisateur
|
|
303
|
+
* Cette action permet à l'utilisateur connecté de se désabonner d'un autre utilisateur.
|
|
304
|
+
* Elle nécessite que l'utilisateur soit connecté.
|
|
305
|
+
*
|
|
306
|
+
* @returns - Résultat de la requête.
|
|
307
|
+
* @throws {ApiError} - Si l'utilisateur n'est pas connecté ou si l'action est interdite.
|
|
308
|
+
*/
|
|
309
|
+
unfollow(): Promise<unknown>;
|
|
195
310
|
/**
|
|
196
311
|
* Vérifie si l'utilisateur connecté est ami avec cet utilisateur.
|
|
197
312
|
*
|
|
198
|
-
* @returns
|
|
313
|
+
* @returns - True si l'utilisateur connecté est ami, sinon false.
|
|
199
314
|
* @throws {ApiError} - Si l'utilisateur n'est pas connecté.
|
|
200
315
|
*/
|
|
201
316
|
isFriend(): boolean;
|
|
317
|
+
/**
|
|
318
|
+
* Vérifie si l'utilisateur suit l'entité.
|
|
319
|
+
*
|
|
320
|
+
* @returns - `true` si l'utilisateur suit l'entité, `false` sinon.
|
|
321
|
+
* @throws {ApiError}
|
|
322
|
+
*/
|
|
323
|
+
isFollower(): boolean;
|
|
324
|
+
/**
|
|
325
|
+
* Vérifie si l'utilisateur est abonné à l'entité.
|
|
326
|
+
*
|
|
327
|
+
* @returns - `true` si l'utilisateur est abonné, `false` sinon.
|
|
328
|
+
* @throws {ApiError}
|
|
329
|
+
*/
|
|
330
|
+
isFollowing(): boolean;
|
|
202
331
|
}
|
|
203
|
-
|
|
332
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"User.d.ts","sourceRoot":"","sources":["../../src/api/User.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,KAAK,SAAS,GAAG,OAAO,iBAAiB,EAAE,OAAO,CAAC;AACnD,KAAK,kBAAkB,GAAG,OAAO,0BAA0B,EAAE,kBAAkB,CAAC;AAChF,qBAAa,IAAK,SAAQ,UAAU,CAAC,kBAAkB,CAAC;IAEtD,MAAM,CAAC,UAAU,EAAE,UAAU,CAAc;IAE3C,MAAM,CAAC,SAAS,SAAU;IAE1B,MAAM,CAAC,gBAAgB,EAAE,MAAM,EAAE,CAO/B;IAEF,MAAM,CAAC,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAOtC;IAEH,aAAa,EAAE,GAAG,CAEhB;IAEF,YAAY,EAAE,MAAM,EAAE,CAEpB;IAEF,UAAU,EAAE;QACV,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC;QACrC,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC;QACrC,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC;QACvC,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC;QACtC,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC;QACxC,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC;QACv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