@communecter/cocolight-api-client 1.0.145 → 1.0.147
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/ApiClient.ts +66 -2
- package/src/api/Answer.ts +114 -1
- package/src/api/EndpointApi.ts +16 -1
- package/src/api/EndpointApi.types.ts +13 -0
- package/src/api/Form.ts +81 -1
- package/src/api/UserApi.ts +30 -0
- package/src/endpoints.module.ts +1 -1
- package/types/ApiClient.d.ts +20 -1
- package/types/api/Answer.d.ts +84 -0
- package/types/api/EndpointApi.d.ts +10 -1
- package/types/api/EndpointApi.types.d.ts +11 -0
- package/types/api/Form.d.ts +51 -0
- package/types/api/UserApi.d.ts +18 -0
- package/types/endpoints.module.d.ts +384 -0
package/types/ApiClient.d.ts
CHANGED
|
@@ -24,6 +24,17 @@ export interface ApiClientOptions {
|
|
|
24
24
|
circuitBreakerThreshold?: number;
|
|
25
25
|
circuitBreakerResetTime?: number;
|
|
26
26
|
fromJSONValue?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Mode de dialogue avec le backend cocolight-backend :
|
|
29
|
+
* - `legacy` (défaut) : réponses byte-compatibles PHP ; la lib applique TOUTES ses
|
|
30
|
+
* normalisations côté client (_transformData/_normalizeJsonData) + validation AJV.
|
|
31
|
+
* - `clean` : envoie `X-Coco-Mode: clean` ; le SERVEUR applique les normalisations et
|
|
32
|
+
* répond {success, data|error}. La lib unwrap l'enveloppe, lève ApiResponseError sur
|
|
33
|
+
* success:false, SAUTE _transformData et la validation AJV (schémas legacy), et revive
|
|
34
|
+
* (dates ISO -> Date, id -> _id ObjectID) pour rendre à l'app le MÊME shape qu'avant.
|
|
35
|
+
* NB : l'intercepteur refresh-token reste en legacy (appel interne sans le header).
|
|
36
|
+
*/
|
|
37
|
+
mode?: "legacy" | "clean";
|
|
27
38
|
tokenStorageStrategy?: TokenStorageStrategy | null;
|
|
28
39
|
}
|
|
29
40
|
/**
|
|
@@ -81,7 +92,8 @@ export default class ApiClient extends EventEmitter {
|
|
|
81
92
|
private _accessToken;
|
|
82
93
|
private _refreshToken;
|
|
83
94
|
private _setUserId;
|
|
84
|
-
|
|
95
|
+
private _mode;
|
|
96
|
+
constructor({ baseURL, accessToken, refreshToken, refreshUrl, endpoints, timeout, debug, maxRetries, circuitBreakerThreshold, circuitBreakerResetTime, fromJSONValue, mode, tokenStorageStrategy }: ApiClientOptions);
|
|
85
97
|
/**
|
|
86
98
|
* Sets the access token for the API client and updates the authorization header.
|
|
87
99
|
*/
|
|
@@ -236,6 +248,13 @@ export default class ApiClient extends EventEmitter {
|
|
|
236
248
|
*
|
|
237
249
|
* @private
|
|
238
250
|
*/
|
|
251
|
+
/**
|
|
252
|
+
* Reviver du mode clean : redonne à l'app le shape exact qu'elle recevait après les
|
|
253
|
+
* normalisations legacy de la lib — dates ISO (champs _dateFields) -> instances Date,
|
|
254
|
+
* `id` oid-hex -> `_id` instance ObjectID (créée via EJSON.fromJSONValue, MÊME chemin
|
|
255
|
+
* que le mode legacy). Le serveur clean a déjà fait tout le reste.
|
|
256
|
+
*/
|
|
257
|
+
private _reviveClean;
|
|
239
258
|
private _transformData;
|
|
240
259
|
/**
|
|
241
260
|
* Normalizes JSON data by transforming specific fields and ensuring URLs are complete.
|
package/types/api/Answer.d.ts
CHANGED
|
@@ -7,6 +7,46 @@ type UploadInput = File | Blob | Buffer | import("stream").Readable;
|
|
|
7
7
|
* Générique : la lib ne fait aucune supposition sur le type des valeurs.
|
|
8
8
|
*/
|
|
9
9
|
export type AllStepsData = Record<string, Record<string, unknown>>;
|
|
10
|
+
/**
|
|
11
|
+
* Une entrée de l'historique d'audit d'une réponse (réponse de
|
|
12
|
+
* `GET_COFORM_ANSWER_HISTORY`). `userName`/`userSlug` sont dénormalisés
|
|
13
|
+
* au moment de la modification : survivent à une suppression de l'user.
|
|
14
|
+
*/
|
|
15
|
+
export interface AnswerChange {
|
|
16
|
+
userId: string;
|
|
17
|
+
userName: string;
|
|
18
|
+
userSlug: string;
|
|
19
|
+
/** Timestamp unix en SECONDES (pas ms) — `new Date(at * 1000)`. */
|
|
20
|
+
at: number;
|
|
21
|
+
/** `""` possible : cast PHP `(string)` avec défaut vide si champ absent. */
|
|
22
|
+
mutationType: "create" | "update" | "";
|
|
23
|
+
changedFields: string[];
|
|
24
|
+
}
|
|
25
|
+
/** Un axe du radar multi-eval (= un input radioNew d'une step donnée). */
|
|
26
|
+
export interface MultiEvalAxis {
|
|
27
|
+
key: string;
|
|
28
|
+
label: string;
|
|
29
|
+
options: string[];
|
|
30
|
+
}
|
|
31
|
+
/** Un dataset = la contribution d'un user à un step (1 dataset = 1 user). */
|
|
32
|
+
export interface MultiEvalDataset {
|
|
33
|
+
userId: string;
|
|
34
|
+
userName: string;
|
|
35
|
+
userSlug: string;
|
|
36
|
+
evaluatedAt: number | null;
|
|
37
|
+
values: Record<string, number>;
|
|
38
|
+
}
|
|
39
|
+
/** Une step avec ses axes et ses contributeurs (élément de `getMultiEvalData`). */
|
|
40
|
+
export interface MultiEvalStepData {
|
|
41
|
+
stepKey: string;
|
|
42
|
+
stepName: string;
|
|
43
|
+
axes: MultiEvalAxis[];
|
|
44
|
+
datasets: MultiEvalDataset[];
|
|
45
|
+
}
|
|
46
|
+
/** Réponse de `Answer.getMultiEvalData()`. */
|
|
47
|
+
export interface MultiEvalDataResponse {
|
|
48
|
+
steps: MultiEvalStepData[];
|
|
49
|
+
}
|
|
10
50
|
/**
|
|
11
51
|
* Valeur d'un upload en attente — objet `{ name?, data: "data:...;base64,..." }`
|
|
12
52
|
* inséré par les inputs uploader avant le pré-upload backend.
|
|
@@ -286,6 +326,50 @@ export declare class Answer extends BaseEntity<AnswerItemNormalized> {
|
|
|
286
326
|
* files[0].docPath; // Chemin relatif (à concaténer avec baseURL pour affichage)
|
|
287
327
|
*/
|
|
288
328
|
getFiles(opts: GetFilesOptions): Promise<AnswerFileItem[]>;
|
|
329
|
+
/**
|
|
330
|
+
* Récupère l'historique d'audit de cette Answer.
|
|
331
|
+
*
|
|
332
|
+
* Trace `create` + `update` triée du plus récent au plus ancien, max 200
|
|
333
|
+
* entrées (cap backend). Auth côté serveur : owner OU canAdminAnswer
|
|
334
|
+
* (admin du parent du form, admin/membre finder selon
|
|
335
|
+
* `membersCanEditSharedAnswer`, ou form `publicCanEditSharedAnswer`).
|
|
336
|
+
*
|
|
337
|
+
* Constant : `GET_COFORM_ANSWER_HISTORY` (POST
|
|
338
|
+
* `/survey/coform/getanswerhistory`, auth bearer).
|
|
339
|
+
*
|
|
340
|
+
* @returns Liste des changements ; tableau vide si l'historique est vide.
|
|
341
|
+
* @throws {ApiError} 400 si Answer sans id.
|
|
342
|
+
* @throws {ApiAuthenticationError} si non connecté.
|
|
343
|
+
*
|
|
344
|
+
* @example
|
|
345
|
+
* const form = await org.form({ id: formId });
|
|
346
|
+
* const answer = await form.answer({ id: answerId });
|
|
347
|
+
* const history = await answer.getHistory();
|
|
348
|
+
* new Date(history[0].at * 1000); // date de la dernière modif (at en SECONDES)
|
|
349
|
+
*/
|
|
350
|
+
getHistory(): Promise<AnswerChange[]>;
|
|
351
|
+
/**
|
|
352
|
+
* Récupère les datasets agrégés des évaluations multiples (radar) de cette
|
|
353
|
+
* Answer. Pour une réponse partagée contenant des inputs `radioNew` avec
|
|
354
|
+
* `activeMultieval: true`, retourne un dataset par contributeur pour
|
|
355
|
+
* chaque step.
|
|
356
|
+
*
|
|
357
|
+
* Constant : `GET_COFORM_MULTIEVAL_DATA` (POST
|
|
358
|
+
* `/survey/coform/getmultievaldata`, auth bearer). Auth côté serveur :
|
|
359
|
+
* owner OU canAdminAnswer.
|
|
360
|
+
*
|
|
361
|
+
* @param opts.stepKey - Optionnel : filtrer aux datasets d'une seule
|
|
362
|
+
* step. Sinon retourne toutes les steps.
|
|
363
|
+
* @throws {ApiError} 400 si Answer sans id.
|
|
364
|
+
* @throws {ApiAuthenticationError} si non connecté.
|
|
365
|
+
*
|
|
366
|
+
* @example
|
|
367
|
+
* const data = await answer.getMultiEvalData();
|
|
368
|
+
* data.steps.forEach(s => renderRadar(s));
|
|
369
|
+
*/
|
|
370
|
+
getMultiEvalData(opts?: {
|
|
371
|
+
stepKey?: string | null;
|
|
372
|
+
}): Promise<MultiEvalDataResponse>;
|
|
289
373
|
/**
|
|
290
374
|
* Upload un fichier rattaché à cette Answer via `COFORM_UPLOAD_ANSWER_FILE`.
|
|
291
375
|
*
|
|
@@ -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, DeletePoiData, DeleteEventData, 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 } from "./EndpointApi.types.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, DeletePoiData, DeleteEventData, 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
|
*/
|
|
@@ -1386,5 +1386,14 @@ export declare class EndpointApi {
|
|
|
1386
1386
|
* @throws {Error} - En cas d'erreur inattendue.
|
|
1387
1387
|
*/
|
|
1388
1388
|
addClassified(data: AddClassifiedData): Promise<any>;
|
|
1389
|
+
/**
|
|
1390
|
+
* 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).
|
|
1391
|
+
* Constant : PERSON_ACTIVATE
|
|
1392
|
+
* @param data - Données envoyées à l'API
|
|
1393
|
+
* @returns Les données de réponse.
|
|
1394
|
+
* @throws {ApiResponseError} - En cas d'erreur détectée dans la réponse.
|
|
1395
|
+
* @throws {Error} - En cas d'erreur inattendue.
|
|
1396
|
+
*/
|
|
1397
|
+
personActivate(data: PersonActivateData): Promise<any>;
|
|
1389
1398
|
}
|
|
1390
1399
|
export default EndpointApi;
|
|
@@ -6107,3 +6107,14 @@ export interface AddClassifiedData {
|
|
|
6107
6107
|
scope: "";
|
|
6108
6108
|
[k: string]: unknown;
|
|
6109
6109
|
}
|
|
6110
|
+
export interface PersonActivateData {
|
|
6111
|
+
/**
|
|
6112
|
+
* Identifiant (_id) du compte à activer
|
|
6113
|
+
*/
|
|
6114
|
+
user: string;
|
|
6115
|
+
/**
|
|
6116
|
+
* Clé de validation = sha256(user + email)
|
|
6117
|
+
*/
|
|
6118
|
+
validationKey: string;
|
|
6119
|
+
[k: string]: unknown;
|
|
6120
|
+
}
|
package/types/api/Form.d.ts
CHANGED
|
@@ -3,6 +3,32 @@ import type { Answer } from "./Answer.js";
|
|
|
3
3
|
import type { PaginatorPage, PaginatorState } from "./BaseEntity.js";
|
|
4
4
|
import type { CoformAnswersSearchData } from "./EndpointApi.types.js";
|
|
5
5
|
import type { CoformCommonTableContributor, FormItemNormalized } from "./serverDataType/Form.js";
|
|
6
|
+
/**
|
|
7
|
+
* Une entrée de catalogue commonTable (une criteria agrégée cross-réponses).
|
|
8
|
+
* `label`/`usage`/`usageKey`/`coeff`/`count` toujours présents (le backend
|
|
9
|
+
* les construit avec défauts) ; `names`/`name` seulement si au moins une
|
|
10
|
+
* réponse `yesOrNo` non vide existe pour la criteria. Les champs echo
|
|
11
|
+
* (`label`, `usage`…) renvoient la valeur stockée brute, sans coercion.
|
|
12
|
+
*/
|
|
13
|
+
export interface CommonTableCatalogEntry {
|
|
14
|
+
label: unknown;
|
|
15
|
+
usage: unknown;
|
|
16
|
+
usageKey: unknown;
|
|
17
|
+
coeff: number | string | boolean | null;
|
|
18
|
+
count: number;
|
|
19
|
+
/** Distribution `{ solutionName → fréquence }` ; absent si aucune réponse. */
|
|
20
|
+
names?: Record<string, number>;
|
|
21
|
+
/** Mode (plus fréquent) de `names` ; présent ssi `names` présent. */
|
|
22
|
+
name?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Catalogue collaboratif des inputs `commonTable` : map
|
|
26
|
+
* `inputKey → (criteriaId → CommonTableCatalogEntry)`. Les entrées sont
|
|
27
|
+
* DIRECTEMENT sous l'inputKey (pas de niveau intermédiaire `entries`).
|
|
28
|
+
* Format aligné sur la réponse backend de `GET_COFORM_CATALOGS`
|
|
29
|
+
* (`getCatalogs` normalise les `[]` PHP — catalogues vides — en `{}`).
|
|
30
|
+
*/
|
|
31
|
+
export type CommonTableCatalogs = Record<string, Record<string, CommonTableCatalogEntry>>;
|
|
6
32
|
export declare class Form extends BaseEntity<FormItemNormalized> {
|
|
7
33
|
static entityType: string;
|
|
8
34
|
static entityTag: string;
|
|
@@ -105,4 +131,29 @@ export declare class Form extends BaseEntity<FormItemNormalized> {
|
|
|
105
131
|
inputKey: string;
|
|
106
132
|
criteriaIds: string | string[];
|
|
107
133
|
}): Promise<CoformCommonTableContributor[]>;
|
|
134
|
+
/**
|
|
135
|
+
* Récupère en UN appel batch les catalogues collaboratifs des inputs
|
|
136
|
+
* `commonTable` de CE formulaire. Pour chaque `inputKey`, retourne les
|
|
137
|
+
* `criterias` agrégées par toutes les réponses + le comptage par
|
|
138
|
+
* `criteriaId`.
|
|
139
|
+
*
|
|
140
|
+
* Constant : `GET_COFORM_CATALOGS` (POST `/survey/coform/getformcatalogs`,
|
|
141
|
+
* auth: none — accessible aux visiteurs anonymes pour pré-remplir les
|
|
142
|
+
* suggestions côté input).
|
|
143
|
+
*
|
|
144
|
+
* Si `inputKeys` est vide, on lève une erreur — le caller doit gate
|
|
145
|
+
* l'appel en amont (cf. `useCoFormCatalogs` qui passe `enabled: false`).
|
|
146
|
+
*
|
|
147
|
+
* @param params.inputKeys - `fieldKey` de tous les inputs commonTable.
|
|
148
|
+
* @returns Map `inputKey → (criteriaId → entry)` ; `{}` pour un inputKey sans données.
|
|
149
|
+
* @throws {ApiError} 400 si Form sans id ou `inputKeys` vide.
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* const form = await api.form({ id: formId });
|
|
153
|
+
* const catalogs = await form.getCatalogs({ inputKeys: ["usagesEtSolutions"] });
|
|
154
|
+
* catalogs["usagesEtSolutions"]; // {criteriaId: {label, count, name?, names?, ...}}
|
|
155
|
+
*/
|
|
156
|
+
getCatalogs(params: {
|
|
157
|
+
inputKeys: string[];
|
|
158
|
+
}): Promise<CommonTableCatalogs>;
|
|
108
159
|
}
|
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
|
}
|