glitch-javascript-sdk 3.2.8 → 3.2.10

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.
@@ -0,0 +1,15 @@
1
+ import Route from "./interface";
2
+ /**
3
+ * Route declarations for the PR Directory API.
4
+ *
5
+ * These mirror the Laravel routes under `/api/pr/*` and the title-scoped
6
+ * matcher route under `/api/titles/{title_id}/pr/matches`. Keeping the URL
7
+ * templates in one place lets the SDK methods stay small and consistent with
8
+ * the rest of the package's route-wrapper pattern.
9
+ */
10
+ declare class PrDirectoryRoutes {
11
+ static routes: {
12
+ [key: string]: Route;
13
+ };
14
+ }
15
+ export default PrDirectoryRoutes;
package/dist/index.d.ts CHANGED
@@ -7219,6 +7219,14 @@ declare class Scheduler {
7219
7219
  platform: string;
7220
7220
  account_id?: string;
7221
7221
  }): AxiosPromise<Response<T>>;
7222
+ /**
7223
+ * Send a platform test conversion event through the backend scheduler route.
7224
+ *
7225
+ * @param scheduler_id The ID of the promotion schedule.
7226
+ * @param platform Platform key, e.g. reddit, tiktok, facebook, google.
7227
+ * @param params Query parameters such as Reddit test_id or Meta test_event_code.
7228
+ */
7229
+ static sendTestConversionEvent<T>(scheduler_id: string, platform: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
7222
7230
  /**
7223
7231
  * Trigger a historical sync for a specific platform on a scheduler.
7224
7232
  *
@@ -9341,6 +9349,390 @@ declare class Agents {
9341
9349
  static agencyInbox<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
9342
9350
  }
9343
9351
 
9352
+ /**
9353
+ * Allowed outlet types in the PR directory.
9354
+ */
9355
+ type PrPublicationType = "blog" | "podcast" | "publication";
9356
+ /**
9357
+ * Eligibility state for a PR outlet.
9358
+ */
9359
+ type PrEligibilityStatus = "eligible" | "ineligible" | "needs_review" | "duplicate" | "archived";
9360
+ /**
9361
+ * Verification state used by PR outlets, people, links, and contact points.
9362
+ */
9363
+ type PrVerificationStatus = "unverified" | "verified" | "stale" | "blocked" | "failed" | "needs_review";
9364
+ /**
9365
+ * Email health status stored on the outlet-level PR email field.
9366
+ */
9367
+ type PrEmailStatus = "unknown" | "verified" | "bounced" | "missing" | "needs_review";
9368
+ /**
9369
+ * Contact verification state for normalized contact points.
9370
+ */
9371
+ type PrContactVerificationStatus = "unverified" | "verified" | "stale" | "bounced" | "invalid" | "blocked" | "needs_review";
9372
+ /**
9373
+ * Link refresh status for evidence URLs.
9374
+ */
9375
+ type PrLinkStatus = "unverified" | "ok" | "redirected" | "broken" | "blocked" | "failed" | "stale";
9376
+ /**
9377
+ * Filters accepted by `/pr/publications` and `/pr/report`.
9378
+ *
9379
+ * Tag filters are human-readable slugs from `/pr/tags`. The backend accepts
9380
+ * format, genre, platform, and audience as namespace-specific tag filters so
9381
+ * frontend screens can expose simple controls without knowing pivot table
9382
+ * details.
9383
+ */
9384
+ interface PrPublicationSearchParams {
9385
+ q?: string;
9386
+ type?: PrPublicationType;
9387
+ eligibility_status?: PrEligibilityStatus;
9388
+ verification_status?: PrVerificationStatus;
9389
+ dedicated_to_gaming?: boolean;
9390
+ has_email?: boolean;
9391
+ country?: string;
9392
+ language?: string;
9393
+ canonical_domain?: string;
9394
+ tag?: string;
9395
+ format?: string;
9396
+ genre?: string;
9397
+ platform?: string;
9398
+ audience?: string;
9399
+ sort?: "name" | "-name" | "type" | "-type" | "eligibility_status" | "-eligibility_status" | "verification_status" | "-verification_status" | "last_verified_at" | "-last_verified_at" | "updated_at" | "-updated_at" | string;
9400
+ page?: number;
9401
+ per_page?: number;
9402
+ }
9403
+ /**
9404
+ * Filters accepted by `/pr/people`.
9405
+ */
9406
+ interface PrPeopleSearchParams {
9407
+ q?: string;
9408
+ publication_id?: string;
9409
+ role_category?: string;
9410
+ is_active?: boolean;
9411
+ verification_status?: PrVerificationStatus;
9412
+ has_email?: boolean;
9413
+ tag?: string;
9414
+ role?: string;
9415
+ sort?: "name" | "-name" | "verification_status" | "-verification_status" | "last_verified_at" | "-last_verified_at" | "updated_at" | "-updated_at" | string;
9416
+ page?: number;
9417
+ per_page?: number;
9418
+ }
9419
+ /**
9420
+ * Filters accepted by `/pr/tags`.
9421
+ */
9422
+ interface PrTagSearchParams {
9423
+ namespace?: string;
9424
+ q?: string;
9425
+ }
9426
+ /**
9427
+ * Query parameters accepted by `/titles/{title_id}/pr/matches`.
9428
+ *
9429
+ * The title matcher uses the title profile plus optional human-readable search
9430
+ * context to rank eligible outlets and explain why each outlet is a fit.
9431
+ */
9432
+ interface PrTitleMatchParams extends PrPublicationSearchParams {
9433
+ genres?: string[];
9434
+ platforms?: string[];
9435
+ audiences?: string[];
9436
+ limit?: number;
9437
+ }
9438
+ /**
9439
+ * Request body accepted by `/admin/pr/verification/queue`.
9440
+ */
9441
+ interface PrQueueVerificationRequest {
9442
+ due?: boolean;
9443
+ limit?: number;
9444
+ link_ids?: string[];
9445
+ }
9446
+ /**
9447
+ * A normalized metadata tag used to filter and match PR outlets, people, and
9448
+ * roles.
9449
+ */
9450
+ interface PrTag {
9451
+ id: string;
9452
+ namespace: string;
9453
+ slug: string;
9454
+ label: string;
9455
+ description?: string | null;
9456
+ pivot?: {
9457
+ confidence?: number | null;
9458
+ source?: string | null;
9459
+ source_link_id?: string | null;
9460
+ verified_at?: string | null;
9461
+ metadata?: Record<string, any> | null;
9462
+ };
9463
+ metadata?: Record<string, any>;
9464
+ created_at?: string | null;
9465
+ updated_at?: string | null;
9466
+ }
9467
+ /**
9468
+ * A refreshable evidence URL that supports an outlet, person, role, or contact
9469
+ * point.
9470
+ */
9471
+ interface PrLink {
9472
+ id: string;
9473
+ linkable_type?: string | null;
9474
+ linkable_id?: string | null;
9475
+ link_type: string;
9476
+ url: string;
9477
+ canonical_url?: string | null;
9478
+ final_url?: string | null;
9479
+ domain?: string | null;
9480
+ priority: number;
9481
+ http_status?: number | null;
9482
+ status: PrLinkStatus;
9483
+ content_type?: string | null;
9484
+ content_hash?: string | null;
9485
+ etag?: string | null;
9486
+ last_modified_at?: string | null;
9487
+ last_checked_at?: string | null;
9488
+ next_check_at?: string | null;
9489
+ last_error?: string | null;
9490
+ is_source_of_truth: boolean;
9491
+ metadata?: Record<string, any>;
9492
+ created_at?: string | null;
9493
+ updated_at?: string | null;
9494
+ }
9495
+ /**
9496
+ * A normalized way to reach an outlet, person, or publication role.
9497
+ */
9498
+ interface PrContactPoint {
9499
+ id: string;
9500
+ contactable_type: string;
9501
+ contactable_id: string;
9502
+ pr_link_id?: string | null;
9503
+ contact_type: "email" | "linkedin" | "x" | "bluesky" | "contact_form" | string;
9504
+ label?: string | null;
9505
+ value: string;
9506
+ normalized_value: string;
9507
+ verification_status: PrContactVerificationStatus;
9508
+ confidence?: number | null;
9509
+ is_primary: boolean;
9510
+ first_seen_at?: string | null;
9511
+ last_seen_at?: string | null;
9512
+ source_link?: PrLink | null;
9513
+ metadata?: Record<string, any>;
9514
+ created_at?: string | null;
9515
+ updated_at?: string | null;
9516
+ }
9517
+ /**
9518
+ * The role a PR person has at one publication, blog, or podcast.
9519
+ */
9520
+ interface PublicationPerson {
9521
+ id: string;
9522
+ publication_id: string;
9523
+ pr_person_id: string;
9524
+ source_link_id?: string | null;
9525
+ role_title?: string | null;
9526
+ role_category?: string | null;
9527
+ email?: string | null;
9528
+ email_status: "unknown" | "verified" | "bounced" | "invalid" | "needs_review";
9529
+ is_primary_contact: boolean;
9530
+ is_current: boolean;
9531
+ confidence?: number | null;
9532
+ started_at?: string | null;
9533
+ ended_at?: string | null;
9534
+ last_verified_at?: string | null;
9535
+ source_notes?: string | null;
9536
+ person?: PrPerson | null;
9537
+ publication?: PrPublication | null;
9538
+ source_link?: PrLink | null;
9539
+ contact_points?: PrContactPoint[];
9540
+ tags?: PrTag[];
9541
+ metadata?: Record<string, any>;
9542
+ created_at?: string | null;
9543
+ updated_at?: string | null;
9544
+ }
9545
+ /**
9546
+ * A gaming-focused publication, independent blog, or podcast in the PR
9547
+ * directory.
9548
+ */
9549
+ interface PrPublication {
9550
+ id: string;
9551
+ name: string;
9552
+ slug?: string | null;
9553
+ type: PrPublicationType;
9554
+ url?: string | null;
9555
+ canonical_domain?: string | null;
9556
+ description?: string | null;
9557
+ main_pr_email?: string | null;
9558
+ main_pr_email_status: PrEmailStatus;
9559
+ dedicated_to_gaming: boolean;
9560
+ eligibility_status: PrEligibilityStatus;
9561
+ exclusion_reason?: string | null;
9562
+ language?: string | null;
9563
+ country?: string | null;
9564
+ network_or_owner?: string | null;
9565
+ verification_status: PrVerificationStatus;
9566
+ last_verified_at?: string | null;
9567
+ next_verification_at?: string | null;
9568
+ source_imported_at?: string | null;
9569
+ people_count?: number;
9570
+ contact_points_count?: number;
9571
+ links_count?: number;
9572
+ people?: PublicationPerson[];
9573
+ contact_points?: PrContactPoint[];
9574
+ links?: PrLink[];
9575
+ tags?: PrTag[];
9576
+ metadata?: Record<string, any>;
9577
+ created_at?: string | null;
9578
+ updated_at?: string | null;
9579
+ }
9580
+ /**
9581
+ * A journalist, editor, podcast host, producer, contributor, or other PR
9582
+ * contact associated with one or more gaming-focused outlets.
9583
+ */
9584
+ interface PrPerson {
9585
+ id: string;
9586
+ name: string;
9587
+ slug?: string | null;
9588
+ bio?: string | null;
9589
+ location?: string | null;
9590
+ linkedin_url?: string | null;
9591
+ x_url?: string | null;
9592
+ bluesky_url?: string | null;
9593
+ website_url?: string | null;
9594
+ is_active: boolean;
9595
+ verification_status: PrVerificationStatus;
9596
+ last_verified_at?: string | null;
9597
+ next_verification_at?: string | null;
9598
+ roles_count?: number;
9599
+ contact_points_count?: number;
9600
+ links_count?: number;
9601
+ roles?: PublicationPerson[];
9602
+ contact_points?: PrContactPoint[];
9603
+ links?: PrLink[];
9604
+ tags?: PrTag[];
9605
+ metadata?: Record<string, any>;
9606
+ created_at?: string | null;
9607
+ updated_at?: string | null;
9608
+ }
9609
+ /**
9610
+ * Aggregate PR directory health metrics returned by `/pr/report`.
9611
+ */
9612
+ interface PrDirectoryReport {
9613
+ generated_at: string;
9614
+ publications: {
9615
+ total: number;
9616
+ by_type: Record<string, number>;
9617
+ by_eligibility_status: Record<string, number>;
9618
+ by_verification_status: Record<string, number>;
9619
+ dedicated_to_gaming: number;
9620
+ with_email: number;
9621
+ due_for_verification: number;
9622
+ };
9623
+ people: {
9624
+ total: number;
9625
+ active: number;
9626
+ with_email: number;
9627
+ by_verification_status: Record<string, number>;
9628
+ };
9629
+ links: {
9630
+ total: number;
9631
+ by_type: Record<string, number>;
9632
+ by_status: Record<string, number>;
9633
+ due_for_check: number;
9634
+ };
9635
+ contacts: {
9636
+ total: number;
9637
+ by_type: Record<string, number>;
9638
+ by_status: Record<string, number>;
9639
+ };
9640
+ tags: {
9641
+ total: number;
9642
+ by_namespace: Record<string, number>;
9643
+ };
9644
+ }
9645
+ /**
9646
+ * A ranked title-to-outlet match with evidence, contact route, and plain-English
9647
+ * explanation.
9648
+ */
9649
+ interface PrTitleMatch {
9650
+ publication: PrPublication;
9651
+ score: number;
9652
+ matched_tags: string[];
9653
+ best_contact_path?: Record<string, any> | null;
9654
+ why: string[];
9655
+ risks: string[];
9656
+ evidence_links: PrLink[];
9657
+ }
9658
+ /**
9659
+ * Response body returned after queueing PR verification jobs.
9660
+ */
9661
+ interface PrQueueVerificationResponse {
9662
+ queued: number;
9663
+ }
9664
+ /**
9665
+ * SDK wrapper for the PR Directory API.
9666
+ *
9667
+ * The PR directory is read-friendly by default: public endpoints expose
9668
+ * searchable publications, people, tags, and reporting metrics. Authenticated
9669
+ * title admins can request title-specific PR matches, and site admins can queue
9670
+ * monthly-style verification jobs.
9671
+ */
9672
+ declare class PrDirectory {
9673
+ /**
9674
+ * Search gaming-focused PR publications, independent blogs, and podcasts.
9675
+ *
9676
+ * @example
9677
+ * ```ts
9678
+ * Glitch.api.PrDirectory.listPublications({
9679
+ * q: "indie RPG",
9680
+ * has_email: true,
9681
+ * eligibility_status: "eligible",
9682
+ * sort: "-last_verified_at",
9683
+ * });
9684
+ * ```
9685
+ */
9686
+ static listPublications<T = PrPublication[]>(params?: PrPublicationSearchParams): AxiosPromise<Response<T>>;
9687
+ /**
9688
+ * Retrieve one PR publication profile with loaded people, contact points,
9689
+ * evidence links, and tags.
9690
+ */
9691
+ static viewPublication<T = PrPublication>(publication_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
9692
+ /**
9693
+ * Search PR people and roles across all known publications.
9694
+ *
9695
+ * @example
9696
+ * ```ts
9697
+ * Glitch.api.PrDirectory.listPeople({
9698
+ * q: "reviews editor",
9699
+ * has_email: true,
9700
+ * role_category: "editor",
9701
+ * });
9702
+ * ```
9703
+ */
9704
+ static listPeople<T = PrPerson[]>(params?: PrPeopleSearchParams): AxiosPromise<Response<T>>;
9705
+ /**
9706
+ * Retrieve one PR person profile with their outlet roles, profile links,
9707
+ * contact points, and metadata tags.
9708
+ */
9709
+ static viewPerson<T = PrPerson>(person_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
9710
+ /**
9711
+ * List the normalized tag vocabulary used for PR search, filters, matching,
9712
+ * and reporting.
9713
+ */
9714
+ static listTags<T = PrTag[]>(params?: PrTagSearchParams): AxiosPromise<Response<T>>;
9715
+ /**
9716
+ * Get aggregate PR directory reporting metrics. Publication filters can be
9717
+ * supplied to scope the outlet portion of the report.
9718
+ */
9719
+ static report<T = PrDirectoryReport>(params?: PrPublicationSearchParams): AxiosPromise<Response<T>>;
9720
+ /**
9721
+ * Match a registered game title to PR outlets. Requires an auth token for a
9722
+ * user who can administer the requested title.
9723
+ */
9724
+ static titleMatches<T = PrTitleMatch[]>(title_id: string, params?: PrTitleMatchParams): AxiosPromise<Response<T>>;
9725
+ /**
9726
+ * Queue PR verification jobs. Requires a site-admin auth token.
9727
+ *
9728
+ * @example
9729
+ * ```ts
9730
+ * Glitch.api.PrDirectory.queueVerification({ due: true, limit: 250 });
9731
+ * ```
9732
+ */
9733
+ static queueVerification<T = PrQueueVerificationResponse>(data?: PrQueueVerificationRequest, params?: Record<string, any>): AxiosPromise<Response<T>>;
9734
+ }
9735
+
9344
9736
  interface Route {
9345
9737
  url: string;
9346
9738
  method: string;
@@ -9697,6 +10089,7 @@ declare class Glitch {
9697
10089
  Multiplayer: typeof Multiplayer;
9698
10090
  ServerOperations: typeof ServerOperations;
9699
10091
  Agents: typeof Agents;
10092
+ PrDirectory: typeof PrDirectory;
9700
10093
  };
9701
10094
  static util: {
9702
10095
  Requests: typeof Requests;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "3.2.8",
3
+ "version": "3.2.10",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "publishConfig": {
6
6
  "access": "public"