@dotcms/types 1.2.0-next.5 → 1.2.0-next.6
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/index.cjs.js +8 -0
- package/index.esm.js +8 -1
- package/package.json +1 -1
- package/src/index.d.ts +1 -0
- package/src/internal.d.ts +1 -0
- package/src/lib/ai/internal.d.ts +55 -0
- package/src/lib/ai/public.d.ts +4 -3
- package/src/lib/components/generic/public.d.ts +16 -0
package/index.cjs.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const DotCMSEntityState = {
|
|
4
|
+
IDLE: 'IDLE',
|
|
5
|
+
LOADING: 'LOADING',
|
|
6
|
+
SUCCESS: 'SUCCESS',
|
|
7
|
+
ERROR: 'ERROR'
|
|
8
|
+
};
|
|
9
|
+
|
|
3
10
|
/**
|
|
4
11
|
* Development mode
|
|
5
12
|
*
|
|
@@ -434,6 +441,7 @@ class DotErrorAISearch extends Error {
|
|
|
434
441
|
exports.BaseHttpClient = BaseHttpClient;
|
|
435
442
|
exports.DEVELOPMENT_MODE = DEVELOPMENT_MODE;
|
|
436
443
|
exports.DISTANCE_FUNCTIONS = DISTANCE_FUNCTIONS;
|
|
444
|
+
exports.DotCMSEntityState = DotCMSEntityState;
|
|
437
445
|
exports.DotErrorAISearch = DotErrorAISearch;
|
|
438
446
|
exports.DotErrorContent = DotErrorContent;
|
|
439
447
|
exports.DotErrorNavigation = DotErrorNavigation;
|
package/index.esm.js
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
const DotCMSEntityState = {
|
|
2
|
+
IDLE: 'IDLE',
|
|
3
|
+
LOADING: 'LOADING',
|
|
4
|
+
SUCCESS: 'SUCCESS',
|
|
5
|
+
ERROR: 'ERROR'
|
|
6
|
+
};
|
|
7
|
+
|
|
1
8
|
/**
|
|
2
9
|
* Development mode
|
|
3
10
|
*
|
|
@@ -429,4 +436,4 @@ class DotErrorAISearch extends Error {
|
|
|
429
436
|
}
|
|
430
437
|
}
|
|
431
438
|
|
|
432
|
-
export { BaseHttpClient, DEVELOPMENT_MODE, DISTANCE_FUNCTIONS, DotCMSUVEAction, DotErrorAISearch, DotErrorContent, DotErrorNavigation, DotErrorPage, DotHttpError, PRODUCTION_MODE, UVEEventType, UVE_MODE };
|
|
439
|
+
export { BaseHttpClient, DEVELOPMENT_MODE, DISTANCE_FUNCTIONS, DotCMSEntityState, DotCMSUVEAction, DotErrorAISearch, DotErrorContent, DotErrorNavigation, DotErrorPage, DotHttpError, PRODUCTION_MODE, UVEEventType, UVE_MODE };
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
package/src/internal.d.ts
CHANGED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { DISTANCE_FUNCTIONS, DotCMSAISearchContentletData } from './public';
|
|
2
|
+
import { DotCMSBasicContentlet } from '../page/public';
|
|
3
|
+
/**
|
|
4
|
+
* The raw response from the AI search.
|
|
5
|
+
*
|
|
6
|
+
* @export
|
|
7
|
+
* @interface DotCMSAISearchRawResponse
|
|
8
|
+
*/
|
|
9
|
+
export interface DotCMSAISearchRawResponse<T extends DotCMSBasicContentlet> {
|
|
10
|
+
/**
|
|
11
|
+
* The time to embeddings.
|
|
12
|
+
* @property {number} timeToEmbeddings - The time to embeddings.
|
|
13
|
+
*/
|
|
14
|
+
timeToEmbeddings: number;
|
|
15
|
+
/**
|
|
16
|
+
* The total number of results.
|
|
17
|
+
* @property {number} total - The total number of results.
|
|
18
|
+
*/
|
|
19
|
+
total: number;
|
|
20
|
+
/**
|
|
21
|
+
* The query that was used to search.
|
|
22
|
+
* @property {string} query - The query.
|
|
23
|
+
*/
|
|
24
|
+
query: string;
|
|
25
|
+
/**
|
|
26
|
+
* The threshold that was used to calculate the distance.
|
|
27
|
+
* @property {number} threshold - The threshold.
|
|
28
|
+
*/
|
|
29
|
+
threshold: number;
|
|
30
|
+
/**
|
|
31
|
+
* The operator that was used to calculate the distance.
|
|
32
|
+
* @property {(typeof DISTANCE_FUNCTIONS)[keyof typeof DISTANCE_FUNCTIONS]} operator - The operator.
|
|
33
|
+
*/
|
|
34
|
+
operator: (typeof DISTANCE_FUNCTIONS)[keyof typeof DISTANCE_FUNCTIONS];
|
|
35
|
+
/**
|
|
36
|
+
* The offset of the results.
|
|
37
|
+
* @property {number} offset - The offset.
|
|
38
|
+
*/
|
|
39
|
+
offset: number;
|
|
40
|
+
/**
|
|
41
|
+
* The limit of the results.
|
|
42
|
+
* @property {number} limit - The limit.
|
|
43
|
+
*/
|
|
44
|
+
limit: number;
|
|
45
|
+
/**
|
|
46
|
+
* The count of the results.
|
|
47
|
+
* @property {number} count - The count.
|
|
48
|
+
*/
|
|
49
|
+
count: number;
|
|
50
|
+
/**
|
|
51
|
+
* The dotCMS results.
|
|
52
|
+
* @property {DotCMSAISearchContentletData<T>[]} dotCMSResults - The dotCMS results.
|
|
53
|
+
*/
|
|
54
|
+
dotCMSResults: DotCMSAISearchContentletData<T>[];
|
|
55
|
+
}
|
package/src/lib/ai/public.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DotCMSAISearchRawResponse } from './internal';
|
|
1
2
|
import { DotHttpError } from '../client/public';
|
|
2
3
|
import { DotCMSBasicContentlet } from '../page/public';
|
|
3
4
|
/**
|
|
@@ -159,12 +160,12 @@ export declare class DotErrorAISearch extends Error {
|
|
|
159
160
|
* @public
|
|
160
161
|
* @interface DotCMSAISearchResponse
|
|
161
162
|
*/
|
|
162
|
-
export interface DotCMSAISearchResponse<T extends DotCMSBasicContentlet> {
|
|
163
|
+
export interface DotCMSAISearchResponse<T extends DotCMSBasicContentlet> extends Omit<DotCMSAISearchRawResponse<T>, 'dotCMSResults'> {
|
|
163
164
|
/**
|
|
164
165
|
* The results from the AI search.
|
|
165
|
-
* @property {DotCMSAISearchContentletData<T>[]}
|
|
166
|
+
* @property {DotCMSAISearchContentletData<T>[]} results - The results from the AI search.
|
|
166
167
|
*/
|
|
167
|
-
|
|
168
|
+
results: DotCMSAISearchContentletData<T>[];
|
|
168
169
|
}
|
|
169
170
|
/**
|
|
170
171
|
* The match from the AI search.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const DotCMSEntityState: {
|
|
2
|
+
readonly IDLE: "IDLE";
|
|
3
|
+
readonly LOADING: "LOADING";
|
|
4
|
+
readonly SUCCESS: "SUCCESS";
|
|
5
|
+
readonly ERROR: "ERROR";
|
|
6
|
+
};
|
|
7
|
+
export type DotCMSEntityStatus = {
|
|
8
|
+
state: typeof DotCMSEntityState.IDLE;
|
|
9
|
+
} | {
|
|
10
|
+
state: typeof DotCMSEntityState.LOADING;
|
|
11
|
+
} | {
|
|
12
|
+
state: typeof DotCMSEntityState.SUCCESS;
|
|
13
|
+
} | {
|
|
14
|
+
state: typeof DotCMSEntityState.ERROR;
|
|
15
|
+
error: Error;
|
|
16
|
+
};
|