Class: LicensesHelper

LicensesHelper()

A helper type for resource license-related API endpoints.

Constructor

new LicensesHelper()

Source:

Methods

(async) fetch(resourceId, licenseId) → {License}

Fetch a license for a given resource.
Parameters:
Name Type Description
resourceId number The identifier of the resource.
licenseId number The identifier of the license.
Source:
Returns:
A raw data object.
Type
License

(async) fetchMember(resourceId, memberId, nonce, timestamp) → {License}

Fetch a member's license for a given resource.
Parameters:
Name Type Description
resourceId number The identifier of the resource.
memberId number The identifier of the member.
nonce number | undefined The download's NONCE value, or undefined if using a Private token.
timestamp number | undefined The download's UNIX timestamp, or undefined if using a Private token.
Source:
Returns:
A raw data object.
Type
License

(async) list(resourceId, sort) → {Array.<License>}

List a page of licenses for a given resource.
Parameters:
Name Type Description
resourceId number The identifier of the resource.
sort SortOptions | undefined An optional set of sort options.
Source:
Returns:
An array of raw data objects.
Type
Array.<License>

(async) listAll(resourceId, sort) → {Array.<License>}

List all pages of licenses for a given resource.
Parameters:
Name Type Description
resourceId number The identifier of the resource.
sort SortOptions | undefined An optional set of sort options.
Source:
Returns:
An array of raw data objects.
Type
Array.<License>

(async) listUntil(resourceId, shouldContinue, sort) → {Array.<License>}

List multiple pages of licenses for a given resource until a condition is no longer met.
Parameters:
Name Type Description
resourceId number The identifier of the resource.
shouldContinue function A function which determines if further pages are requested.
sort SortOptions | undefined An optional set of sort options.
Source:
Returns:
An array of raw data objects.
Type
Array.<License>

(async) modifyPermanent(resourceId, licenseId, active)

Modify a permanent license (and convert to permanent if currently temporary).
Parameters:
Name Type Description
resourceId number The identifier of the resource.
licenseId number The identifier of the license.
active boolean Whether or not the license should be active.
Source:

(async) modifyTemporary(resourceId, licenseId, startDate, endDate)

Modify a temporary license (and convert to temporary if currently permanent).
Parameters:
Name Type Description
resourceId number The identifier of the resource.
licenseId number The identifier of the license.
startDate number The UNIX timestamp of when the license should start.
endDate number The UNIX timestamp of when the license should end.
Source: