New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@twilio/flex-plugins-library-utils

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@twilio/flex-plugins-library-utils - npm Package Compare versions

Comparing version 1.1.4 to 1.1.5-beta.0

38

CHANGELOG.md

@@ -42,2 +42,38 @@ # Changelog

- Fix API post calls
- Fix API post calls
## 1.1.2
**v1.1.2** of **`@twilio/flex-plugins-library-utils`**! is released
Added new methods to the `ProgrammableVoiceUtils` class to support callerIds and recording media.
### Added
- Added 5 new methods in the ProgrammableVoiceUtils
- `listOutgoingCallerIds`
- `fetchRecordingMedia`
- `fetchRecording`
- `fetchVoiceQueue`
- `updateCall`
## 1.1.3
**v1.1.3** of **`@twilio/flex-plugins-library-utils`**! is released
Fixed the authentication mechanism for the `ProgrammableVoiceUtils` class to support recording media.
### Fixed
- Authentication for `ProgrammableVoiceUtils` class
## 1.1.5
**v1.1.5** of **`@twilio/flex-plugins-library-utils`**! is released
Added new params to the `getAllTasksFromWorkspace` method of `TaskRouterUtils` class to support filtering of tasks list.
### Added
- Following three parameters are added to `getAllTasksFromWorkspace` method of `TaskRouterUtils`
- `workflowSid`: the workflow SID to filter by
- `assignmentStatus`: the assignment status of tasks to filter by
- `ordering`: the desired ordering of the resulting taskList (e.g. DateCreated:desc)

18

dist/common/BaseClasses/TwilioAPI.js

@@ -27,4 +27,4 @@ "use strict";

request(method, url, config, params) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
var _a;
try {

@@ -40,19 +40,19 @@ const response = yield this.api[method](url, params, config);

}
get({ url, config, params }) {
return __awaiter(this, void 0, void 0, function* () {
get(_a) {
return __awaiter(this, arguments, void 0, function* ({ url, config, params }) {
return this.request("get" /* HTTP_METHODS.GET */, url, config, params);
});
}
post({ url, config, params }) {
return __awaiter(this, void 0, void 0, function* () {
post(_a) {
return __awaiter(this, arguments, void 0, function* ({ url, config, params }) {
return this.request("post" /* HTTP_METHODS.POST */, url, config, params);
});
}
put({ url, config, params }) {
return __awaiter(this, void 0, void 0, function* () {
put(_a) {
return __awaiter(this, arguments, void 0, function* ({ url, config, params }) {
return this.request("put" /* HTTP_METHODS.PUT */, url, config, params);
});
}
delete({ url, config, params }) {
return __awaiter(this, void 0, void 0, function* () {
delete(_a) {
return __awaiter(this, arguments, void 0, function* ({ url, config, params }) {
return this.request("delete" /* HTTP_METHODS.DELETE */, url, config, params);

@@ -59,0 +59,0 @@ });

@@ -140,3 +140,3 @@ "use strict";

}
if (!(0, lodash_1.isString)(status) || (status != 'closed' && status != 'wrapup'))
if (!(0, lodash_1.isString)(status) || (status != 'closed' && status != 'inactive'))
throw new PluginUtilsErrorManager_1.PluginUtilsErrorManager('Invalid parameters object passed. Parameters must contain status to update the channel to and it must be one of "closed" or "wrapup"', statusCodes_1.HttpErrorCode.BadRequest);

@@ -143,0 +143,0 @@ const updatedChannel = yield this.client.flexApi.v1

@@ -42,6 +42,13 @@ import { Twilio } from 'twilio';

* @param {number} parameters.limit limit for the queues to be reterived
* @param {string} parameters.workflowSid (optional) the workflow SID to filter by
* @param {string} parameters.assignmentStatus (optional) the assignment status to filter by
* @param {string} parameters.ordering (optional) the desired ordering (e.g. DateCreated:desc)
* @return { Promise<Array<TaskInstance>> } - list of all tasks from specific workspace
* @description the following method is used to fetch all task from workspace
* */
getAllTasksFromWorkspace(parameters: Parameters): Promise<ApiReturnType & {
getAllTasksFromWorkspace(parameters: Parameters & {
workflowSid?: string;
assignmentStatus?: string[];
ordering?: string;
}): Promise<ApiReturnType & {
taskList?: Array<TaskInstance>;

@@ -48,0 +55,0 @@ }>;

@@ -72,2 +72,5 @@ "use strict";

* @param {number} parameters.limit limit for the queues to be reterived
* @param {string} parameters.workflowSid (optional) the workflow SID to filter by
* @param {string} parameters.assignmentStatus (optional) the assignment status to filter by
* @param {string} parameters.ordering (optional) the desired ordering (e.g. DateCreated:desc)
* @return { Promise<Array<TaskInstance>> } - list of all tasks from specific workspace

@@ -79,6 +82,7 @@ * @description the following method is used to fetch all task from workspace

let taskList = [];
const { limit, workflowSid, assignmentStatus, ordering } = parameters;
try {
taskList = yield this.client.taskrouter.v1
.workspaces(this.config.flexWorkSpaceSid)
.tasks.list({ limit: parameters.limit });
.tasks.list({ limit, workflowSid, assignmentStatus, ordering });
return {

@@ -245,3 +249,4 @@ success: true,

updateTask(parameters) {
return __awaiter(this, arguments, void 0, function* () {
var arguments_1 = arguments;
return __awaiter(this, void 0, void 0, function* () {
const { taskSid, updateParams } = parameters;

@@ -277,3 +282,3 @@ const parameterChecks = {

if (error.code === statusCodes_1.TwilioErrorCode.TaskNotAssigned || error.code === statusCodes_1.TwilioErrorCode.TaskNotExist) {
console.warn(`${arguments.callee.name}(): ${error.message}`);
console.warn(`${arguments_1.callee.name}(): ${error.message}`);
return {

@@ -296,3 +301,4 @@ success: true,

fetchTask(parameters) {
return __awaiter(this, arguments, void 0, function* () {
var arguments_2 = arguments;
return __awaiter(this, void 0, void 0, function* () {
const { taskSid } = parameters;

@@ -324,3 +330,3 @@ const parameterChecks = {

if (error.code === statusCodes_1.TwilioErrorCode.TaskNotAssigned || error.code === statusCodes_1.TwilioErrorCode.TaskNotExist) {
console.warn(`${arguments.callee.name}(): ${error.message}`);
console.warn(`${arguments_2.callee.name}(): ${error.message}`);
return {

@@ -397,3 +403,4 @@ success: true,

completeTask(parameters) {
return __awaiter(this, arguments, void 0, function* () {
var arguments_3 = arguments;
return __awaiter(this, void 0, void 0, function* () {
const { taskSid, reason } = parameters;

@@ -429,3 +436,3 @@ const parameterChecks = {

if (error.code === statusCodes_1.TwilioErrorCode.TaskNotAssigned || error.code === statusCodes_1.TwilioErrorCode.TaskNotExist) {
console.warn(`${arguments.callee.name}(): ${error.message}`);
console.warn(`${arguments_3.callee.name}(): ${error.message}`);
return {

@@ -450,3 +457,4 @@ success: true,

updateReservation(parameters) {
return __awaiter(this, arguments, void 0, function* () {
var arguments_4 = arguments;
return __awaiter(this, void 0, void 0, function* () {
const { taskSid, reservationSid, status } = parameters;

@@ -485,3 +493,3 @@ const parameterChecks = {

if (error.code === statusCodes_1.TwilioErrorCode.TaskNotAssigned || error.code === statusCodes_1.TwilioErrorCode.TaskNotExist) {
console.warn(`${arguments.callee.name}(): ${error.message}`);
console.warn(`${arguments_4.callee.name}(): ${error.message}`);
return {

@@ -488,0 +496,0 @@ success: true,

{
"name": "@twilio/flex-plugins-library-utils",
"version": "1.1.4",
"version": "1.1.5-beta.0",
"description": "Flex Plugins Library Utils",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -168,3 +168,3 @@ import { Twilio } from 'twilio';

if (!isString(status) || (status != 'closed' && status != 'wrapup'))
if (!isString(status) || (status != 'closed' && status != 'inactive'))
throw new PluginUtilsErrorManager(

@@ -171,0 +171,0 @@ 'Invalid parameters object passed. Parameters must contain status to update the channel to and it must be one of "closed" or "wrapup"',

@@ -83,2 +83,5 @@ import { Twilio } from 'twilio';

* @param {number} parameters.limit limit for the queues to be reterived
* @param {string} parameters.workflowSid (optional) the workflow SID to filter by
* @param {string} parameters.assignmentStatus (optional) the assignment status to filter by
* @param {string} parameters.ordering (optional) the desired ordering (e.g. DateCreated:desc)
* @return { Promise<Array<TaskInstance>> } - list of all tasks from specific workspace

@@ -88,5 +91,6 @@ * @description the following method is used to fetch all task from workspace

public async getAllTasksFromWorkspace(
parameters: Parameters,
parameters: Parameters & { workflowSid?: string, assignmentStatus?: string[], ordering?: string },
): Promise<ApiReturnType & { taskList?: Array<TaskInstance> }> {
let taskList: Array<TaskInstance> = [];
const { limit, workflowSid, assignmentStatus, ordering } = parameters;

@@ -96,3 +100,3 @@ try {

.workspaces(this.config.flexWorkSpaceSid)
.tasks.list({ limit: parameters.limit });
.tasks.list({ limit, workflowSid, assignmentStatus, ordering });
return {

@@ -99,0 +103,0 @@ success: true,

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc