1.1.1 • Published 4 months ago

ociconnection v1.1.1

Weekly downloads
1
License
ISC
Repository
github
Last release
4 months ago

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

1.1.1

4 months ago

1.1.0

4 months ago

1.0.39

3 years ago

1.0.38

3 years ago

1.0.19

3 years ago

1.0.22

3 years ago

1.0.21

3 years ago

1.0.20

3 years ago

1.0.26

3 years ago

1.0.25

3 years ago

1.0.24

3 years ago

1.0.29

3 years ago

1.0.28

3 years ago

1.0.27

3 years ago

1.0.33

3 years ago

1.0.32

3 years ago

1.0.31

3 years ago

1.0.30

3 years ago

1.0.37

3 years ago

1.0.36

3 years ago

1.0.35

3 years ago

1.0.34

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago