Skip to content

Commit 876e582

Browse files
committed
Fix not finding games
1 parent 9ad9073 commit 876e582

18 files changed

Lines changed: 177 additions & 381 deletions

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,16 @@ allkeyshopService.search('Borderlands 3').then((data) => {
7777

7878
### Get game names without data
7979
```typescript
80-
allkeyshopService.find('FIFA 22').then((data) => {
80+
allkeyshopService.find('DARK SOULS III').then((data) => {
8181
console.log(data)
8282
})
8383

8484
// Output:
8585
// {
8686
// status: 'success',
8787
// games: [
88-
// { id: '83060', name: 'FIFA 22' },
89-
// { id: '83063', name: 'FIFA 22 PS4' },
88+
// { id: '83060', name: 'DARK SOULS' },
89+
// { id: '83063', name: 'DARK SOULS REMASTERED' },
9090
// ...
9191
// ]
9292
// }

dist/src/allkeyshop.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/src/allkeyshop.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/src/filter.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type BasicGameData, type Offer } from './gather';
1+
import { type BasicGameData, type HistoryEntry, type BaseCatalogItem } from './gather';
22
declare const filterByName: (games: BasicGameData[], name: string) => BasicGameData[];
3-
declare const filterByStore: (offers: Offer[], store: string) => Offer[];
3+
declare const filterByStore: (history: HistoryEntry[], merchants: Record<string, BaseCatalogItem>, store: string) => HistoryEntry[];
44
export { filterByName, filterByStore };

dist/src/filter.js

Lines changed: 8 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/src/filter.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/src/gather.d.ts

Lines changed: 21 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,32 @@
1-
export interface Offer {
2-
id: number;
3-
affiliateUrl: string;
4-
isActive: boolean;
5-
merchant: string;
6-
price: {
7-
eur: {
8-
bestCoupon: {
9-
code: string;
10-
discountValue: string;
11-
discountStrategy: string;
12-
isCashback: boolean;
13-
} | null;
14-
currency: string;
15-
price: number;
16-
priceWithoutCoupon: number;
17-
};
18-
};
1+
export interface HistoryEntry {
2+
product_id: number;
3+
merchant_id: number;
194
edition: string;
205
region: string;
21-
stock: string;
22-
platform: string;
6+
last_price: number;
7+
min_discount_price: number;
8+
best_discount_code: string | null;
9+
start: string;
10+
end: string;
11+
merchantName?: string;
2312
}
24-
export interface Merchant {
13+
export interface BaseCatalogItem {
2514
id: string;
2615
name: string;
27-
aggregateRating: {
28-
value: number;
29-
count: number;
30-
};
31-
types: string;
32-
paymentMethods: string[];
33-
logoSlug: string;
34-
reviewUrl: string;
3516
}
36-
export interface Edition {
37-
id: string;
38-
name: string;
39-
}
40-
export interface Region {
41-
id: string;
42-
name: string;
43-
filterName: string;
17+
export interface PriceSummary {
18+
merchant_id: number;
19+
price: string;
20+
last_update: string;
4421
}
4522
export interface ProductSellingDetails {
46-
success: boolean;
47-
offers: Offer[];
48-
merchants: Record<string, Merchant>;
49-
editions: Record<string, Edition>;
50-
regions: Record<string, Region>;
23+
officialMerchants: string;
24+
history: HistoryEntry[];
25+
editions: Record<string, BaseCatalogItem>;
26+
regions: Record<string, BaseCatalogItem>;
27+
merchants: Record<string, BaseCatalogItem>;
28+
lower_official_price: PriceSummary;
29+
lower_keyshops_price: PriceSummary;
5130
}
5231
export declare const getGameData: (games: BasicGameData[], currency: string, store: string) => Promise<ProductSellingDetails | undefined>;
5332
export interface ProductIdsResponse {

dist/src/gather.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/src/gather.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)