0.2.3 • Published 1 year ago

@plasma-platform/service-tickets v0.2.3

Weekly downloads
29
License
CC-BY-4.0
Repository
gitlab
Last release
1 year ago

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

0.2.3

1 year ago

0.2.1

2 years ago

0.2.2

2 years ago

0.2.0

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.0

4 years ago

0.0.5

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago