@cognigy/rest-api-client 0.13.0 → 0.13.2
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/.eslintConfig.json +117 -0
- package/.eslintrc.json +2 -2
- package/CHANGELOG.md +22 -0
- package/build/apigroups/ResourcesAPIGroup_2_0.js +10 -1
- package/build/shared/charts/descriptors/allFields.js +8 -0
- package/build/shared/charts/descriptors/apps/getAppSessionPin.js +9 -9
- package/build/shared/charts/descriptors/apps/initAppSession.js +36 -53
- package/build/shared/charts/descriptors/apps/setAdaptiveCardAppState.js +5 -18
- package/build/shared/charts/descriptors/apps/setAppState.js +6 -6
- package/build/shared/charts/descriptors/apps/setHtmlAppState.js +3 -3
- package/build/shared/charts/descriptors/apps/utils/buildAppUrl.js +12 -0
- package/build/shared/charts/descriptors/index.js +1 -1
- package/build/shared/charts/descriptors/logic/switch/switch.js +3 -2
- package/build/shared/charts/descriptors/message/question/optionalQuestion.js +8 -1
- package/build/shared/charts/descriptors/message/question/question.js +7 -3
- package/build/shared/charts/descriptors/message/question/utils/evaluateQuestionAnswer.js +6 -0
- package/build/shared/charts/descriptors/service/handoverV2.js +1 -1
- package/build/shared/charts/descriptors/voice/mappers/setSessionConfig.mapper.js +28 -25
- package/build/shared/charts/descriptors/voice/nodes/bargeIn.js +53 -0
- package/build/shared/charts/descriptors/voice/nodes/dtmf.js +5 -3
- package/build/shared/charts/descriptors/voice/nodes/play.js +10 -3
- package/build/shared/charts/descriptors/voice/nodes/transfer.js +4 -0
- package/build/shared/charts/descriptors/voicegateway/nodes/handover.js +5 -1
- package/build/shared/charts/descriptors/voicegateway2/nodes/play.js +17 -5
- package/build/shared/charts/descriptors/voicegateway2/nodes/setSessionConfig.js +27 -9
- package/build/shared/charts/descriptors/voicegateway2/nodes/transfer.js +5 -1
- package/build/shared/errors/BadGatewayError.js +2 -1
- package/build/shared/errors/BadRequestError.js +2 -1
- package/build/shared/errors/ForbiddenError.js +2 -1
- package/build/shared/errors/GatewayTimeoutError.js +2 -1
- package/build/shared/errors/MethodNotAllowedError.js +2 -1
- package/build/shared/errors/NetworkError.js +2 -1
- package/build/shared/errors/PayloadTooLargeError.js +2 -1
- package/build/shared/errors/PaymentRequiredError.js +2 -1
- package/build/shared/errors/ServiceUnavailableError.js +2 -1
- package/build/shared/errors/UnauthorizedError.js +2 -1
- package/build/shared/errors/baseError.js +27 -4
- package/build/shared/errors/conflict.js +2 -1
- package/build/shared/errors/databaseConnectError.js +2 -2
- package/build/shared/errors/databaseQueryError.js +2 -2
- package/build/shared/errors/databaseRead.js +2 -2
- package/build/shared/errors/databaseWrite.js +2 -2
- package/build/shared/errors/exportError.js +2 -2
- package/build/shared/errors/fileRead.js +2 -2
- package/build/shared/errors/fileWrite.js +2 -2
- package/build/shared/errors/importError.js +1 -1
- package/build/shared/errors/inputOutputError.js +2 -2
- package/build/shared/errors/internalServerError.js +2 -1
- package/build/shared/errors/invalidArgument.js +2 -2
- package/build/shared/errors/missingArgument.js +2 -2
- package/build/shared/errors/notImplementedError.js +2 -1
- package/build/shared/errors/process.js +2 -2
- package/build/shared/errors/resourceNotFound.js +5 -1
- package/build/shared/errors/smtpConnectError.js +2 -2
- package/build/shared/errors/timeoutError.js +2 -2
- package/build/shared/interfaces/handover.js +1 -0
- package/build/shared/interfaces/resources/IAgentAssistConfig.js +56 -0
- package/build/shared/interfaces/resources/ILocale.js +25 -3
- package/build/shared/interfaces/resources/INodeDescriptorSet.js +1 -0
- package/build/shared/interfaces/resources/TResourceType.js +3 -0
- package/build/shared/interfaces/resources/settings/ISharedSettings.js +1 -1
- package/build/shared/interfaces/resources/yesNoIntent/IYesNoItem.js +5 -5
- package/build/shared/interfaces/restAPI/administration/liveAgent/v2.0/ICognigyLiveAgentMiddleware_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/agentAssist/v2.0/IAgentAssistConfig_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/agentAssist/v2.0/ICreateAgentAssistConfigRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/agentAssist/v2.0/IDeleteAgentAssistConfigRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/agentAssist/v2.0/IIndexAgentAssistConfigsRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/agentAssist/v2.0/IReadAgentAssistConfigRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/agentAssist/v2.0/IUpdateAgentAssistConfigRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/agentAssist/v2.0/index.js +3 -0
- package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoIntents/ITrainYesNoIntentsProjectRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoIntents/IYesNoIntents_2_0.js +4 -4
- package/build/shared/interfaces/security/IACL.js +1 -1
- package/build/shared/interfaces/security/IPermission.js +2 -0
- package/build/shared/interfaces/security/IRole.js +4 -0
- package/package.json +2 -2
- package/types/index.d.ts +218 -66
|
@@ -41,7 +41,7 @@ const HttpStatusCode_1 = require("../helper/HttpStatusCode");
|
|
|
41
41
|
* example: {}
|
|
42
42
|
*/
|
|
43
43
|
class UnauthorizedError extends baseError_1.BaseError {
|
|
44
|
-
constructor(message, stack, meta, details) {
|
|
44
|
+
constructor(message, stack, meta, details, logLevel) {
|
|
45
45
|
super({
|
|
46
46
|
name: "Unauthorized Error",
|
|
47
47
|
message,
|
|
@@ -51,6 +51,7 @@ class UnauthorizedError extends baseError_1.BaseError {
|
|
|
51
51
|
meta,
|
|
52
52
|
stack,
|
|
53
53
|
details,
|
|
54
|
+
logLevel,
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
57
|
}
|
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BaseError = exports.errorLogger = void 0;
|
|
3
|
+
exports.BaseError = exports.setErrorTracer = exports.errorLogger = void 0;
|
|
4
4
|
/* Custom Modules */
|
|
5
5
|
const HttpStatusCode_1 = require("../helper/HttpStatusCode");
|
|
6
6
|
exports.errorLogger = {
|
|
7
7
|
log: Function.prototype
|
|
8
8
|
};
|
|
9
|
+
let tracer = null;
|
|
10
|
+
/**
|
|
11
|
+
* Set an instance of a Tracer, e.g. a Sentry Tracer,
|
|
12
|
+
* to be used to send errors to the tracing provider
|
|
13
|
+
*/
|
|
14
|
+
function setErrorTracer(t) {
|
|
15
|
+
if (t.getIsErrorTracingEnabled()) {
|
|
16
|
+
tracer = t;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.setErrorTracer = setErrorTracer;
|
|
9
20
|
class BaseError extends Error {
|
|
10
|
-
constructor({ name, message, code, httpStatusCode, httpStatusText, stack, meta, details }) {
|
|
21
|
+
constructor({ name, message, code, httpStatusCode, httpStatusText, stack, meta, details, logLevel }) {
|
|
22
|
+
var _a;
|
|
11
23
|
super(message || name);
|
|
12
24
|
this.name = name;
|
|
13
25
|
this.code = code;
|
|
@@ -16,9 +28,10 @@ class BaseError extends Error {
|
|
|
16
28
|
this.loggerstack = stack;
|
|
17
29
|
this.details = details || {};
|
|
18
30
|
this.meta = meta || {};
|
|
31
|
+
this.logLevel = logLevel || "error";
|
|
19
32
|
if (this.meta.originalError) {
|
|
20
33
|
if (this.meta.originalError instanceof BaseError) {
|
|
21
|
-
// if the passed error is already an instance of our base class error class, no need to
|
|
34
|
+
// if the passed error is already an instance of our base class error class, no need to
|
|
22
35
|
this.originalErrorDetails = this.meta.originalError.originalErrorDetails;
|
|
23
36
|
}
|
|
24
37
|
else {
|
|
@@ -26,7 +39,16 @@ class BaseError extends Error {
|
|
|
26
39
|
}
|
|
27
40
|
this.meta.originalError = this.originalErrorDetails;
|
|
28
41
|
}
|
|
29
|
-
|
|
42
|
+
if (tracer) {
|
|
43
|
+
if (this.logLevel === "error" || this.logLevel === "fatal") {
|
|
44
|
+
tracer.captureException(this, {
|
|
45
|
+
traceId: (_a = this.loggerstack) === null || _a === void 0 ? void 0 : _a.traceId,
|
|
46
|
+
organisationId: (meta === null || meta === void 0 ? void 0 : meta.organisationId) || (meta === null || meta === void 0 ? void 0 : meta.organisation),
|
|
47
|
+
projectId: meta === null || meta === void 0 ? void 0 : meta.projectId,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.errorLogger.log(this.logLevel, stack, message || name, this.meta);
|
|
30
52
|
}
|
|
31
53
|
parseOriginalError(error) {
|
|
32
54
|
return {
|
|
@@ -59,6 +81,7 @@ class BaseError extends Error {
|
|
|
59
81
|
loggerstack: this.loggerstack,
|
|
60
82
|
meta: this.meta,
|
|
61
83
|
details: this.details,
|
|
84
|
+
logLevel: this.logLevel,
|
|
62
85
|
}
|
|
63
86
|
};
|
|
64
87
|
}
|
|
@@ -41,7 +41,7 @@ const HttpStatusCode_1 = require("../helper/HttpStatusCode");
|
|
|
41
41
|
* example: {}
|
|
42
42
|
*/
|
|
43
43
|
class ConflictError extends baseError_1.BaseError {
|
|
44
|
-
constructor(message, stack, meta, details) {
|
|
44
|
+
constructor(message, stack, meta, details, logLevel) {
|
|
45
45
|
super({
|
|
46
46
|
name: "Conflict Error",
|
|
47
47
|
message,
|
|
@@ -51,6 +51,7 @@ class ConflictError extends baseError_1.BaseError {
|
|
|
51
51
|
stack,
|
|
52
52
|
meta,
|
|
53
53
|
details,
|
|
54
|
+
logLevel,
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
57
|
}
|
|
@@ -5,8 +5,8 @@ exports.DatabaseConnectError = void 0;
|
|
|
5
5
|
const BadGatewayError_1 = require("./BadGatewayError");
|
|
6
6
|
const ErrorCode_1 = require("./ErrorCode");
|
|
7
7
|
class DatabaseConnectError extends BadGatewayError_1.BadGatewayError {
|
|
8
|
-
constructor(message, stack, meta, details) {
|
|
9
|
-
super(message, stack, meta, details);
|
|
8
|
+
constructor(message, stack, meta, details, logLevel) {
|
|
9
|
+
super(message, stack, meta, details, logLevel);
|
|
10
10
|
this.name = "Database Connect Error";
|
|
11
11
|
this.code = ErrorCode_1.ErrorCode.DATABASE_CONNECT_ERROR;
|
|
12
12
|
}
|
|
@@ -5,8 +5,8 @@ exports.DatabaseQueryError = void 0;
|
|
|
5
5
|
const internalServerError_1 = require("./internalServerError");
|
|
6
6
|
const ErrorCode_1 = require("./ErrorCode");
|
|
7
7
|
class DatabaseQueryError extends internalServerError_1.InternalServerError {
|
|
8
|
-
constructor(message, stack, meta, details) {
|
|
9
|
-
super(message, stack, meta, details);
|
|
8
|
+
constructor(message, stack, meta, details, logLevel) {
|
|
9
|
+
super(message, stack, meta, details, logLevel);
|
|
10
10
|
this.name = "Database Query Error";
|
|
11
11
|
this.code = ErrorCode_1.ErrorCode.DATABASE_QUERY_ERROR;
|
|
12
12
|
}
|
|
@@ -5,8 +5,8 @@ exports.DatabaseReadError = void 0;
|
|
|
5
5
|
const internalServerError_1 = require("./internalServerError");
|
|
6
6
|
const ErrorCode_1 = require("./ErrorCode");
|
|
7
7
|
class DatabaseReadError extends internalServerError_1.InternalServerError {
|
|
8
|
-
constructor(message, stack, meta, details) {
|
|
9
|
-
super(message, stack, meta, details);
|
|
8
|
+
constructor(message, stack, meta, details, logLevel) {
|
|
9
|
+
super(message, stack, meta, details, logLevel);
|
|
10
10
|
this.name = "Database Read Error";
|
|
11
11
|
this.code = ErrorCode_1.ErrorCode.DATABASE_READ_ERROR;
|
|
12
12
|
}
|
|
@@ -5,8 +5,8 @@ exports.DatabaseWriteError = void 0;
|
|
|
5
5
|
const internalServerError_1 = require("./internalServerError");
|
|
6
6
|
const ErrorCode_1 = require("./ErrorCode");
|
|
7
7
|
class DatabaseWriteError extends internalServerError_1.InternalServerError {
|
|
8
|
-
constructor(message, stack, meta, details) {
|
|
9
|
-
super(message, stack, meta, details);
|
|
8
|
+
constructor(message, stack, meta, details, logLevel) {
|
|
9
|
+
super(message, stack, meta, details, logLevel);
|
|
10
10
|
this.name = "Database Write Error";
|
|
11
11
|
this.code = ErrorCode_1.ErrorCode.DATABASE_WRITE_ERROR;
|
|
12
12
|
}
|
|
@@ -5,8 +5,8 @@ exports.ExportError = void 0;
|
|
|
5
5
|
const internalServerError_1 = require("./internalServerError");
|
|
6
6
|
const ErrorCode_1 = require("./ErrorCode");
|
|
7
7
|
class ExportError extends internalServerError_1.InternalServerError {
|
|
8
|
-
constructor(message, stack, meta, details) {
|
|
9
|
-
super(message, stack, meta, details);
|
|
8
|
+
constructor(message, stack, meta, details, logLevel) {
|
|
9
|
+
super(message, stack, meta, details, logLevel);
|
|
10
10
|
this.name = "Export Error";
|
|
11
11
|
this.code = ErrorCode_1.ErrorCode.EXPORT_ERROR;
|
|
12
12
|
}
|
|
@@ -5,8 +5,8 @@ exports.FileReadError = void 0;
|
|
|
5
5
|
const internalServerError_1 = require("./internalServerError");
|
|
6
6
|
const ErrorCode_1 = require("./ErrorCode");
|
|
7
7
|
class FileReadError extends internalServerError_1.InternalServerError {
|
|
8
|
-
constructor(message, stack, meta, details) {
|
|
9
|
-
super(message, stack, meta, details);
|
|
8
|
+
constructor(message, stack, meta, details, logLevel) {
|
|
9
|
+
super(message, stack, meta, details, logLevel);
|
|
10
10
|
this.name = "File Read Error";
|
|
11
11
|
this.code = ErrorCode_1.ErrorCode.FILE_READ_ERROR;
|
|
12
12
|
}
|
|
@@ -5,8 +5,8 @@ exports.FileWriteError = void 0;
|
|
|
5
5
|
const internalServerError_1 = require("./internalServerError");
|
|
6
6
|
const ErrorCode_1 = require("./ErrorCode");
|
|
7
7
|
class FileWriteError extends internalServerError_1.InternalServerError {
|
|
8
|
-
constructor(message, stack, meta, details) {
|
|
9
|
-
super(message, stack, meta, details);
|
|
8
|
+
constructor(message, stack, meta, details, logLevel) {
|
|
9
|
+
super(message, stack, meta, details, logLevel);
|
|
10
10
|
this.name = "File Write Error";
|
|
11
11
|
this.code = ErrorCode_1.ErrorCode.FILE_WRITE_ERROR;
|
|
12
12
|
}
|
|
@@ -5,7 +5,7 @@ exports.ImportError = void 0;
|
|
|
5
5
|
const internalServerError_1 = require("./internalServerError");
|
|
6
6
|
const ErrorCode_1 = require("./ErrorCode");
|
|
7
7
|
class ImportError extends internalServerError_1.InternalServerError {
|
|
8
|
-
constructor(message, stack, meta, details) {
|
|
8
|
+
constructor(message, stack, meta, details, logLevel) {
|
|
9
9
|
super(message, stack, meta);
|
|
10
10
|
this.name = "Import Error";
|
|
11
11
|
this.code = ErrorCode_1.ErrorCode.IMPORT_ERROR;
|
|
@@ -5,8 +5,8 @@ exports.InputOutputError = void 0;
|
|
|
5
5
|
const internalServerError_1 = require("./internalServerError");
|
|
6
6
|
const ErrorCode_1 = require("./ErrorCode");
|
|
7
7
|
class InputOutputError extends internalServerError_1.InternalServerError {
|
|
8
|
-
constructor(message, stack, meta, details) {
|
|
9
|
-
super(message, stack, meta, details);
|
|
8
|
+
constructor(message, stack, meta, details, logLevel) {
|
|
9
|
+
super(message, stack, meta, details, logLevel);
|
|
10
10
|
this.name = "Input Output Error";
|
|
11
11
|
this.code = ErrorCode_1.ErrorCode.INPUT_OUTPUT_ERROR;
|
|
12
12
|
}
|
|
@@ -41,7 +41,7 @@ const HttpStatusCode_1 = require("../helper/HttpStatusCode");
|
|
|
41
41
|
* example: {}
|
|
42
42
|
*/
|
|
43
43
|
class InternalServerError extends baseError_1.BaseError {
|
|
44
|
-
constructor(message, stack, meta, details) {
|
|
44
|
+
constructor(message, stack, meta, details, logLevel) {
|
|
45
45
|
super({
|
|
46
46
|
name: "Internal Server Error",
|
|
47
47
|
message,
|
|
@@ -51,6 +51,7 @@ class InternalServerError extends baseError_1.BaseError {
|
|
|
51
51
|
meta,
|
|
52
52
|
stack,
|
|
53
53
|
details,
|
|
54
|
+
logLevel,
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
57
|
}
|
|
@@ -5,8 +5,8 @@ exports.InvalidArgumentError = void 0;
|
|
|
5
5
|
const BadRequestError_1 = require("./BadRequestError");
|
|
6
6
|
const ErrorCode_1 = require("./ErrorCode");
|
|
7
7
|
class InvalidArgumentError extends BadRequestError_1.BadRequestError {
|
|
8
|
-
constructor(message, stack, meta, details) {
|
|
9
|
-
super(message, stack, meta, details);
|
|
8
|
+
constructor(message, stack, meta, details, logLevel) {
|
|
9
|
+
super(message, stack, meta, details, logLevel);
|
|
10
10
|
this.name = "Invalid Argument Error";
|
|
11
11
|
this.code = ErrorCode_1.ErrorCode.INVALID_ARGUMENT_ERROR;
|
|
12
12
|
}
|
|
@@ -5,8 +5,8 @@ exports.MissingArgumentError = void 0;
|
|
|
5
5
|
const ErrorCode_1 = require("./ErrorCode");
|
|
6
6
|
const BadRequestError_1 = require("./BadRequestError");
|
|
7
7
|
class MissingArgumentError extends BadRequestError_1.BadRequestError {
|
|
8
|
-
constructor(message, stack, meta, details) {
|
|
9
|
-
super(message, stack, meta, details);
|
|
8
|
+
constructor(message, stack, meta, details, logLevel) {
|
|
9
|
+
super(message, stack, meta, details, logLevel);
|
|
10
10
|
this.name = "Missing Argument Error";
|
|
11
11
|
this.code = ErrorCode_1.ErrorCode.MISSING_ARGUMENT_ERROR;
|
|
12
12
|
}
|
|
@@ -41,7 +41,7 @@ const HttpStatusCode_1 = require("../helper/HttpStatusCode");
|
|
|
41
41
|
* example: {}
|
|
42
42
|
*/
|
|
43
43
|
class NotImplementedError extends baseError_1.BaseError {
|
|
44
|
-
constructor(message, stack, meta, details) {
|
|
44
|
+
constructor(message, stack, meta, details, logLevel) {
|
|
45
45
|
super({
|
|
46
46
|
name: "Not Implemented Error",
|
|
47
47
|
message,
|
|
@@ -51,6 +51,7 @@ class NotImplementedError extends baseError_1.BaseError {
|
|
|
51
51
|
meta,
|
|
52
52
|
stack,
|
|
53
53
|
details,
|
|
54
|
+
logLevel,
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
57
|
}
|
|
@@ -5,8 +5,8 @@ exports.ProcessError = void 0;
|
|
|
5
5
|
const internalServerError_1 = require("./internalServerError");
|
|
6
6
|
const ErrorCode_1 = require("./ErrorCode");
|
|
7
7
|
class ProcessError extends internalServerError_1.InternalServerError {
|
|
8
|
-
constructor(message, stack, meta, details) {
|
|
9
|
-
super(message, stack, meta, details);
|
|
8
|
+
constructor(message, stack, meta, details, logLevel) {
|
|
9
|
+
super(message, stack, meta, details, logLevel);
|
|
10
10
|
this.name = "Process Error";
|
|
11
11
|
this.code = ErrorCode_1.ErrorCode.PROCESS_ERROR;
|
|
12
12
|
}
|
|
@@ -39,9 +39,12 @@ const HttpStatusCode_1 = require("../helper/HttpStatusCode");
|
|
|
39
39
|
* details:
|
|
40
40
|
* type: object
|
|
41
41
|
* example: {}
|
|
42
|
+
* logLevel:
|
|
43
|
+
* type: string
|
|
44
|
+
* example: error
|
|
42
45
|
*/
|
|
43
46
|
class ResourceNotFoundError extends baseError_1.BaseError {
|
|
44
|
-
constructor(message, stack, meta, details) {
|
|
47
|
+
constructor(message, stack, meta, details, logLevel) {
|
|
45
48
|
super({
|
|
46
49
|
name: "Resource Not Found Error",
|
|
47
50
|
message,
|
|
@@ -51,6 +54,7 @@ class ResourceNotFoundError extends baseError_1.BaseError {
|
|
|
51
54
|
meta,
|
|
52
55
|
stack,
|
|
53
56
|
details,
|
|
57
|
+
logLevel,
|
|
54
58
|
});
|
|
55
59
|
}
|
|
56
60
|
}
|
|
@@ -5,8 +5,8 @@ exports.SMTPConnectError = void 0;
|
|
|
5
5
|
const BadGatewayError_1 = require("./BadGatewayError");
|
|
6
6
|
const ErrorCode_1 = require("./ErrorCode");
|
|
7
7
|
class SMTPConnectError extends BadGatewayError_1.BadGatewayError {
|
|
8
|
-
constructor(message, stack, meta, details) {
|
|
9
|
-
super(message, stack, meta, details);
|
|
8
|
+
constructor(message, stack, meta, details, logLevel) {
|
|
9
|
+
super(message, stack, meta, details, logLevel);
|
|
10
10
|
this.name = "SMTP Connect Error";
|
|
11
11
|
this.code = ErrorCode_1.ErrorCode.SMTP_CONNECT_ERROR;
|
|
12
12
|
}
|
|
@@ -5,8 +5,8 @@ exports.TimeoutError = void 0;
|
|
|
5
5
|
const GatewayTimeoutError_1 = require("./GatewayTimeoutError");
|
|
6
6
|
const ErrorCode_1 = require("./ErrorCode");
|
|
7
7
|
class TimeoutError extends GatewayTimeoutError_1.GatewayTimeoutError {
|
|
8
|
-
constructor(message, stack, meta, details) {
|
|
9
|
-
super(message, stack, meta, details);
|
|
8
|
+
constructor(message, stack, meta, details, logLevel) {
|
|
9
|
+
super(message, stack, meta, details, logLevel);
|
|
10
10
|
this.name = "Timeout Error";
|
|
11
11
|
this.code = ErrorCode_1.ErrorCode.TIMEOUT_ERROR;
|
|
12
12
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateAgentAssistConfigRedisKeys = exports.agentAssistConfigSchema = exports.agentAssistConfigDataSchema = exports.agentAssistGridConfigSchema = void 0;
|
|
4
|
+
/* Interfaces & Types */
|
|
5
|
+
const IEntityMeta_1 = require("./IEntityMeta");
|
|
6
|
+
exports.agentAssistGridConfigSchema = {
|
|
7
|
+
title: "agentAssistGridConfigSchema",
|
|
8
|
+
type: "object",
|
|
9
|
+
minProperties: 1,
|
|
10
|
+
additionalProperties: false,
|
|
11
|
+
patternProperties: {
|
|
12
|
+
"[a-zA-Z][0-9a-zA-Z_$]*": {
|
|
13
|
+
type: "object",
|
|
14
|
+
required: [
|
|
15
|
+
"x",
|
|
16
|
+
"y",
|
|
17
|
+
"columns",
|
|
18
|
+
"rows"
|
|
19
|
+
],
|
|
20
|
+
additionalProperties: false,
|
|
21
|
+
properties: {
|
|
22
|
+
x: { type: "number" },
|
|
23
|
+
y: { type: "number" },
|
|
24
|
+
columns: { type: "number" },
|
|
25
|
+
rows: { type: "number" }
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
exports.agentAssistConfigDataSchema = {
|
|
31
|
+
title: "agentAssistConfigDataSchema",
|
|
32
|
+
type: "object",
|
|
33
|
+
additionalProperties: false,
|
|
34
|
+
required: [
|
|
35
|
+
"name",
|
|
36
|
+
"config",
|
|
37
|
+
],
|
|
38
|
+
properties: {
|
|
39
|
+
name: { type: "string", format: "resource-name" },
|
|
40
|
+
description: { type: "string", format: "snapshot-description" },
|
|
41
|
+
config: exports.agentAssistGridConfigSchema
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
exports.agentAssistConfigSchema = {
|
|
45
|
+
title: "agentAssistConfigSchema",
|
|
46
|
+
type: "object",
|
|
47
|
+
additionalProperties: false,
|
|
48
|
+
properties: Object.assign(Object.assign(Object.assign({}, IEntityMeta_1.entityMetaSchema.properties), exports.agentAssistConfigDataSchema.properties), { referenceId: { type: "string", format: "uuid" }, projectReference: { type: "string", format: "mongo-id" }, organisationReference: { type: "string", format: "mongo-id" } }),
|
|
49
|
+
};
|
|
50
|
+
const generateAgentAssistConfigRedisKeys = (data) => {
|
|
51
|
+
return [
|
|
52
|
+
`organisationId:${data.organisationReference}:projectId:${data.projectReference}:flowId:${data.configId}:agentAssistConfig:v1`
|
|
53
|
+
];
|
|
54
|
+
};
|
|
55
|
+
exports.generateAgentAssistConfigRedisKeys = generateAgentAssistConfigRedisKeys;
|
|
56
|
+
//# sourceMappingURL=IAgentAssistConfig.js.map
|
|
@@ -1,17 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.localeSchema = exports.localeDataSchema = void 0;
|
|
3
|
+
exports.localeSchema = exports.localeDataSchema = exports.localeInDBSchema = exports.localeInDBDataSchema = void 0;
|
|
4
|
+
const ITrainGroupFeedbackReport_1 = require("./intent/ITrainGroupFeedbackReport");
|
|
5
|
+
exports.localeInDBDataSchema = {
|
|
6
|
+
title: "localeDataSchema",
|
|
7
|
+
additionalProperties: false,
|
|
8
|
+
properties: {
|
|
9
|
+
name: { type: "string", format: "resource-name" },
|
|
10
|
+
nluLanguage: { type: "string", format: "nlu-language" }
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
exports.localeInDBSchema = {
|
|
14
|
+
title: "localeSchema",
|
|
15
|
+
additionalProperties: false,
|
|
16
|
+
properties: Object.assign(Object.assign({}, exports.localeInDBDataSchema.properties), { _id: { type: "string", format: "mongo-id" }, referenceId: { type: "string", format: "uuid" }, primary: { type: "boolean" }, createdAt: { type: "number" }, createdBy: { type: "string", format: "mongo-id" }, lastChanged: { type: "number" }, lastChangedBy: { type: "string", format: "mongo-id" }, projectReference: { type: "string", format: "mongo-id" }, organisationReference: { type: "string", format: "mongo-id" }, fallbackLocaleReference: { type: ["string", "null"], format: "mongo-id" } })
|
|
17
|
+
};
|
|
4
18
|
exports.localeDataSchema = {
|
|
5
19
|
title: "localeDataSchema",
|
|
6
20
|
additionalProperties: false,
|
|
7
21
|
properties: {
|
|
8
22
|
name: { type: "string", format: "resource-name" },
|
|
9
|
-
nluLanguage: { type: "string", format: "nlu-language" }
|
|
23
|
+
nluLanguage: { type: "string", format: "nlu-language" }
|
|
10
24
|
}
|
|
11
25
|
};
|
|
12
26
|
exports.localeSchema = {
|
|
13
27
|
title: "localeSchema",
|
|
14
28
|
additionalProperties: false,
|
|
15
|
-
properties: Object.assign(Object.assign({}, exports.localeDataSchema.properties), { _id: { type: "string", format: "mongo-id" }, referenceId: { type: "string", format: "uuid" }, primary: { type: "boolean" }, createdAt: { type: "number" }, createdBy: { type: "string", format: "mongo-id" }, lastChanged: { type: "number" }, lastChangedBy: { type: "string", format: "mongo-id" }, projectReference: { type: "string", format: "mongo-id" }, organisationReference: { type: "string", format: "mongo-id" }, fallbackLocaleReference: { type: ["string", "null"], format: "mongo-id" } }
|
|
29
|
+
properties: Object.assign(Object.assign({}, exports.localeDataSchema.properties), { _id: { type: "string", format: "mongo-id" }, referenceId: { type: "string", format: "uuid" }, primary: { type: "boolean" }, createdAt: { type: "number" }, createdBy: { type: "string", format: "mongo-id" }, lastChanged: { type: "number" }, lastChangedBy: { type: "string", format: "mongo-id" }, projectReference: { type: "string", format: "mongo-id" }, organisationReference: { type: "string", format: "mongo-id" }, fallbackLocaleReference: { type: ["string", "null"], format: "mongo-id" }, intentTrainGroupReference: { type: "string", format: "mongo-id" }, intentTrainGroupReferenceId: { type: "string", format: "uuid" }, feedbackReport: ITrainGroupFeedbackReport_1.trainGroupFeedbackReportDataSchema, isTrainingOutOfDate: { type: "boolean" }, lastTrainedAt: { type: "number" }, nluOptions: {
|
|
30
|
+
type: "object",
|
|
31
|
+
additionalProperties: false,
|
|
32
|
+
properties: {
|
|
33
|
+
intentModelVersion: {
|
|
34
|
+
type: "string"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
} })
|
|
16
38
|
};
|
|
17
39
|
//# sourceMappingURL=ILocale.js.map
|
|
@@ -10,6 +10,7 @@ exports.primaryResourceTypes = exports.packageableResourceTypes = exports.search
|
|
|
10
10
|
* description: The type of a resource
|
|
11
11
|
* example: flow
|
|
12
12
|
* enum:
|
|
13
|
+
* - agentassistconfig
|
|
13
14
|
* - agentSettings
|
|
14
15
|
* - chart
|
|
15
16
|
* - connection
|
|
@@ -42,6 +43,7 @@ exports.primaryResourceTypes = exports.packageableResourceTypes = exports.search
|
|
|
42
43
|
* - snippet
|
|
43
44
|
*/
|
|
44
45
|
exports.arrayTResourceType = [
|
|
46
|
+
"agentassistconfig",
|
|
45
47
|
"agentSettings",
|
|
46
48
|
"chart",
|
|
47
49
|
"connection",
|
|
@@ -136,6 +138,7 @@ exports.searchableResourceTypes = [
|
|
|
136
138
|
"snapshot",
|
|
137
139
|
];
|
|
138
140
|
exports.packageableResourceTypes = [
|
|
141
|
+
"agentAssistConfig",
|
|
139
142
|
"connection",
|
|
140
143
|
"endpoint",
|
|
141
144
|
"extension",
|
|
@@ -47,7 +47,7 @@ exports.sharedSettingsSchema = {
|
|
|
47
47
|
useURLSlots: { type: ["boolean", "null"] }
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
|
-
|
|
50
|
+
yesNoLogic: { type: "string", enum: [...IYesNoItem_1.yesNoLogic] },
|
|
51
51
|
yesNoIntentThreshold: { type: "number" }
|
|
52
52
|
}
|
|
53
53
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
3
|
+
exports.yesNoLogic = void 0;
|
|
4
|
+
exports.yesNoLogic = [
|
|
5
|
+
"yesNoIntents",
|
|
6
|
+
"yesNoIntentsWithRules",
|
|
7
|
+
"confirmationWords"
|
|
8
8
|
];
|
|
9
9
|
//# sourceMappingURL=IYesNoItem.js.map
|
package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoIntents/IYesNoIntents_2_0.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
3
|
+
const arrayYesNoLogic = [
|
|
4
|
+
"yesNoIntents",
|
|
5
|
+
"yesNoIntentsWithRules",
|
|
6
|
+
"confirmationWords"
|
|
7
7
|
];
|
|
8
8
|
//# sourceMappingURL=IYesNoIntents_2_0.js.map
|
|
@@ -10,7 +10,7 @@ var CrudOperation;
|
|
|
10
10
|
})(CrudOperation = exports.CrudOperation || (exports.CrudOperation = {}));
|
|
11
11
|
const generateUserAclRedisKeys = (data) => {
|
|
12
12
|
return [
|
|
13
|
-
`organisationId:${data.organisationId}:userId:${data.userId}:acl:
|
|
13
|
+
`organisationId:${data.organisationId}:userId:${data.userId}:acl:v5`,
|
|
14
14
|
];
|
|
15
15
|
};
|
|
16
16
|
exports.generateUserAclRedisKeys = generateUserAclRedisKeys;
|
|
@@ -34,6 +34,7 @@ exports.organisationWidePermissions = [
|
|
|
34
34
|
* TProjectWidePermissions:
|
|
35
35
|
* type: string
|
|
36
36
|
* enum:
|
|
37
|
+
* - agentAssistConfigs
|
|
37
38
|
* - analytics
|
|
38
39
|
* - connections
|
|
39
40
|
* - contactProfiles
|
|
@@ -66,6 +67,7 @@ exports.organisationWidePermissions = [
|
|
|
66
67
|
* - dataPrivacySettings
|
|
67
68
|
*/
|
|
68
69
|
exports.projectWidePermissions = [
|
|
70
|
+
"agentAssistConfigs",
|
|
69
71
|
"analytics",
|
|
70
72
|
"connections",
|
|
71
73
|
"contactProfiles",
|
|
@@ -42,6 +42,8 @@ exports.organisationWideRoles = [
|
|
|
42
42
|
* TProjectWideRole:
|
|
43
43
|
* type: string
|
|
44
44
|
* enum:
|
|
45
|
+
* - agentAssistConfigAdmin
|
|
46
|
+
* - agentAssistConfigViewer
|
|
45
47
|
* - analytics
|
|
46
48
|
* - basic
|
|
47
49
|
* - connection_admin
|
|
@@ -78,6 +80,8 @@ exports.organisationWideRoles = [
|
|
|
78
80
|
* - function_editor
|
|
79
81
|
*/
|
|
80
82
|
exports.projectWideRoles = [
|
|
83
|
+
"agentAssistConfigAdmin",
|
|
84
|
+
"agentAssistConfigViewer",
|
|
81
85
|
"analytics",
|
|
82
86
|
"basic",
|
|
83
87
|
"connection_admin",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cognigy/rest-api-client",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.2",
|
|
4
4
|
"description": "Cognigy REST-Client",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"module": "dist/rollup-plugin-babel.esm.js",
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
"author": "Cognigy GmbH",
|
|
31
31
|
"license": "Cognigy Proprietary License",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@cognigy-internal/core": "0.6.0",
|
|
34
33
|
"ajv": "6.12.6",
|
|
35
34
|
"axios": "0.27.2",
|
|
36
35
|
"form-data": "4.0.0",
|
|
@@ -65,6 +64,7 @@
|
|
|
65
64
|
"eslint-plugin-sonarjs": "0.15.0",
|
|
66
65
|
"eslint-config-prettier": "8.5.0",
|
|
67
66
|
"eslint-plugin-prettier": "4.2.1",
|
|
67
|
+
"eslint-plugin-node": "11.1.0",
|
|
68
68
|
"prettier": "2.7.1",
|
|
69
69
|
"typescript": "4.7.4",
|
|
70
70
|
"@typescript-eslint/eslint-plugin": "5.33.1",
|