Skip to content
Building maxdome requests step by step in a modularized way
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
LICENSE.txt
README.md
package.json

README.md

Dependency Status devDependency Status

Installation

npm i --save drequest-maxdome

Initialisation

const maxdome = require('drequest-maxdome').getRequestBuilder();

Attention: drequest-maxdome will use several information from the package.json and add them to the headers. This makes it easier to identify the source of the request in the logs of maxdome if there are issues. The information which will be used:

  • from:
    • If the author is an object: ${author.name} <${author.email}> (${author.url})
    • If not, the string will be used
  • user-agent: ${app.name} v${app.version} via ${lib.name} v${lib.version}

Examples

Get information for a specific asset by ID

const AssetsQueryOptions = require('drequest-maxdome').AssetsQueryOptions;

const assetId = <assetId>;
const assetsQueryOptions = new AssetsQueryOptions(assetId);

const assets =
  await maxdome.request('assets')
    .addOptions(assetsQueryOptions)
    .send();

Search assets by title and get the first 3 results

const AssetsQueryOptions = require('drequest-maxdome').AssetsQueryOptions;

const title = '<title>';
const assetsQueryOptions = 
  new AssetsQueryOptions()
    .addFilter('contentTypeSeriesOrMovies')
    .addFilter('search', title)
    .addQuery('pageSize', 3);
    
const assets =
  await maxdome.request('assets')
    .addOptions(assetsQueryOptions)
    .send();

Get the 50 newest store movies

const AssetsQueryOptions = require('drequest-maxdome').AssetsQueryOptions;

const title = '<title>';
const assetsQueryOptions = 
  new AssetsQueryOptions()
    .addFilter('availableWithoutPackage')
    .addFilter('movies')
    .addFilter('new')
    .addFilter('notUnlisted')
    .addQuery('pageSize', 50)
    .addSort('activeLicenseStart', 'desc');
    
const assets =
  await maxdome.request('assets')
    .addOptions(assetsQueryOptions)
    .send();
You can’t perform that action at this time.