@coveo/platform-client 72.0.0 → 72.2.0
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/cjs/handlers/response/ResponseHandlers.js +4 -0
- package/dist/cjs/handlers/response/ResponseHandlers.js.map +1 -1
- package/dist/esm/handlers/response/ResponseHandlers.js +4 -0
- package/dist/esm/handlers/response/ResponseHandlers.js.map +1 -1
- package/dist/types/handlers/response/ResponseHandlerInterfaces.d.ts +38 -0
- package/dist/types/handlers/response/ResponseHandlers.d.ts +26 -2
- package/dist/types/resources/MachineLearning/ModelDetailedInfo/details/ModelDetails.d.ts +10 -0
- package/dist/types/resources/MachineLearning/ModelDetailedInfo/details/ModelDetailsBuildingStats.d.ts +6 -0
- package/dist/types/resources/MachineLearning/ModelDetailedInfo/details/ModelDetailsStatsPerSource.d.ts +14 -0
- package/package.json +1 -1
|
@@ -51,6 +51,7 @@ const error = {
|
|
|
51
51
|
platformError.title = responseJson.title ?? getErrorTypeFromAliases(responseJson) ?? 'unknown';
|
|
52
52
|
platformError.detail = responseJson.detail ?? getErrorDetailFromAliases(responseJson) ?? 'unknown';
|
|
53
53
|
platformError.status = response.status;
|
|
54
|
+
platformError.url = response.url;
|
|
54
55
|
throw platformError;
|
|
55
56
|
},
|
|
56
57
|
};
|
|
@@ -62,6 +63,7 @@ const blockedByWAF = {
|
|
|
62
63
|
platformError.title = 'Request blocked for security reasons';
|
|
63
64
|
platformError.detail = 'The web application firewall has identified the request to be potentially malicious.';
|
|
64
65
|
platformError.status = response.status;
|
|
66
|
+
platformError.url = response.url;
|
|
65
67
|
throw platformError;
|
|
66
68
|
},
|
|
67
69
|
};
|
|
@@ -74,6 +76,7 @@ const badGateway = {
|
|
|
74
76
|
platformError.detail =
|
|
75
77
|
'The service is currently unable to reach the necessary endpoint, likely due to a bad gateway. Please try your request again later.';
|
|
76
78
|
platformError.status = response.status;
|
|
79
|
+
platformError.url = response.url;
|
|
77
80
|
throw platformError;
|
|
78
81
|
},
|
|
79
82
|
};
|
|
@@ -86,6 +89,7 @@ const htmlError = {
|
|
|
86
89
|
'Unable to process the request. An issue has occurred with the endpoint, and the system is unable to parse the error.';
|
|
87
90
|
platformError.detail = await response.text();
|
|
88
91
|
platformError.status = response.status;
|
|
92
|
+
platformError.url = response.url;
|
|
89
93
|
throw platformError;
|
|
90
94
|
},
|
|
91
95
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseHandlers.js","sourceRoot":"","sources":["../../../../src/handlers/response/ResponseHandlers.ts"],"names":[],"mappings":";;;AAAA,+FAA+F;AAC/F,wCAAsC;
|
|
1
|
+
{"version":3,"file":"ResponseHandlers.js","sourceRoot":"","sources":["../../../../src/handlers/response/ResponseHandlers.ts"],"names":[],"mappings":";;;AAAA,+FAA+F;AAC/F,wCAAsC;AAStC;;;GAGG;AACI,MAAM,WAAW,GAAwB,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,KAAK,GAAG,CAAC;AAAzE,QAAA,WAAW,eAA8D;AAEtF;;;GAGG;AACI,MAAM,aAAa,GAAwB,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC;AAA/D,QAAA,aAAa,iBAAkD;AAE5E,MAAM,SAAS,GAAoB;IAC/B,UAAU,EAAE,mBAAW;IACvB,OAAO,EAAE,GAAkB,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,EAAO,CAAC;CACzD,CAAC;AAEF,MAAM,OAAO,GAAoB;IAC7B,UAAU,EAAE,qBAAa;IACzB,OAAO,EAAE,KAAK,EAAK,QAAkB,EAAE,qBAAyC,MAAM,EAAc,EAAE;QAClG,IAAI,kBAAkB,KAAK,MAAM,EAAE,CAAC;YAChC,OAAO,QAAQ,CAAC,kBAAkB,CAAC,EAAO,CAAC;QAC/C,CAAC;QACD,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACtC,OACI,IA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AM,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;AAEnG,QAAA,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC1C,SAAS;IACT,OAAO;IACP,WAAW;IACX,YAAY;IACZ,UAAU;IACV,SAAS;IACT,KAAK;CACR,CAAC,CAAC;AAEH,kBAAe,KAAK,EAChB,QAAkB,EAClB,cAAkD,EAClD,kBAAuC,EAC7B,EAAE;IACZ,MAAM,QAAQ,GAAG,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,uBAAuB,CAAC;IACnF,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CACzB,CAAC,SAAS,EAAE,EAAE,CACV,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC;QAC7D,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC;QAC1D,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,CACrC,CAAC;IACF,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IAC1D,CAAC;IACD,OAAO,MAAM,OAAO,CAAC,OAAO,CAAI,QAAQ,EAAE,kBAAkB,CAAC,CAAC;AAClE,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAa,wBAAyB,SAAQ,KAAK;IAC/C;;;OAGG;IACH,UAAU,CAAS;IACnB;;;OAGG;IACH,KAAK,CAAS;IACd;;OAEG;IACH,MAAM,CAAS;IACf;;OAEG;IACH,MAAM,CAAS;CAyBlB;AA3CD,4DA2CC"}
|
|
@@ -46,6 +46,7 @@ const error = {
|
|
|
46
46
|
platformError.title = responseJson.title ?? getErrorTypeFromAliases(responseJson) ?? 'unknown';
|
|
47
47
|
platformError.detail = responseJson.detail ?? getErrorDetailFromAliases(responseJson) ?? 'unknown';
|
|
48
48
|
platformError.status = response.status;
|
|
49
|
+
platformError.url = response.url;
|
|
49
50
|
throw platformError;
|
|
50
51
|
},
|
|
51
52
|
};
|
|
@@ -57,6 +58,7 @@ const blockedByWAF = {
|
|
|
57
58
|
platformError.title = 'Request blocked for security reasons';
|
|
58
59
|
platformError.detail = 'The web application firewall has identified the request to be potentially malicious.';
|
|
59
60
|
platformError.status = response.status;
|
|
61
|
+
platformError.url = response.url;
|
|
60
62
|
throw platformError;
|
|
61
63
|
},
|
|
62
64
|
};
|
|
@@ -69,6 +71,7 @@ const badGateway = {
|
|
|
69
71
|
platformError.detail =
|
|
70
72
|
'The service is currently unable to reach the necessary endpoint, likely due to a bad gateway. Please try your request again later.';
|
|
71
73
|
platformError.status = response.status;
|
|
74
|
+
platformError.url = response.url;
|
|
72
75
|
throw platformError;
|
|
73
76
|
},
|
|
74
77
|
};
|
|
@@ -81,6 +84,7 @@ const htmlError = {
|
|
|
81
84
|
'Unable to process the request. An issue has occurred with the endpoint, and the system is unable to parse the error.';
|
|
82
85
|
platformError.detail = await response.text();
|
|
83
86
|
platformError.status = response.status;
|
|
87
|
+
platformError.url = response.url;
|
|
84
88
|
throw platformError;
|
|
85
89
|
},
|
|
86
90
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseHandlers.js","sourceRoot":"","sources":["../../../../src/handlers/response/ResponseHandlers.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,OAAO,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"ResponseHandlers.js","sourceRoot":"","sources":["../../../../src/handlers/response/ResponseHandlers.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,OAAO,8BAA8B,CAAC;AAStC;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAwB,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,KAAK,GAAG,CAAC;AAEtF;;;GAGG;AACH,MAAM,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,CAAC;IACF,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IAC1D,CAAC;IACD,OAAO,MAAM,OAAO,CAAC,OAAO,CAAI,QAAQ,EAAE,kBAAkB,CAAC,CAAC;AAClE,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IAC/C;;;OAGG;IACH,UAAU,CAAS;IACnB;;;OAGG;IACH,KAAK,CAAS;IACd;;OAEG;IACH,MAAM,CAAS;IACf;;OAEG;IACH,MAAM,CAAS;CAyBlB"}
|
|
@@ -15,3 +15,41 @@ export interface ResponseHandler {
|
|
|
15
15
|
*/
|
|
16
16
|
process<T>(response: Response, responseBodyFormat?: ResponseBodyFormat): Promise<T>;
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* A single error entry returned in the `details` array of a Coveo Platform API error response.
|
|
20
|
+
*/
|
|
21
|
+
export interface PlatformErrorDetail {
|
|
22
|
+
/**
|
|
23
|
+
* A code identifying the type of this error entry, for example `INVALID_PARAMETER`.
|
|
24
|
+
*/
|
|
25
|
+
errorCode: string;
|
|
26
|
+
/**
|
|
27
|
+
* A human-readable explanation of this error entry.
|
|
28
|
+
*/
|
|
29
|
+
message: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The JSON body returned by the Coveo Platform API when a request fails.
|
|
33
|
+
*/
|
|
34
|
+
export interface PlatformErrorResponse {
|
|
35
|
+
/**
|
|
36
|
+
* A human-readable explanation of the error.
|
|
37
|
+
*/
|
|
38
|
+
message: string;
|
|
39
|
+
/**
|
|
40
|
+
* A code identifying the type of error, for example `ORGANIZATION_ALREADY_EXISTS`.
|
|
41
|
+
*/
|
|
42
|
+
errorCode: string;
|
|
43
|
+
/**
|
|
44
|
+
* The unique identifier of the request that failed, useful when contacting Coveo support.
|
|
45
|
+
*/
|
|
46
|
+
requestID: string;
|
|
47
|
+
/**
|
|
48
|
+
* Error messages grouped by key, for example by resource type.
|
|
49
|
+
*/
|
|
50
|
+
errorMessages?: Record<string, string[]>;
|
|
51
|
+
/**
|
|
52
|
+
* Additional errors that caused the request to fail, for example one per invalid parameter.
|
|
53
|
+
*/
|
|
54
|
+
details?: PlatformErrorDetail[];
|
|
55
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import 'core-js/actual/json/parse.js';
|
|
2
2
|
import { Predicate } from '../../utils/types.js';
|
|
3
|
-
import { ResponseBodyFormat, ResponseHandler } from './ResponseHandlerInterfaces.js';
|
|
3
|
+
import { PlatformErrorDetail, PlatformErrorResponse, ResponseBodyFormat, ResponseHandler } from './ResponseHandlerInterfaces.js';
|
|
4
4
|
/**
|
|
5
5
|
* Check whether the response status is `204 No Content`.
|
|
6
6
|
* @param response
|
|
@@ -26,7 +26,7 @@ export default _default;
|
|
|
26
26
|
* Represent errors coming from Coveo's API.
|
|
27
27
|
* Follow loosely [RFC-7807](https://www.ietf.org/rfc/rfc7807.html)
|
|
28
28
|
*/
|
|
29
|
-
export declare class CoveoPlatformClientError extends Error {
|
|
29
|
+
export declare class CoveoPlatformClientError extends Error implements Partial<PlatformErrorResponse> {
|
|
30
30
|
/**
|
|
31
31
|
* The HTTP X-Request-ID request header is an optional and unofficial HTTP header, used to trace individual HTTP requests from the client to the server and back again.
|
|
32
32
|
* It allows the client and server to correlate each HTTP request.
|
|
@@ -45,4 +45,28 @@ export declare class CoveoPlatformClientError extends Error {
|
|
|
45
45
|
* A human-readable explanation specific to this occurrence of the problem.
|
|
46
46
|
*/
|
|
47
47
|
detail: string;
|
|
48
|
+
/**
|
|
49
|
+
* The URL of the request that failed.
|
|
50
|
+
*/
|
|
51
|
+
url?: string;
|
|
52
|
+
/**
|
|
53
|
+
* A code identifying the type of error, as returned by the Coveo Platform API.
|
|
54
|
+
* Only set when the error response body is JSON.
|
|
55
|
+
*/
|
|
56
|
+
errorCode?: string;
|
|
57
|
+
/**
|
|
58
|
+
* The unique identifier of the request that failed, as returned by the Coveo Platform API.
|
|
59
|
+
* Only set when the error response body is JSON.
|
|
60
|
+
*/
|
|
61
|
+
requestID?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Error messages grouped by key, as returned by the Coveo Platform API.
|
|
64
|
+
* Only set when the error response body is JSON and contains them.
|
|
65
|
+
*/
|
|
66
|
+
errorMessages?: Record<string, string[]>;
|
|
67
|
+
/**
|
|
68
|
+
* Additional errors that caused the request to fail, as returned by the Coveo Platform API.
|
|
69
|
+
* Only set when the error response body is JSON and contains them.
|
|
70
|
+
*/
|
|
71
|
+
details?: PlatformErrorDetail[];
|
|
48
72
|
}
|
|
@@ -18,6 +18,16 @@ export interface ModelDetails {
|
|
|
18
18
|
[key: string]: ModelDetailsSubModels;
|
|
19
19
|
};
|
|
20
20
|
candidates?: number;
|
|
21
|
+
/**
|
|
22
|
+
* The name of the encoder used to build the model. Indicates whether the model supports multilingual content.
|
|
23
|
+
* @example MULTILINGUAL_E5_SMALL
|
|
24
|
+
*/
|
|
25
|
+
encoderName?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The name of the strategy used to split documents into chunks when building the model.
|
|
28
|
+
* @example STRUCTURE_AWARE
|
|
29
|
+
*/
|
|
30
|
+
chunkerStrategyName?: string;
|
|
21
31
|
modelDetailedBuildingStats?: ModelDetailsBuildingStats;
|
|
22
32
|
modelDetailedTrainingDetails: ModelDetailsTrainingDetails;
|
|
23
33
|
modelDetailedPreparationDetails: ModelDetailsPreparationDetails;
|
|
@@ -34,6 +34,12 @@ export interface ModelDetailsBuildingStats {
|
|
|
34
34
|
max?: number;
|
|
35
35
|
mean?: number;
|
|
36
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* The number of documents per content stream used when building the model.
|
|
39
|
+
* The values sum up to `documentsWithChunksCount`.
|
|
40
|
+
* @example {"markdown": 10, "content": 5}
|
|
41
|
+
*/
|
|
42
|
+
documentStreams?: Record<string, number>;
|
|
37
43
|
commerceEventCounts?: ModelDetailsCommerceEvents;
|
|
38
44
|
modelDetailedStatsPerSource?: ModelDetailsStatsPerSource[];
|
|
39
45
|
addToCart?: number;
|
|
@@ -12,4 +12,18 @@ export interface ModelDetailsStatsPerSource {
|
|
|
12
12
|
max?: number;
|
|
13
13
|
mean?: number;
|
|
14
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* The minimum, maximum, and mean number of snippets per document of the source.
|
|
17
|
+
*/
|
|
18
|
+
snippetsPerDocument?: {
|
|
19
|
+
min?: number;
|
|
20
|
+
max?: number;
|
|
21
|
+
mean?: number;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* The number of documents of the source per content stream used when building the model.
|
|
25
|
+
* The values sum up to `documentsWithChunksCount` for the source.
|
|
26
|
+
* @example {"markdown": 10, "content": 0}
|
|
27
|
+
*/
|
|
28
|
+
documentStreams?: Record<string, number>;
|
|
15
29
|
}
|