glitch-javascript-sdk 3.2.24 → 3.2.26

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.
@@ -40,6 +40,16 @@ export type PrContactVerificationStatus =
40
40
  */
41
41
  export type PrLinkStatus = "unverified" | "ok" | "redirected" | "broken" | "blocked" | "failed" | "stale";
42
42
 
43
+ /**
44
+ * Refresh state for discovered RSS/Atom/JSON feeds.
45
+ */
46
+ export type PrFeedStatus = "unverified" | "ok" | "empty" | "blocked" | "failed" | "stale" | "needs_review";
47
+
48
+ /**
49
+ * Feed format detected during PR content ingestion.
50
+ */
51
+ export type PrFeedType = "rss" | "atom" | "json" | "unknown";
52
+
43
53
  /**
44
54
  * Filters accepted by `/pr/publications` and `/pr/report`.
45
55
  *
@@ -85,6 +95,41 @@ export interface PrPeopleSearchParams {
85
95
  per_page?: number;
86
96
  }
87
97
 
98
+ /**
99
+ * Filters accepted by `/pr/feeds`.
100
+ */
101
+ export interface PrFeedSearchParams {
102
+ q?: string;
103
+ publication_id?: string;
104
+ feed_type?: PrFeedType;
105
+ status?: PrFeedStatus;
106
+ source?: string;
107
+ has_stories?: boolean;
108
+ sort?: "title" | "-title" | "feed_type" | "-feed_type" | "status" | "-status" | "last_fetched_at" | "-last_fetched_at" | "next_fetch_at" | "-next_fetch_at" | "updated_at" | "-updated_at" | string;
109
+ page?: number;
110
+ per_page?: number;
111
+ include_raw?: boolean;
112
+ }
113
+
114
+ /**
115
+ * Filters accepted by `/pr/stories`.
116
+ */
117
+ export interface PrStorySearchParams {
118
+ q?: string;
119
+ publication_id?: string;
120
+ pr_feed_id?: string;
121
+ pr_person_id?: string;
122
+ story_type?: string;
123
+ language?: string;
124
+ ingestion_status?: string;
125
+ has_author?: boolean;
126
+ published_after?: string;
127
+ published_before?: string;
128
+ sort?: "published_at" | "-published_at" | "updated_at" | "-updated_at" | "title" | "-title" | string;
129
+ page?: number;
130
+ per_page?: number;
131
+ }
132
+
88
133
  /**
89
134
  * Filters accepted by `/pr/tags`.
90
135
  */
@@ -106,6 +151,14 @@ export interface PrTitleMatchParams extends PrPublicationSearchParams {
106
151
  limit?: number;
107
152
  }
108
153
 
154
+ /**
155
+ * Query parameters accepted by `/titles/{title_id}/pr/research`.
156
+ */
157
+ export interface PrTitleResearchParams extends PrStorySearchParams {
158
+ limit?: number;
159
+ story_sort?: string;
160
+ }
161
+
109
162
  /**
110
163
  * Request body accepted by `/admin/pr/verification/queue`.
111
164
  */
@@ -115,6 +168,36 @@ export interface PrQueueVerificationRequest {
115
168
  link_ids?: string[];
116
169
  }
117
170
 
171
+ /**
172
+ * Review-only PR draft request for `/titles/{title_id}/pr/drafts`.
173
+ */
174
+ export interface PrTitleDraftRequest {
175
+ publication_id?: string;
176
+ pr_person_id?: string;
177
+ q?: string;
178
+ prompt?: string;
179
+ press_kit_url?: string;
180
+ trailer_url?: string;
181
+ demo_or_review_key?: string;
182
+ embargo_or_timing?: string;
183
+ sender?: {
184
+ name?: string;
185
+ };
186
+ use_ai?: boolean;
187
+ }
188
+
189
+ /**
190
+ * Admin request body for `/admin/pr/feeds/refresh`.
191
+ */
192
+ export interface PrFeedRefreshRequest {
193
+ discover?: boolean;
194
+ due?: boolean;
195
+ queue?: boolean;
196
+ limit?: number;
197
+ feed_ids?: string[];
198
+ publication_ids?: string[];
199
+ }
200
+
118
201
  /**
119
202
  * A normalized metadata tag used to filter and match PR outlets, people, and
120
203
  * roles.
@@ -166,6 +249,93 @@ export interface PrLink {
166
249
  updated_at?: string | null;
167
250
  }
168
251
 
252
+ /**
253
+ * RSS/Atom/JSON feed discovered for a publication and used for story research.
254
+ */
255
+ export interface PrFeed {
256
+ id: string;
257
+ publication_id: string;
258
+ pr_link_id?: string | null;
259
+ feed_url: string;
260
+ canonical_url?: string | null;
261
+ feed_type: PrFeedType;
262
+ title?: string | null;
263
+ description?: string | null;
264
+ language?: string | null;
265
+ status: PrFeedStatus;
266
+ http_status?: number | null;
267
+ content_type?: string | null;
268
+ etag?: string | null;
269
+ raw_feed_hash?: string | null;
270
+ raw_feed_content?: string | null;
271
+ raw_feed_size?: number;
272
+ last_modified_at?: string | null;
273
+ last_fetched_at?: string | null;
274
+ next_fetch_at?: string | null;
275
+ item_count_last_fetch: number;
276
+ source?: string | null;
277
+ last_error?: string | null;
278
+ publication?: PrPublication | null;
279
+ stories_count?: number;
280
+ stories?: PrStory[];
281
+ metadata?: Record<string, any>;
282
+ created_at?: string | null;
283
+ updated_at?: string | null;
284
+ }
285
+
286
+ /**
287
+ * A story, article, guide, review, or episode imported from a PR feed.
288
+ */
289
+ export interface PrStory {
290
+ id: string;
291
+ publication_id: string;
292
+ pr_feed_id?: string | null;
293
+ canonical_url?: string | null;
294
+ guid?: string | null;
295
+ title: string;
296
+ dek?: string | null;
297
+ summary?: string | null;
298
+ content_excerpt?: string | null;
299
+ content_hash?: string | null;
300
+ author_name_raw?: string | null;
301
+ author_email_raw?: string | null;
302
+ author_url_raw?: string | null;
303
+ published_at?: string | null;
304
+ updated_at_feed?: string | null;
305
+ story_type?: string | null;
306
+ language?: string | null;
307
+ categories?: string[];
308
+ tags?: string[];
309
+ media_url?: string | null;
310
+ analysis?: Record<string, any>;
311
+ ingestion_status?: string | null;
312
+ publication?: PrPublication | null;
313
+ feed?: PrFeed | null;
314
+ authors?: PrStoryAuthor[];
315
+ created_at?: string | null;
316
+ updated_at?: string | null;
317
+ }
318
+
319
+ /**
320
+ * Raw byline evidence and optional match to a known PR contact.
321
+ */
322
+ export interface PrStoryAuthor {
323
+ id: string;
324
+ pr_story_id: string;
325
+ publication_id?: string | null;
326
+ pr_person_id?: string | null;
327
+ author_name?: string | null;
328
+ author_email?: string | null;
329
+ author_url?: string | null;
330
+ confidence?: number | null;
331
+ match_source?: string | null;
332
+ evidence?: Record<string, any>;
333
+ story?: PrStory | null;
334
+ person?: PrPerson | null;
335
+ created_at?: string | null;
336
+ updated_at?: string | null;
337
+ }
338
+
169
339
  /**
170
340
  * A normalized way to reach an outlet, person, or publication role.
171
341
  */
@@ -245,9 +415,13 @@ export interface PrPublication {
245
415
  people_count?: number;
246
416
  contact_points_count?: number;
247
417
  links_count?: number;
418
+ feeds_count?: number;
419
+ stories_count?: number;
248
420
  people?: PublicationPerson[];
249
421
  contact_points?: PrContactPoint[];
250
422
  links?: PrLink[];
423
+ feeds?: PrFeed[];
424
+ stories?: PrStory[];
251
425
  tags?: PrTag[];
252
426
  metadata?: Record<string, any>;
253
427
  created_at?: string | null;
@@ -275,9 +449,11 @@ export interface PrPerson {
275
449
  roles_count?: number;
276
450
  contact_points_count?: number;
277
451
  links_count?: number;
452
+ stories_count?: number;
278
453
  roles?: PublicationPerson[];
279
454
  contact_points?: PrContactPoint[];
280
455
  links?: PrLink[];
456
+ stories?: PrStoryAuthor[];
281
457
  tags?: PrTag[];
282
458
  metadata?: Record<string, any>;
283
459
  created_at?: string | null;
@@ -319,6 +495,16 @@ export interface PrDirectoryReport {
319
495
  total: number;
320
496
  by_namespace: Record<string, number>;
321
497
  };
498
+ feeds: {
499
+ total: number;
500
+ by_status: Record<string, number>;
501
+ due_for_fetch: number;
502
+ };
503
+ stories: {
504
+ total: number;
505
+ with_author: number;
506
+ by_type: Record<string, number>;
507
+ };
322
508
  }
323
509
 
324
510
  /**
@@ -335,6 +521,70 @@ export interface PrTitleMatch {
335
521
  evidence_links: PrLink[];
336
522
  }
337
523
 
524
+ /**
525
+ * Title-scoped PR research workspace response.
526
+ */
527
+ export interface PrTitleResearchResponse {
528
+ generated_at: string;
529
+ title: {
530
+ id: string;
531
+ name: string;
532
+ slug?: string | null;
533
+ short_description?: string | null;
534
+ description?: string | null;
535
+ genres?: string[];
536
+ platforms?: string[];
537
+ website_url?: string | null;
538
+ steam_url?: string | null;
539
+ itch_url?: string | null;
540
+ demo_url?: string | null;
541
+ video_url?: string | null;
542
+ };
543
+ readiness: {
544
+ score: number;
545
+ strengths: string[];
546
+ gaps: string[];
547
+ };
548
+ publication_matches: PrTitleMatch[];
549
+ stories: PrStory[];
550
+ story_summary: {
551
+ count: number;
552
+ with_known_author: number;
553
+ publication_count: number;
554
+ };
555
+ suggested_next_steps: string[];
556
+ }
557
+
558
+ /**
559
+ * Structured draft fields returned alongside the formatted HTML email body.
560
+ */
561
+ export interface PrOutreachDraft {
562
+ subject?: string | null;
563
+ opener?: string | null;
564
+ body?: string | null;
565
+ body_html?: string | null;
566
+ key_points?: string[];
567
+ personalization_notes?: string[];
568
+ review_notes?: string[];
569
+ missing_context_warnings?: string[];
570
+ [key: string]: any;
571
+ }
572
+
573
+ /**
574
+ * Review-only PR draft response. The API never sends email from this endpoint.
575
+ */
576
+ export interface PrTitleDraftResponse {
577
+ draft_status: "draft_only_not_sent" | "no_verified_email_found" | "no_publication_found" | string;
578
+ emails_sent: boolean;
579
+ publication?: PrPublication | null;
580
+ person?: PrPerson | null;
581
+ target: Record<string, any>;
582
+ recent_stories: PrStory[];
583
+ draft: PrOutreachDraft;
584
+ body_html: string;
585
+ review_notes: string[];
586
+ }
587
+
338
588
  /**
339
589
  * Response body returned after queueing PR verification jobs.
340
590
  */
@@ -342,13 +592,22 @@ export interface PrQueueVerificationResponse {
342
592
  queued: number;
343
593
  }
344
594
 
595
+ /**
596
+ * Response body returned after discovering, queueing, or fetching PR feeds.
597
+ */
598
+ export interface PrFeedRefreshResponse {
599
+ discovered: number;
600
+ queued: number;
601
+ fetched: number;
602
+ }
603
+
345
604
  /**
346
605
  * SDK wrapper for the PR Directory API.
347
606
  *
348
607
  * The PR directory is read-friendly by default: public endpoints expose
349
- * searchable publications, people, tags, and reporting metrics. Authenticated
350
- * title admins can request title-specific PR matches, and site admins can queue
351
- * monthly-style verification jobs.
608
+ * searchable publications, people, feeds, stories, tags, and reporting metrics.
609
+ * Authenticated title admins can request title-specific research and review-only
610
+ * outreach drafts, and site admins can queue verification or feed refresh jobs.
352
611
  */
353
612
  class PrDirectory {
354
613
  /**
@@ -400,6 +659,35 @@ class PrDirectory {
400
659
  return Requests.processRoute(PrDirectoryRoutes.routes.viewPerson, {}, { person_id }, params);
401
660
  }
402
661
 
662
+ /**
663
+ * Search discovered RSS/Atom/JSON feeds across known publications.
664
+ */
665
+ public static listFeeds<T = PrFeed[]>(params?: PrFeedSearchParams): AxiosPromise<Response<T>> {
666
+ return Requests.processRoute(PrDirectoryRoutes.routes.listFeeds, {}, {}, params);
667
+ }
668
+
669
+ /**
670
+ * Retrieve one feed with freshness metadata and recent imported stories.
671
+ * Pass `include_raw: true` to request the stored XML/RSS payload.
672
+ */
673
+ public static viewFeed<T = PrFeed>(feed_id: string, params?: PrFeedSearchParams): AxiosPromise<Response<T>> {
674
+ return Requests.processRoute(PrDirectoryRoutes.routes.viewFeed, {}, { feed_id }, params);
675
+ }
676
+
677
+ /**
678
+ * Search imported stories, reviews, guides, and episodes by outlet or byline.
679
+ */
680
+ public static listStories<T = PrStory[]>(params?: PrStorySearchParams): AxiosPromise<Response<T>> {
681
+ return Requests.processRoute(PrDirectoryRoutes.routes.listStories, {}, {}, params);
682
+ }
683
+
684
+ /**
685
+ * Retrieve one imported story with feed, publication, and byline evidence.
686
+ */
687
+ public static viewStory<T = PrStory>(story_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
688
+ return Requests.processRoute(PrDirectoryRoutes.routes.viewStory, {}, { story_id }, params);
689
+ }
690
+
403
691
  /**
404
692
  * List the normalized tag vocabulary used for PR search, filters, matching,
405
693
  * and reporting.
@@ -424,6 +712,22 @@ class PrDirectory {
424
712
  return Requests.processRoute(PrDirectoryRoutes.routes.titleMatches, {}, { title_id }, params);
425
713
  }
426
714
 
715
+ /**
716
+ * Get a title-scoped PR research workspace with outlet matches, recent story
717
+ * context, media kit readiness, and next steps.
718
+ */
719
+ public static titleResearch<T = PrTitleResearchResponse>(title_id: string, params?: PrTitleResearchParams): AxiosPromise<Response<T>> {
720
+ return Requests.processRoute(PrDirectoryRoutes.routes.titleResearch, {}, { title_id }, params);
721
+ }
722
+
723
+ /**
724
+ * Create a formatted, review-only PR email draft for a selected title target.
725
+ * The backend returns HTML with paragraphs, bullets, and links but sends no email.
726
+ */
727
+ public static titleDraft<T = PrTitleDraftResponse>(title_id: string, data?: PrTitleDraftRequest, params?: Record<string, any>): AxiosPromise<Response<T>> {
728
+ return Requests.processRoute(PrDirectoryRoutes.routes.titleDraft, data || {}, { title_id }, params);
729
+ }
730
+
427
731
  /**
428
732
  * Queue PR verification jobs. Requires a site-admin auth token.
429
733
  *
@@ -435,6 +739,14 @@ class PrDirectory {
435
739
  public static queueVerification<T = PrQueueVerificationResponse>(data?: PrQueueVerificationRequest, params?: Record<string, any>): AxiosPromise<Response<T>> {
436
740
  return Requests.processRoute(PrDirectoryRoutes.routes.queueVerification, data || {}, {}, params);
437
741
  }
742
+
743
+ /**
744
+ * Discover, queue, or synchronously refresh PR feeds. Requires a site-admin
745
+ * auth token.
746
+ */
747
+ public static refreshFeeds<T = PrFeedRefreshResponse>(data?: PrFeedRefreshRequest, params?: Record<string, any>): AxiosPromise<Response<T>> {
748
+ return Requests.processRoute(PrDirectoryRoutes.routes.refreshFeeds, data || {}, {}, params);
749
+ }
438
750
  }
439
751
 
440
752
  export default PrDirectory;
@@ -31,6 +31,7 @@ class GameShowsRoute {
31
31
  analyticsReport: { url: '/gameshows/{show_id}/analytics/report', method: HTTP_METHODS.GET },
32
32
  joinWishlist: { url: '/gameshows/{show_id}/wishlist', method: HTTP_METHODS.POST },
33
33
  listWishlist: { url: '/gameshows/{show_id}/wishlist', method: HTTP_METHODS.GET },
34
+ listForTitle: { url: '/titles/{title_id}/gameshows', method: HTTP_METHODS.GET },
34
35
  };
35
36
 
36
37
  }
@@ -5,7 +5,7 @@ import HTTP_METHODS from "../constants/HttpMethods";
5
5
  * Route declarations for the PR Directory API.
6
6
  *
7
7
  * These mirror the Laravel routes under `/api/pr/*` and the title-scoped
8
- * matcher route under `/api/titles/{title_id}/pr/matches`. Keeping the URL
8
+ * matcher/research routes under `/api/titles/{title_id}/pr/*`. Keeping the URL
9
9
  * templates in one place lets the SDK methods stay small and consistent with
10
10
  * the rest of the package's route-wrapper pattern.
11
11
  */
@@ -15,10 +15,17 @@ class PrDirectoryRoutes {
15
15
  viewPublication: { url: "/pr/publications/{publication_id}", method: HTTP_METHODS.GET },
16
16
  listPeople: { url: "/pr/people", method: HTTP_METHODS.GET },
17
17
  viewPerson: { url: "/pr/people/{person_id}", method: HTTP_METHODS.GET },
18
+ listFeeds: { url: "/pr/feeds", method: HTTP_METHODS.GET },
19
+ viewFeed: { url: "/pr/feeds/{feed_id}", method: HTTP_METHODS.GET },
20
+ listStories: { url: "/pr/stories", method: HTTP_METHODS.GET },
21
+ viewStory: { url: "/pr/stories/{story_id}", method: HTTP_METHODS.GET },
18
22
  listTags: { url: "/pr/tags", method: HTTP_METHODS.GET },
19
23
  report: { url: "/pr/report", method: HTTP_METHODS.GET },
20
24
  titleMatches: { url: "/titles/{title_id}/pr/matches", method: HTTP_METHODS.GET },
25
+ titleResearch: { url: "/titles/{title_id}/pr/research", method: HTTP_METHODS.GET },
26
+ titleDraft: { url: "/titles/{title_id}/pr/drafts", method: HTTP_METHODS.POST },
21
27
  queueVerification: { url: "/admin/pr/verification/queue", method: HTTP_METHODS.POST },
28
+ refreshFeeds: { url: "/admin/pr/feeds/refresh", method: HTTP_METHODS.POST },
22
29
  };
23
30
  }
24
31