@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.
Files changed (179) hide show
  1. package/dist/401.cocolight-api-client.browser.js +1 -0
  2. package/dist/401.cocolight-api-client.cjs +1 -0
  3. package/dist/401.cocolight-api-client.mjs.js +1 -0
  4. package/dist/588.cocolight-api-client.browser.js +1 -0
  5. package/dist/588.cocolight-api-client.cjs +1 -0
  6. package/dist/588.cocolight-api-client.mjs.js +1 -0
  7. package/dist/593.cocolight-api-client.browser.js +1 -0
  8. package/dist/593.cocolight-api-client.cjs +1 -0
  9. package/dist/593.cocolight-api-client.mjs.js +1 -0
  10. package/dist/839.cocolight-api-client.browser.js +1 -0
  11. package/dist/839.cocolight-api-client.cjs +1 -0
  12. package/dist/839.cocolight-api-client.mjs.js +1 -0
  13. package/dist/cocolight-api-client.browser.js +3 -3
  14. package/dist/cocolight-api-client.cjs +1 -1
  15. package/dist/cocolight-api-client.mjs.js +1 -1
  16. package/dist/cocolight-api-client.vite.mjs.js +1 -1
  17. package/dist/cocolight-api-client.vite.mjs.js.map +1 -1
  18. package/package.json +29 -17
  19. package/src/{Api.js → Api.ts} +85 -95
  20. package/src/{ApiClient.js → ApiClient.ts} +436 -247
  21. package/src/EJSONType.ts +103 -0
  22. package/src/api/{Badge.js → Badge.ts} +56 -45
  23. package/src/api/BaseEntity.ts +3890 -0
  24. package/src/api/Comment.ts +200 -0
  25. package/src/api/{EndpointApi.js → EndpointApi.ts} +363 -297
  26. package/src/api/EndpointApi.types.ts +4609 -0
  27. package/src/api/EntityRegistry.ts +203 -0
  28. package/src/api/Event.ts +332 -0
  29. package/src/api/News.ts +331 -0
  30. package/src/api/{Organization.js → Organization.ts} +155 -119
  31. package/src/api/{Poi.js → Poi.ts} +68 -60
  32. package/src/api/{Project.js → Project.ts} +150 -127
  33. package/src/api/{User.js → User.ts} +321 -256
  34. package/src/api/UserApi.ts +148 -0
  35. package/src/api/serverDataType/Comment.ts +88 -0
  36. package/src/api/serverDataType/Event.ts +80 -0
  37. package/src/api/serverDataType/News.ts +138 -0
  38. package/src/api/serverDataType/Organization.ts +80 -0
  39. package/src/api/serverDataType/Project.ts +71 -0
  40. package/src/api/serverDataType/User.ts +103 -0
  41. package/src/api/serverDataType/common.ts +80 -0
  42. package/src/endpoints.module.ts +2621 -0
  43. package/src/error.ts +86 -0
  44. package/src/index.ts +86 -0
  45. package/src/mixin/UserMixin.ts +4 -0
  46. package/src/types/api-responses.ts +217 -0
  47. package/src/types/entities.ts +22 -0
  48. package/src/types/error-guards.ts +230 -0
  49. package/src/types/index.ts +39 -0
  50. package/src/types/payloads.ts +21 -0
  51. package/src/types/transforms.ts +110 -0
  52. package/src/utils/{FileOfflineStorageStrategy.node.js → FileOfflineStorageStrategy.node.ts} +15 -12
  53. package/src/utils/{FileStorageStrategy.node.js → FileStorageStrategy.node.ts} +16 -39
  54. package/src/utils/MultiServerFileStorageStrategy.node.ts +67 -0
  55. package/src/utils/MultiServerTokenStorageStrategy.ts +139 -0
  56. package/src/utils/{OfflineClientManager.js → OfflineClientManager.ts} +82 -86
  57. package/src/utils/OfflineQueueStorageStrategy.ts +47 -0
  58. package/src/utils/TokenStorage.ts +77 -0
  59. package/src/utils/compat.ts +12 -0
  60. package/src/utils/createDefaultMultiServerTokenStorageStrategy.ts +35 -0
  61. package/src/utils/{createDefaultOfflineStrategy.js → createDefaultOfflineStrategy.ts} +8 -3
  62. package/src/utils/createDefaultTokenStorageStrategy.ts +33 -0
  63. package/src/utils/{reactive.js → reactive.ts} +49 -40
  64. package/src/utils/stream-utils.node.ts +12 -0
  65. package/types/Api.d.ts +38 -82
  66. package/types/Api.d.ts.map +1 -0
  67. package/types/ApiClient.d.ts +244 -184
  68. package/types/ApiClient.d.ts.map +1 -0
  69. package/types/EJSONType.d.ts +48 -22
  70. package/types/EJSONType.d.ts.map +1 -0
  71. package/types/api/Badge.d.ts +20 -20
  72. package/types/api/Badge.d.ts.map +1 -0
  73. package/types/api/BaseEntity.d.ts +751 -446
  74. package/types/api/BaseEntity.d.ts.map +1 -0
  75. package/types/api/Comment.d.ts +36 -0
  76. package/types/api/EndpointApi.d.ts +347 -295
  77. package/types/api/EndpointApi.d.ts.map +1 -0
  78. package/types/api/EndpointApi.types.d.ts +3914 -4133
  79. package/types/api/EntityRegistry.d.ts +18 -16
  80. package/types/api/EntityRegistry.d.ts.map +1 -0
  81. package/types/api/Event.d.ts +119 -35
  82. package/types/api/Event.d.ts.map +1 -0
  83. package/types/api/News.d.ts +52 -20
  84. package/types/api/News.d.ts.map +1 -0
  85. package/types/api/Organization.d.ts +165 -49
  86. package/types/api/Organization.d.ts.map +1 -0
  87. package/types/api/Poi.d.ts +51 -22
  88. package/types/api/Poi.d.ts.map +1 -0
  89. package/types/api/Project.d.ts +151 -52
  90. package/types/api/Project.d.ts.map +1 -0
  91. package/types/api/User.d.ts +222 -93
  92. package/types/api/User.d.ts.map +1 -0
  93. package/types/api/UserApi.d.ts +60 -9
  94. package/types/api/UserApi.d.ts.map +1 -0
  95. package/types/api/serverDataType/Comment.d.ts +83 -0
  96. package/types/api/serverDataType/Event.d.ts +67 -0
  97. package/types/api/serverDataType/News.d.ts +130 -0
  98. package/types/api/serverDataType/Organization.d.ts +65 -0
  99. package/types/api/serverDataType/Organization.d.ts.map +1 -0
  100. package/types/api/serverDataType/Project.d.ts +58 -0
  101. package/types/api/serverDataType/Project.d.ts.map +1 -0
  102. package/types/api/serverDataType/User.d.ts +86 -0
  103. package/types/api/serverDataType/User.d.ts.map +1 -0
  104. package/types/api/serverDataType/common.d.ts +71 -0
  105. package/types/api/serverDataType/common.d.ts.map +1 -0
  106. package/types/endpoints.module.d.ts +6922 -1215
  107. package/types/endpoints.module.d.ts.map +1 -0
  108. package/types/error.d.ts +25 -51
  109. package/types/error.d.ts.map +1 -0
  110. package/types/index.d.ts +55 -48
  111. package/types/index.d.ts.map +1 -0
  112. package/types/mixin/UserMixin.d.ts +1 -1
  113. package/types/mixin/UserMixin.d.ts.map +1 -0
  114. package/types/types/api-responses.d.ts +190 -0
  115. package/types/types/api-responses.d.ts.map +1 -0
  116. package/types/types/entities.d.ts +17 -0
  117. package/types/types/entities.d.ts.map +1 -0
  118. package/types/types/error-guards.d.ts +99 -0
  119. package/types/types/error-guards.d.ts.map +1 -0
  120. package/types/types/index.d.ts +7 -0
  121. package/types/types/payloads.d.ts +17 -0
  122. package/types/types/payloads.d.ts.map +1 -0
  123. package/types/types/transforms.d.ts +79 -0
  124. package/types/types/transforms.d.ts.map +1 -0
  125. package/types/utils/FileOfflineStorageStrategy.node.d.ts +10 -9
  126. package/types/utils/FileOfflineStorageStrategy.node.d.ts.map +1 -0
  127. package/types/utils/FileStorageStrategy.node.d.ts +9 -20
  128. package/types/utils/FileStorageStrategy.node.d.ts.map +1 -0
  129. package/types/utils/MultiServerFileStorageStrategy.node.d.ts +13 -18
  130. package/types/utils/MultiServerFileStorageStrategy.node.d.ts.map +1 -0
  131. package/types/utils/MultiServerTokenStorageStrategy.d.ts +30 -51
  132. package/types/utils/MultiServerTokenStorageStrategy.d.ts.map +1 -0
  133. package/types/utils/OfflineClientManager.d.ts +52 -88
  134. package/types/utils/OfflineClientManager.d.ts.map +1 -0
  135. package/types/utils/OfflineQueueStorageStrategy.d.ts +12 -9
  136. package/types/utils/OfflineQueueStorageStrategy.d.ts.map +1 -0
  137. package/types/utils/TokenStorage.d.ts +20 -70
  138. package/types/utils/TokenStorage.d.ts.map +1 -0
  139. package/types/utils/compat.d.ts +4 -0
  140. package/types/utils/compat.d.ts.map +1 -0
  141. package/types/utils/createDefaultMultiServerTokenStorageStrategy.d.ts +2 -11
  142. package/types/utils/createDefaultMultiServerTokenStorageStrategy.d.ts.map +1 -0
  143. package/types/utils/createDefaultOfflineStrategy.d.ts +2 -3
  144. package/types/utils/createDefaultOfflineStrategy.d.ts.map +1 -0
  145. package/types/utils/createDefaultTokenStorageStrategy.d.ts +2 -12
  146. package/types/utils/createDefaultTokenStorageStrategy.d.ts.map +1 -0
  147. package/types/utils/reactive.d.ts +10 -16
  148. package/types/utils/reactive.d.ts.map +1 -0
  149. package/types/utils/stream-utils.node.d.ts +3 -2
  150. package/types/utils/stream-utils.node.d.ts.map +1 -0
  151. package/dist/123.cocolight-api-client.browser.js +0 -1
  152. package/dist/123.cocolight-api-client.cjs +0 -1
  153. package/dist/22.cocolight-api-client.mjs.js +0 -1
  154. package/dist/339.cocolight-api-client.mjs.js +0 -1
  155. package/dist/394.cocolight-api-client.browser.js +0 -1
  156. package/dist/394.cocolight-api-client.cjs +0 -1
  157. package/dist/405.cocolight-api-client.browser.js +0 -1
  158. package/dist/405.cocolight-api-client.cjs +0 -1
  159. package/dist/774.cocolight-api-client.mjs.js +0 -1
  160. package/dist/790.cocolight-api-client.mjs.js +0 -1
  161. package/dist/931.cocolight-api-client.browser.js +0 -1
  162. package/dist/931.cocolight-api-client.cjs +0 -1
  163. package/src/EJSONType.js +0 -53
  164. package/src/api/BaseEntity.js +0 -2828
  165. package/src/api/EntityRegistry.js +0 -152
  166. package/src/api/Event.js +0 -226
  167. package/src/api/News.js +0 -244
  168. package/src/api/UserApi.js +0 -81
  169. package/src/endpoints.module.js +0 -5
  170. package/src/error.js +0 -121
  171. package/src/index.js +0 -97
  172. package/src/mixin/UserMixin.js +0 -8
  173. package/src/utils/MultiServerFileStorageStrategy.node.js +0 -87
  174. package/src/utils/MultiServerTokenStorageStrategy.js +0 -188
  175. package/src/utils/OfflineQueueStorageStrategy.js +0 -51
  176. package/src/utils/TokenStorage.js +0 -153
  177. package/src/utils/createDefaultMultiServerTokenStorageStrategy.js +0 -51
  178. package/src/utils/createDefaultTokenStorageStrategy.js +0 -49
  179. package/src/utils/stream-utils.node.js +0 -10
@@ -1,9 +1,54 @@
1
+ import { EventEmitter } from "events";
2
+ import { type TokenStorageStrategy } from "./utils/TokenStorage.js";
3
+ /**
4
+ * Résultat retourné quand une requête est **mise en file** (offline ou breaker).
5
+ * Permet de typer précisément les chemins « non-réseau » de `callEndpoint`.
6
+ */
7
+ export interface ApiClientOfflineEnqueueResult {
8
+ data: null;
9
+ offline?: true;
10
+ breaker?: true;
11
+ }
12
+ /**
13
+ * Options de configuration pour ApiClient
14
+ */
15
+ export interface ApiClientOptions {
16
+ baseURL: string;
17
+ accessToken?: string | null;
18
+ refreshToken?: string | null;
19
+ refreshUrl?: string;
20
+ endpoints?: any[];
21
+ timeout?: number;
22
+ debug?: boolean;
23
+ maxRetries?: number;
24
+ circuitBreakerThreshold?: number;
25
+ circuitBreakerResetTime?: number;
26
+ fromJSONValue?: boolean;
27
+ tokenStorageStrategy?: TokenStorageStrategy | null;
28
+ }
29
+ /**
30
+ * Structure des données pour les appels d'endpoint
31
+ */
32
+ export interface CallEndpointData {
33
+ pathParams?: Record<string, any>;
34
+ [key: string]: any;
35
+ }
36
+ /**
37
+ * Résultat d'un appel d'endpoint réussi
38
+ */
39
+ export interface CallEndpointResult<T = any> {
40
+ data: T;
41
+ offline?: never;
42
+ breaker?: never;
43
+ }
44
+ /**
45
+ * Union type pour tous les résultats possibles de callEndpoint
46
+ */
47
+ export type CallEndpointResponse<T = any> = CallEndpointResult<T> | ApiClientOfflineEnqueueResult;
1
48
  /**
2
49
  * Client générique pour consommer une API REST avec validation AJV, gestion des tokens,
3
50
  * circuit breaker, retry automatique, et support offline.
4
51
  *
5
- * @extends EventEmitter
6
- *
7
52
  * @fires ApiClient#retryAttempt
8
53
  * @fires ApiClient#queuedOffline
9
54
  * @fires ApiClient#circuitBreakerOpen
@@ -15,148 +60,106 @@
15
60
  * @fires ApiClient#offlineModeChanged
16
61
  * @fires ApiClient#userLoggedIn
17
62
  */
18
- export default class ApiClient extends EventEmitter<[never]> {
19
- static stripNullsInPlace(obj: any): any;
20
- /**
21
- * Converts an object to URL search parameters.
22
- *
23
- * @param {Object} obj - The object to be converted to URL search parameters.
24
- * @param {Object} [options={}] - Optional settings for the conversion.
25
- * @returns {URLSearchParams} The URL search parameters generated from the object.
26
- */
27
- static toURLSearchParams(obj: any, options?: any): URLSearchParams;
28
- /**
29
- * Builds parameters for an API request from a given object.
30
- *
31
- * @param {Object} obj - The object to be converted into parameters.
32
- * @param {FormData|URLSearchParams} paramsInstance - The instance to which the parameters will be appended.
33
- * @param {Object} [options={}] - Optional settings.
34
- * @param {boolean} [options.dots=false] - Whether to use dots in the parameter keys.
35
- * @param {boolean} [options.indexes=false] - Whether to include array indexes in the parameter keys.
36
- * @param {boolean} [options.metaTokens=true] - Whether to include meta tokens in the parameter keys.
37
- * @throws {TypeError} If the provided obj is not an object or is null.
38
- * @returns {FormData|URLSearchParams} The instance with the appended parameters.
39
- */
40
- static _buildParams(obj: any, paramsInstance: FormData | URLSearchParams, options?: {
41
- dots?: boolean;
42
- indexes?: boolean;
43
- metaTokens?: boolean;
44
- }): FormData | URLSearchParams;
45
- /**
46
- * @param {ApiClientOptions} [options]
47
- */
48
- constructor({ baseURL, accessToken, refreshToken, refreshUrl, endpoints, timeout, debug, maxRetries, circuitBreakerThreshold, circuitBreakerResetTime, fromJSONValue, tokenStorageStrategy }?: ApiClientOptions);
49
- __entityTag: string;
50
- _baseURL: string;
51
- _refreshUrl: string;
52
- _endpoints: any[];
53
- _debug: boolean;
54
- _offlineClientManager: any;
55
- _fromJSONValue: boolean;
56
- _setUserId: (id: any) => void;
57
- _ajv: any;
63
+ export default class ApiClient extends EventEmitter {
64
+ readonly __entityTag: string;
65
+ readonly userId: string | null;
66
+ private readonly _baseURL;
67
+ private readonly _refreshUrl;
68
+ private readonly _endpoints;
69
+ private readonly _debug;
70
+ private readonly _fromJSONValue;
71
+ private readonly _tokenStorage;
72
+ private _offlineClientManager;
73
+ private _ajv;
58
74
  _logger: any;
59
- _client: any;
60
- _breakerThreshold: number;
61
- _breakerResetTime: number;
62
- _breakerErrorCount: number;
63
- _breakerOpen: boolean;
64
- /** @type {string|null} */
65
- _lastBreakerOpenTime: string | null;
66
- /** @type {string|null} */
67
- _accessToken: string | null;
68
- /** @type {string|null} */
69
- _refreshToken: string | null;
70
- /** @type {TokenStorageStrategy} */
71
- _tokenStorage: TokenStorageStrategy;
75
+ private _client;
76
+ private readonly _breakerThreshold;
77
+ private readonly _breakerResetTime;
78
+ private _breakerErrorCount;
79
+ private _breakerOpen;
80
+ private _lastBreakerOpenTime;
81
+ private _accessToken;
82
+ private _refreshToken;
83
+ private _setUserId;
84
+ constructor({ baseURL, accessToken, refreshToken, refreshUrl, endpoints, timeout, debug, maxRetries, circuitBreakerThreshold, circuitBreakerResetTime, fromJSONValue, tokenStorageStrategy }: ApiClientOptions);
72
85
  /**
73
86
  * Sets the access token for the API client and updates the authorization header.
74
- *
75
- * @param {string|null} token - The access token to be set.
76
87
  */
77
88
  setToken(token: string | null): void;
78
89
  /**
79
90
  * Retrieves the current access token.
80
- *
81
- * @returns {string|null} The access token.
82
91
  */
83
92
  getToken(): string | null;
84
93
  /**
85
94
  * Sets the refresh token for the API client.
86
- *
87
- * @param {string|null} token - The refresh token to be set.
88
95
  */
89
96
  setRefreshToken(token: string | null): void;
90
97
  /**
91
98
  * Retrieves the current refresh token.
92
- *
93
- * @returns {string|null} The refresh token.
94
99
  */
95
100
  getRefreshToken(): string | null;
96
101
  /**
97
102
  * Indique si le client est connecté.
98
103
  * On considère que le client est connecté si un token d'accès (_accessToken) est défini.
99
- *
100
- * @returns {boolean} True si connecté, false sinon.
101
104
  */
102
105
  get isConnected(): boolean;
103
106
  /**
104
- * Extrait l'identifiant depuis un JWT.
105
- *
106
- * @param {string} token - Le token JWT (accessToken ou refreshToken).
107
- * @returns {string|null} L'identifiant extrait ou null si non trouvé.
108
- */
109
- _getIdFromToken(token: string): string | null;
107
+ * Extrait l'identifiant depuis un JWT.
108
+ */
109
+ private _getIdFromToken;
110
110
  /**
111
111
  * Méthode simplifiée de refresh (en JSON).
112
112
  * Emet un event refreshSuccess si ça marche
113
113
  */
114
- _refreshAccessToken(): Promise<boolean>;
114
+ private _refreshAccessToken;
115
115
  /**
116
116
  * checkCircuitBreaker : vérifie si on peut appeler l'API ou non
117
- * si le breaker est \"open\", on regarde si on peut \"reset\"
117
+ * si le breaker est "open", on regarde si on peut "reset"
118
118
  */
119
- _checkCircuitBreaker(): boolean;
119
+ private _checkCircuitBreaker;
120
120
  /**
121
121
  * updateCircuitBreaker : incremente le compteur d'erreurs
122
- * si on dépasse le threshold, on \"open\" le breaker.
122
+ * si on dépasse le threshold, on "open" le breaker.
123
123
  */
124
- _updateCircuitBreakerError(): void;
124
+ private _updateCircuitBreakerError;
125
125
  /**
126
126
  * resetCircuitBreaker : en cas de succès on reset le compteur
127
127
  */
128
- _resetCircuitBreakerSuccess(): void;
129
- _resolveSpecialValuesInPlace(obj: any, pathParams?: {}): any;
130
- _cleanSchemaLeftoverAlias(obj: any): any;
128
+ private _resetCircuitBreakerSuccess;
129
+ static stripNullsInPlace(obj: any): any;
130
+ private _resolveSpecialValuesInPlace;
131
+ private _cleanSchemaLeftoverAlias;
131
132
  /**
132
133
  * Safely calls an asynchronous function and handles any errors that occur.
133
134
  * Logs the error message using the instance's logger before re-throwing the error.
134
135
  *
135
- * @param {Function} fn - The asynchronous function to be called.
136
- * @param {...any} args - The arguments to pass to the function.
137
- * @returns {Promise<any>} The result of the asynchronous function.
136
+ * @param fn - The asynchronous function to be called.
137
+ * @param args - The arguments to pass to the function.
138
+ * @returns The result of the asynchronous function.
138
139
  * @throws {Error} Re-throws any error that occurs during the function execution.
139
140
  */
140
- safeCall(fn: Function, ...args: any[]): Promise<any>;
141
+ safeCall(fn: (...args: any[]) => Promise<any>, ...args: any[]): Promise<any>;
141
142
  /**
142
- * Calls an API endpoint with the specified parameters.
143
+ * Appelle un endpoint avec validations AJV, auth et circuit breaker.
144
+ * En cas d’indisponibilité (offline ou breaker), **met en file** l’action via
145
+ * `_offlineClientManager` si présent.
143
146
  *
144
- * @param {string} constant - The constant representing the endpoint to call.
145
- * @param {Object} [data={}] - The data to send with the request.
146
- * @param {boolean|function} [transformResponseData=true] - Whether to transform the response data or a function to transform it.
147
- * @param {boolean} [validateResponseSchema=true] - Whether to validate the response schema.
148
- * @returns {Promise<Object>} The response from the API.
147
+ * @param constant - The constant representing the endpoint to call.
148
+ * @param data - Données envoyées (incluant éventuellement `pathParams`).
149
+ * @param transformResponseData - `true` (transforme via `_transformData`), `false`, ou une fonction `(data) => any`.
150
+ * @param validateResponseSchema - Whether to validate the response schema.
151
+ * @returns The response from the endpoint call, or an enqueue result if offline or breaker is active.
149
152
  * @throws {CircuitBreakerError} If the circuit breaker is activated.
150
153
  * @throws {ApiClientError} If the endpoint is not found, token is required but not provided, or validation fails.
151
154
  */
152
- callEndpoint(constant: string, data?: any, transformResponseData?: boolean | Function, validateResponseSchema?: boolean): Promise<any>;
155
+ callEndpoint<T = any>(constant: string, data?: CallEndpointData, transformResponseData?: boolean | ((data: any) => any), validateResponseSchema?: boolean): Promise<CallEndpointResponse<T>>;
153
156
  /**
154
157
  * Converts AJV (Another JSON Schema Validator) errors into human-readable messages.
155
158
  *
156
- * @param {Array} errors - An array of AJV validation error objects.
157
- * @returns {Array<string>} An array of human-readable error messages extracted from the AJV errors.
159
+ * @param errors - An array of AJV validation error objects.
160
+ * @returns An array of human-readable error messages extracted from the AJV errors.
158
161
  */
159
- _ajvErrorHuman(errors: any[]): Array<string>;
162
+ private _ajvErrorHuman;
160
163
  /**
161
164
  * Checks the API response for errors and throws an `ApiResponseError` if any are found.
162
165
  *
@@ -169,16 +172,11 @@ export default class ApiClient extends EventEmitter<[never]> {
169
172
  *
170
173
  * If no errors are found, the original `response` is returned.
171
174
  *
172
- * @param {Object} response - The API response object to check.
173
- * @param {Object} response.data - The data payload of the response.
174
- * @param {number} response.status - The HTTP status code of the response.
175
+ * @param {import("axios").AxiosResponse | { data: any } } response
176
+ * @returns {import("axios").AxiosResponse | { data: any }}
175
177
  * @throws {ApiResponseError} If an error is detected in the response data.
176
- * @returns {Object} The original `response` object if no errors are found.
177
178
  */
178
- checkAndThrowApiResponseError(response: {
179
- data: any;
180
- status: number;
181
- }): any;
179
+ checkAndThrowApiResponseError(response: any): any;
182
180
  /**
183
181
  * Réinitialise complètement la session de l'utilisateur :
184
182
  * - Token d'accès
@@ -189,12 +187,42 @@ export default class ApiClient extends EventEmitter<[never]> {
189
187
  resetSession(): void;
190
188
  /**
191
189
  * Retrieves the value from an object based on a dot-separated path.
190
+ */
191
+ private _getValueByPath;
192
+ /**
193
+ * Normalizes Date objects to ISO strings for AJV validation.
194
+ * This preserves the object structure while converting only Dates.
195
+ * Handles reactive Proxies by unwrapping them first.
196
+ *
197
+ * @param obj - The object to normalize
198
+ * @returns The normalized object with Dates as ISO strings
199
+ */
200
+ static normalizeDatesForValidation(obj: any): any;
201
+ /**
202
+ * Normalizes fields with format:"date" in schema to YYYY-MM-DD format.
203
+ * Extracts only the date part from ISO datetime strings.
192
204
  *
193
- * @param {Object} obj - The object from which to retrieve the value.
194
- * @param {string} path - The dot-separated path string indicating the value to retrieve.
195
- * @returns {*} - The value found at the specified path, or undefined if the path is invalid.
205
+ * @param data - The data object to normalize
206
+ * @param schema - The JSON schema containing field definitions
207
+ * @returns The normalized data with date-only strings for format:"date" fields
196
208
  */
197
- _getValueByPath(obj: any, path: string): any;
209
+ static normalizeSchemaDateFields(data: any, schema: any): any;
210
+ /**
211
+ * Converts an object to URL search parameters.
212
+ *
213
+ * @param obj - The object to be converted to URL search parameters.
214
+ * @param [options={}] - Optional settings for the conversion.
215
+ * @returns The URL search parameters generated from the object.
216
+ */
217
+ static toURLSearchParams(obj: any, options?: any): URLSearchParams;
218
+ /**
219
+ * Builds parameters for an API request from a given object.
220
+ */
221
+ static _buildParams(obj: any, paramsInstance: FormData | URLSearchParams, options?: {
222
+ dots?: boolean;
223
+ indexes?: boolean;
224
+ metaTokens?: boolean;
225
+ }): FormData | URLSearchParams;
198
226
  /**
199
227
  * Transforms the given data based on its structure.
200
228
  *
@@ -203,8 +231,8 @@ export default class ApiClient extends EventEmitter<[never]> {
203
231
  * nested structures like `resultGoods`, `resultErrors`, `results`, `news`,
204
232
  * `notif`, `citoyens`, `organizations`, `cities`, `newComment`, `map`, and `object`.
205
233
  *
206
- * @param {Object|Array} data - The data to be transformed.
207
- * @returns {Object|Array} - The transformed data.
234
+ * @param data - The data to be transformed.
235
+ * @returns - The transformed data.
208
236
  *
209
237
  * @private
210
238
  */
@@ -212,8 +240,8 @@ export default class ApiClient extends EventEmitter<[never]> {
212
240
  /**
213
241
  * Normalizes JSON data by transforming specific fields and ensuring URLs are complete.
214
242
  *
215
- * @param {Object} item - The JSON object to be normalized.
216
- * @returns {Object} - The normalized JSON object.
243
+ * @param item - The JSON object to be normalized.
244
+ * @returns - The normalized JSON object.
217
245
  *
218
246
  * The function performs the following transformations:
219
247
  * - Normalizes the ID field if it matches a specific pattern.
@@ -223,23 +251,23 @@ export default class ApiClient extends EventEmitter<[never]> {
223
251
  * - Removes the `timeAgo` field if it exists.
224
252
  * - Converts the object to EJSON format if necessary.
225
253
  */
226
- _normalizeJsonData(item: any): any;
254
+ private _normalizeJsonData;
227
255
  /**
228
256
  * Ensures that the given image path is a full URL. If the image path is already a full URL
229
257
  * (i.e., it starts with "http://" or "https://"), it is returned as is. Otherwise, the image path
230
258
  * is concatenated with the base URL of the ApiClient instance.
231
259
  *
232
- * @param {string} imagePath - The image path to ensure as a full URL.
233
- * @returns {string} - The full URL of the image path.
260
+ * @param imagePath - The image path to ensure as a full URL.
261
+ * @returns - The full URL of the image path.
234
262
  */
235
- _ensureFullURL(imagePath: string): string;
263
+ private _ensureFullURL;
236
264
  /**
237
265
  * Parcourt récursivement un objet pour normaliser les champs de date.
238
266
  * Pour chaque clé présente dans dateFields, si la valeur est un nombre ou un objet
239
267
  * contenant une propriété sec (nombre), la transforme en { $date: valeurEnMs }.
240
268
  *
241
- * @param {Object} obj - L’objet à normaliser.
242
- * @returns {Object} L’objet normalisé.
269
+ * @param obj - L’objet à normaliser.
270
+ * @returns L’objet normalisé.
243
271
  */
244
272
  /**
245
273
  * Parcourt récursivement un objet pour normaliser les chemins d'images.
@@ -247,65 +275,65 @@ export default class ApiClient extends EventEmitter<[never]> {
247
275
  * vérifie et convertit le chemin en URL complète à l’aide de _ensureFullURL.
248
276
  * Les cas particuliers (comme mediaImg.images ou mediaFile.files) sont également gérés.
249
277
  *
250
- * @param {Object} obj - L’objet à normaliser.
251
- * @returns {Object} L’objet normalisé.
278
+ * @param obj - L’objet à normaliser.
279
+ * @returns L’objet normalisé.
252
280
  */
253
281
  /**
254
282
  * Parcourt récursivement un objet ou un tableau pour normaliser les identifiants (ID).
255
283
  * Si un objet possède une propriété "_id" ou "id" contenant un sous-objet "$id" valide,
256
284
  * l'ID est normalisé et la propriété _id est convertie au format EJSON attendu.
257
285
  *
258
- * @param {Object|Array} obj - L'objet ou le tableau à normaliser.
259
- * @returns {Object|Array} L'objet ou le tableau normalisé.
286
+ * @param obj - L'objet ou le tableau à normaliser.
287
+ * @returns L'objet ou le tableau normalisé.
260
288
  */
261
289
  /**
262
290
  * Normalise récursivement les valeurs booléennes.
263
291
  * Si une valeur est une chaîne "true" ou "false", elle est convertie en booléen.
264
292
  *
265
- * @param {any} data - L'objet, le tableau ou la valeur à normaliser.
266
- * @returns {any} La donnée normalisée.
293
+ * @param data - L'objet, le tableau ou la valeur à normaliser.
294
+ * @returns La donnée normalisée.
267
295
  */
268
296
  /**
269
297
  * Transforme une chaîne "true" ou "false" en booléen.
270
298
  *
271
- * @param {string} str - La chaîne à normaliser.
272
- * @returns {boolean|string} La valeur booléenne ou la chaîne originale.
299
+ * @param str - La chaîne à normaliser.
300
+ * @returns La valeur booléenne ou la chaîne originale.
273
301
  */
274
- _normalizeString(str: string): boolean | string;
302
+ private _normalizeString;
275
303
  /**
276
304
  * Normalise les identifiants dans un objet.
277
305
  * Si l'objet possède une propriété "_id" ou "id" contenant un sous-objet "$id" valide,
278
306
  * il met à jour l'objet en assignant la valeur de l'ID et en formattant _id en EJSON.
279
307
  *
280
- * @param {Object} obj - L'objet à normaliser.
281
- * @returns {Object} L'objet avec l'ID normalisé.
308
+ * @param obj - L'objet à normaliser.
309
+ * @returns L'objet avec l'ID normalisé.
282
310
  */
283
- _normalizeId(obj: any): any;
311
+ private _normalizeId;
284
312
  /**
285
313
  * Normalise une valeur de date.
286
314
  * Si la valeur est un objet contenant "sec" (nombre) ou un nombre,
287
315
  * elle est convertie en { $date: valeurEnMs }.
288
316
  *
289
- * @param {any} value - La valeur à normaliser.
290
- * @returns {any} La valeur normalisée.
317
+ * @param value - La valeur à normaliser.
318
+ * @returns La valeur normalisée.
291
319
  */
292
- _normalizeDate(value: any): any;
320
+ private _normalizeDate;
293
321
  /**
294
322
  * Normalise une URL d'image.
295
323
  * Si la valeur est une chaîne non vide, retourne l'URL complète via _ensureFullURL.
296
324
  *
297
- * @param {any} value - La valeur à normaliser.
298
- * @returns {any} La valeur normalisée.
325
+ * @param value - La valeur à normaliser.
326
+ * @returns La valeur normalisée.
299
327
  */
300
- _normalizeImage(value: any): any;
328
+ private _normalizeImage;
301
329
  /**
302
330
  * Liste des champs d'image à normaliser.
303
331
  */
304
- _imageFields: string[];
332
+ private _imageFields;
305
333
  /**
306
334
  * Liste des champs de date à normaliser.
307
335
  */
308
- _dateFields: string[];
336
+ private _dateFields;
309
337
  /**
310
338
  * Normalise récursivement un objet, un tableau ou une valeur simple.
311
339
  * Cette fonction réalise en une seule passe les opérations suivantes :
@@ -315,63 +343,95 @@ export default class ApiClient extends EventEmitter<[never]> {
315
343
  * - Transformation récursive des objets et tableaux.
316
344
  * - Normalisation des identifiants.
317
345
  *
318
- * @param {any} data - La donnée à normaliser.
319
- * @returns {any} La donnée normalisée.
346
+ * @param data - La donnée à normaliser.
347
+ * @returns La donnée normalisée.
320
348
  */
321
- _normalizeRecursively(data: any): any;
322
- _startBeforeEndValidate: (schema: any, data: any) => boolean;
323
- getRequestSchema(constant: any): any;
324
- getPathSchema(constant: any): any;
349
+ private _normalizeRecursively;
350
+ private _startBeforeEndValidate;
351
+ /**
352
+ * Récupère le schéma de requête pour un endpoint donné.
353
+ * @param constant - Le nom de l'endpoint.
354
+ * @returns Le schéma de requête ou null si non trouvé.
355
+ */
356
+ getRequestSchema(constant: string): any;
357
+ /**
358
+ * Récupère le schéma de chemin pour un endpoint donné.
359
+ * @param constant - Le nom de l'endpoint.
360
+ * @returns Le schéma de chemin ou null si non trouvé.
361
+ */
362
+ getPathSchema(constant: string): any;
325
363
  /**
326
364
  * Permet d'écouter facilement un ensemble d'événements importants émis par l'ApiClient.
327
365
  *
328
- * @param {Object} handlers - Un objet avec des fonctions à appeler selon l'événement.
329
- * @param {Function} [handlers.retryAttempt] - Lors d'une tentative de retry axios.
330
- * @param {Function} [handlers.queuedOffline] - Lorsqu'une requête est mise en file.
331
- * @param {Function} [handlers.circuitBreakerOpen] - Quand le breaker s'ouvre.
332
- * @param {Function} [handlers.circuitBreakerReset] - Quand le breaker se referme.
333
- * @param {Function} [handlers.refreshSuccess] - Quand le token est rafraîchi.
334
- * @param {Function} [handlers.refreshFailed] - Quand le refresh échoue.
335
- * @param {Function} [handlers.sessionReset] - Quand la session est réinitialisée.
336
- * @param {Function} [handlers.validationError] - Quand une validation échoue.
337
- * @param {Function} [handlers.offlineModeChanged] - Quand le mode offline change.
338
- * @param {Function} [handlers.userLoggedIn] - Quand un utilisateur se connecte.
366
+ * @param handlers - Un objet avec des fonctions à appeler selon l'événement.
367
+ * @param [handlers.retryAttempt] - Lors d'une tentative de retry axios.
368
+ * @param [handlers.queuedOffline] - Lorsqu'une requête est mise en file.
369
+ * @param [handlers.circuitBreakerOpen] - Quand le breaker s'ouvre.
370
+ * @param [handlers.circuitBreakerReset] - Quand le breaker se referme.
371
+ * @param [handlers.refreshSuccess] - Quand le token est rafraîchi.
372
+ * @param [handlers.refreshFailed] - Quand le refresh échoue.
373
+ * @param [handlers.sessionReset] - Quand la session est réinitialisée.
374
+ * @param [handlers.validationError] - Quand une validation échoue.
375
+ * @param [handlers.offlineModeChanged] - Quand le mode offline change.
376
+ * @param [handlers.userLoggedIn] - Quand un utilisateur se connecte.
339
377
  */
340
- onEvent(handlers?: {
341
- retryAttempt?: Function;
342
- queuedOffline?: Function;
343
- circuitBreakerOpen?: Function;
344
- circuitBreakerReset?: Function;
345
- refreshSuccess?: Function;
346
- refreshFailed?: Function;
347
- sessionReset?: Function;
348
- validationError?: Function;
349
- offlineModeChanged?: Function;
350
- userLoggedIn?: Function;
351
- }): void;
378
+ onEvent(handlers?: Record<string, (...args: any[]) => void>): void;
352
379
  /**
353
380
  * Retourne la liste des noms d'événements personnalisés déclarés dans les endpoints.
354
381
  * Utile pour introspection ou documentation.
355
382
  *
356
- * @returns {string[]} Liste des événements émis dynamiquement via postActions.
383
+ * @returns Liste des événements émis dynamiquement via postActions.
357
384
  */
358
- getDeclaredEvents(): string[];
385
+ getDeclaredEvents(): unknown[];
359
386
  }
360
- export type TokenStorageStrategy = import("./utils/TokenStorage.js").TokenStorageStrategy;
361
- export type MemoryStorageStrategy = import("./utils/TokenStorage.js").MemoryStorageStrategy;
362
- export type MultiServerTokenStorageStrategy = import("./utils/MultiServerTokenStorageStrategy.js").MultiServerTokenStorageStrategy;
363
- export type ApiClientOptions = {
364
- baseURL: string;
365
- accessToken?: string;
366
- refreshToken?: string;
367
- refreshUrl?: string;
368
- endpoints?: any[];
369
- timeout?: number;
370
- debug?: boolean;
371
- maxRetries?: number;
372
- circuitBreakerThreshold?: number;
373
- circuitBreakerResetTime?: number;
374
- fromJSONValue?: boolean;
375
- tokenStorageStrategy?: TokenStorageStrategy | null;
376
- };
377
- import { EventEmitter } from "events";
387
+ /**
388
+ * @event ApiClient#retryAttempt
389
+ * @type {Object}
390
+ * @property {number} retryCount - Le numéro de tentative.
391
+ * @property {string} url - L'URL de la requête ayant échoué.
392
+ */
393
+ /**
394
+ * @event ApiClient#queuedOffline
395
+ * @type {Object}
396
+ * @property {string} constant - Le nom de l'endpoint.
397
+ * @property {Object} data - Les données envoyées.
398
+ * @property {"offlineMode"|"circuitBreaker"} reason - La raison de la mise en file.
399
+ */
400
+ /**
401
+ * @event ApiClient#circuitBreakerOpen
402
+ * @type {Object}
403
+ * @property {number} timestamp - Date (ms) à laquelle le breaker s'est ouvert.
404
+ */
405
+ /**
406
+ * @event ApiClient#circuitBreakerReset
407
+ * @type {void}
408
+ */
409
+ /**
410
+ * @event ApiClient#refreshSuccess
411
+ * @type {Object}
412
+ * @property {string} token - Le nouveau token d'accès.
413
+ * @property {string} [refreshToken] - Le nouveau refreshToken (optionnel).
414
+ */
415
+ /**
416
+ * @event ApiClient#refreshFailed
417
+ * @type {Object}
418
+ * @property {string} error - Le message d’erreur de refresh.
419
+ */
420
+ /**
421
+ * @event ApiClient#sessionReset
422
+ * @type {void}
423
+ */
424
+ /**
425
+ * @event ApiClient#validationError
426
+ * @type {Object}
427
+ * @property {"pathParams"|"request"|"response"} stage - Étape de validation échouée.
428
+ * @property {Array<Object>} errors - Erreurs AJV brutes.
429
+ */
430
+ /**
431
+ * @event ApiClient#offlineModeChanged
432
+ * @type {boolean} - true si le client est offline, false sinon.
433
+ */
434
+ /**
435
+ * @event ApiClient#userLoggedIn
436
+ * @param user - Les données utilisateur extraites de la réponse.
437
+ */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiClient.d.ts","sourceRoot":"","sources":["../src/ApiClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AActC,OAAO,EAAyB,KAAK,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAM3F;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC5C,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,UA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