diff --git a/CHANGELOG.md b/CHANGELOG.md index 184fe927..345d920c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/index.d.ts b/index.d.ts index d19e2409..7c0c244f 100644 --- a/index.d.ts +++ b/index.d.ts @@ -859,7 +859,7 @@ export declare class Subscription { limit?: number, status?: string ): Promise>; - getSubscription(id: number): Promise>; + getSubscription(id: string): Promise>; cancelSubscription( unsubscribeUrl: string ): Promise>; @@ -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 diff --git a/src/constants/index.ts b/src/constants/index.ts index 4fe01cb9..e42f816c 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -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', diff --git a/src/endpoints/subscription.ts b/src/endpoints/subscription.ts index 4c3008d5..10cba896 100644 --- a/src/endpoints/subscription.ts +++ b/src/endpoints/subscription.ts @@ -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') @@ -106,7 +106,7 @@ class Subscription extends BaseExtend { * } * ``` */ - async getSubscription(id: number): Promise> { + async getSubscription(id: string): Promise> { const tokenObject = await this.request.getToken(); return this.request.authenticatedGet(API.getSubscription(id), { diff --git a/src/models/Config.ts b/src/models/Config.ts index bf915c43..c7550874 100644 --- a/src/models/Config.ts +++ b/src/models/Config.ts @@ -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; diff --git a/src/models/ISubscription.ts b/src/models/ISubscription.ts index 88350978..c73cec15 100644 --- a/src/models/ISubscription.ts +++ b/src/models/ISubscription.ts @@ -124,7 +124,7 @@ export interface Subscription extends BaseExtend { page?: number, limit?: number ): Promise>; - getSubscription(id: number): Promise>; + getSubscription(id: string): Promise>; cancelSubscription( unsubscribeUrl: string ): Promise>;