@dotcms/client 1.2.1-next.2 → 1.2.1-next.3

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": "@dotcms/client",
3
- "version": "1.2.1-next.2",
3
+ "version": "1.2.1-next.3",
4
4
  "description": "Official JavaScript library for interacting with DotCMS REST APIs.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,18 +1,19 @@
1
1
  import { DotCMSAISearchResponse, DotCMSBasicContentlet, DotErrorAISearch } from '@dotcms/types';
2
+ import { ThenableCallback } from '@dotcms/types/internal';
2
3
  /**
3
4
  * Callback for a fulfilled promise.
4
5
  *
5
6
  * @template T - The type of the response.
6
7
  * @callback OnFullfilled
7
8
  * @param {DotCMSAISearchResponse} value - The response value.
8
- * @returns {DotCMSAISearchResponse | PromiseLike<DotCMSAISearchResponse>} The processed response or a promise.
9
+ * @returns {DotCMSAISearchResponse | PromiseLike<DotCMSAISearchResponse> | void} The processed response or a promise.
9
10
  */
10
- export type OnFullfilled<T extends DotCMSBasicContentlet> = ((value: DotCMSAISearchResponse<T>) => DotCMSAISearchResponse<T> | PromiseLike<DotCMSAISearchResponse<T>>) | undefined | null;
11
+ export type OnFullfilled<T extends DotCMSBasicContentlet> = ThenableCallback<DotCMSAISearchResponse<T>>;
11
12
  /**
12
13
  * Callback for a rejected promise.
13
14
  *
14
15
  * @callback OnRejected
15
16
  * @param {DotErrorAISearch} error - The AI search error object.
16
- * @returns {DotErrorAISearch | PromiseLike<DotErrorAISearch>} The processed error or a promise.
17
+ * @returns {DotErrorAISearch | PromiseLike<DotErrorAISearch> | void} The processed error or a promise.
17
18
  */
18
- export type OnRejected = ((error: DotErrorAISearch) => DotErrorAISearch | PromiseLike<DotErrorAISearch>) | undefined | null;
19
+ export type OnRejected = ThenableCallback<DotErrorAISearch>;
@@ -1,4 +1,5 @@
1
1
  import { Contentlet, DotErrorContent } from '@dotcms/types';
2
+ import { ThenableCallback } from '@dotcms/types/internal';
2
3
  import { Equals } from '../builders/query/lucene-syntax';
3
4
  import { QueryBuilder } from '../builders/query/query';
4
5
  /**
@@ -28,17 +29,17 @@ export type BuildQuery = (qb: QueryBuilder) => Equals;
28
29
  * @template T - The type of the response.
29
30
  * @callback OnFullfilled
30
31
  * @param {GetCollectionResponse<T>} value - The response value.
31
- * @returns {GetCollectionResponse<T> | PromiseLike<GetCollectionResponse<T>>} The processed response or a promise.
32
+ * @returns {GetCollectionResponse<T> | PromiseLike<GetCollectionResponse<T>> | void} The processed response or a promise.
32
33
  */
33
- export type OnFullfilled<T> = ((value: GetCollectionResponse<T>) => GetCollectionResponse<T> | PromiseLike<GetCollectionResponse<T>>) | undefined | null;
34
+ export type OnFullfilled<T> = ThenableCallback<GetCollectionResponse<T>>;
34
35
  /**
35
36
  * Callback for a rejected promise.
36
37
  *
37
38
  * @callback OnRejected
38
39
  * @param {DotErrorContent} error - The content error object.
39
- * @returns {DotErrorContent | PromiseLike<DotErrorContent>} The processed error or a promise.
40
+ * @returns {DotErrorContent | PromiseLike<DotErrorContent> | void} The processed error or a promise.
40
41
  */
41
- export type OnRejected = ((error: DotErrorContent) => DotErrorContent | PromiseLike<DotErrorContent>) | undefined | null;
42
+ export type OnRejected = ThenableCallback<DotErrorContent>;
42
43
  /**
43
44
  * Response of the get collection method.
44
45
  *