New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

webplug

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webplug

This holds the code for the webhooks plug client used to connect to the server

latest
npmnpm
Version
0.0.12
Version published
Maintainers
1
Created
Source

Webhooks Plug JS Client

This holds the code for the webhooks plug client used to connect to the server

installation

yarn add webplug

Usage

import Webplug from "webplug";

const webplugClient = new Webplug({
  url: "api-gateway-url",
  apiKey: "api-key-api-gateway",
});

Documentation

Services Module

  • Create a service: webplugClient.services.create
const service = await webplugClient.services.create("service-name");

 

  • Retreive all services: webplugClient.services.all
const services = await webplugClient.services.all();

 

  • Get the details of a service: webplugClient.services.get
const service = await webplugClient.services.get("service-id");

 

  • Delete a service: webplugClient.services.delete
const service = await webplugClient.services.delete("service-id");

 

Users Module

  • Create a user: webplugClient.users.create
const user = await webplugClient.users.create("name-of-user", "service-id");

 

  • Retreive all users: webplugClient.users.all
const users = await webplugClient.users.all("service-id");

 

  • Get the details of a user: webplugClient.users.get
const user = await webplugClient.users.get("user-id");

 

  • Delete a user: webplugClient.users.delete
const user = await webplugClient.users.delete("user-id");

 

Subscriptions Module

  • Create a subscription: webplugClient.subscriptions.create
const subscription = await webplugClient.subscriptions.create(
  "event-type-name",
  "endpoint-url",
  "id-of-user"
);

 

  • Retreive all subscriptions for an event type: webplugClient.subscriptions.all
const subscriptions = await webplugClient.subscriptions.all("event-type-id");

 

  • Get the details of a subscription: webplugClient.subscriptions.get
const subscription = await webplugClient.subscriptions.get("subscription-id");

 

  • Delete a subscription: webplugClient.subscriptions.delete
const subscription = await webplugClient.subscriptions.delete(
  "subscription-id"
);

 

Event Types Module

  • Create an event type: webplugClient.eventTypes.create
const eventType = await webplugClient.eventTypes.create(
  "event-type-name",
  "service-id"
);

 

  • Retreive all event types for a service: webplugClient.eventTypes.all
const eventTypes = await webplugClient.eventTypes.all("service-id");

 

  • Get the details of an event type: webplugClient.eventTypes.get
const eventType = await webplugClient.eventTypes.get("event-type-id");

 

  • Delete an event type: webplugClient.eventTypes.delete
const eventType = await webplugClient.eventTypes.delete("event-type-id");

 

Events Module

  • Publish an event: webplugClient.events.publish
const event = await webplugClient.events.create(
  "event-type-name",
  "user-id",
  "message-payload"
);

Keywords

webhooks

FAQs

Package last updated on 23 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts