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

@plasma-platform/service-tickets

v0.2.3

Published

Tickets Service API

Downloads

8

Readme

version nextVersion downloads license dependency


Full documentation
install:
npm i @plasma-platform/service-discounts -S

Short documentation

Table of Contents

TicketsService

Tickets Micro Service API

Parameters

messages

Object with class service messages

Type: Object

getChatRooms

Chats - Request chat rooms list of the department

Examples

To use
(async () => {
  const TicketsService = new TicketsService(url);
  const result = await TicketsService.getChatRooms();
})();

Returns Object array of posts

createExternalTicket

Create external ticket

Parameters

  • params Object
    • params.subject String The value of the subject field for this ticket
    • params.comment String Ticket comment
    • params.group String Ticket group/department
    • params.userEmail String The original recipient e-mail address of the ticket
    • params.userName String The original recipient name of the ticket
    • params.tags String Tags for tickets
    • params.ticketFields String Custom fields for the ticket. Must contain key value. Key stands for field names
    • params.attachments Array<Object>? Ticket attachments files
    • params.userIp String User IP
    • params.referrer String Referer
  • String String [].keyStorage] - Key Storage S3
  • String String [].fileName] - File Name
  • String String [].fileSize] - File Size
  • String String [].fileType] - File mime-type

Examples

(async () => {
  const service = new Service('//api.templatemonsterdev.com/users/v1/', token);
  const request = await service.createExternalTicket({
    id: 123,
    content: 'Test escalate',
  });
})();

getExternalTickets

Create external ticket

Parameters

  • params Object
    • params.subject String The value of the subject field for this ticket
    • params.comment String Ticket comment
    • params.group String Ticket group/department
    • params.userEmail String The original recipient e-mail address of the ticket
    • params.userName String The original recipient name of the ticket
    • params.ticketFields String Custom fields for the ticket. Must contain key value. Key stands for field names
    • params.attachments Array<Object>? Ticket attachments files
    • params.userIp String User IP
    • params.referrer String Referer
  • String String [].keyStorage] - Key Storage S3
  • String String [].fileName] - File Name
  • String String [].fileSize] - File Size
  • String String [].fileType] - File mime-type

Examples

(async () => {
  const service = new Service('//api.templatemonsterdev.com/users/v1/', token);
  const request = await service.getExternalTickets({
    id: 123,
    content: 'Test escalate',
  });
})();

addEscalateToDispute

Add escalate to dispute

Parameters

  • params Object
    • params.id String disputes id
    • params.contents String content of escalate
    • params.isRefundedByAuthor String for escalate by author
    • params.expand String for escalate expands
    • params.attachments Array<Object>? Attachments
  • String String [].keyStorage] - Key Storage S3
  • String String [].fileName] - File Name
  • String String [].fileSize] - File Size
  • String String [].fileType] - File mime-type

Examples

(async () => {
  const service = new Service('//api.templatemonsterdev.com/users/v1/', token);
  const request = await service.addEscalateToDispute({
    id: 123,
    contents: 'Test escalate',
  });
})();

refundDispute

Refund for dispute

Parameters

Examples

(async () => {
  const service = new Service('//api.templatemonsterdev.com/users/v1/', token);
  const request = await service.refundDispute({
    id: 123,
    contents: 'Test escalate',
  });
})();

changeStateDispute

Change state

Parameters

Examples

(async () => {
  const service = new Service('//api.templatemonsterdev.com/users/v1/', token);
  const request = await service.changeStateDispute({
    id: 123,
    state: 12,
  });
})();

createNewDispute

Create new dispute

Parameters

  • params Object
    • params.subject String subject
    • params.expand String subject
    • params.authorUserId String Author User Id
    • params.authorName String Author Name
    • params.contents String Content
    • params.fields Array<Object>? CustomFields
      • params.fields.productId String? Product Id
      • params.fields.orderId String? Order Id
      • params.fields.productName String? Product Name
      • params.fields.clientName String? Client Name
      • params.fields.propertyValueTypeId String? Product property value type Id
    • params.attachments Array<Object>? Attachments
  • String String [].keyStorage] - Key Storage S3
  • String String [].fileName] - File Name
  • String String [].fileSize] - File Size
  • String String [].fileType] - File mime-type

Examples

(async () => {
  const service = new Service('//api.templatemonsterdev.com/users/v1/', token);
  const request = await service.createNewDispute({
    id: 123,
    state: 12,
  });
})();

createNewPostToDispute

Create new post to dispute

Parameters

  • params Object
    • params.id String disputes id
    • params.contents String Content of disputes post
    • params.expand String expand of disputes post
    • params.attachments Array<Object>? Attachments
  • String String [].keyStorage] - Key Storage S3
  • String String [].fileName] - File Name
  • String String [].fileSize] - File Size
  • String String [].fileType] - File mime-type

Examples

(async () => {
  const service = new Service('//api.templatemonsterdev.com/users/v1/', token);
  const request = await service.createNewPostToDispute({
    id: 123,
    state: 12,
  });
})();

getDisputeInfoForAgent

Dispute information for Agent

Parameters

  • params Object
    • params.id String disputes id
    • params.fields String List of fields for return. Add creator, department, operators for show additional info.
    • params.expand String List of fields for return. Add creator, department, operators for show additional info.

Examples

(async () => {
  const service = new Service('//api.templatemonsterdev.com/users/v1/', token);
  const request = await service.getDisputeInfoForAgent({
    id: 123,
    fields: 'creator,
  });
})();

getDisputesInfoCreator

Dispute information which creator

Parameters

  • params Object
    • params.id String disputes id
    • params.fields String List of fields for return. Add creator, department, operators for show additional info.
    • params.expand String List of fields for return. Add creator, department, operators for show additional info.

Examples

(async () => {
  const service = new Service('//api.templatemonsterdev.com/users/v1/', token);
  const request = await service.getDisputesInfoCreator({
    id: 123,
    fields: 'creator,
  });
})();

getDisputesForAuthor

Dispute information which creator

Parameters

  • params Object
    • params.expand String expands divided by comma (e.g. "free,wp")
    • params.tags String array of tags id divided by comma (e.g. "free,wp")
    • params.ids String array of ids disputes divided by comma (e.g. "1,2,5")
    • params.text String Search query
    • params.aggregations String aggregations array of tags id divided by comma
    • params.fields String List of fields for return. Add creator, department, operators for show additional info.
    • params.conditions String find all disputes with given conditions urlEncode(JSON).
    • params.sort String defines on which fields to sort (e.g. ?sort=id,-createdAt)
    • params.perPage String max items per one page (20 by default, 50 is max size)
    • params.page String page number to view
    • params.departmentId String Department Id
    • params.departmentNickname String Department Nickname
    • params.departmentEmail String Department Email
    • params.creatorId String User Creator Id
    • params.creatorNickname String User Creator Nickname
    • params.creatorEmail String User Creator Email

Examples

(async () => {
  const service = new Service('//api.templatemonsterdev.com/users/v1/', token);
  const request = await service.getDisputesForAuthor({
    id: 123,
    fields: 'creator,
  });
})();

getDisputesMe

Disputes which creator

Parameters

  • params Object
    • params.expand String expands divided by comma (e.g. "free,wp")
    • params.tags String array of tags id divided by comma (e.g. "free,wp")
    • params.ids String array of ids disputes divided by comma (e.g. "1,2,5")
    • params.text String Search query
    • params.aggregations String aggregations array of tags id divided by comma
    • params.fields String List of fields for return. Add creator, department, operators for show additional info.
    • params.conditions String find all disputes with given conditions urlEncode(JSON).
    • params.sort String defines on which fields to sort (e.g. ?sort=id,-createdAt)
    • params.perPage String max items per one page (20 by default, 50 is max size)
    • params.page String page number to view
    • params.departmentId String Department Id
    • params.departmentNickname String Department Nickname
    • params.departmentEmail String Department Email
    • params.creatorId String User Creator Id
    • params.creatorNickname String User Creator Nickname
    • params.creatorEmail String User Creator Email

Examples

(async () => {
  const service = new Service('//api.templatemonsterdev.com/users/v1/', token);
  const request = await service.getDisputesMe({
    id: 123,
    fields: 'creator,
  });
})();

getPostsById

Posts for ticket or dispute

Parameters

  • params Object
    • params.id String disputes id
    • params.expand String List of fields for return. Add creator, department, operators for show additional info.
    • params.page Integer page of posts
    • params.perPage Integer per-page to count of 1 page
    • params.sort String sort posts

Examples

(async () => {
  const service = new Service('//api.templatemonsterdev.com/users/v1/', token);
  const request = await service.getPostsById({
    id: 123,
    fields: 'creator,
  });
})();

agentStartWatchDispute

Start watch dispute

Parameters

Examples

(async () => {
  const service = new Service('//api.templatemonsterdev.com/users/v1/', token);
  const request = await service.agentStartWatchDispute({
    id: 123,
  });
})();

agentStopWatchDispute

Stop watch dispute

Parameters

Examples

(async () => {
  const service = new Service('//api.templatemonsterdev.com/users/v1/', token);
  const request = await service.agentStopWatchDispute({
    id: 123,
  });
})();

addNoteToDispute

Create new post to dispute

Parameters

  • params Object
    • params.id String disputes id
    • params.contents String Content of disputes note
    • params.expand String expand of disputes note
    • params.type String 1 - author, 2 - agent
    • params.userId String users id

Examples

(async () => {
  const service = new Service('//api.templatemonsterdev.com/tickets/v1/', token);
  const request = await service.addNoteToDispute({
    id: 123,
    state: 12,
  });
})();

removeNoteFromDispute

Create new post to dispute

Parameters

Examples

(async () => {
  const service = new Service('//api.templatemonsterdev.com/tickets/v1/', token);
  const request = await service.removeNoteFromDispute({
    id: 123,
    state: 12,
  });
})();

addTagsToDispute

Add new tags to dispute

Parameters

Examples

(async () => {
  const service = new Service('//api.templatemonsterdev.com/tickets/v1/', token);
  const request = await service.addTagsToDispute({
    id: 123,
    state: 12,
  });
})();

removeTagsFromDispute

Remove tags from dispute

Parameters

Examples

(async () => {
  const service = new Service('//api.templatemonsterdev.com/tickets/v1/', token);
  const request = await service.removeTagsFromDispute({
    id: 123,
    state: 12,
  });
})();

getCustomerSupportStatistics

Get customer support statistics

Parameters

Examples

(async () => {
  const service = new Service('//api.templatemonsterdev.com/tickets/v2/', token);
  const request = await service.getCustomerSupportStatistics({
    authorId: '1519369,
  });
})();

defaultAutoTrim

Object with class service messages

Type: object