@trii/types 2.10.686 → 2.10.688
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/Automations/Nodes/Node.d.ts +7 -0
- package/dist/Common/Channels/Channel.d.ts +21 -3
- package/dist/src/Automations/Capabilities/Capability.d.ts +48 -0
- package/dist/src/Automations/Capabilities/Capability.js +9 -0
- package/dist/src/Automations/Capabilities/index.d.ts +1 -0
- package/dist/src/Automations/Capabilities/index.js +17 -0
- package/dist/src/Automations/Common.d.ts +47 -0
- package/dist/src/Automations/Common.js +18 -0
- package/dist/src/Automations/Events/Event.d.ts +41 -0
- package/dist/src/Automations/Events/Event.js +2 -0
- package/dist/src/Automations/Events/index.d.ts +1 -0
- package/dist/src/Automations/Events/index.js +17 -0
- package/dist/src/Automations/Executions/Execution.d.ts +114 -0
- package/dist/src/Automations/Executions/Execution.js +23 -0
- package/dist/src/Automations/Executions/index.d.ts +1 -0
- package/dist/src/Automations/Executions/index.js +17 -0
- package/dist/src/Automations/Flows/Canvas.d.ts +86 -0
- package/dist/src/Automations/Flows/Canvas.js +34 -0
- package/dist/src/Automations/Flows/Flow.d.ts +102 -0
- package/dist/src/Automations/Flows/Flow.js +34 -0
- package/dist/src/Automations/Flows/Requests.d.ts +71 -0
- package/dist/src/Automations/Flows/Requests.js +2 -0
- package/dist/src/Automations/Flows/Validation.d.ts +28 -0
- package/dist/src/Automations/Flows/Validation.js +9 -0
- package/dist/src/Automations/Flows/index.d.ts +4 -0
- package/dist/src/Automations/Flows/index.js +20 -0
- package/dist/src/Automations/Nodes/Node.d.ts +75 -0
- package/dist/src/Automations/Nodes/Node.js +18 -0
- package/dist/src/Automations/Nodes/index.d.ts +1 -0
- package/dist/src/Automations/Nodes/index.js +17 -0
- package/dist/src/Automations/index.d.ts +6 -0
- package/dist/src/Automations/index.js +22 -0
- package/dist/src/Common/Channels/Channel.d.ts +17 -1
- package/dist/src/Conversations/Conversation.d.ts +11 -0
- package/dist/src/Conversations/Queue.d.ts +41 -0
- package/dist/src/Conversations/Sla.d.ts +227 -0
- package/dist/src/Conversations/Sla.js +6 -0
- package/dist/src/Conversations/index.d.ts +1 -0
- package/dist/src/Conversations/index.js +1 -0
- package/dist/src/Tickets/Dashboard.d.ts +17 -0
- package/dist/src/Tickets/Dashboard.js +13 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowEntryPointExecutionMode = exports.AutomationFlowVersionStatus = exports.AutomationFlowStatus = exports.AutomationFlowKind = void 0;
|
|
4
|
+
var AutomationFlowKind;
|
|
5
|
+
(function (AutomationFlowKind) {
|
|
6
|
+
AutomationFlowKind["CONVERSATIONAL"] = "conversational";
|
|
7
|
+
AutomationFlowKind["VOICE"] = "voice";
|
|
8
|
+
AutomationFlowKind["CAMPAIGN"] = "campaign";
|
|
9
|
+
AutomationFlowKind["MARKETING"] = "marketing";
|
|
10
|
+
AutomationFlowKind["TICKET"] = "ticket";
|
|
11
|
+
AutomationFlowKind["SALES"] = "sales";
|
|
12
|
+
AutomationFlowKind["GENERIC"] = "generic";
|
|
13
|
+
})(AutomationFlowKind || (exports.AutomationFlowKind = AutomationFlowKind = {}));
|
|
14
|
+
var AutomationFlowStatus;
|
|
15
|
+
(function (AutomationFlowStatus) {
|
|
16
|
+
AutomationFlowStatus["DRAFT"] = "draft";
|
|
17
|
+
AutomationFlowStatus["ACTIVE"] = "active";
|
|
18
|
+
AutomationFlowStatus["DISABLED"] = "disabled";
|
|
19
|
+
AutomationFlowStatus["ARCHIVED"] = "archived";
|
|
20
|
+
})(AutomationFlowStatus || (exports.AutomationFlowStatus = AutomationFlowStatus = {}));
|
|
21
|
+
var AutomationFlowVersionStatus;
|
|
22
|
+
(function (AutomationFlowVersionStatus) {
|
|
23
|
+
AutomationFlowVersionStatus["DRAFT"] = "draft";
|
|
24
|
+
AutomationFlowVersionStatus["TESTING"] = "testing";
|
|
25
|
+
AutomationFlowVersionStatus["PUBLISHED"] = "published";
|
|
26
|
+
AutomationFlowVersionStatus["DEPRECATED"] = "deprecated";
|
|
27
|
+
})(AutomationFlowVersionStatus || (exports.AutomationFlowVersionStatus = AutomationFlowVersionStatus = {}));
|
|
28
|
+
var FlowEntryPointExecutionMode;
|
|
29
|
+
(function (FlowEntryPointExecutionMode) {
|
|
30
|
+
/** Un evento inicia como máximo una ejecución de esta versión del Flow. */
|
|
31
|
+
FlowEntryPointExecutionMode["SINGLE"] = "single";
|
|
32
|
+
/** El solapamiento fue habilitado explícitamente. */
|
|
33
|
+
FlowEntryPointExecutionMode["MULTIPLE"] = "multiple";
|
|
34
|
+
})(FlowEntryPointExecutionMode || (exports.FlowEntryPointExecutionMode = FlowEntryPointExecutionMode = {}));
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { AutomationPageRequest } from '../Common';
|
|
2
|
+
import { AutomationFlowDefinition, AutomationFlowKind, AutomationFlowStatus, AutomationFlowVersion, AutomationFlowVersionStatus, AutomationFlowCanvas, FlowEntryPoint } from './Flow';
|
|
3
|
+
import { AutomationFlowValidationResult } from './Validation';
|
|
4
|
+
export interface CreateAutomationFlowRequest {
|
|
5
|
+
name: string;
|
|
6
|
+
description?: string | null;
|
|
7
|
+
kind: AutomationFlowKind;
|
|
8
|
+
ownerId?: string | null;
|
|
9
|
+
tags: string[];
|
|
10
|
+
initialCanvas?: AutomationFlowCanvas | null;
|
|
11
|
+
entryPoints: FlowEntryPoint[];
|
|
12
|
+
}
|
|
13
|
+
export interface UpdateAutomationFlowRequest {
|
|
14
|
+
name: string;
|
|
15
|
+
description?: string | null;
|
|
16
|
+
kind: AutomationFlowKind;
|
|
17
|
+
ownerId?: string | null;
|
|
18
|
+
tags: string[];
|
|
19
|
+
}
|
|
20
|
+
export interface AutomationFlowSummary {
|
|
21
|
+
id: string;
|
|
22
|
+
name: string;
|
|
23
|
+
description?: string | null;
|
|
24
|
+
kind: AutomationFlowKind;
|
|
25
|
+
status: AutomationFlowStatus;
|
|
26
|
+
ownerId?: string | null;
|
|
27
|
+
tags: string[];
|
|
28
|
+
draftVersionId?: string | null;
|
|
29
|
+
activeVersionId?: string | null;
|
|
30
|
+
updatedAt?: string | null;
|
|
31
|
+
}
|
|
32
|
+
export interface AutomationFlowDetails {
|
|
33
|
+
definition: AutomationFlowDefinition;
|
|
34
|
+
draftVersion?: AutomationFlowVersion | null;
|
|
35
|
+
activeVersion?: AutomationFlowVersion | null;
|
|
36
|
+
}
|
|
37
|
+
export interface CreateAutomationFlowVersionRequest {
|
|
38
|
+
sourceVersionId?: string | null;
|
|
39
|
+
schemaVersion: number;
|
|
40
|
+
canvas?: AutomationFlowCanvas | null;
|
|
41
|
+
entryPoints?: FlowEntryPoint[] | null;
|
|
42
|
+
}
|
|
43
|
+
export interface UpdateAutomationFlowDraftRequest {
|
|
44
|
+
expectedRevision: number;
|
|
45
|
+
status: AutomationFlowVersionStatus;
|
|
46
|
+
schemaVersion: number;
|
|
47
|
+
canvas: AutomationFlowCanvas;
|
|
48
|
+
entryPoints: FlowEntryPoint[];
|
|
49
|
+
}
|
|
50
|
+
export interface PublishAutomationFlowVersionRequest {
|
|
51
|
+
expectedRevision: number;
|
|
52
|
+
validateOnly: boolean;
|
|
53
|
+
}
|
|
54
|
+
export interface PublishAutomationFlowVersionResult {
|
|
55
|
+
definition: AutomationFlowDefinition;
|
|
56
|
+
version: AutomationFlowVersion;
|
|
57
|
+
validation: AutomationFlowValidationResult;
|
|
58
|
+
published: boolean;
|
|
59
|
+
}
|
|
60
|
+
export interface ReplaceFlowEntryPointsRequest {
|
|
61
|
+
expectedRevision: number;
|
|
62
|
+
entryPoints: FlowEntryPoint[];
|
|
63
|
+
}
|
|
64
|
+
export interface AutomationFlowQuery extends AutomationPageRequest {
|
|
65
|
+
search?: string | null;
|
|
66
|
+
kinds?: AutomationFlowKind[] | null;
|
|
67
|
+
statuses?: AutomationFlowStatus[] | null;
|
|
68
|
+
ownerId?: string | null;
|
|
69
|
+
tags?: string[] | null;
|
|
70
|
+
includeArchived: boolean;
|
|
71
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AutomationJsonObject } from '../Common';
|
|
2
|
+
export declare enum AutomationValidationSeverity {
|
|
3
|
+
INFO = "info",
|
|
4
|
+
WARNING = "warning",
|
|
5
|
+
ERROR = "error"
|
|
6
|
+
}
|
|
7
|
+
export interface AutomationValidationIssue {
|
|
8
|
+
code: string;
|
|
9
|
+
severity: AutomationValidationSeverity;
|
|
10
|
+
message: string;
|
|
11
|
+
path?: string | null;
|
|
12
|
+
nodeId?: string | null;
|
|
13
|
+
entryPointId?: string | null;
|
|
14
|
+
details?: AutomationJsonObject | null;
|
|
15
|
+
}
|
|
16
|
+
export interface AutomationFlowValidationResult {
|
|
17
|
+
flowId: string;
|
|
18
|
+
flowVersionId: string;
|
|
19
|
+
valid: boolean;
|
|
20
|
+
issues: AutomationValidationIssue[];
|
|
21
|
+
validatedAt: string;
|
|
22
|
+
}
|
|
23
|
+
export interface FlowEntryPointOverlap {
|
|
24
|
+
firstEntryPointId: string;
|
|
25
|
+
secondEntryPointId: string;
|
|
26
|
+
reason: string;
|
|
27
|
+
allowsMultipleExecutions: boolean;
|
|
28
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AutomationValidationSeverity = void 0;
|
|
4
|
+
var AutomationValidationSeverity;
|
|
5
|
+
(function (AutomationValidationSeverity) {
|
|
6
|
+
AutomationValidationSeverity["INFO"] = "info";
|
|
7
|
+
AutomationValidationSeverity["WARNING"] = "warning";
|
|
8
|
+
AutomationValidationSeverity["ERROR"] = "error";
|
|
9
|
+
})(AutomationValidationSeverity || (exports.AutomationValidationSeverity = AutomationValidationSeverity = {}));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Flow"), exports);
|
|
18
|
+
__exportStar(require("./Canvas"), exports);
|
|
19
|
+
__exportStar(require("./Requests"), exports);
|
|
20
|
+
__exportStar(require("./Validation"), exports);
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { AutomationJsonObject, AutomationJsonSchema, AutomationJsonValue, AutomationPageRequest, AutomationSourceApplication } from '../Common';
|
|
2
|
+
import { AutomationCapabilityReference } from '../Capabilities';
|
|
3
|
+
import { AutomationNodeHandle, AutomationNodeKind } from '../Flows';
|
|
4
|
+
export declare enum AutomationNodePropertyEditor {
|
|
5
|
+
STRING = "string",
|
|
6
|
+
NUMBER = "number",
|
|
7
|
+
BOOLEAN = "boolean",
|
|
8
|
+
PASSWORD = "password",
|
|
9
|
+
JSON = "json",
|
|
10
|
+
DATE = "date",
|
|
11
|
+
FILE = "file",
|
|
12
|
+
CODE = "code",
|
|
13
|
+
OPTIONS = "options",
|
|
14
|
+
MULTI_OPTIONS = "multiOptions",
|
|
15
|
+
ASYNC_OPTIONS = "asyncOptions",
|
|
16
|
+
ASYNC_MULTI_OPTIONS = "asyncMultiOptions"
|
|
17
|
+
}
|
|
18
|
+
export interface AutomationNodeDefinition {
|
|
19
|
+
code: string;
|
|
20
|
+
version: number;
|
|
21
|
+
kind: AutomationNodeKind;
|
|
22
|
+
sourceApplication: AutomationSourceApplication;
|
|
23
|
+
name: string;
|
|
24
|
+
description?: string | null;
|
|
25
|
+
icon?: string | null;
|
|
26
|
+
color?: string | null;
|
|
27
|
+
tags: string[];
|
|
28
|
+
requiredPermissions: string[];
|
|
29
|
+
capability?: AutomationCapabilityReference | null;
|
|
30
|
+
inputs: AutomationNodeHandle[];
|
|
31
|
+
outputs: AutomationNodeHandle[];
|
|
32
|
+
properties: AutomationNodePropertyDefinition[];
|
|
33
|
+
inputSchema?: AutomationJsonSchema | null;
|
|
34
|
+
outputSchema?: AutomationJsonSchema | null;
|
|
35
|
+
enabled: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface AutomationNodePropertyDefinition {
|
|
38
|
+
id: string;
|
|
39
|
+
label: string;
|
|
40
|
+
description?: string | null;
|
|
41
|
+
editor: AutomationNodePropertyEditor;
|
|
42
|
+
required: boolean;
|
|
43
|
+
defaultValue?: AutomationJsonValue;
|
|
44
|
+
schema?: AutomationJsonSchema | null;
|
|
45
|
+
options: AutomationNodeOption[];
|
|
46
|
+
optionsCapabilityCode?: string | null;
|
|
47
|
+
ui?: AutomationJsonObject | null;
|
|
48
|
+
showWhen?: AutomationJsonObject | null;
|
|
49
|
+
hideWhen?: AutomationJsonObject | null;
|
|
50
|
+
}
|
|
51
|
+
export interface AutomationNodeOption {
|
|
52
|
+
id: string;
|
|
53
|
+
label: string;
|
|
54
|
+
description?: string | null;
|
|
55
|
+
imageUrl?: string | null;
|
|
56
|
+
metadata?: AutomationJsonObject | null;
|
|
57
|
+
}
|
|
58
|
+
export interface AutomationNodeDefinitionQuery extends AutomationPageRequest {
|
|
59
|
+
search?: string | null;
|
|
60
|
+
kinds?: AutomationNodeKind[] | null;
|
|
61
|
+
sourceApplications?: AutomationSourceApplication[] | null;
|
|
62
|
+
tags?: string[] | null;
|
|
63
|
+
enabledOnly: boolean;
|
|
64
|
+
}
|
|
65
|
+
export interface AutomationNodeOptionsRequest {
|
|
66
|
+
definitionCode: string;
|
|
67
|
+
definitionVersion: number;
|
|
68
|
+
propertyId: string;
|
|
69
|
+
currentValues: AutomationJsonObject;
|
|
70
|
+
context: AutomationJsonObject;
|
|
71
|
+
}
|
|
72
|
+
export interface AutomationNodeOptionsResult {
|
|
73
|
+
options: AutomationNodeOption[];
|
|
74
|
+
continuationToken?: string | null;
|
|
75
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AutomationNodePropertyEditor = void 0;
|
|
4
|
+
var AutomationNodePropertyEditor;
|
|
5
|
+
(function (AutomationNodePropertyEditor) {
|
|
6
|
+
AutomationNodePropertyEditor["STRING"] = "string";
|
|
7
|
+
AutomationNodePropertyEditor["NUMBER"] = "number";
|
|
8
|
+
AutomationNodePropertyEditor["BOOLEAN"] = "boolean";
|
|
9
|
+
AutomationNodePropertyEditor["PASSWORD"] = "password";
|
|
10
|
+
AutomationNodePropertyEditor["JSON"] = "json";
|
|
11
|
+
AutomationNodePropertyEditor["DATE"] = "date";
|
|
12
|
+
AutomationNodePropertyEditor["FILE"] = "file";
|
|
13
|
+
AutomationNodePropertyEditor["CODE"] = "code";
|
|
14
|
+
AutomationNodePropertyEditor["OPTIONS"] = "options";
|
|
15
|
+
AutomationNodePropertyEditor["MULTI_OPTIONS"] = "multiOptions";
|
|
16
|
+
AutomationNodePropertyEditor["ASYNC_OPTIONS"] = "asyncOptions";
|
|
17
|
+
AutomationNodePropertyEditor["ASYNC_MULTI_OPTIONS"] = "asyncMultiOptions";
|
|
18
|
+
})(AutomationNodePropertyEditor || (exports.AutomationNodePropertyEditor = AutomationNodePropertyEditor = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Node';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Node"), exports);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Common"), exports);
|
|
18
|
+
__exportStar(require("./Flows"), exports);
|
|
19
|
+
__exportStar(require("./Capabilities"), exports);
|
|
20
|
+
__exportStar(require("./Executions"), exports);
|
|
21
|
+
__exportStar(require("./Nodes"), exports);
|
|
22
|
+
__exportStar(require("./Events"), exports);
|
|
@@ -37,6 +37,16 @@ interface IChannelInfo {
|
|
|
37
37
|
*/
|
|
38
38
|
status?: string;
|
|
39
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Fallback routing used only when no published Flow entry point matches the
|
|
42
|
+
* channel, or when the selected Flow cannot produce a valid disposition.
|
|
43
|
+
*
|
|
44
|
+
* Flow-to-channel bindings remain authoritative in FlowEntryPoint.
|
|
45
|
+
*/
|
|
46
|
+
interface ChannelConversationRoutingConfig {
|
|
47
|
+
/** Stable id of a ConversationQueue in the same space as the channel. */
|
|
48
|
+
defaultQueueId: string;
|
|
49
|
+
}
|
|
40
50
|
interface IChannel {
|
|
41
51
|
id?: string | null;
|
|
42
52
|
spaceId?: string | null;
|
|
@@ -60,6 +70,12 @@ interface IChannel {
|
|
|
60
70
|
* habilita la creacion de conversaciones para este canal, si esta en false, los mensajes entrantes no generaran conversaciones
|
|
61
71
|
*/
|
|
62
72
|
conversationsEnabled: boolean | false;
|
|
73
|
+
/**
|
|
74
|
+
* Default Queue for newly-created conversations that are not handled by a
|
|
75
|
+
* Flow. Store only the Queue id; Queue configuration remains authoritative
|
|
76
|
+
* in the Conversations domain.
|
|
77
|
+
*/
|
|
78
|
+
conversationRouting?: ChannelConversationRoutingConfig | null;
|
|
63
79
|
/**
|
|
64
80
|
* Gets or sets a value indicating whether webhook notifications are enabled.
|
|
65
81
|
* Redirects incoming messages to the specified webhook URL when set to true.
|
|
@@ -105,4 +121,4 @@ declare enum channelStatus {
|
|
|
105
121
|
SUSPENDED = 7,
|
|
106
122
|
CONFIGURATION_PENDING = 9
|
|
107
123
|
}
|
|
108
|
-
export { IChannel, IChannelInfo, channelStatus, MessagingAvailability };
|
|
124
|
+
export { IChannel, IChannelInfo, ChannelConversationRoutingConfig, channelStatus, MessagingAvailability };
|
|
@@ -4,10 +4,13 @@ import { GroupInfo } from "./Groups/Group";
|
|
|
4
4
|
import { Channels } from "../Common/index";
|
|
5
5
|
import { IContactAddress, IContactInfo } from "../Contacts/contacts";
|
|
6
6
|
import { IEnding } from "./Ending";
|
|
7
|
+
import { ChatType } from "../Chats/Chat";
|
|
7
8
|
export interface IConversation {
|
|
8
9
|
id: string;
|
|
9
10
|
spaceId: string;
|
|
10
11
|
version: number;
|
|
12
|
+
/** @deprecated Use assignment.owner. */
|
|
13
|
+
type: ChatType;
|
|
11
14
|
/**only for Front-End */
|
|
12
15
|
chatName: string;
|
|
13
16
|
chatImage: string;
|
|
@@ -21,6 +24,8 @@ export interface IConversation {
|
|
|
21
24
|
status: ConversationStatus;
|
|
22
25
|
priority: 'low' | 'normal' | 'high' | 'urgent';
|
|
23
26
|
assignment: ConversationAssignmentSnapshot;
|
|
27
|
+
/** @deprecated Use owner and assignment.*/
|
|
28
|
+
assignedTo?: ConversationAssigned;
|
|
24
29
|
sla: {
|
|
25
30
|
status: 'none' | 'running' | 'warning' | 'breached' | 'met';
|
|
26
31
|
deadlineAt?: Date;
|
|
@@ -36,7 +41,13 @@ export interface IConversation {
|
|
|
36
41
|
lastAgentActivityAt?: Date;
|
|
37
42
|
labels: ILabel[];
|
|
38
43
|
pinned: boolean;
|
|
44
|
+
/** @deprecated A transfer is represented by an event and the resulting current state. */
|
|
45
|
+
transferBy?: string;
|
|
46
|
+
/** @deprecated A transfer is represented by an event and the resulting current state. */
|
|
47
|
+
transferTo?: ConversationAssigned;
|
|
39
48
|
expired: boolean;
|
|
49
|
+
/** @deprecated Expiration does not own a separate assignment snapshot.*/
|
|
50
|
+
expiredAssignedTo: ConversationAssigned;
|
|
40
51
|
participants: UserInfo[];
|
|
41
52
|
archived: boolean;
|
|
42
53
|
spam: boolean;
|
|
@@ -64,3 +64,44 @@ export interface ConversationQueue {
|
|
|
64
64
|
updatedAt: Date;
|
|
65
65
|
updatedByUserId?: ID;
|
|
66
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Editable Queue definition sent by clients.
|
|
69
|
+
*
|
|
70
|
+
* It excludes id, version and audit fields controlled by the backend. Nested
|
|
71
|
+
* routing, SLA and audience objects use full-replacement semantics.
|
|
72
|
+
*/
|
|
73
|
+
export interface ConversationQueueDefinitionInput {
|
|
74
|
+
name: string;
|
|
75
|
+
description?: string;
|
|
76
|
+
color?: string;
|
|
77
|
+
enabled: boolean;
|
|
78
|
+
priority: number;
|
|
79
|
+
memberGroupIds: ID[];
|
|
80
|
+
supervisorGroupIds: ID[];
|
|
81
|
+
routing: QueueRoutingPolicy;
|
|
82
|
+
sla: ConversationQueueSlaConfig;
|
|
83
|
+
audience: ConversationQueueAudienceConfig;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Creates a Queue. commandId makes retries idempotent. The backend assigns
|
|
87
|
+
* queue id, version and audit fields.
|
|
88
|
+
*/
|
|
89
|
+
export interface CreateConversationQueueRequest {
|
|
90
|
+
commandId: ID;
|
|
91
|
+
spaceId: ID;
|
|
92
|
+
definition: ConversationQueueDefinitionInput;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Replaces the editable definition of an existing Queue.
|
|
96
|
+
*
|
|
97
|
+
* expectedVersion is the version loaded by the client; it is not incremented
|
|
98
|
+
* by the client. The backend rejects stale writes and returns the updated
|
|
99
|
+
* ConversationQueue with its new version and audit fields.
|
|
100
|
+
*/
|
|
101
|
+
export interface UpdateConversationQueueRequest {
|
|
102
|
+
commandId: ID;
|
|
103
|
+
spaceId: ID;
|
|
104
|
+
queueId: ID;
|
|
105
|
+
expectedVersion: number;
|
|
106
|
+
definition: ConversationQueueDefinitionInput;
|
|
107
|
+
}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import type { ISchedule } from '../Common/Schedules/Schedules';
|
|
2
|
+
import type { ConversationEventType, ConversationStatus, ID } from './Conversation';
|
|
3
|
+
import type { OutboxEvent } from './Outbox';
|
|
4
|
+
export declare const CONVERSATION_SLA_POLICIES_COLLECTION = "conversation_sla_policies";
|
|
5
|
+
export declare const CONVERSATION_SLA_CYCLES_COLLECTION = "conversation_sla_cycles";
|
|
6
|
+
export declare const CONVERSATION_SLA_EVENTS_COLLECTION = "conversation_sla_events";
|
|
7
|
+
export type ConversationSlaMetric = 'first_response' | 'next_response' | 'assignment' | 'acceptance' | 'resolution';
|
|
8
|
+
/**
|
|
9
|
+
* continuous counts natural elapsed time, including nights and holidays.
|
|
10
|
+
* schedule counts only ranges allowed by the referenced customer ISchedule.
|
|
11
|
+
*/
|
|
12
|
+
export type ConversationSlaTimeCalculation = {
|
|
13
|
+
mode: 'continuous';
|
|
14
|
+
scheduleId?: never;
|
|
15
|
+
} | {
|
|
16
|
+
mode: 'schedule';
|
|
17
|
+
scheduleId: Exclude<ISchedule['id'], null>;
|
|
18
|
+
};
|
|
19
|
+
export interface ConversationSlaWarningThreshold {
|
|
20
|
+
id: ID;
|
|
21
|
+
percentage: number;
|
|
22
|
+
}
|
|
23
|
+
export interface ConversationSlaTarget {
|
|
24
|
+
metric: ConversationSlaMetric;
|
|
25
|
+
durationSeconds: number;
|
|
26
|
+
warningThresholds: ConversationSlaWarningThreshold[];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Threshold received by the SLA policy write API.
|
|
30
|
+
*
|
|
31
|
+
* Existing thresholds keep their id. New thresholds may omit it so the
|
|
32
|
+
* backend can assign the canonical identifier returned in
|
|
33
|
+
* ConversationSlaPolicy.
|
|
34
|
+
*/
|
|
35
|
+
export interface ConversationSlaWarningThresholdInput {
|
|
36
|
+
id?: ID;
|
|
37
|
+
percentage: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Target received by the SLA policy write API.
|
|
41
|
+
* durationSeconds is stored as seconds regardless of the unit used by the UI.
|
|
42
|
+
*/
|
|
43
|
+
export interface ConversationSlaTargetInput {
|
|
44
|
+
metric: ConversationSlaMetric;
|
|
45
|
+
durationSeconds: number;
|
|
46
|
+
warningThresholds: ConversationSlaWarningThresholdInput[];
|
|
47
|
+
}
|
|
48
|
+
export type ConversationSlaResumeBehavior = 'continue' | 'restart' | 'recalculate';
|
|
49
|
+
export type ConversationSlaReopenBehavior = 'preserve' | 'restart' | 'recalculate' | 'do_not_start';
|
|
50
|
+
export interface ConversationSlaClockBehavior {
|
|
51
|
+
/**
|
|
52
|
+
* Conversation statuses that pause every running SLA cycle.
|
|
53
|
+
*
|
|
54
|
+
* Entering one of these statuses pauses the clock. Leaving all of them
|
|
55
|
+
* resumes it according to onResume. An empty array means that conversation
|
|
56
|
+
* status changes never pause the SLA clock.
|
|
57
|
+
*/
|
|
58
|
+
pauseOnStatuses: ConversationStatus[];
|
|
59
|
+
/**
|
|
60
|
+
* Behavior applied when the conversation leaves the last status included
|
|
61
|
+
* in pauseOnStatuses.
|
|
62
|
+
*
|
|
63
|
+
* continue: keeps the current cycle and its consumed/remaining time.
|
|
64
|
+
* restart: resets the current cycle from the resume timestamp.
|
|
65
|
+
* recalculate: keeps the applied policy snapshot and recalculates the
|
|
66
|
+
* schedule-derived warnings/deadline. It does not select another policy
|
|
67
|
+
* version.
|
|
68
|
+
*/
|
|
69
|
+
onResume: ConversationSlaResumeBehavior;
|
|
70
|
+
/**
|
|
71
|
+
* Behavior applied when a resolved/finalized conversation is reopened.
|
|
72
|
+
* Reopening is independent from resuming a status-paused clock.
|
|
73
|
+
*
|
|
74
|
+
* preserve: preserves the previous cycle state.
|
|
75
|
+
* restart: starts a new cycle from the reopen timestamp.
|
|
76
|
+
* recalculate: recalculates the cycle using the applied policy snapshot.
|
|
77
|
+
* do_not_start: does not start an SLA cycle because of the reopen action.
|
|
78
|
+
*/
|
|
79
|
+
onReopen: ConversationSlaReopenBehavior;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Immutable, versioned policy referenced by ConversationQueue.sla.
|
|
83
|
+
* Editing a published policy creates a new version.
|
|
84
|
+
*/
|
|
85
|
+
export interface ConversationSlaPolicy {
|
|
86
|
+
id: ID;
|
|
87
|
+
spaceId: ID;
|
|
88
|
+
name: string;
|
|
89
|
+
description?: string;
|
|
90
|
+
enabled: boolean;
|
|
91
|
+
version: number;
|
|
92
|
+
timeCalculation: ConversationSlaTimeCalculation;
|
|
93
|
+
targets: ConversationSlaTarget[];
|
|
94
|
+
clockBehavior: ConversationSlaClockBehavior;
|
|
95
|
+
createdAt: Date;
|
|
96
|
+
createdByUserId?: ID;
|
|
97
|
+
updatedAt: Date;
|
|
98
|
+
updatedByUserId?: ID;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Editable definition sent by clients.
|
|
102
|
+
*
|
|
103
|
+
* It intentionally excludes policy id/version and audit fields controlled by
|
|
104
|
+
* the backend. targets is full-replacement: omitted metrics are disabled in
|
|
105
|
+
* the newly published policy version.
|
|
106
|
+
*/
|
|
107
|
+
export interface ConversationSlaPolicyDefinitionInput {
|
|
108
|
+
name: string;
|
|
109
|
+
description?: string;
|
|
110
|
+
enabled: boolean;
|
|
111
|
+
timeCalculation: ConversationSlaTimeCalculation;
|
|
112
|
+
targets: ConversationSlaTargetInput[];
|
|
113
|
+
clockBehavior: ConversationSlaClockBehavior;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Creates the first immutable version of an SLA policy.
|
|
117
|
+
*
|
|
118
|
+
* commandId provides idempotency for retries. The authenticated backend
|
|
119
|
+
* context supplies createdByUserId and the audit timestamps.
|
|
120
|
+
*/
|
|
121
|
+
export interface CreateConversationSlaPolicyRequest {
|
|
122
|
+
commandId: ID;
|
|
123
|
+
spaceId: ID;
|
|
124
|
+
definition: ConversationSlaPolicyDefinitionInput;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Publishes a new immutable version of an existing SLA policy.
|
|
128
|
+
*
|
|
129
|
+
* expectedVersion implements optimistic concurrency. The backend rejects the
|
|
130
|
+
* request when another version was published after the client loaded it.
|
|
131
|
+
* version, updatedAt and updatedByUserId are always assigned by the backend.
|
|
132
|
+
*/
|
|
133
|
+
export interface PublishConversationSlaPolicyVersionRequest {
|
|
134
|
+
commandId: ID;
|
|
135
|
+
spaceId: ID;
|
|
136
|
+
policyId: ID;
|
|
137
|
+
expectedVersion: number;
|
|
138
|
+
definition: ConversationSlaPolicyDefinitionInput;
|
|
139
|
+
}
|
|
140
|
+
export type ConversationSlaClockAction = 'start' | 'evaluate' | 'pause' | 'resume' | 'complete' | 'recalculate' | 'cancel';
|
|
141
|
+
export type ConversationSlaClockReason = 'conversation_created' | 'conversation_enqueued' | 'customer_message' | 'agent_response' | 'assignment_changed' | 'status_changed' | 'queue_transfer' | 'conversation_reopened' | 'deadline_due' | 'policy_override';
|
|
142
|
+
/**
|
|
143
|
+
* Idempotent input for the conversation-sla-worker.
|
|
144
|
+
* policyId/policyVersion identify the immutable policy snapshot to apply.
|
|
145
|
+
*/
|
|
146
|
+
export interface SlaClockCommand {
|
|
147
|
+
commandId: ID;
|
|
148
|
+
sourceEventId: ID;
|
|
149
|
+
spaceId: ID;
|
|
150
|
+
conversationId: ID;
|
|
151
|
+
expectedConversationVersion: number;
|
|
152
|
+
action: ConversationSlaClockAction;
|
|
153
|
+
reason: ConversationSlaClockReason;
|
|
154
|
+
metric?: ConversationSlaMetric;
|
|
155
|
+
policyId: ID;
|
|
156
|
+
policyVersion: number;
|
|
157
|
+
queueId?: ID;
|
|
158
|
+
occurredAt: Date;
|
|
159
|
+
requestedAt: Date;
|
|
160
|
+
}
|
|
161
|
+
export type ConversationSlaCycleStatus = 'running' | 'paused' | 'met' | 'breached' | 'cancelled';
|
|
162
|
+
export interface ConversationSlaPausePeriod {
|
|
163
|
+
startedAt: Date;
|
|
164
|
+
endedAt?: Date;
|
|
165
|
+
reason: ConversationSlaClockReason;
|
|
166
|
+
sourceEventId: ID;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Durable metric cycle. The target and time calculation are copied from the
|
|
170
|
+
* selected policy version so later policy edits cannot alter active history.
|
|
171
|
+
*/
|
|
172
|
+
export interface ConversationSlaCycle {
|
|
173
|
+
id: ID;
|
|
174
|
+
spaceId: ID;
|
|
175
|
+
conversationId: ID;
|
|
176
|
+
metric: ConversationSlaMetric;
|
|
177
|
+
sequence: number;
|
|
178
|
+
status: ConversationSlaCycleStatus;
|
|
179
|
+
policyId: ID;
|
|
180
|
+
policyVersion: number;
|
|
181
|
+
timeCalculation: ConversationSlaTimeCalculation;
|
|
182
|
+
target: ConversationSlaTarget;
|
|
183
|
+
startedAt: Date;
|
|
184
|
+
deadlineAt?: Date;
|
|
185
|
+
nextWarningAt?: Date;
|
|
186
|
+
pausedAt?: Date;
|
|
187
|
+
completedAt?: Date;
|
|
188
|
+
breachedAt?: Date;
|
|
189
|
+
cancelledAt?: Date;
|
|
190
|
+
elapsedSeconds: number;
|
|
191
|
+
pausedSeconds: number;
|
|
192
|
+
pausePeriods: ConversationSlaPausePeriod[];
|
|
193
|
+
startedByEventId: ID;
|
|
194
|
+
completedByEventId?: ID;
|
|
195
|
+
version: number;
|
|
196
|
+
updatedAt: Date;
|
|
197
|
+
}
|
|
198
|
+
export type ConversationSlaEventType = Extract<ConversationEventType, 'sla_started' | 'sla_paused' | 'sla_resumed' | 'sla_warning' | 'sla_breached' | 'sla_met' | 'sla_overridden'>;
|
|
199
|
+
/**
|
|
200
|
+
* Immutable SLA event. Corrections are represented by a later event.
|
|
201
|
+
*/
|
|
202
|
+
export interface ConversationSlaEvent {
|
|
203
|
+
eventId: ID;
|
|
204
|
+
sourceEventId: ID;
|
|
205
|
+
type: ConversationSlaEventType;
|
|
206
|
+
schemaVersion: 1;
|
|
207
|
+
spaceId: ID;
|
|
208
|
+
conversationId: ID;
|
|
209
|
+
conversationVersion: number;
|
|
210
|
+
cycleId: ID;
|
|
211
|
+
metric: ConversationSlaMetric;
|
|
212
|
+
policyId: ID;
|
|
213
|
+
policyVersion: number;
|
|
214
|
+
status: ConversationSlaCycleStatus;
|
|
215
|
+
deadlineAt?: Date;
|
|
216
|
+
warningThresholdId?: ID;
|
|
217
|
+
reason: ConversationSlaClockReason;
|
|
218
|
+
correlationId: ID;
|
|
219
|
+
causationId: ID;
|
|
220
|
+
occurredAt: Date;
|
|
221
|
+
recordedAt: Date;
|
|
222
|
+
}
|
|
223
|
+
export type ConversationSlaOutboxEvent = OutboxEvent<ConversationSlaEvent> & {
|
|
224
|
+
aggregateType: 'conversation';
|
|
225
|
+
eventType: `conversation.${ConversationSlaEventType}`;
|
|
226
|
+
schemaVersion: 1;
|
|
227
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CONVERSATION_SLA_EVENTS_COLLECTION = exports.CONVERSATION_SLA_CYCLES_COLLECTION = exports.CONVERSATION_SLA_POLICIES_COLLECTION = void 0;
|
|
4
|
+
exports.CONVERSATION_SLA_POLICIES_COLLECTION = 'conversation_sla_policies';
|
|
5
|
+
exports.CONVERSATION_SLA_CYCLES_COLLECTION = 'conversation_sla_cycles';
|
|
6
|
+
exports.CONVERSATION_SLA_EVENTS_COLLECTION = 'conversation_sla_events';
|