glitch-javascript-sdk 3.2.9 → 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.
- package/dist/cjs/index.js +116 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/PrDirectory.d.ts +386 -0
- package/dist/esm/api/index.d.ts +2 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +116 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/PrDirectoryRoutes.d.ts +15 -0
- package/dist/index.d.ts +385 -0
- package/package.json +1 -1
- package/src/api/PrDirectory.ts +440 -0
- package/src/api/index.ts +2 -0
- package/src/index.ts +2 -0
- package/src/routes/PrDirectoryRoutes.ts +25 -0
package/dist/cjs/index.js
CHANGED
|
@@ -31288,6 +31288,121 @@ var Agents = /** @class */ (function () {
|
|
|
31288
31288
|
return Agents;
|
|
31289
31289
|
}());
|
|
31290
31290
|
|
|
31291
|
+
/**
|
|
31292
|
+
* Route declarations for the PR Directory API.
|
|
31293
|
+
*
|
|
31294
|
+
* These mirror the Laravel routes under `/api/pr/*` and the title-scoped
|
|
31295
|
+
* matcher route under `/api/titles/{title_id}/pr/matches`. Keeping the URL
|
|
31296
|
+
* templates in one place lets the SDK methods stay small and consistent with
|
|
31297
|
+
* the rest of the package's route-wrapper pattern.
|
|
31298
|
+
*/
|
|
31299
|
+
var PrDirectoryRoutes = /** @class */ (function () {
|
|
31300
|
+
function PrDirectoryRoutes() {
|
|
31301
|
+
}
|
|
31302
|
+
PrDirectoryRoutes.routes = {
|
|
31303
|
+
listPublications: { url: "/pr/publications", method: HTTP_METHODS.GET },
|
|
31304
|
+
viewPublication: { url: "/pr/publications/{publication_id}", method: HTTP_METHODS.GET },
|
|
31305
|
+
listPeople: { url: "/pr/people", method: HTTP_METHODS.GET },
|
|
31306
|
+
viewPerson: { url: "/pr/people/{person_id}", method: HTTP_METHODS.GET },
|
|
31307
|
+
listTags: { url: "/pr/tags", method: HTTP_METHODS.GET },
|
|
31308
|
+
report: { url: "/pr/report", method: HTTP_METHODS.GET },
|
|
31309
|
+
titleMatches: { url: "/titles/{title_id}/pr/matches", method: HTTP_METHODS.GET },
|
|
31310
|
+
queueVerification: { url: "/admin/pr/verification/queue", method: HTTP_METHODS.POST },
|
|
31311
|
+
};
|
|
31312
|
+
return PrDirectoryRoutes;
|
|
31313
|
+
}());
|
|
31314
|
+
|
|
31315
|
+
/**
|
|
31316
|
+
* SDK wrapper for the PR Directory API.
|
|
31317
|
+
*
|
|
31318
|
+
* The PR directory is read-friendly by default: public endpoints expose
|
|
31319
|
+
* searchable publications, people, tags, and reporting metrics. Authenticated
|
|
31320
|
+
* title admins can request title-specific PR matches, and site admins can queue
|
|
31321
|
+
* monthly-style verification jobs.
|
|
31322
|
+
*/
|
|
31323
|
+
var PrDirectory = /** @class */ (function () {
|
|
31324
|
+
function PrDirectory() {
|
|
31325
|
+
}
|
|
31326
|
+
/**
|
|
31327
|
+
* Search gaming-focused PR publications, independent blogs, and podcasts.
|
|
31328
|
+
*
|
|
31329
|
+
* @example
|
|
31330
|
+
* ```ts
|
|
31331
|
+
* Glitch.api.PrDirectory.listPublications({
|
|
31332
|
+
* q: "indie RPG",
|
|
31333
|
+
* has_email: true,
|
|
31334
|
+
* eligibility_status: "eligible",
|
|
31335
|
+
* sort: "-last_verified_at",
|
|
31336
|
+
* });
|
|
31337
|
+
* ```
|
|
31338
|
+
*/
|
|
31339
|
+
PrDirectory.listPublications = function (params) {
|
|
31340
|
+
return Requests.processRoute(PrDirectoryRoutes.routes.listPublications, {}, {}, params);
|
|
31341
|
+
};
|
|
31342
|
+
/**
|
|
31343
|
+
* Retrieve one PR publication profile with loaded people, contact points,
|
|
31344
|
+
* evidence links, and tags.
|
|
31345
|
+
*/
|
|
31346
|
+
PrDirectory.viewPublication = function (publication_id, params) {
|
|
31347
|
+
return Requests.processRoute(PrDirectoryRoutes.routes.viewPublication, {}, { publication_id: publication_id }, params);
|
|
31348
|
+
};
|
|
31349
|
+
/**
|
|
31350
|
+
* Search PR people and roles across all known publications.
|
|
31351
|
+
*
|
|
31352
|
+
* @example
|
|
31353
|
+
* ```ts
|
|
31354
|
+
* Glitch.api.PrDirectory.listPeople({
|
|
31355
|
+
* q: "reviews editor",
|
|
31356
|
+
* has_email: true,
|
|
31357
|
+
* role_category: "editor",
|
|
31358
|
+
* });
|
|
31359
|
+
* ```
|
|
31360
|
+
*/
|
|
31361
|
+
PrDirectory.listPeople = function (params) {
|
|
31362
|
+
return Requests.processRoute(PrDirectoryRoutes.routes.listPeople, {}, {}, params);
|
|
31363
|
+
};
|
|
31364
|
+
/**
|
|
31365
|
+
* Retrieve one PR person profile with their outlet roles, profile links,
|
|
31366
|
+
* contact points, and metadata tags.
|
|
31367
|
+
*/
|
|
31368
|
+
PrDirectory.viewPerson = function (person_id, params) {
|
|
31369
|
+
return Requests.processRoute(PrDirectoryRoutes.routes.viewPerson, {}, { person_id: person_id }, params);
|
|
31370
|
+
};
|
|
31371
|
+
/**
|
|
31372
|
+
* List the normalized tag vocabulary used for PR search, filters, matching,
|
|
31373
|
+
* and reporting.
|
|
31374
|
+
*/
|
|
31375
|
+
PrDirectory.listTags = function (params) {
|
|
31376
|
+
return Requests.processRoute(PrDirectoryRoutes.routes.listTags, {}, {}, params);
|
|
31377
|
+
};
|
|
31378
|
+
/**
|
|
31379
|
+
* Get aggregate PR directory reporting metrics. Publication filters can be
|
|
31380
|
+
* supplied to scope the outlet portion of the report.
|
|
31381
|
+
*/
|
|
31382
|
+
PrDirectory.report = function (params) {
|
|
31383
|
+
return Requests.processRoute(PrDirectoryRoutes.routes.report, {}, {}, params);
|
|
31384
|
+
};
|
|
31385
|
+
/**
|
|
31386
|
+
* Match a registered game title to PR outlets. Requires an auth token for a
|
|
31387
|
+
* user who can administer the requested title.
|
|
31388
|
+
*/
|
|
31389
|
+
PrDirectory.titleMatches = function (title_id, params) {
|
|
31390
|
+
return Requests.processRoute(PrDirectoryRoutes.routes.titleMatches, {}, { title_id: title_id }, params);
|
|
31391
|
+
};
|
|
31392
|
+
/**
|
|
31393
|
+
* Queue PR verification jobs. Requires a site-admin auth token.
|
|
31394
|
+
*
|
|
31395
|
+
* @example
|
|
31396
|
+
* ```ts
|
|
31397
|
+
* Glitch.api.PrDirectory.queueVerification({ due: true, limit: 250 });
|
|
31398
|
+
* ```
|
|
31399
|
+
*/
|
|
31400
|
+
PrDirectory.queueVerification = function (data, params) {
|
|
31401
|
+
return Requests.processRoute(PrDirectoryRoutes.routes.queueVerification, data || {}, {}, params);
|
|
31402
|
+
};
|
|
31403
|
+
return PrDirectory;
|
|
31404
|
+
}());
|
|
31405
|
+
|
|
31291
31406
|
var Parser = /** @class */ (function () {
|
|
31292
31407
|
function Parser() {
|
|
31293
31408
|
}
|
|
@@ -31832,6 +31947,7 @@ var Glitch = /** @class */ (function () {
|
|
|
31832
31947
|
Multiplayer: Multiplayer,
|
|
31833
31948
|
ServerOperations: ServerOperations,
|
|
31834
31949
|
Agents: Agents,
|
|
31950
|
+
PrDirectory: PrDirectory,
|
|
31835
31951
|
};
|
|
31836
31952
|
Glitch.util = {
|
|
31837
31953
|
Requests: Requests,
|