glitch-javascript-sdk 3.2.25 → 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.
- package/dist/cjs/index.js +57 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/PrDirectory.d.ts +280 -3
- package/dist/esm/index.js +57 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/PrDirectoryRoutes.d.ts +1 -1
- package/dist/index.d.ts +280 -3
- package/package.json +1 -1
- package/src/api/PrDirectory.ts +315 -3
- package/src/routes/PrDirectoryRoutes.ts +8 -1
|
@@ -3,7 +3,7 @@ import Route from "./interface";
|
|
|
3
3
|
* Route declarations for the PR Directory API.
|
|
4
4
|
*
|
|
5
5
|
* These mirror the Laravel routes under `/api/pr/*` and the title-scoped
|
|
6
|
-
* matcher
|
|
6
|
+
* matcher/research routes under `/api/titles/{title_id}/pr/*`. Keeping the URL
|
|
7
7
|
* templates in one place lets the SDK methods stay small and consistent with
|
|
8
8
|
* the rest of the package's route-wrapper pattern.
|
|
9
9
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -9658,6 +9658,14 @@ type PrContactVerificationStatus = "unverified" | "verified" | "stale" | "bounce
|
|
|
9658
9658
|
* Link refresh status for evidence URLs.
|
|
9659
9659
|
*/
|
|
9660
9660
|
type PrLinkStatus = "unverified" | "ok" | "redirected" | "broken" | "blocked" | "failed" | "stale";
|
|
9661
|
+
/**
|
|
9662
|
+
* Refresh state for discovered RSS/Atom/JSON feeds.
|
|
9663
|
+
*/
|
|
9664
|
+
type PrFeedStatus = "unverified" | "ok" | "empty" | "blocked" | "failed" | "stale" | "needs_review";
|
|
9665
|
+
/**
|
|
9666
|
+
* Feed format detected during PR content ingestion.
|
|
9667
|
+
*/
|
|
9668
|
+
type PrFeedType = "rss" | "atom" | "json" | "unknown";
|
|
9661
9669
|
/**
|
|
9662
9670
|
* Filters accepted by `/pr/publications` and `/pr/report`.
|
|
9663
9671
|
*
|
|
@@ -9701,6 +9709,39 @@ interface PrPeopleSearchParams {
|
|
|
9701
9709
|
page?: number;
|
|
9702
9710
|
per_page?: number;
|
|
9703
9711
|
}
|
|
9712
|
+
/**
|
|
9713
|
+
* Filters accepted by `/pr/feeds`.
|
|
9714
|
+
*/
|
|
9715
|
+
interface PrFeedSearchParams {
|
|
9716
|
+
q?: string;
|
|
9717
|
+
publication_id?: string;
|
|
9718
|
+
feed_type?: PrFeedType;
|
|
9719
|
+
status?: PrFeedStatus;
|
|
9720
|
+
source?: string;
|
|
9721
|
+
has_stories?: boolean;
|
|
9722
|
+
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;
|
|
9723
|
+
page?: number;
|
|
9724
|
+
per_page?: number;
|
|
9725
|
+
include_raw?: boolean;
|
|
9726
|
+
}
|
|
9727
|
+
/**
|
|
9728
|
+
* Filters accepted by `/pr/stories`.
|
|
9729
|
+
*/
|
|
9730
|
+
interface PrStorySearchParams {
|
|
9731
|
+
q?: string;
|
|
9732
|
+
publication_id?: string;
|
|
9733
|
+
pr_feed_id?: string;
|
|
9734
|
+
pr_person_id?: string;
|
|
9735
|
+
story_type?: string;
|
|
9736
|
+
language?: string;
|
|
9737
|
+
ingestion_status?: string;
|
|
9738
|
+
has_author?: boolean;
|
|
9739
|
+
published_after?: string;
|
|
9740
|
+
published_before?: string;
|
|
9741
|
+
sort?: "published_at" | "-published_at" | "updated_at" | "-updated_at" | "title" | "-title" | string;
|
|
9742
|
+
page?: number;
|
|
9743
|
+
per_page?: number;
|
|
9744
|
+
}
|
|
9704
9745
|
/**
|
|
9705
9746
|
* Filters accepted by `/pr/tags`.
|
|
9706
9747
|
*/
|
|
@@ -9720,6 +9761,13 @@ interface PrTitleMatchParams extends PrPublicationSearchParams {
|
|
|
9720
9761
|
audiences?: string[];
|
|
9721
9762
|
limit?: number;
|
|
9722
9763
|
}
|
|
9764
|
+
/**
|
|
9765
|
+
* Query parameters accepted by `/titles/{title_id}/pr/research`.
|
|
9766
|
+
*/
|
|
9767
|
+
interface PrTitleResearchParams extends PrStorySearchParams {
|
|
9768
|
+
limit?: number;
|
|
9769
|
+
story_sort?: string;
|
|
9770
|
+
}
|
|
9723
9771
|
/**
|
|
9724
9772
|
* Request body accepted by `/admin/pr/verification/queue`.
|
|
9725
9773
|
*/
|
|
@@ -9728,6 +9776,34 @@ interface PrQueueVerificationRequest {
|
|
|
9728
9776
|
limit?: number;
|
|
9729
9777
|
link_ids?: string[];
|
|
9730
9778
|
}
|
|
9779
|
+
/**
|
|
9780
|
+
* Review-only PR draft request for `/titles/{title_id}/pr/drafts`.
|
|
9781
|
+
*/
|
|
9782
|
+
interface PrTitleDraftRequest {
|
|
9783
|
+
publication_id?: string;
|
|
9784
|
+
pr_person_id?: string;
|
|
9785
|
+
q?: string;
|
|
9786
|
+
prompt?: string;
|
|
9787
|
+
press_kit_url?: string;
|
|
9788
|
+
trailer_url?: string;
|
|
9789
|
+
demo_or_review_key?: string;
|
|
9790
|
+
embargo_or_timing?: string;
|
|
9791
|
+
sender?: {
|
|
9792
|
+
name?: string;
|
|
9793
|
+
};
|
|
9794
|
+
use_ai?: boolean;
|
|
9795
|
+
}
|
|
9796
|
+
/**
|
|
9797
|
+
* Admin request body for `/admin/pr/feeds/refresh`.
|
|
9798
|
+
*/
|
|
9799
|
+
interface PrFeedRefreshRequest {
|
|
9800
|
+
discover?: boolean;
|
|
9801
|
+
due?: boolean;
|
|
9802
|
+
queue?: boolean;
|
|
9803
|
+
limit?: number;
|
|
9804
|
+
feed_ids?: string[];
|
|
9805
|
+
publication_ids?: string[];
|
|
9806
|
+
}
|
|
9731
9807
|
/**
|
|
9732
9808
|
* A normalized metadata tag used to filter and match PR outlets, people, and
|
|
9733
9809
|
* roles.
|
|
@@ -9777,6 +9853,90 @@ interface PrLink {
|
|
|
9777
9853
|
created_at?: string | null;
|
|
9778
9854
|
updated_at?: string | null;
|
|
9779
9855
|
}
|
|
9856
|
+
/**
|
|
9857
|
+
* RSS/Atom/JSON feed discovered for a publication and used for story research.
|
|
9858
|
+
*/
|
|
9859
|
+
interface PrFeed {
|
|
9860
|
+
id: string;
|
|
9861
|
+
publication_id: string;
|
|
9862
|
+
pr_link_id?: string | null;
|
|
9863
|
+
feed_url: string;
|
|
9864
|
+
canonical_url?: string | null;
|
|
9865
|
+
feed_type: PrFeedType;
|
|
9866
|
+
title?: string | null;
|
|
9867
|
+
description?: string | null;
|
|
9868
|
+
language?: string | null;
|
|
9869
|
+
status: PrFeedStatus;
|
|
9870
|
+
http_status?: number | null;
|
|
9871
|
+
content_type?: string | null;
|
|
9872
|
+
etag?: string | null;
|
|
9873
|
+
raw_feed_hash?: string | null;
|
|
9874
|
+
raw_feed_content?: string | null;
|
|
9875
|
+
raw_feed_size?: number;
|
|
9876
|
+
last_modified_at?: string | null;
|
|
9877
|
+
last_fetched_at?: string | null;
|
|
9878
|
+
next_fetch_at?: string | null;
|
|
9879
|
+
item_count_last_fetch: number;
|
|
9880
|
+
source?: string | null;
|
|
9881
|
+
last_error?: string | null;
|
|
9882
|
+
publication?: PrPublication | null;
|
|
9883
|
+
stories_count?: number;
|
|
9884
|
+
stories?: PrStory[];
|
|
9885
|
+
metadata?: Record<string, any>;
|
|
9886
|
+
created_at?: string | null;
|
|
9887
|
+
updated_at?: string | null;
|
|
9888
|
+
}
|
|
9889
|
+
/**
|
|
9890
|
+
* A story, article, guide, review, or episode imported from a PR feed.
|
|
9891
|
+
*/
|
|
9892
|
+
interface PrStory {
|
|
9893
|
+
id: string;
|
|
9894
|
+
publication_id: string;
|
|
9895
|
+
pr_feed_id?: string | null;
|
|
9896
|
+
canonical_url?: string | null;
|
|
9897
|
+
guid?: string | null;
|
|
9898
|
+
title: string;
|
|
9899
|
+
dek?: string | null;
|
|
9900
|
+
summary?: string | null;
|
|
9901
|
+
content_excerpt?: string | null;
|
|
9902
|
+
content_hash?: string | null;
|
|
9903
|
+
author_name_raw?: string | null;
|
|
9904
|
+
author_email_raw?: string | null;
|
|
9905
|
+
author_url_raw?: string | null;
|
|
9906
|
+
published_at?: string | null;
|
|
9907
|
+
updated_at_feed?: string | null;
|
|
9908
|
+
story_type?: string | null;
|
|
9909
|
+
language?: string | null;
|
|
9910
|
+
categories?: string[];
|
|
9911
|
+
tags?: string[];
|
|
9912
|
+
media_url?: string | null;
|
|
9913
|
+
analysis?: Record<string, any>;
|
|
9914
|
+
ingestion_status?: string | null;
|
|
9915
|
+
publication?: PrPublication | null;
|
|
9916
|
+
feed?: PrFeed | null;
|
|
9917
|
+
authors?: PrStoryAuthor[];
|
|
9918
|
+
created_at?: string | null;
|
|
9919
|
+
updated_at?: string | null;
|
|
9920
|
+
}
|
|
9921
|
+
/**
|
|
9922
|
+
* Raw byline evidence and optional match to a known PR contact.
|
|
9923
|
+
*/
|
|
9924
|
+
interface PrStoryAuthor {
|
|
9925
|
+
id: string;
|
|
9926
|
+
pr_story_id: string;
|
|
9927
|
+
publication_id?: string | null;
|
|
9928
|
+
pr_person_id?: string | null;
|
|
9929
|
+
author_name?: string | null;
|
|
9930
|
+
author_email?: string | null;
|
|
9931
|
+
author_url?: string | null;
|
|
9932
|
+
confidence?: number | null;
|
|
9933
|
+
match_source?: string | null;
|
|
9934
|
+
evidence?: Record<string, any>;
|
|
9935
|
+
story?: PrStory | null;
|
|
9936
|
+
person?: PrPerson | null;
|
|
9937
|
+
created_at?: string | null;
|
|
9938
|
+
updated_at?: string | null;
|
|
9939
|
+
}
|
|
9780
9940
|
/**
|
|
9781
9941
|
* A normalized way to reach an outlet, person, or publication role.
|
|
9782
9942
|
*/
|
|
@@ -9854,9 +10014,13 @@ interface PrPublication {
|
|
|
9854
10014
|
people_count?: number;
|
|
9855
10015
|
contact_points_count?: number;
|
|
9856
10016
|
links_count?: number;
|
|
10017
|
+
feeds_count?: number;
|
|
10018
|
+
stories_count?: number;
|
|
9857
10019
|
people?: PublicationPerson[];
|
|
9858
10020
|
contact_points?: PrContactPoint[];
|
|
9859
10021
|
links?: PrLink[];
|
|
10022
|
+
feeds?: PrFeed[];
|
|
10023
|
+
stories?: PrStory[];
|
|
9860
10024
|
tags?: PrTag[];
|
|
9861
10025
|
metadata?: Record<string, any>;
|
|
9862
10026
|
created_at?: string | null;
|
|
@@ -9883,9 +10047,11 @@ interface PrPerson {
|
|
|
9883
10047
|
roles_count?: number;
|
|
9884
10048
|
contact_points_count?: number;
|
|
9885
10049
|
links_count?: number;
|
|
10050
|
+
stories_count?: number;
|
|
9886
10051
|
roles?: PublicationPerson[];
|
|
9887
10052
|
contact_points?: PrContactPoint[];
|
|
9888
10053
|
links?: PrLink[];
|
|
10054
|
+
stories?: PrStoryAuthor[];
|
|
9889
10055
|
tags?: PrTag[];
|
|
9890
10056
|
metadata?: Record<string, any>;
|
|
9891
10057
|
created_at?: string | null;
|
|
@@ -9926,6 +10092,16 @@ interface PrDirectoryReport {
|
|
|
9926
10092
|
total: number;
|
|
9927
10093
|
by_namespace: Record<string, number>;
|
|
9928
10094
|
};
|
|
10095
|
+
feeds: {
|
|
10096
|
+
total: number;
|
|
10097
|
+
by_status: Record<string, number>;
|
|
10098
|
+
due_for_fetch: number;
|
|
10099
|
+
};
|
|
10100
|
+
stories: {
|
|
10101
|
+
total: number;
|
|
10102
|
+
with_author: number;
|
|
10103
|
+
by_type: Record<string, number>;
|
|
10104
|
+
};
|
|
9929
10105
|
}
|
|
9930
10106
|
/**
|
|
9931
10107
|
* A ranked title-to-outlet match with evidence, contact route, and plain-English
|
|
@@ -9940,19 +10116,88 @@ interface PrTitleMatch {
|
|
|
9940
10116
|
risks: string[];
|
|
9941
10117
|
evidence_links: PrLink[];
|
|
9942
10118
|
}
|
|
10119
|
+
/**
|
|
10120
|
+
* Title-scoped PR research workspace response.
|
|
10121
|
+
*/
|
|
10122
|
+
interface PrTitleResearchResponse {
|
|
10123
|
+
generated_at: string;
|
|
10124
|
+
title: {
|
|
10125
|
+
id: string;
|
|
10126
|
+
name: string;
|
|
10127
|
+
slug?: string | null;
|
|
10128
|
+
short_description?: string | null;
|
|
10129
|
+
description?: string | null;
|
|
10130
|
+
genres?: string[];
|
|
10131
|
+
platforms?: string[];
|
|
10132
|
+
website_url?: string | null;
|
|
10133
|
+
steam_url?: string | null;
|
|
10134
|
+
itch_url?: string | null;
|
|
10135
|
+
demo_url?: string | null;
|
|
10136
|
+
video_url?: string | null;
|
|
10137
|
+
};
|
|
10138
|
+
readiness: {
|
|
10139
|
+
score: number;
|
|
10140
|
+
strengths: string[];
|
|
10141
|
+
gaps: string[];
|
|
10142
|
+
};
|
|
10143
|
+
publication_matches: PrTitleMatch[];
|
|
10144
|
+
stories: PrStory[];
|
|
10145
|
+
story_summary: {
|
|
10146
|
+
count: number;
|
|
10147
|
+
with_known_author: number;
|
|
10148
|
+
publication_count: number;
|
|
10149
|
+
};
|
|
10150
|
+
suggested_next_steps: string[];
|
|
10151
|
+
}
|
|
10152
|
+
/**
|
|
10153
|
+
* Structured draft fields returned alongside the formatted HTML email body.
|
|
10154
|
+
*/
|
|
10155
|
+
interface PrOutreachDraft {
|
|
10156
|
+
subject?: string | null;
|
|
10157
|
+
opener?: string | null;
|
|
10158
|
+
body?: string | null;
|
|
10159
|
+
body_html?: string | null;
|
|
10160
|
+
key_points?: string[];
|
|
10161
|
+
personalization_notes?: string[];
|
|
10162
|
+
review_notes?: string[];
|
|
10163
|
+
missing_context_warnings?: string[];
|
|
10164
|
+
[key: string]: any;
|
|
10165
|
+
}
|
|
10166
|
+
/**
|
|
10167
|
+
* Review-only PR draft response. The API never sends email from this endpoint.
|
|
10168
|
+
*/
|
|
10169
|
+
interface PrTitleDraftResponse {
|
|
10170
|
+
draft_status: "draft_only_not_sent" | "no_verified_email_found" | "no_publication_found" | string;
|
|
10171
|
+
emails_sent: boolean;
|
|
10172
|
+
publication?: PrPublication | null;
|
|
10173
|
+
person?: PrPerson | null;
|
|
10174
|
+
target: Record<string, any>;
|
|
10175
|
+
recent_stories: PrStory[];
|
|
10176
|
+
draft: PrOutreachDraft;
|
|
10177
|
+
body_html: string;
|
|
10178
|
+
review_notes: string[];
|
|
10179
|
+
}
|
|
9943
10180
|
/**
|
|
9944
10181
|
* Response body returned after queueing PR verification jobs.
|
|
9945
10182
|
*/
|
|
9946
10183
|
interface PrQueueVerificationResponse {
|
|
9947
10184
|
queued: number;
|
|
9948
10185
|
}
|
|
10186
|
+
/**
|
|
10187
|
+
* Response body returned after discovering, queueing, or fetching PR feeds.
|
|
10188
|
+
*/
|
|
10189
|
+
interface PrFeedRefreshResponse {
|
|
10190
|
+
discovered: number;
|
|
10191
|
+
queued: number;
|
|
10192
|
+
fetched: number;
|
|
10193
|
+
}
|
|
9949
10194
|
/**
|
|
9950
10195
|
* SDK wrapper for the PR Directory API.
|
|
9951
10196
|
*
|
|
9952
10197
|
* The PR directory is read-friendly by default: public endpoints expose
|
|
9953
|
-
* searchable publications, people, tags, and reporting metrics.
|
|
9954
|
-
* title admins can request title-specific
|
|
9955
|
-
*
|
|
10198
|
+
* searchable publications, people, feeds, stories, tags, and reporting metrics.
|
|
10199
|
+
* Authenticated title admins can request title-specific research and review-only
|
|
10200
|
+
* outreach drafts, and site admins can queue verification or feed refresh jobs.
|
|
9956
10201
|
*/
|
|
9957
10202
|
declare class PrDirectory {
|
|
9958
10203
|
/**
|
|
@@ -9992,6 +10237,23 @@ declare class PrDirectory {
|
|
|
9992
10237
|
* contact points, and metadata tags.
|
|
9993
10238
|
*/
|
|
9994
10239
|
static viewPerson<T = PrPerson>(person_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
10240
|
+
/**
|
|
10241
|
+
* Search discovered RSS/Atom/JSON feeds across known publications.
|
|
10242
|
+
*/
|
|
10243
|
+
static listFeeds<T = PrFeed[]>(params?: PrFeedSearchParams): AxiosPromise<Response<T>>;
|
|
10244
|
+
/**
|
|
10245
|
+
* Retrieve one feed with freshness metadata and recent imported stories.
|
|
10246
|
+
* Pass `include_raw: true` to request the stored XML/RSS payload.
|
|
10247
|
+
*/
|
|
10248
|
+
static viewFeed<T = PrFeed>(feed_id: string, params?: PrFeedSearchParams): AxiosPromise<Response<T>>;
|
|
10249
|
+
/**
|
|
10250
|
+
* Search imported stories, reviews, guides, and episodes by outlet or byline.
|
|
10251
|
+
*/
|
|
10252
|
+
static listStories<T = PrStory[]>(params?: PrStorySearchParams): AxiosPromise<Response<T>>;
|
|
10253
|
+
/**
|
|
10254
|
+
* Retrieve one imported story with feed, publication, and byline evidence.
|
|
10255
|
+
*/
|
|
10256
|
+
static viewStory<T = PrStory>(story_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9995
10257
|
/**
|
|
9996
10258
|
* List the normalized tag vocabulary used for PR search, filters, matching,
|
|
9997
10259
|
* and reporting.
|
|
@@ -10007,6 +10269,16 @@ declare class PrDirectory {
|
|
|
10007
10269
|
* user who can administer the requested title.
|
|
10008
10270
|
*/
|
|
10009
10271
|
static titleMatches<T = PrTitleMatch[]>(title_id: string, params?: PrTitleMatchParams): AxiosPromise<Response<T>>;
|
|
10272
|
+
/**
|
|
10273
|
+
* Get a title-scoped PR research workspace with outlet matches, recent story
|
|
10274
|
+
* context, media kit readiness, and next steps.
|
|
10275
|
+
*/
|
|
10276
|
+
static titleResearch<T = PrTitleResearchResponse>(title_id: string, params?: PrTitleResearchParams): AxiosPromise<Response<T>>;
|
|
10277
|
+
/**
|
|
10278
|
+
* Create a formatted, review-only PR email draft for a selected title target.
|
|
10279
|
+
* The backend returns HTML with paragraphs, bullets, and links but sends no email.
|
|
10280
|
+
*/
|
|
10281
|
+
static titleDraft<T = PrTitleDraftResponse>(title_id: string, data?: PrTitleDraftRequest, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
10010
10282
|
/**
|
|
10011
10283
|
* Queue PR verification jobs. Requires a site-admin auth token.
|
|
10012
10284
|
*
|
|
@@ -10016,6 +10288,11 @@ declare class PrDirectory {
|
|
|
10016
10288
|
* ```
|
|
10017
10289
|
*/
|
|
10018
10290
|
static queueVerification<T = PrQueueVerificationResponse>(data?: PrQueueVerificationRequest, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
10291
|
+
/**
|
|
10292
|
+
* Discover, queue, or synchronously refresh PR feeds. Requires a site-admin
|
|
10293
|
+
* auth token.
|
|
10294
|
+
*/
|
|
10295
|
+
static refreshFeeds<T = PrFeedRefreshResponse>(data?: PrFeedRefreshRequest, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
10019
10296
|
}
|
|
10020
10297
|
|
|
10021
10298
|
declare class AdminReports {
|