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

@solace-community/eventportal

v1.4.0

Published

This is a wrapper to Solace PubSub+ Event Portal REST API

Downloads

6

Readme

Solace Pubsub+ Event Portal REST API Wrapper

This module wraps the Solace PubSub+ EP REST API. This can be used to enable the creation of integrations, plugins, and component on top of the Solace PubSub+ Event API.

Dont forget to give this repo a star! ✨

Installation

npm install @solace-community/eventportal

Constructor

const EventPortal = require('@solace-community/eventportal')
const ep = new EventPortal()
// Optional: You can pass Solace Cloud Token as parameter if not defined as environment variable
const ep = new EventPortal(SOLACE_CLOUD_TOKEN)

How to use

Check out the create.js script in the example directory for API usage.

Here is a video as well

PubSub+ Event Portal API Wrapper Demo Video

Environment Variables

| Env Variable | Description | | ------------------ | ------------------------------------------- | | SOLACE_CLOUD_TOKEN | Solace Cloud Token with the right EP access |

Methods

domain = {
  name: "Application Domain name",
  description: "Application Domain description",
  uniqueTopicAddressEnforcementEnabled: true,
  topicDomainEnforcementEnabled: false,
  type: "ApplicationDomain"
}

Returns

  • Application Domain ID

Notes

  • If Application Domain name exists, matching Application Domain ID is returned
schema = {
  applicationDomainId: domainID,
  name: "Schema1",
  shared: false,
  contentType: "json",
  schemaType: "jsonSchema"
}

Returns

  • Schema Object ID

Notes

  • If the Schema name exists, matching Schema Object ID is returned
schemaVersion = {
  schemaID: schemaID,
  description: "This is the schema version description",
  version: "0.0.1",
  displayName: "This is the Display name of the schema",
  content: JSON.stringify(schemaContent),
  stateID: "1"
}

Returns

  • Schema Object ID

Notes

  • If the Schema version exists and overwrite is not set, an error is thrown
  • The schema content is in string format
  • Setting the overwrite flag to true will overwrite the schema if the State is DRAFT otherwise throws an error
event = {
  applicationDomainId: domainID,
  name: "Event Name",
  shared: false
}

Returns

  • Event Object ID

Notes

  • If the Event name exists, matching Event Object ID is returned
eventVersion = {
  eventID: eventID,
  displayName: "Scripted Version",
  version: "0.0.1",
  schemaVersionId: schemaVersionID,
  deliveryDescriptor:{
    brokerType: "solace",
    address:{
      addressLevels
    },
    stateID:"1"
  }
}

Returns

  • Event Object ID

Notes

  • If the Event version exists and overwrite is not set, an error is thrown
  • Setting the overwrite flag to true will overwrite the event if the State is DRAFT otherwise throws an error
  • the addressLevels parameter is an array with the following format
let addressLevels = [
      {name: "level1", addressLevelType: "literal"},
      {name: "level2", addressLevelType: "variable"},
      {name: "level3", addressLevelType: "literal"},
      {name: "level4", addressLevelType: "variable"},
    ]
application = {
  applicationDomainId: domainID,
  name: "My Scripted Application",
  applicationType: "standard",
}

Returns

  • Application Object ID

Notes

  • If the Application name exists, matching Application Object ID is returned
applicationVersion = {
  applicationID: applicationID,
  displayName: "Display Name",
  description: "This is the scripted description",
  version: "0.0.1",
  declaredProducedEventVersionIds:[eventVersionID],
  type: "application"
}

Returns

  • Application Object ID

Notes

  • If the Application version exists and overwrite is not set, an error is thrown
  • declaredProducedEventVersionIds is an array of produced events
  • declaredConsumedEventVersionIds is an array of consumed events
  • Setting the overwrite flag to true will overwrite the application if the State is DRAFT otherwise throws an error

To-Do

  • [ ] Add Jest unit tests
  • [ ] Add Enum support