@buildinternet/releases-api-types 0.2.0 → 0.3.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/package.json +1 -1
- package/src/api-types.ts +41 -0
package/package.json
CHANGED
package/src/api-types.ts
CHANGED
|
@@ -412,6 +412,42 @@ export interface SearchChunkHit {
|
|
|
412
412
|
score: number;
|
|
413
413
|
}
|
|
414
414
|
|
|
415
|
+
// ── Lookup (on-demand GitHub index) ──
|
|
416
|
+
|
|
417
|
+
export type LookupStatus = "indexed" | "existing" | "empty" | "not_found" | "deferred";
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Slim wire payload embedded in a search response when the query is a GitHub
|
|
421
|
+
* coordinate (org/repo) and no existing entity matched. The server performs an
|
|
422
|
+
* on-demand lookup and includes the result here so the client can surface a
|
|
423
|
+
* "just indexed" or "not found" rail without a second round trip.
|
|
424
|
+
*/
|
|
425
|
+
export interface LookupResultPayload {
|
|
426
|
+
status: LookupStatus;
|
|
427
|
+
source?: {
|
|
428
|
+
id: string;
|
|
429
|
+
slug: string;
|
|
430
|
+
name: string;
|
|
431
|
+
url: string;
|
|
432
|
+
discovery: "curated" | "agent" | "on_demand";
|
|
433
|
+
};
|
|
434
|
+
releases?: Array<{
|
|
435
|
+
id: string;
|
|
436
|
+
version: string | null;
|
|
437
|
+
title: string;
|
|
438
|
+
publishedAt: string | null;
|
|
439
|
+
}>;
|
|
440
|
+
/**
|
|
441
|
+
* Unambiguous "did you mean" rail: the curated org that owns GitHub repos
|
|
442
|
+
* under the same org segment, plus its top sources. Null when the org
|
|
443
|
+
* segment matches multiple curated orgs or none.
|
|
444
|
+
*/
|
|
445
|
+
relatedOrg: {
|
|
446
|
+
org: { id: string; slug: string; name: string };
|
|
447
|
+
sources: Array<{ id: string; slug: string; name: string; url: string }>;
|
|
448
|
+
} | null;
|
|
449
|
+
}
|
|
450
|
+
|
|
415
451
|
export interface UnifiedSearchResponse {
|
|
416
452
|
query: string;
|
|
417
453
|
orgs: SearchOrgHit[];
|
|
@@ -429,6 +465,11 @@ export interface UnifiedSearchResponse {
|
|
|
429
465
|
degraded?: boolean;
|
|
430
466
|
/** Human-readable reason for degradation (e.g., missing Vectorize binding). */
|
|
431
467
|
degradedReason?: string;
|
|
468
|
+
/**
|
|
469
|
+
* On-demand lookup result. Present when the query parsed as a GitHub
|
|
470
|
+
* `org/repo` coordinate and no existing entities matched. Null otherwise.
|
|
471
|
+
*/
|
|
472
|
+
lookup?: LookupResultPayload | null;
|
|
432
473
|
}
|
|
433
474
|
|
|
434
475
|
// ── Overview Pages ──
|