patreon-dl 3.8.1 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -311,218 +311,15 @@ Note the URL shown in the output. Open this URL in a web browser to begin viewin
311
311
 
312
312
  ## Changelog
313
313
 
314
- 3.8.1
315
- - YT embeds: obtain images directly from YT instead of Patreon API data, since the latter could give 0-byte content ([@Fabelwesen](https://github.com/Fabelwesen) - [#120](https://github.com/patrickkfkan/patreon-dl/issues/120)).
316
-
317
- 3.8.0
318
- - Add support for custom URLs (creators hosting Patreon pages on their own domains) ([@lucasoskorep](https://github.com/lucasoskorep) - [PR #129](https://github.com/patrickkfkan/patreon-dl/pull/129)).
319
- - Fix YT download errors ([#132](https://github.com/patrickkfkan/patreon-dl/issues/132)).
320
- - Browse: set title tag based on content ([#127](https://github.com/patrickkfkan/patreon-dl/issues/127)).
321
- - CLI: add `--list-posts` / `--list-posts-uid` ([#126](https://github.com/patrickkfkan/patreon-dl/issues/126)).
322
-
323
- 3.7.1
324
- - Check and skip download of Patreon-hosted videos that are protected by DRM; add `include.protectedMedia` / `protected.media` option.
325
- - Fix campaign not found when targeting collections ([#124](https://github.com/patrickkfkan/patreon-dl/issues/124)).
326
-
327
- v3.7.0
328
- - Vimeo download script: fetch full player URL ([#118](https://github.com/patrickkfkan/patreon-dl/issues/118))
329
- - Fix downloaded posts missing content / teaser ([@Fabelwesen](https://github.com/Fabelwesen) - [#119](https://github.com/patrickkfkan/patreon-dl/issues/119))
330
- - Add "max content width" option to browse settings ([#122](https://github.com/patrickkfkan/patreon-dl/issues/122))
331
- - Map inline post links to local server routes (contrib by [@Fabelwesen](https://github.com/Fabelwesen) - [#121](https://github.com/patrickkfkan/patreon-dl/issues/121))
332
- - Support additional fields in `media.filename.format` ([patreon-dl-gui#51](https://github.com/patrickkfkan/patreon-dl-gui/issues/51))
333
- - YT downloader: fix error in n/sig decipher function extraction
334
-
335
- v3.6.1
336
- - Fix Embedly download script error on retrying with alternative URL.
337
-
338
- v3.6.0
339
- - Browse: affix nav links (previous / next post) to viewport bottom if post content overflows ([patreon-dl-gui#41](https://github.com/patrickkfkan/patreon-dl-gui/issues/41))
340
- - Fix error when Deno path contains spaces ([patreon-dl-gui#42](https://github.com/patrickkfkan/patreon-dl-gui/issues/42))
341
- - Add SproutVideo download script ([patreon-dl-gui#43](https://github.com/patrickkfkan/patreon-dl-gui/issues/43))
342
- - Fix YouTube download returning "auth required" error
343
-
344
- v3.5.0
345
- - Add support for downloading from "shop" URLs (e.g. `https://www.patreon.com/<creator>/shop`). This will download all products from a creator's shop.
346
- - Add `productsPublished` / `products.published.after` / `products.published.before` option to set publish date criteria of products included in download.
347
- - Since `stopOn` / `stop.on` option now also applies to products, the `postPreviouslyDownloaded` and `postPublishDateOutOfRange` values have been deprecated in favor of `previouslyDownloaded` and `publishDateOutOfRange`, respectively.
348
- - Add Collections support. Collection info is now saved when downloading posts. This means you can browse posts by collection. ([#107](https://github.com/patrickkfkan/patreon-dl/issues/107))
349
- - (Browse) Add search functionality ([#106](https://github.com/patrickkfkan/patreon-dl/issues/106))
350
- - Add Tags support. Tag info is now saved when downloading posts. This means you can filter posts by tag.
351
- - Add `include.mediaThumbnails` option
352
-
353
- v3.4.0
354
- - Fix "no posts found" on "cw" pages ([patreon-dl-gui#30](https://github.com/patrickkfkan/patreon-dl-gui/issues/30))
355
- - Fix YouTube streams returning 403 error ([patreon-dl-gui#31](https://github.com/patrickkfkan/patreon-dl-gui/issues/31))
356
- - Add `pathToDeno` / `--deno` / `path.to.deno` option (used by built-in YouTube downloader)
357
- - Merged PRs:
358
- - Allow directory to be a symlink ([@piperswe](https://github.com/piperswe) - [#101](https://github.com/patrickkfkan/patreon-dl/pull/101))
359
- - Add Github actions ([@piperswe](https://github.com/piperswe) - [#102](https://github.com/patrickkfkan/patreon-dl/pull/102))
360
- - Add `maxVideoResolution` / `max.video.resolution` option to limit video downloads to a maximum resolution (see [example.conf](./example.conf)) ([@eisenbruch](https://github.com/eisenbruch) - [#105](https://github.com/patrickkfkan/patreon-dl/pull/105)) - extended to include site-hosted videos
361
-
362
- v3.3.1
363
- - Fix bugs affecting library usage:
364
- - `DB.getInstance()` returning same instance despite different DB path
365
- - `API.getInstance()` returning same instance despite different DB instance
366
- - DB not closed when downloader ends or web server stops
367
-
368
- v3.3.0
369
- - Fix:
370
- - YouTube stream fetching error ([patreon-dl-gui#28](https://github.com/patrickkfkan/patreon-dl-gui/issues/28))
371
- - Unsupported option error with FFmpeg v7.1.0 ([#97](https://github.com/patrickkfkan/patreon-dl/issues/97))
372
- - Browse:
373
- - Add next / previous links to post page ([#93](https://github.com/patrickkfkan/patreon-dl/issues/93))
374
- - Fix media filter error when tier selected but not "Post"
375
- - Process linked attachments in body of posts ([patreon-dl-gui#27](https://github.com/patrickkfkan/patreon-dl-gui/issues/27))
376
- - Some DB optimizations (contrib by @[piperswe](https://github.com/piperswe) - PR #[95](https://github.com/patrickkfkan/patreon-dl/pull/95))
377
-
378
- v3.2.1
379
- - Fix log file path sometimes not sanitized properly on Windows
380
- - API: add support for passing request options to `getCampaign()`
381
- - CLI: add support for using request options from conf file when running with `--list-tiers` / `--list-tiers-uid`
382
-
383
- v3.2.0
384
- - Fix:
385
- - "Initial data not found" error in `patreon.com/cw` pages ([#85](https://github.com/patrickkfkan/patreon-dl/issues/85)) and custom-domain pages
386
- - FFmpeg v7.x compatibility issues ([#86](https://github.com/patrickkfkan/patreon-dl/issues/86))
387
- - Dry-run mode executing ops that should have been skipped
388
- - Wrong log file path returned in some cases
389
- - Various YouTube downloading issues
390
- - Add:
391
- - Support passing options to `yt-dlp` in Vimeo download script
392
- - Support case-sensitivity flag in `config.include.mediaByFilename` options
393
- - Browse:
394
- - Show inline images within post body
395
- - Show YouTube embed HTML content if video not downloaded ([#87](https://github.com/patrickkfkan/patreon-dl/issues/87))
396
- - Display "show more" toggle for long post bodies
397
- - API:
398
- - `Downloader.getCampaign(params)`: enable lookup by `params.campaignId`
399
-
400
- v3.1.0
401
- - Defer database initialization until downloader starts
402
- - UI: fix post column width possibly exceeding screen width
403
- - Add `request.userAgent` option
404
-
405
- v3.0.0
406
- - Add support for browsing downloaded content through integrated web server. Note: this feature will not work for downloads made with previous versions of `patreon-dl`.
407
-
408
- v2.4.3
409
- - Fix YouTube embeds failing to download due to YT changes
410
- - Add fallback download logic to Vimeo download script
411
- - Fix error when downloading video ([#75](https://github.com/patrickkfkan/patreon-dl/issues/75))
412
-
413
- v2.4.2
414
- - Fix YouTube embeds failing to download due to YT changes
415
- - Fix slow YouTube downloads ([#66](https://github.com/patrickkfkan/patreon-dl/issues/66))
416
- - Other minor fixes
417
-
418
- v2.4.1
419
- - Fix Vimeo download script obtaining and downloading from player URL in embed HTML ([#65](https://github.com/patrickkfkan/patreon-dl/issues/65))
420
- - Add `post-url` and `cookie` to available external downloader exec params
421
- - API changes (non-breaking):
422
- - Expose `cookie` in `DownloaderConfig`
423
-
424
-
425
- v2.4.0
426
- - Support additional URL format: `https://www.patreon.com/cw/<creator>/posts`
427
- - Add `stopOn` option ([#63](https://github.com/patrickkfkan/patreon-dl/issues/63))
428
- - Add `proxy` option ([#62](https://github.com/patrickkfkan/patreon-dl/issues/62))
429
- - Fix Vimeo download script
430
- - Fix YouTube embeds failing to download due to YT changes
431
- - API changes (non-breaking):
432
- - Expose `URLHelper`, `FetcherError`
433
- - Add `getDefaultDownloaderOptions()`
434
- - `ConsoleLogger` / `FileLogger`: add `getDefaultConfig()`
435
- - Required Node version bumped to v20.18.1 or higher
436
-
437
- v2.3.0
438
- - Add `podcast` type to `include.postsWithMediaType` option
439
- - Add `include.comments` option
440
- - Fix videos not downloaded in podcast-type posts ([#56](https://github.com/patrickkfkan/patreon-dl/issues/56))
441
-
442
- v2.2.0
443
- - Widen scope of external downloaders to any type of embed (previously only works for video embeds) ([#51](https://github.com/patrickkfkan/patreon-dl/issues/51))
444
- - YouTube downloading now covers embedded YT links
445
- - Fix attachment filenames sometimes have wrong extension
446
-
447
- v2.1.1
448
- - Fix multiple abort signal listeners triggering warning ([#48](https://github.com/patrickkfkan/patreon-dl/issues/48))
449
- - Fix YouTube embeds failing to download due to YT changes ([#50](https://github.com/patrickkfkan/patreon-dl/issues/50))
450
- - Fix inline images of posts sometimes missing from downloads
451
- - Fix status cache: target marked as downloaded without errors despite having errors at task creation stage
452
-
453
- v2.1.0
454
- - Fix attachment downloads following API changes ([#40](https://github.com/patrickkfkan/patreon-dl/issues/40))
455
- - Add support for URL format: `https://www.patreon.com/c/<creator>/posts`
456
- - Check and resolve conflicting destination paths ([#38](https://github.com/patrickkfkan/patreon-dl/issues/38))
457
- - Parse inline content media ([#40](https://github.com/patrickkfkan/patreon-dl/issues/40))
458
-
459
- v2.0.0
460
- - Replace [node-fetch](https://github.com/node-fetch/node-fetch) with Fetch API; required Node.js version bumped to v18 or higher.
461
- - Update dependencies and libraries
462
- - New `include` options:
463
- - `include.postsPublished` ([#29](https://github.com/patrickkfkan/patreon-dl/issues/29))
464
- - `include.mediaByFilename` ([#33](https://github.com/patrickkfkan/patreon-dl/issues/33))
465
- - Bug fixes:
466
- - 403 error when downloading YouTube embeds
467
- - Only first of multiple targets downloaded ([#26](https://github.com/patrickkfkan/patreon-dl/issues/26))
468
-
469
- v1.7.0
470
- - Download next batch of posts before expiry of 'next' URL (fixes [#22](https://github.com/patrickkfkan/patreon-dl/issues/22))
471
- - Add `--dry-run` / `dryRun` option
472
- - Support URL format `https://www.patreon.com/posts/<post_id>`
473
-
474
- v1.6.2
475
- - Fix 'campaign ID not found' error due to Patreon changes
476
-
477
- v1.6.1
478
- - Fix file extension sometimes missing ([#20](https://github.com/patrickkfkan/patreon-dl/issues/20))
479
-
480
- v1.6.0
481
- - Add external downloader support for embedded videos
482
-
483
- v1.5.0
484
- - Add support for fetching by user ID instead of creator vanity ([#18](https://github.com/patrickkfkan/patreon-dl/issues/18)):
485
- - Support URL format `https://www.patreon.com/user/posts?u=<user_id>`
486
- - Overload `PatreonDownloader.getCampaign()` to take `userId` arg
487
- - CLI: add `--list-tiers-uid`
488
-
489
- v1.4.0
490
- - Add ability to filter posts by tier ([#8](https://github.com/patrickkfkan/patreon-dl/issues/8))
491
- - CLI:
492
- - Add `--list-tiers`
493
- - Add support for target-specific `include` options
494
- - Print summary at the end for multiple target URLs ([#13](https://github.com/patrickkfkan/patreon-dl/issues/13))
495
-
496
- v1.3.0
497
- - Add support for multiple target URLs
498
- - Add `content.publishDate` field to the content dir name format ([PR #12](https://github.com/patrickkfkan/patreon-dl/pull/12) by [kazuoteramoto](https://github.com/kazuoteramoto))
499
- - Bug fixes
500
-
501
- v1.2.2
502
- - Fix wrong file extension for some content types
503
- - Fix YouTube API requests throwing errors due to YT changes
504
-
505
- v1.2.1
506
- - Bug fixes
507
-
508
- v1.2.0
509
- - Add support for granular control over:
510
- - posts to include in download based on type of media contained
511
- - the type of media to download
512
- - Bug fixes
513
-
514
- v1.1.1
515
- - Fix initial data parsing following Patreon changes
516
-
517
- v1.1.0
518
- - Add support for downloading embedded YouTube videos
519
-
520
- v1.0.1
521
- - Fix missing types when importing as library
522
- - Fix link in this README
523
-
524
- v1.0.0
525
- - Initial release
314
+ 3.9.0
315
+ - Fix "initial data not found" error for certain targets ([#134](https://github.com/patrickkfkan/patreon-dl/issues/134)).
316
+ - Fix order of images in post content ([patreon-dl-gui#60](https://github.com/patrickkfkan/patreon-dl-gui/issues/60)).
317
+ - Support `media.index` field in `media.filename.format`.
318
+ - Handle conditional separators properly in filename format patterns.
319
+ - Browse: use slugified links.
320
+ - Minor bug fixes.
321
+
322
+ See the [full changelog](./CHANGELOG.md) for older versions.
526
323
 
527
324
  ---
528
325
  This project is licensed under the MIT License and includes third-party software—see the [NOTICE](./NOTICE) file for attributions.
@@ -7,10 +7,10 @@ export declare function CampaignDBMixin<TBase extends UserDBConstructor>(Base: T
7
7
  new (...args: any[]): {
8
8
  saveCampaign(campaign: Campaign | null, downloadDate: Date, overwriteIfExists?: boolean): void;
9
9
  getCampaign(params: GetCampaignParams): Campaign | null;
10
- "__#169@#saveRewards"(campaign: Campaign): void;
11
- "__#169@#doSaveReward"(campaign: Campaign, reward: Reward): void;
10
+ "__#170@#saveRewards"(campaign: Campaign): void;
11
+ "__#170@#doSaveReward"(campaign: Campaign, reward: Reward): void;
12
12
  getCampaignList(params: GetCampaignListParams): CampaignList;
13
- "__#169@#getCampaignWithCounts"(params: GetCampaignParams): CampaignWithCounts | null;
13
+ "__#170@#getCampaignWithCounts"(params: GetCampaignParams): CampaignWithCounts | null;
14
14
  checkCampaignExists(id: string): boolean;
15
15
  saveUser(user: import("../../index.js").User | null): void;
16
16
  getUserByID(id: string): import("../../index.js").User | null;
@@ -5,13 +5,13 @@ import { type CampaignDBConstructor } from './CampaignDBMixin.js';
5
5
  export declare function ContentDBMixin<TBase extends CampaignDBConstructor>(Base: TBase): {
6
6
  new (...args: any[]): {
7
7
  saveContent(content: Post | Product): void;
8
- "__#170@#saveContentMedia"(content: Post | Product): void;
9
- "__#170@#savepostMedia"(post: Post): void;
10
- "__#170@#saveProductMedia"(product: Product): void;
11
- "__#170@#doSaveContentMedia"(content: Post | Product, media: Downloadable, mediaIndex: number, isPreview: boolean): void;
12
- "__#170@#publishedAtToTime"(publishedAt: string | null): number | null;
13
- "__#170@#savePostTiers"(post: Post): void;
14
- "__#170@#doSaveTier"(post: Post, tier: Tier): void;
8
+ "__#171@#saveContentMedia"(content: Post | Product): void;
9
+ "__#171@#savepostMedia"(post: Post): void;
10
+ "__#171@#saveProductMedia"(product: Product): void;
11
+ "__#171@#doSaveContentMedia"(content: Post | Product, media: Downloadable, mediaIndex: number, isPreview: boolean): void;
12
+ "__#171@#publishedAtToTime"(publishedAt: string | null): number | null;
13
+ "__#171@#savePostTiers"(post: Post): void;
14
+ "__#171@#doSaveTier"(post: Post, tier: Tier): void;
15
15
  savePostComments(post: Post, comments: Comment[]): void;
16
16
  checkPostCommentsExist(post: Post): boolean;
17
17
  getContent(id: string, contentType: "post"): PostWithComments | null;
@@ -26,7 +26,7 @@ export declare function ContentDBMixin<TBase extends CampaignDBConstructor>(Base
26
26
  * @param row Must have `details`, `comment_count` and `comments`
27
27
  * @returns
28
28
  */
29
- "__#170@#parseContentRowJoinedComments"(row: any): any;
29
+ "__#171@#parseContentRowJoinedComments"(row: any): any;
30
30
  getContentCountByDate(contentType: ContentType, groupBy: "year" | "month", filter?: {
31
31
  campaign?: Campaign | string | null;
32
32
  date?: Date | null;
@@ -50,19 +50,19 @@ export declare function ContentDBMixin<TBase extends CampaignDBConstructor>(Base
50
50
  collection: Collection;
51
51
  campaignId: string;
52
52
  } | null;
53
- "__#170@#savePostCollection"(post: Post): void;
53
+ "__#171@#savePostCollection"(post: Post): void;
54
54
  getCollectionList(params: GetCollectionListParams): CollectionList;
55
55
  checkCollectionExists(id: string): boolean;
56
56
  checkPostTagExists(id: string, campaign: Campaign | null): boolean;
57
57
  getPostComments(post: Post | string): Comment[] | null;
58
- "__#170@#savePostTags"(post: Post): void;
58
+ "__#171@#savePostTags"(post: Post): void;
59
59
  getPostTagList(params: GetPostTagListParams): PostTagList;
60
60
  saveCampaign(campaign: Campaign | null, downloadDate: Date, overwriteIfExists?: boolean): void;
61
61
  getCampaign(params: import("../types/Campaign").GetCampaignParams): Campaign | null;
62
- "__#169@#saveRewards"(campaign: Campaign): void;
63
- "__#169@#doSaveReward"(campaign: Campaign, reward: import("../../entities").Reward): void;
62
+ "__#170@#saveRewards"(campaign: Campaign): void;
63
+ "__#170@#doSaveReward"(campaign: Campaign, reward: import("../../entities").Reward): void;
64
64
  getCampaignList(params: import("../types/Campaign").GetCampaignListParams): import("../types/Campaign").CampaignList;
65
- "__#169@#getCampaignWithCounts"(params: import("../types/Campaign").GetCampaignParams): import("../types/Campaign").CampaignWithCounts | null;
65
+ "__#170@#getCampaignWithCounts"(params: import("../types/Campaign").GetCampaignParams): import("../types/Campaign").CampaignWithCounts | null;
66
66
  checkCampaignExists(id: string): boolean;
67
67
  saveUser(user: import("../../entities").User | null): void;
68
68
  getUserByID(id: string): import("../../entities").User | null;
@@ -45,13 +45,13 @@ declare const DB: {
45
45
  } & {
46
46
  new (...args: any[]): {
47
47
  saveContent(content: import("../../index.js").Post | import("../../index.js").Product): void;
48
- "__#170@#saveContentMedia"(content: import("../../index.js").Post | import("../../index.js").Product): void;
49
- "__#170@#savepostMedia"(post: import("../../index.js").Post): void;
50
- "__#170@#saveProductMedia"(product: import("../../index.js").Product): void;
51
- "__#170@#doSaveContentMedia"(content: import("../../index.js").Post | import("../../index.js").Product, media: import("../../index.js").Downloadable, mediaIndex: number, isPreview: boolean): void;
52
- "__#170@#publishedAtToTime"(publishedAt: string | null): number | null;
53
- "__#170@#savePostTiers"(post: import("../../index.js").Post): void;
54
- "__#170@#doSaveTier"(post: import("../../index.js").Post, tier: import("../../index.js").Tier): void;
48
+ "__#171@#saveContentMedia"(content: import("../../index.js").Post | import("../../index.js").Product): void;
49
+ "__#171@#savepostMedia"(post: import("../../index.js").Post): void;
50
+ "__#171@#saveProductMedia"(product: import("../../index.js").Product): void;
51
+ "__#171@#doSaveContentMedia"(content: import("../../index.js").Post | import("../../index.js").Product, media: import("../../index.js").Downloadable, mediaIndex: number, isPreview: boolean): void;
52
+ "__#171@#publishedAtToTime"(publishedAt: string | null): number | null;
53
+ "__#171@#savePostTiers"(post: import("../../index.js").Post): void;
54
+ "__#171@#doSaveTier"(post: import("../../index.js").Post, tier: import("../../index.js").Tier): void;
55
55
  savePostComments(post: import("../../index.js").Post, comments: import("../../index.js").Comment[]): void;
56
56
  checkPostCommentsExist(post: import("../../index.js").Post): boolean;
57
57
  getContent(id: string, contentType: "post"): import("../types/Content.js").PostWithComments | null;
@@ -61,7 +61,7 @@ declare const DB: {
61
61
  whereClauses: string[];
62
62
  whereValues: any[];
63
63
  } | undefined, includeTotal?: boolean): import("../types/Content.js").ContentList<T>;
64
- "__#170@#parseContentRowJoinedComments"(row: any): any;
64
+ "__#171@#parseContentRowJoinedComments"(row: any): any;
65
65
  getContentCountByDate(contentType: import("../types/Content.js").ContentType, groupBy: "year" | "month", filter?: {
66
66
  campaign?: import("../../index.js").Campaign | string | null;
67
67
  date?: Date | null;
@@ -85,19 +85,19 @@ declare const DB: {
85
85
  collection: import("../../index.js").Collection;
86
86
  campaignId: string;
87
87
  } | null;
88
- "__#170@#savePostCollection"(post: import("../../index.js").Post): void;
88
+ "__#171@#savePostCollection"(post: import("../../index.js").Post): void;
89
89
  getCollectionList(params: import("../types/Content.js").GetCollectionListParams): import("../types/Content.js").CollectionList;
90
90
  checkCollectionExists(id: string): boolean;
91
91
  checkPostTagExists(id: string, campaign: import("../../index.js").Campaign | null): boolean;
92
92
  getPostComments(post: import("../../index.js").Post | string): import("../../index.js").Comment[] | null;
93
- "__#170@#savePostTags"(post: import("../../index.js").Post): void;
93
+ "__#171@#savePostTags"(post: import("../../index.js").Post): void;
94
94
  getPostTagList(params: import("../types/Content.js").GetPostTagListParams): import("../types/Content.js").PostTagList;
95
95
  saveCampaign(campaign: import("../../index.js").Campaign | null, downloadDate: Date, overwriteIfExists?: boolean): void;
96
96
  getCampaign(params: import("../types/Campaign.js").GetCampaignParams): import("../../index.js").Campaign | null;
97
- "__#169@#saveRewards"(campaign: import("../../index.js").Campaign): void;
98
- "__#169@#doSaveReward"(campaign: import("../../index.js").Campaign, reward: import("../../index.js").Reward): void;
97
+ "__#170@#saveRewards"(campaign: import("../../index.js").Campaign): void;
98
+ "__#170@#doSaveReward"(campaign: import("../../index.js").Campaign, reward: import("../../index.js").Reward): void;
99
99
  getCampaignList(params: import("../types/Campaign.js").GetCampaignListParams): import("../types/Campaign.js").CampaignList;
100
- "__#169@#getCampaignWithCounts"(params: import("../types/Campaign.js").GetCampaignParams): import("../types/Campaign.js").CampaignWithCounts | null;
100
+ "__#170@#getCampaignWithCounts"(params: import("../types/Campaign.js").GetCampaignParams): import("../types/Campaign.js").CampaignWithCounts | null;
101
101
  checkCampaignExists(id: string): boolean;
102
102
  saveUser(user: import("../../index.js").User | null): void;
103
103
  getUserByID(id: string): import("../../index.js").User | null;
@@ -147,10 +147,10 @@ declare const DB: {
147
147
  new (...args: any[]): {
148
148
  saveCampaign(campaign: import("../../index.js").Campaign | null, downloadDate: Date, overwriteIfExists?: boolean): void;
149
149
  getCampaign(params: import("../types/Campaign.js").GetCampaignParams): import("../../index.js").Campaign | null;
150
- "__#169@#saveRewards"(campaign: import("../../index.js").Campaign): void;
151
- "__#169@#doSaveReward"(campaign: import("../../index.js").Campaign, reward: import("../../index.js").Reward): void;
150
+ "__#170@#saveRewards"(campaign: import("../../index.js").Campaign): void;
151
+ "__#170@#doSaveReward"(campaign: import("../../index.js").Campaign, reward: import("../../index.js").Reward): void;
152
152
  getCampaignList(params: import("../types/Campaign.js").GetCampaignListParams): import("../types/Campaign.js").CampaignList;
153
- "__#169@#getCampaignWithCounts"(params: import("../types/Campaign.js").GetCampaignParams): import("../types/Campaign.js").CampaignWithCounts | null;
153
+ "__#170@#getCampaignWithCounts"(params: import("../types/Campaign.js").GetCampaignParams): import("../types/Campaign.js").CampaignWithCounts | null;
154
154
  checkCampaignExists(id: string): boolean;
155
155
  saveUser(user: import("../../index.js").User | null): void;
156
156
  getUserByID(id: string): import("../../index.js").User | null;
@@ -30,7 +30,12 @@ class CampaignAPIRequestHandler extends Basehandler {
30
30
  res.json(list);
31
31
  }
32
32
  handleGetRequest(req, res, id) {
33
+ const byVanity = req.query['by_vanity'] ? this.getQueryParamValue(req, 'by_vanity', ['true', 'false']) === 'true' ? true : false : undefined;
33
34
  const withCounts = req.query['with_counts'] ? this.getQueryParamValue(req, 'with_counts', ['true', 'false']) === 'true' ? true : false : undefined;
35
+ if (byVanity) {
36
+ res.json(__classPrivateFieldGet(this, _CampaignAPIRequestHandler_api, "f").getCampaign({ vanity: id, withCounts }));
37
+ return;
38
+ }
34
39
  res.json(__classPrivateFieldGet(this, _CampaignAPIRequestHandler_api, "f").getCampaign({ id, withCounts }));
35
40
  }
36
41
  }
@@ -1 +1 @@
1
- {"version":3,"file":"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AW,CAAC,EAAC,EAAE,EAAE,UAAU,EAAC,CAAC,CAAC,CAAC;IACpD,CAAC;CACF;;eAlCoB,yBAAyB","sourcesContent":["import { type Request, type Response } from 'express';\nimport { type Logger } from '../../../utils/logging';\nimport { type APIInstance } from '../../api';\nimport Basehandler from './BaseHandler.js';\nimport { type CampaignListSortBy } from '../../types/Campaign.js';\n\nconst DEFAULT_ITEMS_PER_PAGE = 20;\n\nexport default class CampaignAPIRequestHandler extends Basehandler {\n name = 'CampaignAPIRequestHandler';\n\n #api: APIInstance;\n\n constructor(api: APIInstance, logger?: Logger | null) {\n super(logger);\n this.#api = api;\n }\n\n handleListRequest(req: Request, res: Response) {\n const { limit, offset } = this.getPaginationParams(req, DEFAULT_ITEMS_PER_PAGE);\n const sortBy = this.getQueryParamValue<CampaignListSortBy>(\n req,\n 'sort_by',\n ['a-z', 'z-a', 'most_content', 'most_media', 'last_downloaded'],\n 'a-z'\n );\n const list = this.#api.getCampaignList({\n sortBy,\n limit,\n offset\n });\n res.json(list);\n }\n\n handleGetRequest(req: Request, res: Response, id: string) {\n const withCounts = req.query['with_counts'] ? this.getQueryParamValue<'true' | 'false'>(\n req,\n 'with_counts',\n ['true', 'false']\n ) === 'true' ? true : false : undefined;\n res.json(this.#api.getCampaign({id, withCounts}));\n }\n}"]}
1
+ {"version":3,"file":"CampaignAPIRequesthandler.js","sourceRoot":"","sources":["../../../../src/browse/server/handler/CampaignAPIRequesthandler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAG3C,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAElC,MAAqB,yBAA0B,SAAQ,WAAW;IAKhE,YAAY,GAAgB,EAAE,MAAsB;QAClD,KAAK,CAAC,MAAM,CAAC,CAAC;QALhB,SAAI,GAAG,2BAA2B,CAAC;QAEnC,iDAAkB;QAIhB,uBAAA,IAAI,kCAAQ,GAAG,MAAA,CAAC;IAClB,CAAC;IAED,iBAAiB,C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AC,uBAAA,IAAI,sCAAK,CAAC,WAAW,CAAC,EAAC,EAAE,EAAE,UAAU,EAAC,CAAC,CAAC,CAAC;IACpD,CAAC;CACF;;eA3CoB,yBAAyB","sourcesContent":["import { type Request, type Response } from 'express';\nimport { type Logger } from '../../../utils/logging';\nimport { type APIInstance } from '../../api';\nimport Basehandler from './BaseHandler.js';\nimport { type CampaignListSortBy } from '../../types/Campaign.js';\n\nconst DEFAULT_ITEMS_PER_PAGE = 20;\n\nexport default class CampaignAPIRequestHandler extends Basehandler {\n name = 'CampaignAPIRequestHandler';\n\n #api: APIInstance;\n\n constructor(api: APIInstance, logger?: Logger | null) {\n super(logger);\n this.#api = api;\n }\n\n handleListRequest(req: Request, res: Response) {\n const { limit, offset } = this.getPaginationParams(req, DEFAULT_ITEMS_PER_PAGE);\n const sortBy = this.getQueryParamValue<CampaignListSortBy>(\n req,\n 'sort_by',\n ['a-z', 'z-a', 'most_content', 'most_media', 'last_downloaded'],\n 'a-z'\n );\n const list = this.#api.getCampaignList({\n sortBy,\n limit,\n offset\n });\n res.json(list);\n }\n\n handleGetRequest(req: Request, res: Response, id: string) {\n const byVanity = req.query['by_vanity'] ? this.getQueryParamValue<'true' | 'false'>(\n req,\n 'by_vanity',\n ['true', 'false']\n ) === 'true' ? true : false : undefined;\n const withCounts = req.query['with_counts'] ? this.getQueryParamValue<'true' | 'false'>(\n req,\n 'with_counts',\n ['true', 'false']\n ) === 'true' ? true : false : undefined;\n if (byVanity) {\n res.json(this.#api.getCampaign({ vanity: id, withCounts }));\n return;\n }\n res.json(this.#api.getCampaign({id, withCounts}));\n }\n}"]}