@ignos/api-client 20260213.48.1 → 20260216.52.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ignos/api-client",
3
- "version": "20260213.48.1",
3
+ "version": "20260216.52.1",
4
4
  "description": "IGNOS API Client",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -1,19 +1,31 @@
1
1
  export interface IAccessTokenProvider {
2
- getAccessToken: () => Promise<string>;
2
+ getAccessToken: () => Promise<string>;
3
3
  }
4
4
 
5
5
  export class AuthorizedApiBase {
6
- private readonly config: IAccessTokenProvider;
6
+ private readonly config: IAccessTokenProvider;
7
7
 
8
- protected constructor(config: IAccessTokenProvider) {
9
- this.config = config;
10
- }
8
+ protected constructor(config: IAccessTokenProvider) {
9
+ this.config = config;
10
+ }
11
11
 
12
- protected transformOptions = async (options: any): Promise<any> => {
13
- options.headers = {
14
- ...options.headers,
15
- Authorization: 'Bearer ' + (await this.config.getAccessToken()),
16
- };
17
- return options;
12
+ protected transformOptions = async (options: any): Promise<any> => {
13
+ options.headers = {
14
+ ...options.headers,
15
+ Authorization: "Bearer " + (await this.config.getAccessToken()),
18
16
  };
19
- }
17
+ return options;
18
+ };
19
+
20
+ protected jsonParseReviver = (_: any, value: any) => {
21
+ // Matches starts with "2025-12-09T13:19:39"
22
+ // Will also match "2025-12-09T13:19:39.4576289+00:00"
23
+ const regex = /(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})/;
24
+
25
+ if (typeof value === "string" && regex.exec(value)) {
26
+ return new Date(value);
27
+ }
28
+
29
+ return value;
30
+ };
31
+ }