Skip to content

Commit c48c761

Browse files
Merge pull request #768 from inplayer-org/feat-jw-ott-webapp-endpoints
2 parents ca91a39 + 34ee7ae commit c48c761

File tree

6 files changed

+549
-147
lines changed

6 files changed

+549
-147
lines changed

CHANGELOG.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

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

5+
# [3.13.2] - 06-12-2022
6+
7+
### Added
8+
9+
- New `Account` methods for handling account favorites and wachlist history from external source
10+
511
# [3.13.1] - 16-08-2022
612

713
### Added
@@ -25,6 +31,7 @@ All notable changes to this project will be documented in this file.
2531
### Changes
2632

2733
- Updated AWS_IOT_URL for staging and production environments
34+
2835
# [3.12.6] - 08-03-2022
2936

3037
### Changes
@@ -56,17 +63,19 @@ All notable changes to this project will be documented in this file.
5663
- The type of getSubscription method parameter changed to string
5764

5865
# [3.12.1] - 03-12-2021
66+
5967
## Changes
6068

6169
- IOT token validity changed from 60 to 30 minutes
6270

6371
# [3.12.0] - 28-09-2021
72+
6473
## Changes
6574

6675
- Typedoc version upgraded to 0.22.4
6776
- The view of our generated docs is changed, due to breaking changes introduces in typedoc 0.20.0 version
6877
- Moved the directDebitSubscribe and idealSubscribe methods in subscription module and added deprecated description next to them in payments module
69-
- Added more comprehensive description for methods parameters and responses
78+
- Added more comprehensive description for methods parameters and responses
7079
- Removed redundant getPaymentTools method
7180

7281
# [3.11.3] - 23-09-2021

index.d.ts

+61-22
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export declare class Account {
181181
setToken<R = void>(
182182
token: string,
183183
refreshToken: string,
184-
expiresAt: number,
184+
expiresAt: number
185185
): R | void;
186186
removeToken<R = void>(): R | void;
187187

@@ -200,7 +200,7 @@ export declare class Account {
200200
token?: string
201201
): Promise<AxiosResponse<void>>;
202202
getAccountInfo(): Promise<AxiosResponse<AccountData>>;
203-
updateAccount(data: UpdateAccountData): Promise<AxiosResponse<void>>;
203+
updateAccount(data: UpdateAccountData): Promise<AxiosResponse<AccountData>>;
204204
exportData(data: AccountAuthData): Promise<AxiosResponse<CommonResponse>>;
205205
deleteAccount(data: AccountAuthData): Promise<AxiosResponse<CommonResponse>>;
206206
getSocialLoginUrls(state: string): Promise<AxiosResponse<ListSocialURLs>>;
@@ -217,9 +217,13 @@ export declare class Account {
217217
loadMerchantRestrictionSettings(
218218
merchantUuid: string
219219
): Promise<AxiosResponse<RestrictionSettingsData>>;
220-
syncWithExternalAccount(integration: string, itemId: number): Promise<AxiosResponse<ExternalAccount>>;
220+
syncWithExternalAccount(
221+
integration: string,
222+
itemId: number
223+
): Promise<AxiosResponse<ExternalAccount>>;
221224
updateExternalAccount(
222-
integration: string, body: Record<string, string | number>
225+
integration: string,
226+
body: Record<string, string | number>
223227
): Promise<AxiosResponse<CommonResponse>>;
224228
}
225229

@@ -470,7 +474,7 @@ export declare class Asset {
470474
page?: number,
471475
startDate?: string,
472476
endDate?: string,
473-
type?: string,
477+
type?: string
474478
): Promise<AxiosResponse<Record<string, unknown>[]>>;
475479
getAccessCode(assetId: number | string): CodeAccessData;
476480
requestCodeAccess(
@@ -479,7 +483,9 @@ export declare class Asset {
479483
getAccesCodeSessions(
480484
codeId: number
481485
): Promise<AxiosResponse<Array<CodeAccessSessionsData>>>;
482-
terminateSession(assetId: number): Promise<AxiosResponse<CommonResponse> | null>;
486+
terminateSession(
487+
assetId: number
488+
): Promise<AxiosResponse<CommonResponse> | null>;
483489
getCloudfrontURL(
484490
assetId: number,
485491
videoUrl: string
@@ -715,7 +721,10 @@ interface AmazonPlatformData {
715721
}
716722

717723
interface NonAmazonPlatformData {
718-
platform: Exclude<ReceiptValidationPlatform, ReceiptValidationPlatform.AMAZON>;
724+
platform: Exclude<
725+
ReceiptValidationPlatform,
726+
ReceiptValidationPlatform.AMAZON
727+
>;
719728
amazonUserId?: never;
720729
}
721730

@@ -745,8 +754,12 @@ export declare class Payment {
745754
constructor(config: Record<string, unknown>, Account: Account);
746755

747756
getPaymentMethods(): Promise<AxiosResponse<MerchantPaymentMethod[]>>;
748-
createPayment(data: CreatePaymentData): Promise<AxiosResponse<CommonResponse>>;
749-
createDonationPayment(data: CreateDonationPaymentData): Promise<AxiosResponse<CommonResponse>>;
757+
createPayment(
758+
data: CreatePaymentData
759+
): Promise<AxiosResponse<CommonResponse>>;
760+
createDonationPayment(
761+
data: CreateDonationPaymentData
762+
): Promise<AxiosResponse<CommonResponse>>;
750763
getPayPalParams(
751764
data: PayPalParamsData
752765
): Promise<AxiosResponse<GeneratePayPalParameters>>;
@@ -873,7 +886,7 @@ export declare class Subscription {
873886
): Promise<AxiosResponse<CommonResponse>>;
874887
changeSubscriptionPlan(
875888
data: ChangeSubscriptionPlanRequestBody
876-
): Promise<AxiosResponse<ChangeSubscriptionPlanResponse>>;
889+
): Promise<AxiosResponse<ChangeSubscriptionPlanResponse>>;
877890
}
878891

879892
export interface DiscountData {
@@ -932,7 +945,7 @@ export interface GetMerchantNFTResponse {
932945
merchant_uuid: string;
933946
prices: Partial<{
934947
[Prices.CRYPTO]: CryptoPrice;
935-
[Prices.FIAT]: GetAccessFee
948+
[Prices.FIAT]: GetAccessFee;
936949
}>;
937950
published: boolean;
938951
supply: number;
@@ -980,13 +993,31 @@ export interface MakeReservationResponse {
980993
export declare class NFTs {
981994
constructor(config: Record<string, unknown>, Account: Account);
982995

983-
getMerchantMarketplace(merchantUuid: string): Promise<AxiosResponse<GetMerchantMarketplaceResponse>>;
984-
getMerchantNFTList(merchantUuid: string, page?: number, size?: number, filter?: string):
985-
Promise<AxiosResponse<GetMerchantNFTListResponse>>;
986-
getMerchantNFT(merchantUuid: string, nftId: number): Promise<AxiosResponse<GetMerchantNFTResponse>>;
987-
getExchangeRates(fiat: string, invert?: boolean): Promise<AxiosResponse<GetExchangeRatesResponse>>;
988-
getUserBoughtNFTs(page?: number, size?: number): Promise<AxiosResponse<GetUserBoughtNFTsResponse>>;
989-
makeReservation(merchantUuid: string, nftId: number): Promise<AxiosResponse<MakeReservationResponse>>;
996+
getMerchantMarketplace(
997+
merchantUuid: string
998+
): Promise<AxiosResponse<GetMerchantMarketplaceResponse>>;
999+
getMerchantNFTList(
1000+
merchantUuid: string,
1001+
page?: number,
1002+
size?: number,
1003+
filter?: string
1004+
): Promise<AxiosResponse<GetMerchantNFTListResponse>>;
1005+
getMerchantNFT(
1006+
merchantUuid: string,
1007+
nftId: number
1008+
): Promise<AxiosResponse<GetMerchantNFTResponse>>;
1009+
getExchangeRates(
1010+
fiat: string,
1011+
invert?: boolean
1012+
): Promise<AxiosResponse<GetExchangeRatesResponse>>;
1013+
getUserBoughtNFTs(
1014+
page?: number,
1015+
size?: number
1016+
): Promise<AxiosResponse<GetUserBoughtNFTsResponse>>;
1017+
makeReservation(
1018+
merchantUuid: string,
1019+
nftId: number
1020+
): Promise<AxiosResponse<MakeReservationResponse>>;
9901021
}
9911022

9921023
export interface ApiEndpoints {
@@ -1007,7 +1038,7 @@ export interface ApiEndpoints {
10071038
page: number,
10081039
startDate: string,
10091040
endDate: string,
1010-
type?: string,
1041+
type?: string
10111042
) => string;
10121043
deleteAccount: string;
10131044
exportData: string;
@@ -1043,14 +1074,22 @@ export interface ApiEndpoints {
10431074
getSubscription: (id: string) => string;
10441075
subscribe: string;
10451076
cancelSubscription: (url: string) => string;
1046-
changeSubscriptionPlan: (accessFeeId: number, inplayerToken: string) => string;
1077+
changeSubscriptionPlan: (
1078+
accessFeeId: number,
1079+
inplayerToken: string
1080+
) => string;
10471081
// Voucher
10481082
getDiscount: string;
10491083
// Branding
10501084
getBranding: (clientId: string, brandingId: string) => string;
10511085
// NFTs
1052-
getMerchantMarketplace: (merchantUuid: string) => string,
1053-
getMerchantNFTList: (merchantUuid: string, page: number, size: number, filter: string) => string;
1086+
getMerchantMarketplace: (merchantUuid: string) => string;
1087+
getMerchantNFTList: (
1088+
merchantUuid: string,
1089+
page: number,
1090+
size: number,
1091+
filter: string
1092+
) => string;
10541093
getMerchantNFT: (merchantUuid: string, nftId: number) => string;
10551094
getExchangeRates: (fiat: string, invert: boolean) => string;
10561095
getUserBoughtNFTs: (page: number, size: number) => string;

package.json

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

src/constants/index.ts

+31-11
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,27 @@ export const API = {
77
signOut: '/accounts/logout',
88
changePassword: '/accounts/change-password',
99
requestNewPassword: '/accounts/forgot-password',
10-
setNewPassword: (token: string): string => `/accounts/forgot-password/${token}`,
10+
setNewPassword: (token: string): string =>
11+
`/accounts/forgot-password/${token}`,
1112
getAccountInfo: '/accounts',
1213
updateAccount: '/accounts',
1314
exportData: '/accounts/export',
1415
deleteAccount: '/accounts/erase',
15-
getSocialLoginUrls: (state: string): string => `/accounts/social?state=${state}`,
16+
getSocialLoginUrls: (state: string): string =>
17+
`/accounts/social?state=${state}`,
1618
getRegisterFields: (merchantUuid: string): string =>
1719
`/accounts/register-fields/${merchantUuid}`,
1820
reportSSOtoken: (ssoDomain: string): string => `${ssoDomain}/sso/cookie`,
1921
sendPinCode: '/v2/accounts/pin-codes/send',
2022
validatePinCode: '/v2/accounts/pin-codes/validate',
2123
requestDataCaptureNoAuthAccess: '/v2/accounts/customers/data-capture',
22-
externalAccount: (integration: string): string => `/v2/accounts/external/${integration}`,
24+
externalAccount: (integration: string): string =>
25+
`/v2/accounts/external/${integration}`,
26+
getFavorites: '/v2/accounts/media/favorites',
27+
getFavorite: (id: string): string => `/v2/accounts/media/favorites/${id}`,
28+
getWatchHistory: '/v2/accounts/media/watchlist-history',
29+
getWatchHistoryForItem: (id: string) =>
30+
`/v2/accounts/media/watchlist-history/${id}`,
2331
// restrictions
2432
merchantRestrictionSettings: (merchantUuid: string): string =>
2533
`/restrictions/settings/${merchantUuid}`,
@@ -48,8 +56,10 @@ export const API = {
4856
`/items/access/customers?status=${status}&page=${page}&size=${size}`,
4957
// code only
5058
requestCodeAccess: '/items/access/codes/entry',
51-
requestAccessCodeSessions: (codeId: number): string => `items/access/codes/${codeId}/sessions`,
52-
terminateSession: (codeId: number, fingerprint: string): string => `items/access/codes/${codeId}/${fingerprint}`,
59+
requestAccessCodeSessions: (codeId: number): string =>
60+
`items/access/codes/${codeId}/sessions`,
61+
terminateSession: (codeId: number, fingerprint: string): string =>
62+
`items/access/codes/${codeId}/${fingerprint}`,
5363
// donation
5464
getDonations: (id: number): string => `v2/items/${id}/donations`,
5565

@@ -64,7 +74,8 @@ export const API = {
6474
createDirectDebitMandate: '/v2/payments/direct-debit/mandate',
6575
payForAssetDonation: '/v2/payments/donation',
6676
confirmForAssetDonation: '/v2/payments/donation:confirm',
67-
validateReceipt: (platform: string): string => `v2/external-payments/${platform}/validate`,
77+
validateReceipt: (platform: string): string =>
78+
`v2/external-payments/${platform}/validate`,
6879
getAssetsHistory: (
6980
size: number,
7081
page: number,
@@ -109,12 +120,21 @@ export const API = {
109120
`/branding/paywall/${clientId}/${brandingId}`,
110121

111122
// NFTs
112-
getMerchantMarketplace: (merchantUuid: string): string => `/v2/nfts/marketplaces/${merchantUuid}`,
113-
getMerchantNFTList: (merchantUuid: string, page: number, size: number, filter: string): string =>
123+
getMerchantMarketplace: (merchantUuid: string): string =>
124+
`/v2/nfts/marketplaces/${merchantUuid}`,
125+
getMerchantNFTList: (
126+
merchantUuid: string,
127+
page: number,
128+
size: number,
129+
filter: string,
130+
): string =>
114131
`/v2/nfts/${merchantUuid}?filter=${filter}&page=${page}&size=${size}`,
115-
getMerchantNFT: (merchantUuid: string, nftId: number): string => `/v2/nfts/${merchantUuid}/${nftId}`,
132+
getMerchantNFT: (merchantUuid: string, nftId: number): string =>
133+
`/v2/nfts/${merchantUuid}/${nftId}`,
116134
getExchangeRates: (fiat: string, invert: boolean): string =>
117135
`/v2/nfts/exchange-rate/${fiat}${invert ? '?invert=true' : ''}`,
118-
getUserBoughtNFTs: (page: number, size: number): string => `/v2/nfts?page=${page}&size=${size}`,
119-
makeReservation: (merchantUuid: string, nftId: number): string => `/v2/nfts/${merchantUuid}/${nftId}/reserve`,
136+
getUserBoughtNFTs: (page: number, size: number): string =>
137+
`/v2/nfts?page=${page}&size=${size}`,
138+
makeReservation: (merchantUuid: string, nftId: number): string =>
139+
`/v2/nfts/${merchantUuid}/${nftId}/reserve`,
120140
};

0 commit comments

Comments
 (0)