npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ticketing-module-prodio

v0.0.4

Published

NPM for consuming prodio ticketing service

Downloads

2

Readme

ticketing-module-prodio

Build Status

ticketing-module-prodio is an node js client for the ticketing-prodio API. Integrate in to any application to perform ticketing releted user journeys.

Features!

  1. Create Ticket Types
  2. Create Ticket Actionable
  3. Edit Ticket Actionable
  4. Delete Ticket Actionable
  5. List Ticket Actionable
  6. Create Ticket
  7. Assign Ticket
  8. Ticket Reporter
  9. Accept Ticket
  10. Hold / Un hold Ticke
  11. Search & List Tickets
  12. Complete Ticket
  13. Reopen Ticket
  14. Change Assignee
  15. Edit Ticket
  16. Take Action on Ticket
  17. Ticket Details

Prerequisite:

  • Clone this repository on your server git clone https://github.com/ProdioDesignWorks/ticketing-service-prodio.git
  • Navigate to your repo cd ticketing-service-prodio
  • Install dependencies npm install
  • Start service node . or npm start or node server/server.js
  • If you've pm2 installed then use this pm2 start server/server.js --name="TICKETING_SERVICE"

Note:

ticketing-service-prodio uses loopback as the core framework for developing API's, so all customisations, configurations, middlewares, events, and db connectors can be used which you would have used in loopback.

Installation

$ npm install ticketing-module-prodio --save

Initialization

Require the ticketing-module-prodio module and initialize the ticketingSdk client.


 const ticket = require('ticketing-module-prodio');
 const ticketModule = new ticket("API BASE PATH OF TICKETING SERVICE");//http://domainname:3004/api

 First Step is to create Default ticket actions. It is Mandatory.

Method

1. Create Ticket Types: This will create a new ticket type.

Payload

| Key | Type | Value | Description | Required | | --- | ---- | ----- | ----------- | -------- | | action | string | CREATETICKETTYPE | key which defines the type of action to be performed | YES | | meta | json | refer example below | - | YES |

Example

	const metaInfo = {
		"businessId": "" //mandatory
		"label": "Task", //mandatory
		"value": "TASK", //mandatory
		"hexcode": "#ffffff" //optional
	};
	const payload = {
		"action": "CREATETICKETTYPE",
		"meta": metaInfo
	};
	let ticketType = ticketModule.execute(payload);

2. Edit Ticket Types: This will edit an existing ticket type. Edit operation will be performed based on the value key which cannot be updated.

Payload

| Key | Type | Value | Description | Required | | --- | ---- | ----- | ----------- | -------- | | action | string | EDITTICKETTYPE | key which defines the type of action to be performed | YES | | meta | json | refer example below | - | YES |

Example

	const metaInfo = {
		"businessId": "" //mandatory
		"label": "Task", //mandatory
		"value": "TASK", //mandatory
		"hexcode": "#ffffff" //optional
	};
	const payload = {
		"action": "EDITTICKETTYPE",
		"meta": metaInfo
	};
	let ticketType = ticketModule.execute(payload);

3. List Ticket Types: This will list all ticket types.

Payload

| Key | Type | Value | Description | Required | | --- | ---- | ----- | ----------- | -------- | | action | string | LISTTICKETTYPE | key which defines the type of action to be performed | YES | | meta | json | refer example below | - | YES |

Example

	const metaInfo = {
		"businessId": "" //mandatory
	};
	const payload = {
		"action": "LISTTICKETTYPE",
		"meta": metaInfo
	};
	let ticketType = ticketModule.execute(payload);

4. Delete Ticket Types: This will list all ticket types.

Payload

| Key | Type | Value | Description | Required | | --- | ---- | ----- | ----------- | -------- | | action | string | DELETETICKETTYPE | key which defines the type of action to be performed | YES | | meta | json | refer example below | - | YES |

Example

	const metaInfo = {
		"businessId": "" //mandatory
		"value": "TASK", //mandatory
	};
	const payload = {
		"action": "DELETETICKETTYPE",
		"meta": metaInfo
	};
	let ticketType = ticketModule.execute(payload);

5. Create Default Ticket Actions: This will create default ticket actions.

Payload

| Key | Type | Value | Description | Required | | --- | ---- | ----- | ----------- | -------- | | action | string | TICKETDEFAULTACTIONS | key which defines the type of action to be performed | YES | | meta | json | refer example below | - | YES |

Example

	const metaInfo = {};
	const payload = {
		"action": "TICKETDEFAULTACTIONS",
		"meta": metaInfo
	};
	let ticketType = ticketModule.execute(payload);

6. Create Ticket Actions: This will create ticket actions.

Payload

| Key | Type | Value | Description | Required | | --- | ---- | ----- | ----------- | -------- | | action | string | CREATETICKETACTION | key which defines the type of action to be performed | YES | | meta | json | refer example below | - | YES |

Example

	const metaInfo = {
		"label": "Made a call", //mandatory
		"value": "CALLED" //mandatory
	};
	const payload = {
		"action": "CREATETICKETACTION",
		"meta": metaInfo
	};
	let ticketType = ticketModule.execute(payload);

7. Edit Ticket Actions: This will edit an existing ticket actions. This can only update the label.

Payload

| Key | Type | Value | Description | Required | | --- | ---- | ----- | ----------- | -------- | | action | string | EDITTICKETACTION | key which defines the type of action to be performed | YES | | meta | json | refer example below | - | YES |

Example

	const metaInfo = {
		"label": "Made a call", //mandatory
		"value": "CALLED" //mandatory
	};
	const payload = {
		"action": "EDITTICKETACTION",
		"meta": metaInfo
	};
	let ticketType = ticketModule.execute(payload);

8. List Ticket Actions: This will list all existing ticket actions.

Payload

| Key | Type | Value | Description | Required | | --- | ---- | ----- | ----------- | -------- | | action | string | LISTTICKETACTION | key which defines the type of action to be performed | YES | | meta | json | refer example below | - | YES |

Example

	const metaInfo = {};
	const payload = {
		"action": "LISTTICKETACTION",
		"meta": metaInfo
	};
	let ticketType = ticketModule.execute(payload);

9. Delete Ticket Actions: This will delete an existing ticket actions. This can only update the label.

Payload

| Key | Type | Value | Description | Required | | --- | ---- | ----- | ----------- | -------- | | action | string | DELETETICKETACTION | key which defines the type of action to be performed | YES | | meta | json | refer example below | - | YES |

Example

	const metaInfo = {
		"value": "CALLED" //mandatory
	};
	const payload = {
		"action": "DELETETICKETACTION",
		"meta": metaInfo
	};
	let ticketType = ticketModule.execute(payload);

10. Create Ticket: This will create a new ticket.

Payload

| Key | Type | Value | Description | Required | | --- | ---- | ----- | ----------- | -------- | | action | string | CREATETICKET | key which defines the type of action to be performed | YES | | meta | json | refer example below | - | YES |

Example

	const metaInfo = {
		"businessId" : "", //mandatory
		"ticketType": "TASK", //mandatory - value attribute of ticket type
		"title": "new ticket", //mandatory
		"desc": "description", //mandatory
		"reporterName": "Vatsal Shah", //mandatory
		"reporterEmail": "[email protected]", //mandatory
		"reporterMetadata": { //optional object
			"userId": "1234"
		},
		"assigneeName": "Vatsal", //mandatory
		"assigneeEmail": "[email protected]", //mandatory
		"assigneeMetadata": { //optional object
			"userId": "1234"
		},
		"notes": "" //optional
	};
	const payload = {
		"action": "CREATETICKET",
		"meta": metaInfo
	};
	let ticketType = ticketModule.execute(payload);

11. Assign/Reassign Ticket to an individual: This will assign/reassign an existing ticket to an individual.

Payload

| Key | Type | Value | Description | Required | | --- | ---- | ----- | ----------- | -------- | | action | string | ASSIGNTICKET | key which defines the type of action to be performed | YES | | meta | json | refer example below | - | YES |

Example

	const metaInfo = {
		"businessId" : "", //mandatory
		"ticketId": "98765", //mandatory
        "assigneeName": "Vatsal", //mandatory
		"assigneeEmail": "[email protected]", //mandatory
		"assigneeMetadata": { //optional object
			"userId": "1234"
		},
		"notes": "" //optional
	};
	const payload = {
		"action": "ASSIGNTICKET",
		"meta": metaInfo
	};
	let ticketType = ticketModule.execute(payload);

12. Update Ticket reporter: This will update reporter of an existing ticket.

Payload

| Key | Type | Value | Description | Required | | --- | ---- | ----- | ----------- | -------- | | action | string | UPDATEREPORTER | key which defines the type of action to be performed | YES | | meta | json | refer example below | - | YES |

Example

	const metaInfo = {
		"businessId" : "", //mandatory
		"ticketId": "98765", //mandatory
        "reporterName": "Vatsal", //mandatory
		"reporterEmail": "[email protected]", //mandatory
		"reporterMetadata": { //optional object
			"userId": "1234"
		}
	};
	const payload = {
		"action": "UPDATEREPORTER",
		"meta": metaInfo
	};
	let ticketType = ticketModule.execute(payload);

13. Accept Ticket: This will accept a assigned ticket.

Payload

| Key | Type | Value | Description | Required | | --- | ---- | ----- | ----------- | -------- | | action | string | ACCEPTTICKET | key which defines the type of action to be performed | YES | | meta | json | refer example below | - | YES |

Example

	const metaInfo = {
		"businessId" : "", //mandatory
		"ticketId": "98765", //mandatory
		"email": "[email protected]", //mandatory
	};
	const payload = {
		"action": "ACCEPTTICKET",
		"meta": metaInfo
	};
	let ticketType = ticketModule.execute(payload);

14. Hold/Unhold Ticket: This will accept a assigned ticket.

Payload

| Key | Type | Value | Description | Required | | --- | ---- | ----- | ----------- | -------- | | action | string | HOLDUNHOLDTICKET | key which defines the type of action to be performed | YES | | meta | json | refer example below | - | YES |

Example

	const metaInfo = {
		"businessId" : "", //mandatory
		"ticketId": "98765", //mandatory
		"holdStatus": true, //mandatory - true or false
	};
	const payload = {
		"action": "HOLDUNHOLDTICKET",
		"meta": metaInfo
	};
	let ticketType = ticketModule.execute(payload);

15. Close Ticket: This will close a assigned ticket.

Payload

| Key | Type | Value | Description | Required | | --- | ---- | ----- | ----------- | -------- | | action | string | CLOSETICKET | key which defines the type of action to be performed | YES | | meta | json | refer example below | - | YES |

Example

	const metaInfo = {
		"businessId" : "", //mandatory
		"ticketId": "98765", //mandatory
		"note": "", //optional
	};
	const payload = {
		"action": "CLOSETICKET",
		"meta": metaInfo
	};
	let ticketType = ticketModule.execute(payload);

16. Reopen Ticket: This will reopen a closed ticket.

Payload

| Key | Type | Value | Description | Required | | --- | ---- | ----- | ----------- | -------- | | action | string | REOPENTICKET | key which defines the type of action to be performed | YES | | meta | json | refer example below | - | YES |

Example

	const metaInfo = {
		"businessId" : "", //mandatory
		"ticketId": "98765", //mandatory
		"note": "", //optional
	};
	const payload = {
		"action": "REOPENTICKET",
		"meta": metaInfo
	};
	let ticketType = ticketModule.execute(payload);

17. Take action on Ticket: This is to perform action on a ticket.

Payload

| Key | Type | Value | Description | Required | | --- | ---- | ----- | ----------- | -------- | | action | string | TAKEACTION | key which defines the type of action to be performed | YES | | meta | json | refer example below | - | YES |

Example

	const metaInfo = {
		"businessId" : "", //mandatory
		"ticketId": "98765", //mandatory
		"action": "", //value of action created
		"note": "", //optional
	};
	const payload = {
		"action": "TAKEACTION",
		"meta": metaInfo
	};
	let ticketType = ticketModule.execute(payload);

18. Get Ticket Details: This is to get details of a ticket.

Payload

| Key | Type | Value | Description | Required | | --- | ---- | ----- | ----------- | -------- | | action | string | TICKETDETAILS | key which defines the type of action to be performed | YES | | meta | json | refer example below | - | YES |

Example

	const metaInfo = {
		"businessId" : "", //mandatory
		"ticketId": "98765" //mandatory
	};
	const payload = {
		"action": "TICKETDETAILS",
		"meta": metaInfo
	};
	let ticketType = ticketModule.execute(payload);

18. Get All Tickets : This is to get all tickets.

Payload

| Key | Type | Value | Description | Required | | --- | ---- | ----- | ----------- | -------- | | action | string | LISTTICKETS | key which defines the type of action to be performed | YES | | meta | json | refer example below | - | YES |

Example

	const metaInfo = {
		"businessId" : "", //mandatory
		"status": "TODO,INPROGRESS,DONE",
		"number": 1,
		"from": "10/22/2019",
		"to": "",
		"title": "",
		"assignee": "[email protected]"
	};
	const payload = {
		"action": "LISTTICKETS",
		"meta": metaInfo
	};
	let ticketType = ticketModule.execute(payload);