Skip to content

Commit 579f67b

Browse files
Merge pull request #798 from inplayer-org/getAsset-merchant-optional
Make merchantUuid in getAsset optional
2 parents 3550070 + 889e16a commit 579f67b

File tree

6 files changed

+13
-9
lines changed

6 files changed

+13
-9
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
# [3.13.16] - 08-08-2023
6+
7+
- Modified `merchantUuid` parameter in `getAsset` method to be optional
8+
59
# [3.13.15] - 24-07-2023
610

711
- Added `getFeatureFlags` method and `FeatureFlagData` type to `Account` module

index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ export declare class Asset {
520520

521521
checkAccessForAsset(id: number): Promise<AxiosResponse<GetItemAccessV1>>;
522522
isFreeTrialUsed(id: number): Promise<AxiosResponse<boolean>>;
523-
getAsset(assetId: number, merchantUuid: string): Promise<AxiosResponse<ItemDetailsV1>>;
523+
getAsset(assetId: number, merchantUuid: string): Promise<AxiosResponse<ExternalItemDetails>>;
524524
getExternalAsset(
525525
assetType: string,
526526
externalId: string,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@inplayer-org/inplayer.js",
3-
"version": "3.13.15",
3+
"version": "3.13.16",
44
"author": "InPlayer",
55
"license": "MIT",
66
"description": "A Javascript SDK for Inplayer's RESTful API",

src/constants/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const API = {
3131
merchantRestrictionSettings: (merchantUuid: string): string => `/restrictions/settings/${merchantUuid}`,
3232

3333
// Items
34-
getAsset: (id: number, merchantUuid: string): string => `/items/${merchantUuid}/${id}`,
34+
getAsset: (id: number, merchantUuid?: string): string => `/items/${merchantUuid ? `${merchantUuid}/` : ''}${id}`,
3535
getExternalAsset: (assetType: string, externalId: string, merchantUuid?: string): string => {
3636
let url = `/items/assets/external/${assetType}/${externalId}`;
3737
if (merchantUuid) {

src/endpoints/asset.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class Asset extends BaseExtend {
9898
* @method getAsset
9999
* @async
100100
* @param {number} assetId The id of created premium content in InPlayer Dashboard (i.e asset id).
101-
* @param {string} merchantUuid The Merchant's unique universal identifier (Merchant UUID).
101+
* @param {string?} merchantUuid The Merchant's unique universal identifier (Merchant UUID).
102102
* You can find it on the InPlayer's dashboard at the Account Details section as Account ID.
103103
* @example
104104
* InPlayer.Asset
@@ -133,8 +133,8 @@ class Asset extends BaseExtend {
133133
*/
134134
async getAsset(
135135
assetId: number,
136-
merchantUuid: string,
137-
): Promise<AxiosResponse<ItemDetailsV1>> {
136+
merchantUuid?: string,
137+
): Promise<AxiosResponse<ExternalItemDetails>> {
138138
return this.request.get(API.getAsset(assetId, merchantUuid));
139139
}
140140

src/models/IAsset&Access.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ export interface ItemDetailsAccess extends ItemDetailsV1 {
170170
}
171171

172172
export interface ExternalItemDetails extends ItemDetailsV1 {
173-
access_fees: GetAccessFee[];
173+
access_fees: AccessFee[];
174174
metahash: Record<string, string>;
175175
}
176176

@@ -368,8 +368,8 @@ export interface Asset extends BaseExtend {
368368
isFreeTrialUsed(id: number): Promise<AxiosResponse<boolean>>;
369369
getAsset(
370370
assetId: number,
371-
merchantUuid: string
372-
): Promise<AxiosResponse<ItemDetailsV1>>;
371+
merchantUuid?: string
372+
): Promise<AxiosResponse<ExternalItemDetails>>;
373373
getExternalAsset(
374374
assetType: string,
375375
externalId: string,

0 commit comments

Comments
 (0)