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

wbb-testing-mod

v0.0.5

Published

asd

Downloads

3

Readme

Jadu

With this integration you can create tickets in a designated Jadu workspace.

Blocks Provided

| Block Name | Purpose | | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Jadu fetch fields | This block fetches and displays all valid fields for a given endpoint | | Jadu Create Ticket | This block will ask any necessary questions, and once complete send the data to the APIs to create the ticket. Parameters, explained below, allow you to determine what happens next. | | Jadu authenticate | This block matches a users email and uk phone number to a person in Jadu |

Handler Names

The following handler names and their functions are available :

| Handler Name | Purpose | | ------------------ | ---------------------------------------------------------------------------------------------------------------------- | | jadu-fields | Fetches valid fields for the endpoint supplied | | jadu-create-ticket | Raises new ticket using any valid params for the designated case | | jadu-authenticate | Authenticates user based on email and ukPhoneNumber. The matching persons id is set as a variable wbb-jadu-person-id |

Configuration Options

Within the function there are a number of options that can be set to configure the behaviour of the integration. The tables below show the settings that are available for each handler.

jadu-fields

| Property | Required | Description | | ------------ | -------- | ------------------------------------------------------------------------------------------------------------------ | | endpoint | true | The endpoint to fetch and display the valid fields of. This should be the same as is used in for creating tickets. | | successBlock | false | The id of the block to display next, defaults to the menu block. | | failureBlock | false | The id of the block to display if the function fails, defaults to webhook-fail |

jadu-authenticate

| Property | Required | Description | | ---------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | endpoint | true | The endpoint to fetch person from. | | confirmUser | false | Prompts user to confirm piece of address information to continue if set to true | | confirmMessage | false | Overrides default confirm message, can include template to display fields from the users primary address, defaults to Is %%street%% the street you current live at? | | confirmFailBlock | false | The id of the block to dispaly if the user says no to the confirm message | | successBlock | false | The id of the block to display next, defaults to the jadu-create-ticket block. | | failureBlock | false | The id of the block to display if the function fails due to missing args, defaults to webhook-fail. | | authFailBlock | false | The id of the block to display if the found users phone number doesn't match the users input, defaults to data-error | | noUserBlock | false | The id of the block to display if no user is found, or if the api call somehow fails otherwise. Defaults to the error message supplied by jadu api | | unset | false | Unsets the forms used, if set to true |

jadu-create-ticket

| Property | Required | Description | | -------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | endpoint | true | The endpoint used to raise the ticket. This should include any parameters that does not go into the body of the request | | unset | false | Unsets the forms used, if set to true | | successMessage | false | The message you want the bot to display when ticket has been successfully raised. This can include template values, such as %%id%%, which will be filled out dynamically for the user. | | successBlock | false | The id of the block to display next, defaults to the menu block. This will override the successMessage field, and it will not be displayed | | failureBlock | false | The id of the block to display if the function fails, defaults to webhook-fail | | jadu specific fields | false | This is a stand-in for any fields specific to your jadu ticket. These can be either static or use dynamic templates, following the instructions below. Invalid fields are filtered dynamically. A list of valid fields can be fetched through the jadu-fields handler. |

Templates

Using template strings, the successMessage and jadu specific fields can be set dynamically, using forms, variables, and other integrations (for example, Singlepoint, to get a users uprn).

To mark an argument as a template, surround the value with %%, for example "postcode": "%%postcode%%", this will replace the value with the value of a field named postcode.

The fields available depend on any forms used for the function, variables set during the conversation, and the information gathered from the user. Syntax may also vary, if using other integrations, so be sure to check documentation for these.

successMessage can also make use of fields found in the response to the new ticket request, for example %%id%%.

### Example config and response

The below is an example of a config, using both static and template values, note that the fields may not be valid for your case.

{
  "endpoint": "https://youruat.api.q.jadu.net/api/service-api/case/create-ticket?key=your-api-key-here",
  "order-type": "bins",
  "order-details": "%%orderDetails%%",
  "user-last-name": "%%lastName%%",
  "user-email-address": "%%email%%",
  "user-telephone-number": "%%ukPhoneNumber%%",
  "channel": "Chatbot",
  "uprn": "%%wbb-singlepoint-uprn%%",
  "successMessage": "Thanks, I have raised a ticket for you, your ticket id is: %%id%%, use it if you have any further inquiries.",
}

Assuming no invalid fields, the above config would send a request to the endpoint https://youruat.api.q.jadu.net/api/service-api/case/create-ticket?key=your-api-key-here with a body similar to this:

{
    "order-type": "bins",
    "order-details": "Recycling bins",
    "user-last-name": "Smith",
    "user-email-address": "[email protected]",
    "user-telephone-number": "07777777777",
    "channel": "Chatbot",
    "uprn": "12345678910"
}

Then the bot would respond, Thanks, I have raised a ticket for you, your ticket id is: 12345, use it if you have any further inquiries., and proceed to the menu block.