Skip to content

The type of getSubscription method parameter changed to string #750

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

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

# [3.12.2] - 07-12-2021

### Changes

- The type of getSubscription method parameter changed to string

# [3.12.1] - 03-12-2021
## Changes

Expand Down
4 changes: 2 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ export declare class Subscription {
limit?: number,
status?: string
): Promise<AxiosResponse<GetSubscription>>;
getSubscription(id: number): Promise<AxiosResponse<SubscriptionDetails>>;
getSubscription(id: string): Promise<AxiosResponse<SubscriptionDetails>>;
cancelSubscription(
unsubscribeUrl: string
): Promise<AxiosResponse<CancelSubscription>>;
Expand Down Expand Up @@ -936,7 +936,7 @@ export interface ApiEndpoints {
validateReceipt: (platform: string) => string;
// Subscription
getSubscriptions: (limit: number, page: number) => string;
getSubscription: (id: number) => string;
getSubscription: (id: string) => string;
subscribe: string;
cancelSubscription: (url: string) => string;
// Voucher
Expand Down
2 changes: 1 addition & 1 deletion src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const API = {
}
return url;
},
getSubscription: (id: number): string => `/subscriptions/${id}`,
getSubscription: (id: string): string => `/subscriptions/${id}`,
cancelSubscription: (url: string): string => `${url}`,
subscribe: '/subscriptions',
subscribeV2: '/v2/subscriptions',
Expand Down
4 changes: 2 additions & 2 deletions src/endpoints/subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class Subscription extends BaseExtend {
* @method getSubscription
* @async
*
* @param {number} id The subscription id.
* @param {string} id The subscription id.
* @example
* InPlayer.Subscription
* .getSubscription('abcdef')
Expand All @@ -106,7 +106,7 @@ class Subscription extends BaseExtend {
* }
* ```
*/
async getSubscription(id: number): Promise<AxiosResponse<SubscriptionDetails>> {
async getSubscription(id: string): Promise<AxiosResponse<SubscriptionDetails>> {
const tokenObject = await this.request.getToken();

return this.request.authenticatedGet(API.getSubscription(id), {
Expand Down
2 changes: 1 addition & 1 deletion src/models/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export interface ApiEndpoints {
) => string;
// Subscriptions
getSubscriptions: (limit: number, page: number) => string;
getSubscription: (id: number) => string;
getSubscription: (id: string) => string;
cancelSubscription: (url: string) => string;
subscribe: string;
subscribeV2: string;
Expand Down
2 changes: 1 addition & 1 deletion src/models/ISubscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export interface Subscription extends BaseExtend {
page?: number,
limit?: number
): Promise<AxiosResponse<GetSubscription>>;
getSubscription(id: number): Promise<AxiosResponse<SubscriptionDetails>>;
getSubscription(id: string): Promise<AxiosResponse<SubscriptionDetails>>;
cancelSubscription(
unsubscribeUrl: string
): Promise<AxiosResponse<CancelSubscription>>;
Expand Down