From ada634c991194d85bac8f12d60f7562d8330310f Mon Sep 17 00:00:00 2001 From: mirovladimitrovski Date: Wed, 19 Jun 2024 14:54:08 +0200 Subject: [PATCH] Search string for can be any string --- CHANGELOG.md | 6 ++++++ index.d.ts | 2 +- package.json | 2 +- src/constants/index.ts | 8 ++------ src/endpoints/payment.ts | 4 ++-- src/models/Config.ts | 2 +- src/models/IPayment.ts | 2 +- 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c8813a2..9abef04a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +# [3.13.27] - 19-06-2024 + +### Changes + +- Search string for `InPlayer.Payment.getSitePlans` can be any string + # [3.13.26] - 19-06-2024 ### Fixes diff --git a/index.d.ts b/index.d.ts index ee072438..ee0af045 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1018,7 +1018,7 @@ export declare class Payment { ) => Promise>; getSitePlans: ( siteId: string, - plansIds?: string[] + searchString?: string ) => Promise>; getSitePlanPrices: ( siteId: string, diff --git a/package.json b/package.json index 52bb5e0e..39703be4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@inplayer-org/inplayer.js", - "version": "3.13.26", + "version": "3.13.27", "author": "InPlayer", "license": "MIT", "description": "A Javascript SDK for Inplayer's RESTful API", diff --git a/src/constants/index.ts b/src/constants/index.ts index 7a7bb5c3..7f753ea2 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -110,12 +110,8 @@ export const API = { return url; }, - getSitePlans: (siteId: string, plansIds: string[] = []) => - `/v3/sites/${siteId}/plans${ - plansIds.length - ? `?q=id:(${plansIds.map((planId) => `"${planId}"`).join(' OR ')})` - : '' - }`, + getSitePlans: (siteId: string, searchString?: string) => + `/v3/sites/${siteId}/plans${searchString ? `?${searchString}` : ''}`, getSitePlanPrices: (siteId: string, planId: string) => `/v3/sites/${siteId}/plans/${planId}/prices`, diff --git a/src/endpoints/payment.ts b/src/endpoints/payment.ts index 06262c56..610b1ad7 100644 --- a/src/endpoints/payment.ts +++ b/src/endpoints/payment.ts @@ -1257,9 +1257,9 @@ class Payment extends BaseExtend { async getSitePlans( siteId: string, - plansIds?: string[] + searchString?: string ): Promise> { - return this.request.get(API.getSitePlans(siteId, plansIds), { + return this.request.get(API.getSitePlans(siteId, searchString), { headers: { Accept: 'application/json', 'Content-Type': 'application/json' diff --git a/src/models/Config.ts b/src/models/Config.ts index 35491975..1a9b8905 100644 --- a/src/models/Config.ts +++ b/src/models/Config.ts @@ -66,7 +66,7 @@ export interface ApiEndpoints { payForAssetDonation: string; confirmForAssetDonation: string; validateReceipt: (platform: string) => string; - getSitePlans: (siteId: string, plansIds?: string[]) => string; + getSitePlans: (siteId: string, searchString: string) => string; getSitePlanPrices: (siteId: string, planId: string) => string; getAssetsHistory: ( size: number, diff --git a/src/models/IPayment.ts b/src/models/IPayment.ts index 15601ada..312079e5 100644 --- a/src/models/IPayment.ts +++ b/src/models/IPayment.ts @@ -455,7 +455,7 @@ export interface Payment extends BaseExtend { getSitePlans: ( siteId: string, - plansIds?: string[], + searchString?: string, ) => Promise>; getSitePlanPrices: (