twilio-taskrouter 0.8.2 → 0.8.3
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/CHANGELOG.md +6 -0
- package/dist/declarations/Activity.d.ts +17 -0
- package/dist/declarations/Channel.d.ts +19 -0
- package/dist/declarations/Reservation.d.ts +89 -0
- package/dist/declarations/Supervisor.d.ts +7 -0
- package/dist/declarations/Task.d.ts +53 -0
- package/dist/declarations/TaskQueue.d.ts +20 -0
- package/dist/declarations/Worker.d.ts +70 -0
- package/dist/declarations/WorkerContainer.d.ts +5 -0
- package/dist/declarations/Workspace.d.ts +40 -0
- package/dist/declarations/core/transfer/IncomingTransfer.d.ts +5 -0
- package/dist/declarations/core/transfer/OutgoingTransfer.d.ts +10 -0
- package/dist/declarations/core/transfer/Transfer.d.ts +21 -0
- package/dist/declarations/core/transfer/Transfers.d.ts +16 -0
- package/dist/declarations/data/ActivitiesEntity.d.ts +19 -0
- package/dist/declarations/data/ChannelsEntity.d.ts +20 -0
- package/dist/declarations/data/ReservationsEntity.d.ts +26 -0
- package/dist/declarations/data/WorkspaceEntity.d.ts +22 -0
- package/dist/declarations/descriptors/ActivityDescriptor.d.ts +10 -0
- package/dist/declarations/descriptors/ReservationDescriptor.d.ts +17 -0
- package/dist/declarations/descriptors/TaskDescriptor.d.ts +23 -0
- package/dist/declarations/descriptors/TaskQueueDescriptor.d.ts +18 -0
- package/dist/declarations/descriptors/TransferDescriptor.d.ts +15 -0
- package/dist/declarations/descriptors/WorkerChannelDescriptor.d.ts +16 -0
- package/dist/declarations/descriptors/WorkerDescriptor.d.ts +19 -0
- package/dist/declarations/handlers/TaskRouterEventHandler.d.ts +40 -0
- package/dist/declarations/index.d.ts +27 -0
- package/dist/declarations/signaling/EventBridgeSignaling.d.ts +26 -0
- package/dist/declarations/util/BaseRoutes.d.ts +4 -0
- package/dist/declarations/util/Configuration.d.ts +22 -0
- package/dist/declarations/util/Constants.d.ts +106 -0
- package/dist/declarations/util/Heartbeat.d.ts +19 -0
- package/dist/declarations/util/Logger.d.ts +17 -0
- package/dist/declarations/util/Paginator.d.ts +8 -0
- package/dist/declarations/util/Request.d.ts +8 -0
- package/dist/declarations/util/Retry.d.ts +7 -0
- package/dist/declarations/util/Routes.d.ts +67 -0
- package/dist/declarations/util/Tools.d.ts +3 -0
- package/dist/declarations/util/TwilioError.d.ts +6 -0
- package/dist/declarations/util/WorkspaceRoutes.d.ts +18 -0
- package/dist/declarations/util/errors.d.ts +51 -0
- package/dist/docs/Activity.html +525 -131
- package/dist/docs/Channel.html +900 -7
- package/dist/docs/IncomingTransfer.html +180 -14
- package/dist/docs/OutgoingTransfer.html +234 -17
- package/dist/docs/Reservation.html +901 -2351
- package/dist/docs/Supervisor.html +4385 -0
- package/dist/docs/Task.html +1738 -537
- package/dist/docs/TaskQueue.html +1021 -5
- package/dist/docs/Transfers.html +444 -4
- package/dist/docs/Worker.html +1555 -594
- package/dist/docs/Workspace.html +159 -913
- package/dist/docs/classes.list.html +1823 -14
- package/dist/docs/global.html +4755 -0
- package/dist/docs/index.html +11 -4
- package/dist/docs/quicksearch.html +1 -1
- package/dist/index.commonjs2.js +1 -1
- package/dist/index.commonjs2.js.LICENSE.txt +1 -1
- package/dist/index.window.js +2 -2
- package/dist/index.window.js.LICENSE.txt +1 -1
- package/package.json +10 -9
- package/dist/types.d.ts +0 -256
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const ActivityProperties: string[];
|
|
2
|
+
export default Activity;
|
|
3
|
+
export type ActivityUpdateOptions = {
|
|
4
|
+
rejectPendingReservations?: boolean | undefined;
|
|
5
|
+
};
|
|
6
|
+
declare interface Activity {
|
|
7
|
+
readonly accountSid: string;
|
|
8
|
+
readonly available: boolean;
|
|
9
|
+
readonly dateCreated: Date;
|
|
10
|
+
readonly dateUpdated: Date;
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly sid: string;
|
|
13
|
+
readonly workspaceSid: string;
|
|
14
|
+
get isCurrent(): boolean;
|
|
15
|
+
setAsCurrent(options?: ActivityUpdateOptions | undefined): Promise<Activity>;
|
|
16
|
+
}
|
|
17
|
+
import ActivityDescriptor from "./descriptors/ActivityDescriptor";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const ChannelProperties: string[];
|
|
2
|
+
export default Channel;
|
|
3
|
+
declare interface Channel extends EventEmitter {
|
|
4
|
+
readonly accountSid: string;
|
|
5
|
+
readonly assignedTasks: number;
|
|
6
|
+
readonly available: boolean;
|
|
7
|
+
readonly availableCapacityPercentage: number;
|
|
8
|
+
readonly capacity: number;
|
|
9
|
+
readonly dateCreated: Date;
|
|
10
|
+
readonly dateUpdated: Date;
|
|
11
|
+
readonly lastReservedTime: Date;
|
|
12
|
+
readonly sid: string;
|
|
13
|
+
readonly taskChannelSid: string;
|
|
14
|
+
readonly taskChannelUniqueName: string;
|
|
15
|
+
readonly workerSid: string;
|
|
16
|
+
readonly workspaceSid: string;
|
|
17
|
+
}
|
|
18
|
+
import { EventEmitter } from "events";
|
|
19
|
+
import WorkerChannelDescriptor from "./descriptors/WorkerChannelDescriptor";
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
export const ReservationProperties: string[];
|
|
2
|
+
export default Reservation;
|
|
3
|
+
export type RejectOptions = {
|
|
4
|
+
activitySid: string;
|
|
5
|
+
};
|
|
6
|
+
export type CallOptions = {
|
|
7
|
+
accept?: boolean | undefined;
|
|
8
|
+
record?: string | undefined;
|
|
9
|
+
statusCallbackUrl?: string | undefined;
|
|
10
|
+
to?: string | undefined;
|
|
11
|
+
timeout?: number | undefined;
|
|
12
|
+
};
|
|
13
|
+
export type DequeueOptions = {
|
|
14
|
+
from?: string | undefined;
|
|
15
|
+
to?: string | undefined;
|
|
16
|
+
postWorkActivitySid?: string | undefined;
|
|
17
|
+
record?: string | undefined;
|
|
18
|
+
timeout?: number | undefined;
|
|
19
|
+
statusCallbackUrl?: string | undefined;
|
|
20
|
+
statusCallbackEvents?: string | undefined;
|
|
21
|
+
};
|
|
22
|
+
export type RedirectOptions = {
|
|
23
|
+
accept?: boolean | undefined;
|
|
24
|
+
};
|
|
25
|
+
export type ConferenceOptions = {
|
|
26
|
+
to?: string | undefined;
|
|
27
|
+
from?: string | undefined;
|
|
28
|
+
timeout?: number | undefined;
|
|
29
|
+
statusCallback?: string | undefined;
|
|
30
|
+
statusCallbackMethod?: string | undefined;
|
|
31
|
+
statusCallbackEvent?: string | undefined;
|
|
32
|
+
record?: string | undefined;
|
|
33
|
+
muted?: boolean | undefined;
|
|
34
|
+
beep?: string | boolean | undefined;
|
|
35
|
+
startConferenceOnEnter?: boolean | undefined;
|
|
36
|
+
endConferenceOnExit?: boolean | undefined;
|
|
37
|
+
endConferenceOnCustomerExit?: boolean | undefined;
|
|
38
|
+
beepOnCustomerEntrance?: boolean | undefined;
|
|
39
|
+
waitUrl?: string | undefined;
|
|
40
|
+
waitMethod?: string | undefined;
|
|
41
|
+
earlyMedia?: boolean | undefined;
|
|
42
|
+
maxParticipants?: number | undefined;
|
|
43
|
+
conferenceStatusCallback?: string | undefined;
|
|
44
|
+
conferenceStatusCallbackMethod?: string | undefined;
|
|
45
|
+
conferenceStatusCallbackEvent?: string | undefined;
|
|
46
|
+
conferenceRecord?: string | boolean | undefined;
|
|
47
|
+
conferenceTrim?: string | undefined;
|
|
48
|
+
recordingChannels?: string | undefined;
|
|
49
|
+
recordingStatusCallback?: string | undefined;
|
|
50
|
+
recordingStatusCallbackMethod?: string | undefined;
|
|
51
|
+
conferenceRecordingStatusCallback?: string | undefined;
|
|
52
|
+
conferenceRecordingStatusCallbackMethod?: string | undefined;
|
|
53
|
+
region?: string | undefined;
|
|
54
|
+
sipAuthUsername?: string | undefined;
|
|
55
|
+
sipAuthPassword?: string | undefined;
|
|
56
|
+
};
|
|
57
|
+
export type ReservationParticipantOptions = {
|
|
58
|
+
endConferenceOnExit: boolean;
|
|
59
|
+
mute: boolean;
|
|
60
|
+
beepOnExit: boolean;
|
|
61
|
+
};
|
|
62
|
+
declare interface Reservation extends EventEmitter {
|
|
63
|
+
readonly task: Task | {};
|
|
64
|
+
readonly transfer: IncomingTransfer | {};
|
|
65
|
+
readonly accountSid: string;
|
|
66
|
+
readonly dateCreated: Date;
|
|
67
|
+
readonly dateUpdated: Date;
|
|
68
|
+
readonly sid: string;
|
|
69
|
+
readonly status: "pending" | "accepted" | "rejected" | "timeout" | "canceled" | "rescinded" | "wrapping" | "completed";
|
|
70
|
+
readonly timeout: number;
|
|
71
|
+
readonly workerSid: string;
|
|
72
|
+
readonly workspaceSid: string;
|
|
73
|
+
readonly version: string;
|
|
74
|
+
readonly canceledReasonCode: number | undefined;
|
|
75
|
+
accept(): Promise<Reservation>;
|
|
76
|
+
complete(): Promise<Reservation>;
|
|
77
|
+
reject(options?: RejectOptions | undefined): Promise<Reservation>;
|
|
78
|
+
wrap(): Promise<Reservation>;
|
|
79
|
+
call(from: string, url: string, options?: CallOptions | undefined): Promise<Reservation>;
|
|
80
|
+
dequeue(options?: DequeueOptions | undefined): Promise<Reservation>;
|
|
81
|
+
redirect(callSid: string, url: string, options?: RedirectOptions | undefined): Promise<Reservation>;
|
|
82
|
+
conference(options?: ConferenceOptions | undefined): Promise<Reservation>;
|
|
83
|
+
updateParticipant(options: ReservationParticipantOptions): Promise<Reservation>;
|
|
84
|
+
fetchLatestVersion(): Promise<Reservation>;
|
|
85
|
+
}
|
|
86
|
+
import { EventEmitter } from "events";
|
|
87
|
+
import Task from "./Task";
|
|
88
|
+
import IncomingTransfer from "./core/transfer/IncomingTransfer";
|
|
89
|
+
import ReservationDescriptor from "./descriptors/ReservationDescriptor";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export const SuperviseModes: string[];
|
|
2
|
+
export default Supervisor;
|
|
3
|
+
declare class Supervisor extends Worker {
|
|
4
|
+
monitor(taskSid: string, reservationSid: string, extraParams?: Record<any, any> | undefined): Promise<void>;
|
|
5
|
+
private _supervise;
|
|
6
|
+
}
|
|
7
|
+
import Worker from "./Worker";
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export const TaskProperties: string[];
|
|
2
|
+
export default Task;
|
|
3
|
+
export type TransferOptions = {
|
|
4
|
+
attributes: Record<any, any>;
|
|
5
|
+
mode: 'WARM' | 'COLD';
|
|
6
|
+
priority: number;
|
|
7
|
+
};
|
|
8
|
+
export type WrappingOptions = {
|
|
9
|
+
reason: string;
|
|
10
|
+
};
|
|
11
|
+
export type TaskParticipantOptions = {
|
|
12
|
+
hold: boolean;
|
|
13
|
+
holdUrl: string;
|
|
14
|
+
holdMethod: 'GET';
|
|
15
|
+
};
|
|
16
|
+
export type HoldOptions = {
|
|
17
|
+
holdUrl: string;
|
|
18
|
+
holdMethod: 'GET';
|
|
19
|
+
};
|
|
20
|
+
declare interface Task extends EventEmitter {
|
|
21
|
+
readonly transfers: Transfers;
|
|
22
|
+
readonly addOns: Record<any, any>;
|
|
23
|
+
readonly age: number;
|
|
24
|
+
readonly attributes: Record<any, any>;
|
|
25
|
+
readonly dateCreated: Date;
|
|
26
|
+
readonly dateUpdated: Date;
|
|
27
|
+
readonly priority: number;
|
|
28
|
+
readonly queueName: string;
|
|
29
|
+
readonly queueSid: string;
|
|
30
|
+
readonly reason: string;
|
|
31
|
+
readonly routingTarget: string;
|
|
32
|
+
readonly sid: string;
|
|
33
|
+
readonly status: 'pending' | 'reserved' | 'assigned' | 'canceled' | 'completed' | 'wrapping';
|
|
34
|
+
readonly taskChannelUniqueName: string;
|
|
35
|
+
readonly taskChannelSid: string;
|
|
36
|
+
readonly timeout: number;
|
|
37
|
+
readonly workflowName: string;
|
|
38
|
+
readonly workflowSid: string;
|
|
39
|
+
readonly version: string;
|
|
40
|
+
readonly reservationSid: string;
|
|
41
|
+
complete(reason: string): Promise<Task>;
|
|
42
|
+
transfer(to: string, options?: TransferOptions | undefined): Promise<Task>;
|
|
43
|
+
wrapUp(options?: WrappingOptions): Promise<Task>;
|
|
44
|
+
setAttributes(attributes: Record<any, any>): Promise<Task>;
|
|
45
|
+
updateParticipant(options: TaskParticipantOptions): Promise<Task>;
|
|
46
|
+
kick(workerSid: string): Promise<Task>;
|
|
47
|
+
hold(targetWorkerSid: string, onHold: boolean, options: HoldOptions): Promise<Task>;
|
|
48
|
+
fetchLatestVersion(): Promise<Task>;
|
|
49
|
+
}
|
|
50
|
+
import { EventEmitter } from "events";
|
|
51
|
+
import Transfers from "./core/transfer/Transfers";
|
|
52
|
+
import Worker from "./Worker";
|
|
53
|
+
import TaskDescriptor from "./descriptors/TaskDescriptor";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const TaskQueueProperties: string[];
|
|
2
|
+
export default TaskQueue;
|
|
3
|
+
declare interface TaskQueue {
|
|
4
|
+
readonly sid: string;
|
|
5
|
+
readonly queueSid: string;
|
|
6
|
+
readonly accountSid: string;
|
|
7
|
+
readonly workspaceSid: string;
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly queueName: string;
|
|
10
|
+
readonly assignmentActivityName: string;
|
|
11
|
+
readonly reservationActivityName: string;
|
|
12
|
+
readonly assignmentActivitySid: string;
|
|
13
|
+
readonly reservationActivitySid: string;
|
|
14
|
+
readonly targetWorkers: string;
|
|
15
|
+
readonly maxReservedWorkers: number;
|
|
16
|
+
readonly taskOrder: string;
|
|
17
|
+
readonly dateCreated: Date;
|
|
18
|
+
readonly dateUpdated: Date;
|
|
19
|
+
}
|
|
20
|
+
import TaskQueueDescriptor from "./descriptors/TaskQueueDescriptor";
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export const WorkerProperties: string[];
|
|
2
|
+
export default Worker;
|
|
3
|
+
export type WorkerOptions = {
|
|
4
|
+
connectActivitySid?: string | undefined;
|
|
5
|
+
closeExistingSessions?: boolean | undefined;
|
|
6
|
+
logLevel?: string | undefined;
|
|
7
|
+
region?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
export type WorkerDeps = {
|
|
10
|
+
Request: Request;
|
|
11
|
+
EventBridgeSignaling: EventBridgeSignaling;
|
|
12
|
+
};
|
|
13
|
+
export type WorkerTaskOptions = {
|
|
14
|
+
attributes?: Record<any, any> | undefined;
|
|
15
|
+
taskChannelUniqueName?: string | undefined;
|
|
16
|
+
taskChannelSid?: string | undefined;
|
|
17
|
+
};
|
|
18
|
+
declare class Worker extends EventEmitter {
|
|
19
|
+
constructor(token: string, options?: WorkerOptions | undefined, deps?: WorkerDeps | undefined);
|
|
20
|
+
private _connectActivitySid;
|
|
21
|
+
private _closeExistingSessions;
|
|
22
|
+
private _logLevel;
|
|
23
|
+
private _config;
|
|
24
|
+
private _log;
|
|
25
|
+
private _request;
|
|
26
|
+
private _dataServices;
|
|
27
|
+
private _routes;
|
|
28
|
+
private _connectRetry;
|
|
29
|
+
private _signaling;
|
|
30
|
+
private retryUtil;
|
|
31
|
+
private taskRouterEventHandler;
|
|
32
|
+
readonly activity: typeof import("./Activity");
|
|
33
|
+
readonly accountSid: string;
|
|
34
|
+
readonly attributes: Record<any, any>;
|
|
35
|
+
readonly dateCreated: Date;
|
|
36
|
+
readonly dateStatusChanged: Date;
|
|
37
|
+
readonly dateUpdated: Date;
|
|
38
|
+
readonly name: string;
|
|
39
|
+
readonly sid: string;
|
|
40
|
+
readonly workspaceSid: string;
|
|
41
|
+
version: string;
|
|
42
|
+
readonly workerSid: string;
|
|
43
|
+
readonly workerActivitySid: string;
|
|
44
|
+
readonly friendlyName: string;
|
|
45
|
+
readonly dateActivityChanged: Date;
|
|
46
|
+
createTask(to: string, from: string, workflowSid: string, taskQueueSid: string, options?: WorkerTaskOptions | undefined): Promise<string>;
|
|
47
|
+
getLogger(prefix: string): Logger;
|
|
48
|
+
setAttributes(attributes: Record<any, any>): Promise<Worker>;
|
|
49
|
+
_bumpVersion(): void;
|
|
50
|
+
updateToken(newToken: string): void;
|
|
51
|
+
fetchLatestVersion(): Promise<Worker>;
|
|
52
|
+
private _subscribeToSignalingEvents;
|
|
53
|
+
private _subscribeToTaskRouterEvents;
|
|
54
|
+
private _unSubscribeFromTaskRouterEvents;
|
|
55
|
+
private _initialize;
|
|
56
|
+
get channels(): Map<string, typeof import("./Channel")>;
|
|
57
|
+
get activities(): Map<string, typeof import("./Activity")>;
|
|
58
|
+
get reservations(): Map<string, typeof import("./Reservation")>;
|
|
59
|
+
private _setCurrentActivity;
|
|
60
|
+
private _setWorkerConnectActivity;
|
|
61
|
+
private _updateWorkerActivity;
|
|
62
|
+
private _update;
|
|
63
|
+
disconnect(): void;
|
|
64
|
+
getRoutes(): Routes;
|
|
65
|
+
}
|
|
66
|
+
import Request from "./util/Request";
|
|
67
|
+
import EventBridgeSignaling from "./signaling/EventBridgeSignaling";
|
|
68
|
+
import { EventEmitter } from "events";
|
|
69
|
+
import Logger from "./util/Logger";
|
|
70
|
+
import Routes from "./util/Routes";
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export default Workspace;
|
|
2
|
+
export type WorkspaceOptions = {
|
|
3
|
+
region?: string | undefined;
|
|
4
|
+
pageSize?: number | undefined;
|
|
5
|
+
logLevel?: string | undefined;
|
|
6
|
+
};
|
|
7
|
+
export type FetchWorkersParams = {
|
|
8
|
+
AfterSid?: string | undefined;
|
|
9
|
+
FriendlyName?: string | undefined;
|
|
10
|
+
ActivitySid?: string | undefined;
|
|
11
|
+
ActivityName?: string | undefined;
|
|
12
|
+
TargetWorkersExpression?: string | undefined;
|
|
13
|
+
Ordering?: "DateStatusChanged:asc" | "DateStatusChanged:desc" | undefined;
|
|
14
|
+
MaxWorkers?: number | undefined;
|
|
15
|
+
};
|
|
16
|
+
export type FetchTaskQueuesParams = {
|
|
17
|
+
AfterSid?: string | undefined;
|
|
18
|
+
FriendlyName?: string | undefined;
|
|
19
|
+
Ordering?: "DateUpdated:asc" | "DateUpdated:desc" | undefined;
|
|
20
|
+
};
|
|
21
|
+
declare class Workspace {
|
|
22
|
+
constructor(jwt: string, options?: WorkspaceOptions | undefined, workspaceSid?: string | undefined);
|
|
23
|
+
private _config;
|
|
24
|
+
private _request;
|
|
25
|
+
private _logLevel;
|
|
26
|
+
private _log;
|
|
27
|
+
private shouldDecodeToken;
|
|
28
|
+
readonly workspaceSid: string;
|
|
29
|
+
private workspaceEntity;
|
|
30
|
+
fetchWorker(workerSid: string): Promise<typeof import("./Worker")>;
|
|
31
|
+
fetchWorkers(params?: FetchWorkersParams | undefined): Promise<Map<string, typeof import("./Worker")>>;
|
|
32
|
+
fetchTaskQueue(queueSid: string): Promise<typeof import("./TaskQueue")>;
|
|
33
|
+
fetchTaskQueues(params?: FetchTaskQueuesParams | undefined): Promise<Map<string, typeof import("./TaskQueue")>>;
|
|
34
|
+
updateToken(newToken: string): void;
|
|
35
|
+
private _updateJWTProperties;
|
|
36
|
+
private jwt;
|
|
37
|
+
private accountSid;
|
|
38
|
+
private workerSid;
|
|
39
|
+
private role;
|
|
40
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default OutgoingTransfer;
|
|
2
|
+
declare class OutgoingTransfer extends Transfer {
|
|
3
|
+
constructor(worker: typeof import("../../Worker"), request: typeof import("../../util/Request"), taskSid: string, descriptor: typeof import("../../descriptors/TransferDescriptor"));
|
|
4
|
+
private _worker;
|
|
5
|
+
private _request;
|
|
6
|
+
taskSid: string;
|
|
7
|
+
private _emitEvent;
|
|
8
|
+
public cancel(): Promise<OutgoingTransfer>;
|
|
9
|
+
}
|
|
10
|
+
import Transfer from "./Transfer";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const TransferProperties: string[];
|
|
2
|
+
export default Transfer;
|
|
3
|
+
declare class Transfer extends EventEmitter {
|
|
4
|
+
constructor(worker: typeof import("../../Worker"), descriptor: TransferDescriptor);
|
|
5
|
+
private _log;
|
|
6
|
+
dateCreated: Date;
|
|
7
|
+
dateUpdated: Date;
|
|
8
|
+
mode: string;
|
|
9
|
+
queueSid: string;
|
|
10
|
+
reservationSid: string;
|
|
11
|
+
to: string;
|
|
12
|
+
transferFailedReason: string | null;
|
|
13
|
+
type: string;
|
|
14
|
+
sid: string;
|
|
15
|
+
status: string;
|
|
16
|
+
workerSid: string;
|
|
17
|
+
workflowSid: string;
|
|
18
|
+
_update(latestTransferData: Object): this;
|
|
19
|
+
}
|
|
20
|
+
import { EventEmitter } from "events";
|
|
21
|
+
import TransferDescriptor from "../../descriptors/TransferDescriptor";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default Transfers;
|
|
2
|
+
declare class Transfers extends EventEmitter {
|
|
3
|
+
constructor(worker: typeof import("../../Worker"), request: typeof import("../../util/Request"), taskDescriptor: TaskDescriptor);
|
|
4
|
+
private _log;
|
|
5
|
+
private _worker;
|
|
6
|
+
private _request;
|
|
7
|
+
incoming: IncomingTransfer;
|
|
8
|
+
outgoing: OutgoingTransfer;
|
|
9
|
+
_emitEvent(eventType: Object, rawEventData: Object): void;
|
|
10
|
+
private _updateOutgoing;
|
|
11
|
+
_update(latestTransfersData: Object): void;
|
|
12
|
+
}
|
|
13
|
+
import { EventEmitter } from "events";
|
|
14
|
+
import IncomingTransfer from "./IncomingTransfer";
|
|
15
|
+
import OutgoingTransfer from "./OutgoingTransfer";
|
|
16
|
+
import TaskDescriptor from "../../descriptors/TaskDescriptor";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default class ActivitiesEntity {
|
|
2
|
+
constructor(worker: typeof import("../Worker"), request: typeof import("../util/Request"), options?: Activities.Options | undefined);
|
|
3
|
+
private _activities;
|
|
4
|
+
private _log;
|
|
5
|
+
private _request;
|
|
6
|
+
private _worker;
|
|
7
|
+
private _pageSize;
|
|
8
|
+
get activities(): Map<string, Activity>;
|
|
9
|
+
public fetchActivities(): Promise<Map<string, Activity>>;
|
|
10
|
+
private _getAllActivities;
|
|
11
|
+
private _getPage;
|
|
12
|
+
private _insertActivity;
|
|
13
|
+
}
|
|
14
|
+
export namespace Activities {
|
|
15
|
+
type Options = {
|
|
16
|
+
pageSize?: number | undefined;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
import Activity from "../Activity";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default class ChannelsEntity {
|
|
2
|
+
constructor(worker: Worker, request: typeof import("../util/Request"), options?: Channels.Options | undefined);
|
|
3
|
+
private _channels;
|
|
4
|
+
private _log;
|
|
5
|
+
private _request;
|
|
6
|
+
private _pageSize;
|
|
7
|
+
private _worker;
|
|
8
|
+
get channels(): Map<string, Channel>;
|
|
9
|
+
public fetchChannels(): Promise<Map<string, Channel>>;
|
|
10
|
+
private _getAllChannels;
|
|
11
|
+
private _getPage;
|
|
12
|
+
private _insertChannel;
|
|
13
|
+
}
|
|
14
|
+
export namespace Channels {
|
|
15
|
+
type Options = {
|
|
16
|
+
pageSize?: number | undefined;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
import Channel from "../Channel";
|
|
20
|
+
import Worker from "../Worker";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default class ReservationsEntity extends EventEmitter {
|
|
2
|
+
constructor(worker: Worker, request: typeof import("../util/Request"), options?: Reservations.Options | undefined);
|
|
3
|
+
private _worker;
|
|
4
|
+
private _log;
|
|
5
|
+
private _request;
|
|
6
|
+
private _reservations;
|
|
7
|
+
private _reservationSidsByTask;
|
|
8
|
+
private _pageSize;
|
|
9
|
+
get reservations(): Map<string, Reservation>;
|
|
10
|
+
public fetchReservations(): Promise<Map<string, Reservation>>;
|
|
11
|
+
private _getAllReservations;
|
|
12
|
+
private _getPage;
|
|
13
|
+
private _insertReservation;
|
|
14
|
+
public insert(rawReservationData: Object): Reservation;
|
|
15
|
+
public getTasks(taskSid: string): [typeof import("../Task")] | null;
|
|
16
|
+
private _deleteByReservationSid;
|
|
17
|
+
private _cleanUpReservationAndTask;
|
|
18
|
+
}
|
|
19
|
+
export namespace Reservations {
|
|
20
|
+
type Options = {
|
|
21
|
+
pageSize?: number | undefined;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
import { EventEmitter } from "events";
|
|
25
|
+
import Reservation from "../Reservation";
|
|
26
|
+
import Worker from "../Worker";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export default class WorkspaceEntity {
|
|
2
|
+
constructor(workspaceSid: string, request: typeof import("../util/Request"), options?: import('Workspace').WorkspaceOptions | undefined);
|
|
3
|
+
private _Workers;
|
|
4
|
+
private _TaskQueues;
|
|
5
|
+
private _routes;
|
|
6
|
+
private _request;
|
|
7
|
+
private _log;
|
|
8
|
+
private _pageSize;
|
|
9
|
+
get Workers(): Map<string, Worker>;
|
|
10
|
+
get TaskQueues(): Map<string, TaskQueue>;
|
|
11
|
+
public fetchWorker(workerSid: string): Promise<Worker>;
|
|
12
|
+
public fetchWorkers(params: import('Workspace').FetchWorkersParams): Promise<Map<string, Worker>>;
|
|
13
|
+
public fetchTaskQueue(queueSid: string): Promise<TaskQueue>;
|
|
14
|
+
public fetchTaskQueues(params: import('Workspace').FetchTaskQueuesParams): Promise<Map<string, TaskQueue>>;
|
|
15
|
+
private _getAllWorkers;
|
|
16
|
+
private _getWorkerPage;
|
|
17
|
+
private _insertWorker;
|
|
18
|
+
private _getAllTaskQueues;
|
|
19
|
+
private _getTaskQueuePage;
|
|
20
|
+
private _insertTaskQueue;
|
|
21
|
+
}
|
|
22
|
+
import TaskQueue from "../TaskQueue";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export default class ReservationDescriptor {
|
|
2
|
+
constructor(descriptor: Object, worker: typeof import("../Worker"), ignoredProperties?: Array<string>);
|
|
3
|
+
accountSid: string;
|
|
4
|
+
dateCreated: Date;
|
|
5
|
+
dateUpdated: Date;
|
|
6
|
+
sid: string;
|
|
7
|
+
status: string;
|
|
8
|
+
timeout: number;
|
|
9
|
+
workerSid: string;
|
|
10
|
+
workspaceSid: string;
|
|
11
|
+
taskDescriptor: TaskDescriptor | null;
|
|
12
|
+
transferDescriptor: TransferDescriptor | null;
|
|
13
|
+
version: string;
|
|
14
|
+
canceledReasonCode: number | null;
|
|
15
|
+
}
|
|
16
|
+
import TaskDescriptor from "./TaskDescriptor";
|
|
17
|
+
import TransferDescriptor from "./TransferDescriptor";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export default class TaskDescriptor {
|
|
2
|
+
constructor(descriptor: Object);
|
|
3
|
+
addOns: Object;
|
|
4
|
+
age: number;
|
|
5
|
+
attributes: Object;
|
|
6
|
+
dateCreated: Date;
|
|
7
|
+
dateUpdated: Date;
|
|
8
|
+
priority: number;
|
|
9
|
+
queueName: string;
|
|
10
|
+
queueSid: string;
|
|
11
|
+
reason: string;
|
|
12
|
+
routingTarget: string;
|
|
13
|
+
sid: string;
|
|
14
|
+
status: string;
|
|
15
|
+
taskChannelUniqueName: string;
|
|
16
|
+
taskChannelSid: string;
|
|
17
|
+
timeout: number;
|
|
18
|
+
workflowName: string;
|
|
19
|
+
workflowSid: string;
|
|
20
|
+
incomingTransferDescriptor: typeof import("./TransferDescriptor") | null;
|
|
21
|
+
outgoingTransferDescriptor: typeof import("./TransferDescriptor") | null;
|
|
22
|
+
version: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export default class TaskQueueDescriptor {
|
|
2
|
+
constructor(descriptor: Object);
|
|
3
|
+
sid: string;
|
|
4
|
+
queueSid: string;
|
|
5
|
+
accountSid: string;
|
|
6
|
+
workspaceSid: string;
|
|
7
|
+
name: string;
|
|
8
|
+
queueName: string;
|
|
9
|
+
assignmentActivityName: string;
|
|
10
|
+
reservationActivityName: string;
|
|
11
|
+
assignmentActivitySid: string;
|
|
12
|
+
reservationActivitySid: string;
|
|
13
|
+
targetWorkers: string;
|
|
14
|
+
maxReservedWorkers: number;
|
|
15
|
+
taskOrder: string;
|
|
16
|
+
dateCreated: Date;
|
|
17
|
+
dateUpdated: Date;
|
|
18
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default class TransferDescriptor {
|
|
2
|
+
constructor(descriptor: Object);
|
|
3
|
+
dateCreated: Date;
|
|
4
|
+
dateUpdated: Date;
|
|
5
|
+
mode: string;
|
|
6
|
+
queueSid: string;
|
|
7
|
+
reservationSid: string;
|
|
8
|
+
to: string;
|
|
9
|
+
transferFailedReason: string | null;
|
|
10
|
+
type: string;
|
|
11
|
+
sid: string;
|
|
12
|
+
status: string;
|
|
13
|
+
workerSid: string;
|
|
14
|
+
workflowSid: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default class WorkerChannelDescriptor {
|
|
2
|
+
constructor(descriptor: Object);
|
|
3
|
+
accountSid: string;
|
|
4
|
+
assignedTasks: number;
|
|
5
|
+
available: boolean;
|
|
6
|
+
availableCapacityPercentage: number;
|
|
7
|
+
capacity: number;
|
|
8
|
+
dateCreated: Date;
|
|
9
|
+
dateUpdated: Date;
|
|
10
|
+
lastReservedTime: Date;
|
|
11
|
+
sid: string;
|
|
12
|
+
taskChannelSid: string;
|
|
13
|
+
taskChannelUniqueName: string;
|
|
14
|
+
workerSid: string;
|
|
15
|
+
workspaceSid: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default class WorkerDescriptor {
|
|
2
|
+
constructor(descriptor: Object);
|
|
3
|
+
accountSid: string;
|
|
4
|
+
activityName: string;
|
|
5
|
+
activitySid: string;
|
|
6
|
+
attributes: Object;
|
|
7
|
+
available: boolean;
|
|
8
|
+
dateCreated: Date;
|
|
9
|
+
dateStatusChanged: Date;
|
|
10
|
+
dateUpdated: Date;
|
|
11
|
+
name: string;
|
|
12
|
+
sid: string;
|
|
13
|
+
workspaceSid: string;
|
|
14
|
+
version: string;
|
|
15
|
+
workerSid: string;
|
|
16
|
+
workerActivitySid: string;
|
|
17
|
+
dateActivityChanged: Date;
|
|
18
|
+
friendlyName: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export default class TaskRouterEventHandler {
|
|
2
|
+
constructor(worker: typeof import("../Worker"), options?: Object | undefined);
|
|
3
|
+
private _worker;
|
|
4
|
+
private _logLevel;
|
|
5
|
+
private _log;
|
|
6
|
+
public getTREventsToHandlerMapping(): {
|
|
7
|
+
"task.transfer-completed": string;
|
|
8
|
+
"reservation.completed": string;
|
|
9
|
+
"task.transfer-attempt-failed": string;
|
|
10
|
+
"reservation.created": string;
|
|
11
|
+
"task.updated": string;
|
|
12
|
+
"reservation.rescinded": string;
|
|
13
|
+
"worker.attributes.update": string;
|
|
14
|
+
"worker.channel.availability.update": string;
|
|
15
|
+
"task.transfer-initiated": string;
|
|
16
|
+
"reservation.accepted": string;
|
|
17
|
+
"reservation.timeout": string;
|
|
18
|
+
"reservation.failed": string;
|
|
19
|
+
"worker.activity.update": string;
|
|
20
|
+
"reservation.rejected": string;
|
|
21
|
+
"task.canceled": string;
|
|
22
|
+
"task.transfer-failed": string;
|
|
23
|
+
"task.wrapup": string;
|
|
24
|
+
"reservation.wrapup": string;
|
|
25
|
+
"reservation.canceled": string;
|
|
26
|
+
"task.transfer-canceled": string;
|
|
27
|
+
"worker.capacity.update": string;
|
|
28
|
+
"task.completed": string;
|
|
29
|
+
};
|
|
30
|
+
private _workerActivityUpdateHandler;
|
|
31
|
+
private _workerAttributesUpdateHandler;
|
|
32
|
+
private _workerCapacityUpdateHandler;
|
|
33
|
+
private _workerChannelAvailabilityUpdateHandler;
|
|
34
|
+
private _reservationCreatedHandler;
|
|
35
|
+
private _reservationFailedHandler;
|
|
36
|
+
private _reservationUpdateHandler;
|
|
37
|
+
private _reservationCleanupEventsHandler;
|
|
38
|
+
private _taskTypeEventHandler;
|
|
39
|
+
private _transferTaskEventHandler;
|
|
40
|
+
}
|