0.7.0 • Published 9 months ago

@p7m/queue-backend v0.7.0

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
9 months ago

@p7m/queue-backend

QueueBackend - JavaScript client for @p7m/queue-backend API for managing phone services

This is the API of the service at P7M that manages phone services.

Attention: this API will probably still change a lot in the future, it's not at all stable yet This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 0.7.0
  • Package version: 0.7.0
  • Generator version: 7.11.0-SNAPSHOT
  • Build package: org.openapitools.codegen.languages.JavascriptClientCodegen

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install @p7m/queue-backend --save

Finally, you need to build the module:

npm run build
Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:

npm install

Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:

npm link

To use the link you just defined in your project, switch to the directory you want to use your @p7m/queue-backend from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

Finally, you need to build the module:

npm run build

git

If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:

    npm install GIT_USER_ID/GIT_REPO_ID --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var QueueBackend = require('@p7m/queue-backend');

var defaultClient = QueueBackend.ApiClient.instance;
// Configure OAuth2 access token for authorization: oauth
var oauth = defaultClient.authentications['oauth'];
oauth.accessToken = "YOUR ACCESS TOKEN"

var api = new QueueBackend.BlockApi()
var id = "id_example"; // {String} ID of the block
api.deleteBlockById(id).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

Documentation for API Endpoints

All URIs are relative to https://queue.api.p7m.de/v1

ClassMethodHTTP requestDescription
QueueBackend.BlockApideleteBlockByIdDELETE /block/{id}Delete a block by its ID
QueueBackend.BlockApigetBlockByIdGET /block/{id}Get a single block by its ID
QueueBackend.BlockApigetBlocksGET /blockGet the list of all waiting queue blocks
QueueBackend.BlockApipostBlockPOST /blockCreate a new block for a waiting queue
QueueBackend.BlockApiputBlockByIdPUT /block/{id}Update an existing block
QueueBackend.CallApigetCallAlarmGET /call/alarmGet the list of all alarm calls
QueueBackend.CallApigetCallAlarmByCalleeE164UnsecureGET /call/alarm/by-callee/{e164}Get the alarm calls for a given telephone number
QueueBackend.CallApipostCallAlarmPOST /call/alarmCreate a new alarm call
QueueBackend.CallApipostCallCodePOST /call/codeRPC to trigger an outgoing call to send a PIN code to a user
QueueBackend.CallApiputCallAlarmIdPUT /call/alarm/{id}Update the state of an existing alarm call
QueueBackend.InternalApicheckPendingBlocksGET /block/check_pendingInternal call: check for blocks that are pending and have to be started/stopped
QueueBackend.NumberConfigurationApideleteNumberConfigurationsNumberConfigurationIdDELETE /numberconfigurations/{ncid}Delete a number configuration
QueueBackend.NumberConfigurationApigetNumberConfigurationsNumberConfigurationIdGET /numberconfigurations/{ncid}Get a single number configuration
QueueBackend.NumberConfigurationApigetNumberConfigurationsNumberSuperadminGET /numberconfigurations/{phone_number}Get a number configuration for a given phone number
QueueBackend.NumberConfigurationApigetNumberConfigurationsSuperadminGET /numberconfigurationsGet the list of all number configurations
QueueBackend.NumberConfigurationApipostNumberConfigurationsPOST /numberconfigurationsCreate a new number configuration
QueueBackend.QueueApideleteQueueOpeningsIdDELETE /queues/{qid}/openings/{qoid}Delete a queue opening interval by its ID
QueueBackend.QueueApideleteQueueQueueIdCallersQueueCallerIdDELETE /queues/{qid}/callers/{qcid}Remove a caller from a queue
QueueBackend.QueueApideleteQueuesQueueIdDestinationsQueueNumberIdDELETE /queues/{qid}/destinations/{qdid}Delete a destination from a queue
QueueBackend.QueueApideleteQueuesQueueIdNumbersQueueNumberIdDELETE /queues/{qid}/numbers/{qnid}Delete a number from a queue
QueueBackend.QueueApigetQueueOpeningGET /queues/{qid}/openingsGet the list of intervals where the waiting queue is opened
QueueBackend.QueueApigetQueueOpeningsIdGET /queues/{qid}/openings/{qoid}Get an opening interval by its ID
QueueBackend.QueueApigetQueueQueueIdCallersGET /queues/{qid}/callersGet the list of callers in a waiting queue
QueueBackend.QueueApigetQueuesGET /queuesGet the list of all waiting queues
QueueBackend.QueueApigetQueuesByNumberPhoneNumberGET /queues/bynumber/{phone_number}Find a queue by its number
QueueBackend.QueueApigetQueuesQueueIdGET /queues/{qid}Get a single queue by its ID
QueueBackend.QueueApigetQueuesQueueIdCallersQueueCallerIdGET /queues/{qid}/callers/{qcid}Get an invidivual caller in a queue
QueueBackend.QueueApigetQueuesQueueIdDestinationsQueueDestinationIdGET /queues/{qid}/destinations/{qdid}Get a single queue destination
QueueBackend.QueueApigetQueuesQueueIdQueueNumberIdGET /queues/{qid}/numbers/{qnid}Get a single queue number
QueueBackend.QueueApipostQueueOpeningsPOST /queues/{qid}/openingsCreate a new queue opening interval
QueueBackend.QueueApipostQueuesQueueIdCallersPOST /queues/{qid}/callersAdd a caller to a waiting queue
QueueBackend.QueueApipostQueuesQueueIdDestinationsPOST /queues/{qid}/destinationsAdd a destination to a queue
QueueBackend.QueueApipostQueuesQueueIdNumberPOST /queues/{qid}/numbersAdd a number to a queue
QueueBackend.QueueApiputQueueOpeningsIdPUT /queues/{qid}/openings/{qoid}Update an existing queue opening interval
QueueBackend.QueueApiputQueueQueueIdCallersQueueCallerIdPUT /queues/{qid}/callers/{qcid}Update or just keep-alive for a queue caller
QueueBackend.QueueApiputQueuesQueueIdDestinationsQueueDestinationIdPUT /queues/{qid}/destinations/{qdid}Update a destination configuration of a queue
QueueBackend.QueueApiputQueuesQueueIdNumbersQueueNumberIdPUT /queues/{qid}/numbers/{qnid}Update a number configuration of a queue
QueueBackend.QueueApiqueueGET /queueGet the list of all waiting queues
QueueBackend.StatusApistatusGET /status/{queue}Get the current calls present in a queue

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

oauth