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

glassix

v1.0.92

Published

Glassix Client API

Downloads

233

Readme

Glassix

Official JavaScript client library of the Glassix REST API

NPM version NPM downloads

Installation:

NPM:

npm i glassix

Usage:

Import:

import glassix from 'glassix';

Or using require:

const glassix = require('glassix');

Create a client:

const clientOptions = {
    // Your glassix subdomain
    workspace: process.env.WORKSPACE,
    // Find your key and secret on Settings → Developers → Api keys
    apiKey: process.env.API_KEY,
    apiSecret: process.env.API_SECRET,
    // A user with access to your department, preferably an API user
    userName: process.env.USER_NAME
};
const client = new glassix(clientOptions);

Methods:

Tickets:

Create:

const payload = {
    participants: [
      {
        type: "Client",
        protocolType: "Mail",
        subProtocolType: "MailTo",
        name: "David Gilmour",
        identifier: "[email protected]"
      }
    ],
    tags: [
      "Info"
    ]
  };
const newTicket = await client.tickets.create(payload);

Get:

const ticket = await client.tickets.get(ticketId);

List:

let payload = {
    since: '01/07/2023 00:00:00:00',
    until: '30/07/2023 23:59:59:00'
};
const tickets = await client.tickets.list(payload);

Send:

const payload = {
    text: 'Hello!'
};
const result = await client.tickets.send(ticketId, payload);

Set state:

  const payload = {
      nextState: "Closed"
  };
  const result = await client.tickets.setState(ticketId, payload);

Set fields:

let payload = {
    field1: "The great gig in the sky",
    uniqueArgument: "8bc5812f-22cb-4dda-89a4-7dc93a123ede",
    details: {
        source: {
            title: "My Landing Page",
            uri: "https://www.example.com/landing-page"
        }   
    }
};
const result = await client.tickets.setFields(ticketId, payload);

Set participant name:

const payload = {
    id: 1,
    name: "Brenda Rahman"
};
const result = await client.tickets.setParticipantName(ticketId, payload);

Set ticket owner:

const payload = {
    nextOwnerUserName: "[email protected]",
    keepCurrentOwnerInConversation: false
};
const result = await client.tickets.setOwner(ticketId, payload);

Assign available user:

const result = await client.tickets.assignAvailableUser(ticketId);

Set department:

const payload = {
  departmentId: '5baf94b7-4ebb-4442-81a5-27ac4dd1f03f'
};
const result = await client.tickets.setDepartment(ticketId, payload);

Add tags:

const newTags = ['Sales', 'Excel'];
const nextTags = await client.tickets.addTags(ticketId, newTags);

Remove tag:

const payload = {
  tag: 'Sales'
};
const result = await client.tickets.removeTag(ticketId, payload);

Add note:

const payload = {
  text: 'Ye on properly handsome returned throwing am no whatever.'
};
const result = await client.tickets.addNote(ticketId, payload);

Scramble:

const result = await client.tickets.scramble(ticketId);

PDF:

const payload = {
  includeDetails: true,
  includeConversationLink: false,
  includeNotes: true
};
const result = await client.tickets.pdf(ticketId, payload);

HTML:

const payload = {
  includeDetails: true,
  includeConversationLink: false,
  includeNotes: true
};
const result = await client.tickets.html(ticketId, payload);

Generate survey link:

const payload = {
  surveyId: 73993,
  participantId: 1
};
const result = await client.tickets.generateSurveyLink(ticketId, payload);

Users:

Get all:

const users = await client.users.getAll();

Set status:

const payload = {
    nextStatus: "Break"
};
const result = await client.users.setStatus(payload);

Get status:

const status = await client.users.getStatus();

Add:

const params = {
    role: "SystemUser", 
    userType: "AGENT"
};
const payload = [{
    uniqueArgument: "exampleValue", 
    userName: "[email protected]"
}];
const result = await client.users.add(payload, params);

Delete:

const userName = {
    userName: "[email protected]"
};
const result = await client.users.delete(userName);

Set unique argument:

const uniqueArgument = {
    nextUniqueArgument: "John Doe's unique argument"
};
const result = await client.users.setUniqueArgument(uniqueArgument);

Update:

const payload = {
        shortName: "John",
        fullName: "John Doe",
        jobTitle: "customer support representative"
    };
const result = await client.users.update(payload);

Get by unique argument:

const uniqueArgument = {
    uniqueArgument: "John Doe's unique argument"
};
const user = await client.users.getByUniqueArgument(uniqueArgument);

Set roles:

const userName = {
    userName: "[email protected]"
};
const roles = ["DepartmentAdmin", "SystemUser"];
const result = await client.users.setRoles(roles, userName);

Tenants:

Is online:

const parameters = {
    departmentId: "YOUR_API_KEY", 
    protocolType: "Mail"
};
const result = await client.tenants.isOnline(parameters);

Get tags:

const tags = await client.tenants.getTags();

Contacts:

Get:

const contact = await client.contacts.get(contactId);

Set name:

const payload = {
    nextName: "Jane Doe"
};
const result = await client.contacts.setName(contactId, payload);

Add identifier:

const payload = {
    forceMerge: false, 
    identifierType: "MailAddress", 
    identifier: "[email protected]"
};
const result = await client.contacts.addIdentifier(contactId, payload);

Set unique argument:

const payload = {
    nextUniqueArgument: "Jane Doe's unique argument"
};
const result = await client.contacts.setUniqueArgument(contactId, payload);

Delete identifier:

const params = {
    contactIdentifierId: 1
};
const result = await client.contacts.deleteIdentifier(contactId, params);

Canned Replies:

Get all:

const cannedReplies = await client.cannedReplies.getAll();

Interactive documents:

Send:

const payload = {
    shouldLockDocument: false,
    baseTemplateId: 20,
    message: "Please enter your full name in the document.",
    fields: [
        {
             type: "Text",
             name: "fullName_1"
        }
    ]
};
const result = await client.interactiveDocuments.send(ticketId, payload);

Protocols:

Send:

const payload = {
    protocolType: "Whatsapp",
    text: "Hi",
    from: "972524646214",
    to: "972547101833"
};
const result = await client.protocols.send(payload);

Phone Calls:

Started:

const payload = {
    dateTime: "24/12/2020 11:20:00:22"
};
const result = await client.phoneCalls.started(ticketId, payload);

Ended:

const payload = {
    dateTime: "24/12/2020 11:25:00:22"
};
const result = await client.phoneCalls.ended(ticketId, payload);

Audio Link:

const payload = {
    audioUri: "https://file-examples-com.github.io/uploads/2017/11/file_example_OOG_1MG.ogg"
};
const result = await client.phoneCalls.audioLink(ticketId, payload);

Files:

Upload:

const payload = new FormData();

const response = await fetch('https://example.com/some-file.txt');
const blob = await response.blob();

const file = new File([blob], "downloaded_example.txt", {
	type: "text/plain",
});

payload.append(0, file);
const result = await client.files.upload(payload);

Token:

Get:

const userName = "[email protected]";
const result = await client.getToken(userName);

Events:

Get Events:

  const payload = {
      deleteEvent: "false"
  };
  const result = await client.webhooks.getevents(payload);

License

Apache-2.0