npm i --save drequest-maxdome
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
- If the author is an object:
- user-agent:
${app.name} v${app.version} via ${lib.name} v${lib.version}
const AssetsQueryOptions = require('drequest-maxdome').AssetsQueryOptions;
const assetId = <assetId>;
const assetsQueryOptions = new AssetsQueryOptions(assetId);
const assets =
await maxdome.request('assets')
.addOptions(assetsQueryOptions)
.send();
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();
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();