@trii/types 2.10.726 → 2.10.728
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/Events/Event.d.ts +3 -3
- package/dist/Contacts/CommunicationEndpoint.d.ts +8 -8
- package/dist/Conversations/Conversation.d.ts +8 -8
- package/dist/Conversations/InboxMongo.d.ts +12 -12
- package/dist/Conversations/Routing.d.ts +10 -10
- package/dist/Events/DomainEventTypes.d.ts +23 -23
- package/dist/Tickets/AdvancedApi.d.ts +55 -0
- package/dist/Tickets/AdvancedApi.js +17 -1
- package/dist/Tickets/Security.d.ts +55 -0
- package/dist/src/Automations/Capabilities/Capability.d.ts +81 -0
- package/dist/src/Automations/Capabilities/Capability.js +23 -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 +94 -0
- package/dist/src/Automations/Common.js +40 -0
- package/dist/src/Automations/Events/Event.d.ts +96 -0
- package/dist/src/Automations/Events/Event.js +19 -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 +298 -0
- package/dist/src/Automations/Executions/Execution.js +76 -0
- package/dist/src/Automations/Executions/Testing.d.ts +166 -0
- package/dist/src/Automations/Executions/Testing.js +54 -0
- package/dist/src/Automations/Executions/index.d.ts +2 -0
- package/dist/src/Automations/Executions/index.js +18 -0
- package/dist/src/Automations/Flows/Canvas.d.ts +109 -0
- package/dist/src/Automations/Flows/Canvas.js +43 -0
- package/dist/src/Automations/Flows/Flow.d.ts +154 -0
- package/dist/src/Automations/Flows/Flow.js +58 -0
- package/dist/src/Automations/Flows/Requests.d.ts +71 -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 +116 -0
- package/dist/src/Automations/Nodes/Node.js +27 -0
- package/dist/src/Automations/Nodes/index.d.ts +1 -0
- package/dist/src/Automations/Nodes/index.js +17 -0
- package/dist/src/Automations/Triggers/Trigger.d.ts +112 -0
- package/dist/src/Automations/Triggers/Trigger.js +66 -0
- package/dist/src/Automations/Triggers/index.d.ts +1 -0
- package/dist/src/Automations/Triggers/index.js +17 -0
- package/dist/src/Automations/index.d.ts +7 -0
- package/dist/src/Automations/index.js +23 -0
- package/dist/src/Chats/Chat.d.ts +61 -0
- package/dist/src/Chats/Chat.js +28 -0
- package/dist/src/Common/Channels/Channel.d.ts +28 -1
- package/dist/src/Common/Channels/Email.d.ts +1 -0
- package/dist/src/Common/Channels/Facebook.d.ts +1 -0
- package/dist/src/Common/Channels/Form.d.ts +1 -0
- package/dist/src/Common/Channels/GoogleBusiness.d.ts +1 -0
- package/dist/src/Common/Channels/Instagram.d.ts +1 -0
- package/dist/src/Common/Channels/MercadoLibre.d.ts +1 -0
- package/dist/src/Common/Channels/WebChat.d.ts +1 -0
- package/dist/src/Contacts/CommunicationEndpoint.d.ts +107 -0
- package/dist/src/Contacts/CommunicationEndpoint.js +39 -0
- package/dist/src/Contacts/CommunicationMethod.d.ts +9 -0
- package/dist/src/Contacts/CommunicationMethod.js +2 -0
- package/dist/src/Contacts/contacts.d.ts +2 -2
- package/dist/src/Contacts/index.d.ts +2 -0
- package/dist/src/Contacts/index.js +2 -0
- package/dist/src/Conversations/Assignment.d.ts +181 -0
- package/dist/src/Conversations/Assignment.js +4 -0
- package/dist/src/Conversations/Conversation.d.ts +410 -48
- package/dist/src/Conversations/Conversation.js +14 -34
- package/dist/src/Conversations/DashBoard/dashboard.d.ts +2 -2
- package/dist/src/Conversations/Flows/Workflows/Workflow.d.ts +280 -123
- package/dist/src/Conversations/Flows/Workflows/Workflow.js +85 -35
- package/dist/src/Conversations/Groups/Group.d.ts +2 -8
- package/dist/src/Conversations/Groups/Group.js +0 -6
- package/dist/src/Conversations/InboxMongo.d.ts +154 -0
- package/dist/src/Conversations/InboxMongo.js +128 -0
- package/dist/src/Conversations/InboxProjection.d.ts +162 -0
- package/dist/src/Conversations/InboxProjection.js +2 -0
- package/dist/src/Conversations/Label.d.ts +1 -1
- package/dist/src/Conversations/Outbox.d.ts +24 -0
- package/dist/src/Conversations/Outbox.js +4 -0
- package/dist/src/Conversations/Queue.d.ts +107 -0
- package/dist/src/Conversations/Queue.js +4 -0
- package/dist/src/Conversations/Routing.d.ts +164 -0
- package/dist/src/Conversations/Routing.js +2 -0
- package/dist/src/Conversations/Sla.d.ts +227 -0
- package/dist/src/Conversations/Sla.js +6 -0
- package/dist/src/Conversations/Transfer.d.ts +73 -0
- package/dist/src/Conversations/Transfer.js +2 -0
- package/dist/src/Conversations/WebHook.d.ts +1 -1
- package/dist/src/Conversations/index.d.ts +9 -1
- package/dist/src/Conversations/index.js +9 -1
- package/dist/src/Events/DomainEventTypes.d.ts +51 -0
- package/dist/src/Events/DomainEventTypes.js +49 -0
- package/dist/src/Events/index.d.ts +1 -0
- package/dist/src/Events/index.js +17 -0
- package/dist/src/Forms/API.d.ts +53 -0
- package/dist/src/Forms/API.js +2 -0
- package/dist/src/Forms/SubmittedForm.d.ts +56 -0
- package/dist/src/Forms/SubmittedForm.js +9 -0
- package/dist/src/Forms/index.d.ts +2 -0
- package/dist/src/Forms/index.js +18 -0
- package/dist/src/Presence/AgentPause.d.ts +24 -0
- package/dist/src/Presence/AgentPause.js +19 -0
- package/dist/src/Presence/QueueParticipation.d.ts +17 -0
- package/dist/src/Presence/QueueParticipation.js +2 -0
- package/dist/src/Presence/QueueRoutingState.d.ts +27 -0
- package/dist/src/Presence/QueueRoutingState.js +9 -0
- package/dist/src/Presence/index.d.ts +3 -0
- package/dist/src/Presence/index.js +19 -0
- package/dist/src/PublicAPI/apiKey.d.ts +92 -3
- package/dist/src/PublicAPI/apiKey.js +27 -0
- package/dist/src/Tickets/AI.d.ts +50 -2
- package/dist/src/Tickets/AdvancedApi.d.ts +142 -2
- package/dist/src/Tickets/AdvancedApi.js +28 -1
- package/dist/src/Tickets/Approval.d.ts +20 -4
- package/dist/src/Tickets/Automation.d.ts +46 -2
- package/dist/src/Tickets/Category.d.ts +18 -0
- package/dist/src/Tickets/Dashboard.d.ts +78 -0
- package/dist/src/Tickets/Dashboard.js +13 -1
- package/dist/src/Tickets/Fields.d.ts +4 -0
- package/dist/src/Tickets/Layouts.d.ts +3 -1
- package/dist/src/Tickets/Routing.d.ts +105 -3
- package/dist/src/Tickets/Routing.js +7 -1
- package/dist/src/Tickets/Security.d.ts +271 -4
- package/dist/src/Tickets/Security.js +10 -1
- package/dist/src/Tickets/SelfService.d.ts +190 -0
- package/dist/src/Tickets/Sla.d.ts +140 -0
- package/dist/src/Tickets/Workflow.d.ts +20 -0
- package/dist/src/Users/UserTrii.d.ts +10 -0
- package/dist/src/Users/UserTrii.js +8 -1
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.js +5 -1
- package/package.json +12 -12
- package/dist/Conversations/DashBoard/dashboardForms.d.ts +0 -44
- package/dist/Conversations/DashBoard/dashboardForms.js +0 -24
- package/dist/Conversations/InboxCounters.d.ts +0 -18
- package/dist/src/Conversations/DashBoard/dashboardForms.d.ts +0 -44
- package/dist/src/Conversations/DashBoard/dashboardForms.js +0 -24
- /package/dist/{Conversations/InboxCounters.js → src/Automations/Flows/Requests.js} +0 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
export declare enum CommunicationEndpointKind {
|
|
2
|
+
PHONE = "phone",
|
|
3
|
+
EMAIL = "email",
|
|
4
|
+
PROVIDER_IDENTITY = "provider_identity"
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Known provider identity namespaces. Contracts continue to accept strings so
|
|
8
|
+
* custom providers and namespaces can be introduced without a library update.
|
|
9
|
+
*/
|
|
10
|
+
export declare const providerIdentityNamespaces: {
|
|
11
|
+
readonly meta: {
|
|
12
|
+
readonly instagramUser: 'instagram_user';
|
|
13
|
+
readonly messengerUser: 'messenger_user';
|
|
14
|
+
readonly whatsappUser: 'whatsapp_user';
|
|
15
|
+
};
|
|
16
|
+
readonly telegram: {
|
|
17
|
+
readonly user: 'user';
|
|
18
|
+
readonly chat: 'chat';
|
|
19
|
+
};
|
|
20
|
+
readonly trii: {
|
|
21
|
+
readonly webchatVisitor: 'webchat_visitor';
|
|
22
|
+
};
|
|
23
|
+
readonly mercadolibre: {
|
|
24
|
+
readonly buyer: 'buyer';
|
|
25
|
+
};
|
|
26
|
+
readonly google: {
|
|
27
|
+
readonly businessMessagesUser: 'business_messages_user';
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export type KnownIdentityProvider = keyof typeof providerIdentityNamespaces;
|
|
31
|
+
export type KnownProviderIdentityNamespace = {
|
|
32
|
+
[TProvider in KnownIdentityProvider]: (typeof providerIdentityNamespaces)[TProvider][keyof (typeof providerIdentityNamespaces)[TProvider]];
|
|
33
|
+
}[KnownIdentityProvider];
|
|
34
|
+
export declare enum CommunicationEndpointStatus {
|
|
35
|
+
ACTIVE = "active",
|
|
36
|
+
INACTIVE = "inactive",
|
|
37
|
+
ORPHANED = "orphaned"
|
|
38
|
+
}
|
|
39
|
+
export interface ICommunicationEndpointActivity {
|
|
40
|
+
firstSeenAt?: Date;
|
|
41
|
+
lastSeenAt?: Date;
|
|
42
|
+
lastMessageInAt?: Date;
|
|
43
|
+
lastMessageOutAt?: Date;
|
|
44
|
+
}
|
|
45
|
+
export interface ICommunicationEndpoint {
|
|
46
|
+
id: string;
|
|
47
|
+
spaceId: string;
|
|
48
|
+
kind: CommunicationEndpointKind;
|
|
49
|
+
status: CommunicationEndpointStatus;
|
|
50
|
+
normalizedValue: string;
|
|
51
|
+
normalizationVersion: number;
|
|
52
|
+
displayValue: string;
|
|
53
|
+
phoneInfo?: IPhoneEndpointInfo;
|
|
54
|
+
emailInfo?: IEmailEndpointInfo;
|
|
55
|
+
providerIdentityInfo?: IProviderIdentityEndpointInfo;
|
|
56
|
+
activity?: ICommunicationEndpointActivity;
|
|
57
|
+
createdAt: Date;
|
|
58
|
+
createdBy?: string;
|
|
59
|
+
updatedAt?: Date;
|
|
60
|
+
updatedBy?: string;
|
|
61
|
+
inactiveAt?: Date;
|
|
62
|
+
inactiveBy?: string;
|
|
63
|
+
}
|
|
64
|
+
export interface IPhoneEndpointInfo {
|
|
65
|
+
e164: string;
|
|
66
|
+
isMobile: boolean;
|
|
67
|
+
country: string;
|
|
68
|
+
countryName: string;
|
|
69
|
+
/**
|
|
70
|
+
* ISO 3166-2 subdivision code when it can be resolved from the phone
|
|
71
|
+
* number, for example `AR-C` or `US-CA`. Empty when unknown, not
|
|
72
|
+
* applicable, or when the number does not identify a subdivision.
|
|
73
|
+
*/
|
|
74
|
+
state: string;
|
|
75
|
+
/**
|
|
76
|
+
* Display name corresponding to `state`, for example `Córdoba` or
|
|
77
|
+
* `California`. Empty when `state` is not available.
|
|
78
|
+
*/
|
|
79
|
+
stateName: string;
|
|
80
|
+
}
|
|
81
|
+
export interface IEmailEndpointInfo {
|
|
82
|
+
localPart: string;
|
|
83
|
+
domain: string;
|
|
84
|
+
}
|
|
85
|
+
export interface IProviderIdentityProfile {
|
|
86
|
+
displayName?: string;
|
|
87
|
+
username?: string;
|
|
88
|
+
imageUrl?: string;
|
|
89
|
+
imageObservedAt?: Date;
|
|
90
|
+
}
|
|
91
|
+
export interface IProviderIdentityEndpointInfo {
|
|
92
|
+
/** System that issues and controls the external identity. */
|
|
93
|
+
provider: string;
|
|
94
|
+
/**
|
|
95
|
+
* Provider-defined namespace in which the identity keys are valid.
|
|
96
|
+
* This is not a communication channel or a configured channel account.
|
|
97
|
+
*/
|
|
98
|
+
identityNamespace: string;
|
|
99
|
+
/** Configured channel account in which the external identity is valid. */
|
|
100
|
+
channelAccountId: string;
|
|
101
|
+
profile?: IProviderIdentityProfile;
|
|
102
|
+
}
|
|
103
|
+
export interface ICommunicationEndpointSnapshot {
|
|
104
|
+
endpointId: string;
|
|
105
|
+
kind: CommunicationEndpointKind;
|
|
106
|
+
displayValue: string;
|
|
107
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CommunicationEndpointStatus = exports.providerIdentityNamespaces = exports.CommunicationEndpointKind = void 0;
|
|
4
|
+
var CommunicationEndpointKind;
|
|
5
|
+
(function (CommunicationEndpointKind) {
|
|
6
|
+
CommunicationEndpointKind["PHONE"] = "phone";
|
|
7
|
+
CommunicationEndpointKind["EMAIL"] = "email";
|
|
8
|
+
CommunicationEndpointKind["PROVIDER_IDENTITY"] = "provider_identity";
|
|
9
|
+
})(CommunicationEndpointKind || (exports.CommunicationEndpointKind = CommunicationEndpointKind = {}));
|
|
10
|
+
/**
|
|
11
|
+
* Known provider identity namespaces. Contracts continue to accept strings so
|
|
12
|
+
* custom providers and namespaces can be introduced without a library update.
|
|
13
|
+
*/
|
|
14
|
+
exports.providerIdentityNamespaces = {
|
|
15
|
+
meta: {
|
|
16
|
+
instagramUser: 'instagram_user',
|
|
17
|
+
messengerUser: 'messenger_user',
|
|
18
|
+
whatsappUser: 'whatsapp_user',
|
|
19
|
+
},
|
|
20
|
+
telegram: {
|
|
21
|
+
user: 'user',
|
|
22
|
+
chat: 'chat',
|
|
23
|
+
},
|
|
24
|
+
trii: {
|
|
25
|
+
webchatVisitor: 'webchat_visitor',
|
|
26
|
+
},
|
|
27
|
+
mercadolibre: {
|
|
28
|
+
buyer: 'buyer',
|
|
29
|
+
},
|
|
30
|
+
google: {
|
|
31
|
+
businessMessagesUser: 'business_messages_user',
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
var CommunicationEndpointStatus;
|
|
35
|
+
(function (CommunicationEndpointStatus) {
|
|
36
|
+
CommunicationEndpointStatus["ACTIVE"] = "active";
|
|
37
|
+
CommunicationEndpointStatus["INACTIVE"] = "inactive";
|
|
38
|
+
CommunicationEndpointStatus["ORPHANED"] = "orphaned";
|
|
39
|
+
})(CommunicationEndpointStatus || (exports.CommunicationEndpointStatus = CommunicationEndpointStatus = {}));
|
|
@@ -14,7 +14,7 @@ export interface IBusiness {
|
|
|
14
14
|
counters?: ICounters;
|
|
15
15
|
name: string;
|
|
16
16
|
imageUrl: string;
|
|
17
|
-
|
|
17
|
+
ownerUserId?: string;
|
|
18
18
|
membersId: string[];
|
|
19
19
|
members: IContactInfo[];
|
|
20
20
|
phones: IContactAddress[];
|
|
@@ -54,7 +54,7 @@ export interface IContact {
|
|
|
54
54
|
lastName: string;
|
|
55
55
|
imageUrl: string;
|
|
56
56
|
birthDate?: Date | null;
|
|
57
|
-
|
|
57
|
+
ownerUserId?: string;
|
|
58
58
|
businessId?: string;
|
|
59
59
|
businessName?: string;
|
|
60
60
|
phones: IContactAddress[];
|
|
@@ -23,3 +23,5 @@ __exportStar(require("./Import"), exports);
|
|
|
23
23
|
__exportStar(require("./Relationship"), exports);
|
|
24
24
|
__exportStar(require("./options"), exports);
|
|
25
25
|
__exportStar(require("./DuplicateContact"), exports);
|
|
26
|
+
__exportStar(require("./CommunicationEndpoint"), exports);
|
|
27
|
+
__exportStar(require("./CommunicationMethod"), exports);
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { ID } from './Conversation';
|
|
2
|
+
export declare const CONVERSATION_ASSIGNMENT_EVENTS_COLLECTION = "conversation_assignment_events";
|
|
3
|
+
export type ConversationAssignmentEventType = 'enqueued' | 'routing_started' | 'offered' | 'assigned' | 'accepted' | 'transferred' | 'released' | 'timed_out' | 'requeued';
|
|
4
|
+
export type ConversationAssignmentReason = 'conversation_created' | 'routing_selected' | 'manual_assignment' | 'manual_transfer' | 'flow_routing' | 'offer_timeout' | 'assignment_timeout' | 'agent_accepted' | 'agent_released' | 'supervisor_released' | 'capacity_rebalance' | 'sla_escalation' | 'system_recovery' | 'transfer_cancelled' | 'transfer_declined';
|
|
5
|
+
export type AssignmentOwnerReference = {
|
|
6
|
+
type: 'none';
|
|
7
|
+
id?: never;
|
|
8
|
+
displayName?: string;
|
|
9
|
+
} | {
|
|
10
|
+
type: 'user' | 'bot' | 'flow';
|
|
11
|
+
id: ID;
|
|
12
|
+
displayName?: string;
|
|
13
|
+
};
|
|
14
|
+
export type AssignmentStateReference = {
|
|
15
|
+
status: 'unrouted';
|
|
16
|
+
assignmentId?: never;
|
|
17
|
+
queueId?: never;
|
|
18
|
+
owner: {
|
|
19
|
+
type: 'none';
|
|
20
|
+
id?: never;
|
|
21
|
+
} | {
|
|
22
|
+
type: 'bot' | 'flow';
|
|
23
|
+
id: ID;
|
|
24
|
+
};
|
|
25
|
+
} | {
|
|
26
|
+
status: 'queued' | 'routing';
|
|
27
|
+
assignmentId: ID;
|
|
28
|
+
queueId: ID;
|
|
29
|
+
owner: {
|
|
30
|
+
type: 'none';
|
|
31
|
+
id?: never;
|
|
32
|
+
};
|
|
33
|
+
} | {
|
|
34
|
+
status: 'offered' | 'assigned' | 'accepted';
|
|
35
|
+
assignmentId: ID;
|
|
36
|
+
queueId: ID;
|
|
37
|
+
owner: {
|
|
38
|
+
type: 'user';
|
|
39
|
+
id: ID;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export type AssignmentActorReference = {
|
|
43
|
+
type: 'system';
|
|
44
|
+
id?: never;
|
|
45
|
+
displayName?: string;
|
|
46
|
+
} | {
|
|
47
|
+
type: 'user' | 'bot' | 'flow';
|
|
48
|
+
id: ID;
|
|
49
|
+
displayName?: string;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Immutable domain event stored in conversation_assignment_events.
|
|
53
|
+
*
|
|
54
|
+
* Events must only be inserted. Corrections are represented by a new event.
|
|
55
|
+
*/
|
|
56
|
+
export interface ConversationAssignmentEvent {
|
|
57
|
+
id: ID;
|
|
58
|
+
spaceId: ID;
|
|
59
|
+
conversationId: ID;
|
|
60
|
+
/**
|
|
61
|
+
* Monotonic order within a conversation.
|
|
62
|
+
*/
|
|
63
|
+
sequence: number;
|
|
64
|
+
eventType: ConversationAssignmentEventType;
|
|
65
|
+
reason: ConversationAssignmentReason;
|
|
66
|
+
/**
|
|
67
|
+
* Undefined only when no previous assignment state existed.
|
|
68
|
+
*/
|
|
69
|
+
previous?: AssignmentStateReference;
|
|
70
|
+
current: AssignmentStateReference;
|
|
71
|
+
actor: AssignmentActorReference;
|
|
72
|
+
routingDecisionId?: ID;
|
|
73
|
+
/**
|
|
74
|
+
* Version of conversations after applying the transition.
|
|
75
|
+
*/
|
|
76
|
+
conversationVersion: number;
|
|
77
|
+
correlationId?: ID;
|
|
78
|
+
causationId?: ID;
|
|
79
|
+
idempotencyKey: string;
|
|
80
|
+
/**
|
|
81
|
+
* Domain time and persistence time, respectively.
|
|
82
|
+
*/
|
|
83
|
+
occurredAt: Date;
|
|
84
|
+
recordedAt: Date;
|
|
85
|
+
}
|
|
86
|
+
export interface AcceptConversationAssignmentCommand {
|
|
87
|
+
commandId: string;
|
|
88
|
+
spaceId: ID;
|
|
89
|
+
conversationId: ID;
|
|
90
|
+
assignmentId: ID;
|
|
91
|
+
expectedConversationVersion: number;
|
|
92
|
+
actor: AssignmentActorReference;
|
|
93
|
+
requestedAt: Date;
|
|
94
|
+
}
|
|
95
|
+
export type AcceptConversationAssignmentRejectionCode = 'conversation_not_found' | 'assignment_not_current' | 'assignment_not_offered' | 'actor_not_authorized';
|
|
96
|
+
export type AcceptConversationAssignmentResult = {
|
|
97
|
+
status: 'accepted' | 'already_applied';
|
|
98
|
+
commandId: string;
|
|
99
|
+
conversationId: ID;
|
|
100
|
+
previousVersion: number;
|
|
101
|
+
conversationVersion: number;
|
|
102
|
+
previous?: AssignmentStateReference;
|
|
103
|
+
current: AssignmentStateReference;
|
|
104
|
+
assignmentEventId: ID;
|
|
105
|
+
outboxEventId?: ID;
|
|
106
|
+
} | {
|
|
107
|
+
status: 'version_conflict';
|
|
108
|
+
commandId: string;
|
|
109
|
+
conversationId: ID;
|
|
110
|
+
expectedVersion: number;
|
|
111
|
+
currentVersion: number;
|
|
112
|
+
} | {
|
|
113
|
+
status: 'rejected';
|
|
114
|
+
commandId: string;
|
|
115
|
+
conversationId: ID;
|
|
116
|
+
code: AcceptConversationAssignmentRejectionCode;
|
|
117
|
+
};
|
|
118
|
+
export interface DeclineConversationAssignmentCommand {
|
|
119
|
+
commandId: string;
|
|
120
|
+
spaceId: ID;
|
|
121
|
+
conversationId: ID;
|
|
122
|
+
assignmentId: ID;
|
|
123
|
+
expectedConversationVersion: number;
|
|
124
|
+
actor: AssignmentActorReference;
|
|
125
|
+
requestedAt: Date;
|
|
126
|
+
}
|
|
127
|
+
export type DeclineConversationAssignmentRejectionCode = 'conversation_not_found' | 'assignment_not_current' | 'assignment_not_offered' | 'actor_not_authorized';
|
|
128
|
+
export type DeclineConversationAssignmentResult = {
|
|
129
|
+
status: 'declined' | 'already_applied';
|
|
130
|
+
commandId: string;
|
|
131
|
+
conversationId: ID;
|
|
132
|
+
previousVersion: number;
|
|
133
|
+
conversationVersion: number;
|
|
134
|
+
previous?: AssignmentStateReference;
|
|
135
|
+
current: AssignmentStateReference;
|
|
136
|
+
assignmentEventId: ID;
|
|
137
|
+
outboxEventId?: ID;
|
|
138
|
+
} | {
|
|
139
|
+
status: 'version_conflict';
|
|
140
|
+
commandId: string;
|
|
141
|
+
conversationId: ID;
|
|
142
|
+
expectedVersion: number;
|
|
143
|
+
currentVersion: number;
|
|
144
|
+
} | {
|
|
145
|
+
status: 'rejected';
|
|
146
|
+
commandId: string;
|
|
147
|
+
conversationId: ID;
|
|
148
|
+
code: DeclineConversationAssignmentRejectionCode;
|
|
149
|
+
};
|
|
150
|
+
export interface CancelConversationAssignmentCommand {
|
|
151
|
+
commandId: string;
|
|
152
|
+
spaceId: ID;
|
|
153
|
+
conversationId: ID;
|
|
154
|
+
assignmentId: ID;
|
|
155
|
+
expectedConversationVersion: number;
|
|
156
|
+
actor: AssignmentActorReference;
|
|
157
|
+
requestedAt: Date;
|
|
158
|
+
}
|
|
159
|
+
export type CancelConversationAssignmentRejectionCode = 'conversation_not_found' | 'assignment_not_current' | 'assignment_not_cancellable' | 'actor_not_authorized';
|
|
160
|
+
export type CancelConversationAssignmentResult = {
|
|
161
|
+
status: 'cancelled' | 'already_applied';
|
|
162
|
+
commandId: string;
|
|
163
|
+
conversationId: ID;
|
|
164
|
+
previousVersion: number;
|
|
165
|
+
conversationVersion: number;
|
|
166
|
+
previous?: AssignmentStateReference;
|
|
167
|
+
current: AssignmentStateReference;
|
|
168
|
+
assignmentEventId: ID;
|
|
169
|
+
outboxEventId?: ID;
|
|
170
|
+
} | {
|
|
171
|
+
status: 'version_conflict';
|
|
172
|
+
commandId: string;
|
|
173
|
+
conversationId: ID;
|
|
174
|
+
expectedVersion: number;
|
|
175
|
+
currentVersion: number;
|
|
176
|
+
} | {
|
|
177
|
+
status: 'rejected';
|
|
178
|
+
commandId: string;
|
|
179
|
+
conversationId: ID;
|
|
180
|
+
code: CancelConversationAssignmentRejectionCode;
|
|
181
|
+
};
|