lib/applications.js
function find (client) {
  return function find (pushAppId) {
    const req = {
      url: pushAppId ? `${client.baseUrl}/rest/applications/${pushAppId}` : `${client.baseUrl}/rest/applications/`
    };

    return request(client, req)
      .then((response) => {
        if (response.resp.statusCode !== 200) {
          return Promise.reject(response.body);
        }

        return Promise.resolve(response.body);
      });
  };
}
function find (client) {
  return function find (pushAppId) {
    const req = {
      url: pushAppId ? `${client.baseUrl}/rest/applications/${pushAppId}` : `${client.baseUrl}/rest/applications/`
    };

    return request(client, req)
      .then((response) => {
        if (response.resp.statusCode !== 200) {
          return Promise.reject(response.body);
        }

        return Promise.resolve(response.body);
      });
  };
}
function find ( client ) { return function find ( pushAppId ) { const req = { url : pushAppId ? ` ${ client . baseUrl } ${ pushAppId } ` : ` ${ client . baseUrl } ` } ; return request ( client , req ) . then ( ( response ) => { if ( response . resp . statusCode !== 200 ) { return Promise . reject ( response . body ) ; } return Promise . resolve ( response . body ) ; } ) ; } ; }
A function to get all the push applications or just 1 push application
@param {string} [pushAppId] - The id of the push application
@returns {Promise} A promise that will resolve with the Array of application objects or if a pushAppId is specified, just the application object
@example
adminClient(baseUrl, settings)
.then((client) => {
client.applications.find()
.then((applications) => {
console.log(applications) // [{...},{...}, ...]
})
})
A function to get all the push applications or just 1 push application