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

ociconnection

v1.1.1

Published

Broadsoft Application Server OCI Helper

Downloads

10

Readme

Welcome to the Broadsoft OCI Application Server Helper Class!

Changes:

1.1.1: adding dist for 1.1.0

1.1.0: fixing sentenceToCamelCase function to work on words that are uppercase acronyms like MAC and converts them to i.e. mac instead of mAC

.1.0: fixing sentenceToCamelCase function to work on words that are uppercase acronyms like MAC and converts them to i.e. mac instead of mAC

.1.0: fixing sentenceToCamelCase function to work on words that are uppercase acronyms like MAC and converts them to i.e. mac instead of mAC

1.0.39: Making host property public

1.0.38: Changing sessionId code. The sessionId does not appear to be showing up in debug.

1.0.37: Fixing completeData. Thinking about changing XML parsers.

1.0.36: Attempt to fix log in OCIConnection class (3)

1.0.35: Attempt to fix log in OCIConnection class (2)

1.0.34: Attempt to fix log in OCIConnection class

1.0.33: Nothing much changed.

1.0.32: Added logging next to debug in the constructor

1.0.31: Fixed output type for OCIConnection.command()

1.0.30: Changing xml2js function to get rid of saxjs error

1.0.29: Fixing SAX-JS error with text root outside of node showing up

1.0.28: testing new method for xml helper

1.0.27: Fixed isError function again

1.0.26: Added extra check on the isError function

1.0.25: No changes to code

1.0.: No changes to code

1.0.24: No code changes for patch 24

1.0.23: No code changes for patch 23

1.0.22: Now building project automatically before publishing.

1.0.21: Built project.

1.0.20: No breaking changes yet. Had to update the isError function.

1.0.19: Added debug function to OCIConnection class. The next version will be a breaking change.

Changelog:

  • Added setDebug(boolean) function to the OCIConenction class. This will output the command XML and response XML when command() is called.
  • Copied the isError() function from the OCIConnection class to the BroadsoftDataUtility class. In the next version, that function will be removed from the OCIConnection class, causing a possible breaking change for some.

1.0.18: Added dist/ folder again because of type declarations.

1.0.17: Fixed parseOciTable and removed dist/ folder.

1.0.16: Added another data utility function for parseOciTable.

An example of the arguments would be from a response like ServiceProviderServicePackGetUtilizationListResponse:

const commandResponse = ServiceProviderServicePackGetUtilizationListResponse
  .BroadsoftDocument
  .command[0]

const table = commandResponse.serviceUtilizationTable
const names = commandResponse.servicePackNames

const tableData = BroadsoftDataUtility.parseOciTable(table, names)

// Example format for output:

let response = [
  {
    "name": "ServicePack1",
    "items": [
        {
            "group": "GROUP_ONE",
            "totalPacks": "3",
            "assigned": "3"
        },
        {
            "group": "GROUP_THREE",
            "totalPacks": "3",
            "assigned": "3"
        }
    ]
  },
  {
    "name": "ServicePack2",
    "items": [
        {
            "group": "GROUP_TWO",
            "totalPacks": "10",
            "assigned": "10"
        }
    ]
  }
]

1.0.12: Added dotenv and jest to test Broadsoft data utility and main class function calls for better development. Planning to add easy docker deployment to this project for 1.0.13.

Easy Setup for project using dotenv and ociconnection:

.env File Setup:

BROADSOFT_TEST_HOST=<IP ADDRESS/HOST NAME OF OCI SERVER HERE>
BROADSOFT_TEST_PORT=<PORT FOR APPLICATION SERVER API>
BROADSOFT_TEST_USERNAME=<OCI_USERNAME_HERE>
BROADSOFT_TEST_PASSWORD=<OCI_PASSWORD_HERE>

index.ts Minimal File Setup:

import { OCIConnection } from 'ociconnection'

const main = async () => {

  const ociConnection = new OCIConnection(
    <string>process.env.BROADSOFT_TEST_HOST,
    <string>process.env.BROADSOFT_TEST_PORT,
    <string>process.env.BROADSOFT_TEST_USERNAME,
    <string>process.env.BROADSOFT_TEST_PASSWORD
  )

  await ociConnection.login()
}

main()

1.0.10: Added a data utility to help with return data from BroadWorks

  • Added OCITable helper static function BroadsoftDataUtility.parseOciTable to convert e.g. ociResponse.BroadsoftDocument.command[0].userTable[0] from
import { OCIConnection } from 'ociconnection'
import BroadsoftDataUtility from 'ociconnection'

const ociConnection = new OCIConnection('1.1.1.1', '3333', 'broadworks_user', 'broadworks_password')

await ociConnection.login()
/*
Or instead of `await ociConnection.login()`:
  const loggedIn = ociConnection.login()
  loggedIn
    .then(() => {
    / * code that happens after successful response from server * /
    })
    .catch(() => {
    / * code that happens after failed response from server * /
    })

*/
const ociResponse = await ociConnection.command('UserGetListInServiceProviderRequest', {
    serviceProviderId: <string>enterpriseId
})
/*
Or instead of using `await` here:
  const ociResponse = ociConnection.command(...)

  ociResponse
    .then(response => / * Deal with XML/object response here * /)
    .catch(serverError => / * Deal with server error here * /)
*/

const table = BroadsoftDataUtility.parseOciTable(ociResponse.BroadsoftDocument.command[0].userTable[0])

console.log(table) 

1.0.8: Had an issue with receiving entire BroadsoftDocument in parser under the command function.

1.0.4: Added 'isError' static function to OCIConnection class. Took out console logs.

Hi! And welcome. ociconnection is a module used to connect to a Broadsoft/BroadWorks Application Server. This package is available at npmjs.org