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. |
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. |
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. |
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. |
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. |
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. |
(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. |