{"info":{"title":"Stargrep","version":"1.0.0"},"servers":[{"url":"/api"}],"security":[],"openapi":"3.2.0","components":{"schemas":{"UndefinedError":{"title":"UndefinedError","type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"message":{"type":"string"},"data":{}},"required":["defined","code","message"]},"BadRequest":{"title":"BAD_REQUEST","type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"message":{"type":"string"},"data":{"type":"object","properties":{"traceId":{"type":"string","description":"Quote this ID when you report the error."},"issues":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["message"],"additionalProperties":true}}},"required":["traceId"],"additionalProperties":true}},"required":["defined","code","message","data"]},"InternalServerError":{"title":"INTERNAL_SERVER_ERROR","type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"message":{"type":"string"},"data":{"type":"object","properties":{"traceId":{"type":"string","description":"Quote this ID when you report the error."}},"required":["traceId"],"additionalProperties":true}},"required":["defined","code","message","data"]},"ServiceUnavailable":{"title":"SERVICE_UNAVAILABLE","type":"object","properties":{"defined":{"const":true},"code":{"const":"SERVICE_UNAVAILABLE"},"message":{"type":"string"},"data":{"type":"object","properties":{"traceId":{"type":"string","description":"Quote this ID when you report the error."}},"required":["traceId"],"additionalProperties":true}},"required":["defined","code","message","data"]},"AccountNotSynced":{"title":"ACCOUNT_NOT_SYNCED","type":"object","properties":{"defined":{"const":true},"code":{"const":"ACCOUNT_NOT_SYNCED"},"message":{"type":"string"},"data":{"type":"object","properties":{"traceId":{"type":"string","description":"Quote this ID when you report the error."}},"required":["traceId"],"additionalProperties":true}},"required":["defined","code","message","data"]},"TooManyRequests":{"title":"TOO_MANY_REQUESTS","type":"object","properties":{"defined":{"const":true},"code":{"const":"TOO_MANY_REQUESTS"},"message":{"type":"string"},"data":{"type":"object","properties":{"traceId":{"type":"string","description":"Quote this ID when you report the error."}},"required":["traceId"],"additionalProperties":true}},"required":["defined","code","message","data"]},"SyncBusy":{"title":"SYNC_BUSY","type":"object","properties":{"defined":{"const":true},"code":{"const":"SYNC_BUSY"},"message":{"type":"string"},"data":{"type":"object","properties":{"traceId":{"type":"string","description":"Quote this ID when you report the error."}},"required":["traceId"],"additionalProperties":true}},"required":["defined","code","message","data"]},"LoginNotFound":{"title":"LOGIN_NOT_FOUND","type":"object","properties":{"defined":{"const":true},"code":{"const":"LOGIN_NOT_FOUND"},"message":{"type":"string"},"data":{"type":"object","properties":{"traceId":{"type":"string","description":"Quote this ID when you report the error."}},"required":["traceId"],"additionalProperties":true}},"required":["defined","code","message","data"]},"RepoNotFound":{"title":"REPO_NOT_FOUND","type":"object","properties":{"defined":{"const":true},"code":{"const":"REPO_NOT_FOUND"},"message":{"type":"string"},"data":{"type":"object","properties":{"traceId":{"type":"string","description":"Quote this ID when you report the error."}},"required":["traceId"],"additionalProperties":true}},"required":["defined","code","message","data"]}}},"paths":{"/search":{"post":{"operationId":"search","summary":"Search a login's GitHub stars","description":"Searches the repos a GitHub login starred, in plain language, and ranks them by how well they match. The login must be synced first.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"q":{"type":"string","maxLength":500,"description":"What to look for, in plain language, such as 'rust library for terminal dashboards'."},"scope":{"type":"object","properties":{"kind":{"type":"string","enum":["stars"]},"login":{"type":"string","pattern":"^[A-Za-z\\d][A-Za-z\\d-]{0,38}$","description":"A GitHub login, such as octocat."}},"required":["kind","login"],"additionalProperties":true,"description":"Whose stars to search. Only stars, the login's own stars, is available now."},"limit":{"type":"integer","minimum":1,"maximum":50,"description":"How many repos to return, at most. 20 when left out."},"filter":{"type":"string","maxLength":2000}},"required":["q","scope"],"additionalProperties":true}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"planSource":{"type":"string","enum":["keyword","cache","model","fallback"],"description":"How the query was read. keyword searched the words as typed, and cache and model used a query plan. fallback means the planner failed or the model allowance ran out. The search then ran the words as typed when it had no plan, and full text alone, without search by meaning, when it could not embed the query."},"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","maximum":9007199254740991,"exclusiveMinimum":0},"owner":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"language":{"anyOf":[{"type":"string"},{"type":"null"}]},"topics":{"type":"array","items":{"type":"string"}},"license":{"anyOf":[{"type":"string"},{"type":"null"}]},"kind":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The repo's primary kind, such as library or cli, or null when Stargrep has not placed it."},"archived":{"type":"boolean"},"pushedAt":{"anyOf":[{"type":"string","description":"An ISO 8601 time in UTC."},{"type":"null"}]},"icon":{"anyOf":[{"type":"object","properties":{"url":{"type":"string","description":"A square WebP on this API's origin, served as immutable, so the URL never shows other bytes."},"plate":{"type":"string","enum":["light","dark","none"],"description":"The tile to draw behind the icon. dark for white ink on transparent, light for black ink on transparent."},"size":{"type":"integer","minimum":1,"maximum":128,"description":"The icon's width and height in pixels, at most 128. Smaller when the source was smaller."}},"required":["url","plate","size"],"additionalProperties":true},{"type":"null"}],"description":"The repo's own icon, or null when Stargrep found none or has not looked yet."},"ownerType":{"anyOf":[{"type":"string","enum":["user","org"]},{"type":"null"}],"description":"Whether a user or an org owns the repo, or null before Stargrep has read it."},"ownerAvatarUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The owner's GitHub avatar, or null before Stargrep has read it."},"facets":{"type":"array","items":{"type":"object","properties":{"atom":{"type":"string","description":"An atom's key, such as 'lang:rust', 'about:subject:4127', or 'alt:subject:77'. It works as a filter."},"label":{"type":"string"},"listed":{"type":"boolean","description":"False for a subject fewer than two repos hold. Library atoms and lookupFacets leave such a subject out, and a filter by it still works."},"repoId":{"anyOf":[{"type":"integer","maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}],"description":"The repo a subject is the project of, or null."}},"required":["atom","label","listed","repoId"],"additionalProperties":true},"description":"Every atom the repo holds, grouped by role, with its primary kind first."},"reason":{"type":"string","description":"Why the repo matched, such as 'keyword match #2, +38% contributors in 90 days'."},"rankedBy":{"type":"array","items":{"type":"string"},"description":"The values that ranked the repo, such as '+38% contributors in 90 days'."},"metrics":{"type":"array","items":{"type":"object","properties":{"metric":{"type":"string","pattern":"^(?:stars|forks|commits|active_contributors|new_contributors|merged_pull_requests|closed_issues|releases)(?:|_30d|_90d|_growth_90d)$"},"value":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["metric","value"],"additionalProperties":true}}},"required":["id","owner","name","url","description","summary","language","topics","license","kind","archived","pushedAt","icon","ownerType","ownerAvatarUrl","facets","reason","rankedBy","metrics"],"additionalProperties":true}},"applied":{"type":"array","items":{"type":"object","properties":{"atom":{"type":"string","description":"An atom's key, such as 'lang:rust', 'about:subject:4127', or 'alt:subject:77'. It works as a filter."},"label":{"type":"string"},"mode":{"type":"string","enum":["filter","exclude","boost"],"description":"filter kept only repos that match, exclude dropped repos that match, and boost ranked repos that match higher without dropping any."},"from":{"type":"string","enum":["query","filter"],"description":"query when the words of q named the atom, filter when the caller's filter did."},"span":{"anyOf":[{"type":"array","prefixItems":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}],"maxItems":2,"minItems":2},{"type":"null"}],"description":"The start and end of the words that named the atom, as character offsets into q trimmed with its runs of spaces collapsed, or null."},"relaxed":{"type":"boolean","description":"True when the words implied a filter that left fewer than 3 repos, so the search ranked the repos it matches first instead of dropping the others. A filter the caller passed never relaxes."}},"required":["atom","label","mode","from","span","relaxed"],"additionalProperties":true},"description":"The atoms the search applied, from the caller's filter and from the words of q. Words Stargrep could not read as an atom with certainty apply nothing and still match by text and meaning."}},"required":["planSource","results","applied"],"additionalProperties":true}}}},"400":{"description":"Malformed request. Ensure the request body is properly formatted and the 'Content-Type' header is set correctly.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/BadRequest"},{"$ref":"#/components/schemas/UndefinedError"}]}}}},"404":{"description":"Stargrep has not synced this login's stars yet. Trigger a sync first.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/AccountNotSynced"},{"$ref":"#/components/schemas/UndefinedError"}]}}}},"429":{"description":"Too many requests from your network. Try again in a minute.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/TooManyRequests"},{"$ref":"#/components/schemas/UndefinedError"}]}}}},"500":{"description":"Stargrep failed to answer.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/InternalServerError"},{"$ref":"#/components/schemas/UndefinedError"}]}}}},"503":{"description":"Stargrep could not reach a service it needs. Try again shortly.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ServiceUnavailable"},{"$ref":"#/components/schemas/UndefinedError"}]}}}}}}},"/sync/{login}":{"post":{"operationId":"triggerSync","summary":"Sync a login's GitHub stars","description":"Checks that the GitHub login exists, queues a sync of its stars, and returns its status. A login synced, queued, or failed in the last 10 minutes is not queued again. When GitHub's budget for new imports is spent, the sync waits in line and the status says when it starts.","parameters":[{"in":"path","required":true,"name":"login","schema":{"type":"string","pattern":"^[A-Za-z\\d][A-Za-z\\d-]{0,38}$","description":"A GitHub login, such as octocat."}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":true}}}},"responses":{"202":{"description":"OK","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"login":{"type":"string"},"starredTotal":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"How many repos the login has starred on GitHub, as of Stargrep's latest look. Null until Stargrep has looked. 0 for an org."},"accountType":{"anyOf":[{"type":"string","enum":["user","org"]},{"type":"null"}],"description":"Whether the login is a user or an org, or null until Stargrep has looked. An org cannot star repos."},"enrichment":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many repos the login stars now."},"read":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of them Stargrep has summarized and embedded, so search by meaning can find them. Repos are shared, so this can start above zero."},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of them Stargrep gave up reading after repeated failures of their own, such as repos GitHub no longer serves."},"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of the unread ones wait for the daily summary cap. Stargrep reads them later on its own, possibly days later, and search finds them by name and description meanwhile."}},"required":["total","read","failed","queued"],"additionalProperties":true,"description":"How far reading the login's stars has got. Reading is settled for now when state is not queued and read plus failed plus queued equals total, and finished once queued is 0 too. Right after triggerSync the total is still 0, so poll while state is queued or read plus failed plus queued is less than total, poll slowly while only queued repos remain, and reload the library when read changes."},"state":{"type":"string","enum":["unknown"]},"requestedAt":{"type":"null"},"syncedAt":{"type":"null"},"waiting":{"type":"null"}},"required":["login","starredTotal","accountType","enrichment","state","requestedAt","syncedAt","waiting"],"additionalProperties":true},{"type":"object","properties":{"login":{"type":"string"},"starredTotal":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"How many repos the login has starred on GitHub, as of Stargrep's latest look. Null until Stargrep has looked. 0 for an org."},"accountType":{"anyOf":[{"type":"string","enum":["user","org"]},{"type":"null"}],"description":"Whether the login is a user or an org, or null until Stargrep has looked. An org cannot star repos."},"enrichment":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many repos the login stars now."},"read":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of them Stargrep has summarized and embedded, so search by meaning can find them. Repos are shared, so this can start above zero."},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of them Stargrep gave up reading after repeated failures of their own, such as repos GitHub no longer serves."},"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of the unread ones wait for the daily summary cap. Stargrep reads them later on its own, possibly days later, and search finds them by name and description meanwhile."}},"required":["total","read","failed","queued"],"additionalProperties":true,"description":"How far reading the login's stars has got. Reading is settled for now when state is not queued and read plus failed plus queued equals total, and finished once queued is 0 too. Right after triggerSync the total is still 0, so poll while state is queued or read plus failed plus queued is less than total, poll slowly while only queued repos remain, and reload the library when read changes."},"state":{"type":"string","enum":["waiting"]},"requestedAt":{"type":"string","description":"An ISO 8601 time in UTC."},"syncedAt":{"anyOf":[{"type":"string","description":"An ISO 8601 time in UTC."},{"type":"null"}]},"waiting":{"type":"object","properties":{"ahead":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many syncs waiting in line start before this one."},"startsAt":{"type":"string","description":"When this sync is due to start. An estimate that can move later."}},"required":["ahead","startsAt"],"additionalProperties":true}},"required":["login","starredTotal","accountType","enrichment","state","requestedAt","syncedAt","waiting"],"additionalProperties":true},{"type":"object","properties":{"login":{"type":"string"},"starredTotal":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"How many repos the login has starred on GitHub, as of Stargrep's latest look. Null until Stargrep has looked. 0 for an org."},"accountType":{"anyOf":[{"type":"string","enum":["user","org"]},{"type":"null"}],"description":"Whether the login is a user or an org, or null until Stargrep has looked. An org cannot star repos."},"enrichment":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many repos the login stars now."},"read":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of them Stargrep has summarized and embedded, so search by meaning can find them. Repos are shared, so this can start above zero."},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of them Stargrep gave up reading after repeated failures of their own, such as repos GitHub no longer serves."},"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of the unread ones wait for the daily summary cap. Stargrep reads them later on its own, possibly days later, and search finds them by name and description meanwhile."}},"required":["total","read","failed","queued"],"additionalProperties":true,"description":"How far reading the login's stars has got. Reading is settled for now when state is not queued and read plus failed plus queued equals total, and finished once queued is 0 too. Right after triggerSync the total is still 0, so poll while state is queued or read plus failed plus queued is less than total, poll slowly while only queued repos remain, and reload the library when read changes."},"state":{"type":"string","enum":["queued"]},"requestedAt":{"type":"string","description":"An ISO 8601 time in UTC."},"syncedAt":{"anyOf":[{"type":"string","description":"An ISO 8601 time in UTC."},{"type":"null"}]},"waiting":{"type":"null"}},"required":["login","starredTotal","accountType","enrichment","state","requestedAt","syncedAt","waiting"],"additionalProperties":true},{"type":"object","properties":{"login":{"type":"string"},"starredTotal":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"How many repos the login has starred on GitHub, as of Stargrep's latest look. Null until Stargrep has looked. 0 for an org."},"accountType":{"anyOf":[{"type":"string","enum":["user","org"]},{"type":"null"}],"description":"Whether the login is a user or an org, or null until Stargrep has looked. An org cannot star repos."},"enrichment":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many repos the login stars now."},"read":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of them Stargrep has summarized and embedded, so search by meaning can find them. Repos are shared, so this can start above zero."},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of them Stargrep gave up reading after repeated failures of their own, such as repos GitHub no longer serves."},"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of the unread ones wait for the daily summary cap. Stargrep reads them later on its own, possibly days later, and search finds them by name and description meanwhile."}},"required":["total","read","failed","queued"],"additionalProperties":true,"description":"How far reading the login's stars has got. Reading is settled for now when state is not queued and read plus failed plus queued equals total, and finished once queued is 0 too. Right after triggerSync the total is still 0, so poll while state is queued or read plus failed plus queued is less than total, poll slowly while only queued repos remain, and reload the library when read changes."},"state":{"type":"string","enum":["failed"]},"requestedAt":{"type":"string","description":"An ISO 8601 time in UTC."},"syncedAt":{"anyOf":[{"type":"string","description":"An ISO 8601 time in UTC."},{"type":"null"}]},"waiting":{"type":"null"}},"required":["login","starredTotal","accountType","enrichment","state","requestedAt","syncedAt","waiting"],"additionalProperties":true},{"type":"object","properties":{"login":{"type":"string"},"starredTotal":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"How many repos the login has starred on GitHub, as of Stargrep's latest look. Null until Stargrep has looked. 0 for an org."},"accountType":{"anyOf":[{"type":"string","enum":["user","org"]},{"type":"null"}],"description":"Whether the login is a user or an org, or null until Stargrep has looked. An org cannot star repos."},"enrichment":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many repos the login stars now."},"read":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of them Stargrep has summarized and embedded, so search by meaning can find them. Repos are shared, so this can start above zero."},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of them Stargrep gave up reading after repeated failures of their own, such as repos GitHub no longer serves."},"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of the unread ones wait for the daily summary cap. Stargrep reads them later on its own, possibly days later, and search finds them by name and description meanwhile."}},"required":["total","read","failed","queued"],"additionalProperties":true,"description":"How far reading the login's stars has got. Reading is settled for now when state is not queued and read plus failed plus queued equals total, and finished once queued is 0 too. Right after triggerSync the total is still 0, so poll while state is queued or read plus failed plus queued is less than total, poll slowly while only queued repos remain, and reload the library when read changes."},"state":{"type":"string","enum":["done"]},"requestedAt":{"type":"null"},"syncedAt":{"type":"string","description":"An ISO 8601 time in UTC."},"waiting":{"type":"null"}},"required":["login","starredTotal","accountType","enrichment","state","requestedAt","syncedAt","waiting"],"additionalProperties":true}],"description":"unknown has never synced, waiting has a place in line, queued is about to run or running, failed could not finish, and done has a sync time."}}}},"400":{"description":"Malformed request. Ensure the request body is properly formatted and the 'Content-Type' header is set correctly.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/BadRequest"},{"$ref":"#/components/schemas/UndefinedError"}]}}}},"404":{"description":"GitHub has no user or org with this login.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/LoginNotFound"},{"$ref":"#/components/schemas/UndefinedError"}]}}}},"429":{"description":"Too many requests from your network. Try again in a minute.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/TooManyRequests"},{"$ref":"#/components/schemas/UndefinedError"}]}}}},"500":{"description":"Stargrep failed to answer.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/InternalServerError"},{"$ref":"#/components/schemas/UndefinedError"}]}}}},"503":{"description":"Stargrep could not reach a service it needs. Try again shortly., Stargrep is importing as many accounts as GitHub allows right now. Try again later.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ServiceUnavailable"},{"$ref":"#/components/schemas/SyncBusy"},{"$ref":"#/components/schemas/UndefinedError"}]}}}}}},"get":{"operationId":"syncStatus","summary":"Read a login's sync status","description":"Says whether a login's stars are synced, queued for a sync, failed to sync, or unknown to Stargrep, and how many of them Stargrep has read.","parameters":[{"in":"path","required":true,"name":"login","schema":{"type":"string","pattern":"^[A-Za-z\\d][A-Za-z\\d-]{0,38}$","description":"A GitHub login, such as octocat."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"login":{"type":"string"},"starredTotal":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"How many repos the login has starred on GitHub, as of Stargrep's latest look. Null until Stargrep has looked. 0 for an org."},"accountType":{"anyOf":[{"type":"string","enum":["user","org"]},{"type":"null"}],"description":"Whether the login is a user or an org, or null until Stargrep has looked. An org cannot star repos."},"enrichment":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many repos the login stars now."},"read":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of them Stargrep has summarized and embedded, so search by meaning can find them. Repos are shared, so this can start above zero."},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of them Stargrep gave up reading after repeated failures of their own, such as repos GitHub no longer serves."},"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of the unread ones wait for the daily summary cap. Stargrep reads them later on its own, possibly days later, and search finds them by name and description meanwhile."}},"required":["total","read","failed","queued"],"additionalProperties":true,"description":"How far reading the login's stars has got. Reading is settled for now when state is not queued and read plus failed plus queued equals total, and finished once queued is 0 too. Right after triggerSync the total is still 0, so poll while state is queued or read plus failed plus queued is less than total, poll slowly while only queued repos remain, and reload the library when read changes."},"state":{"type":"string","enum":["unknown"]},"requestedAt":{"type":"null"},"syncedAt":{"type":"null"},"waiting":{"type":"null"}},"required":["login","starredTotal","accountType","enrichment","state","requestedAt","syncedAt","waiting"],"additionalProperties":true},{"type":"object","properties":{"login":{"type":"string"},"starredTotal":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"How many repos the login has starred on GitHub, as of Stargrep's latest look. Null until Stargrep has looked. 0 for an org."},"accountType":{"anyOf":[{"type":"string","enum":["user","org"]},{"type":"null"}],"description":"Whether the login is a user or an org, or null until Stargrep has looked. An org cannot star repos."},"enrichment":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many repos the login stars now."},"read":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of them Stargrep has summarized and embedded, so search by meaning can find them. Repos are shared, so this can start above zero."},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of them Stargrep gave up reading after repeated failures of their own, such as repos GitHub no longer serves."},"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of the unread ones wait for the daily summary cap. Stargrep reads them later on its own, possibly days later, and search finds them by name and description meanwhile."}},"required":["total","read","failed","queued"],"additionalProperties":true,"description":"How far reading the login's stars has got. Reading is settled for now when state is not queued and read plus failed plus queued equals total, and finished once queued is 0 too. Right after triggerSync the total is still 0, so poll while state is queued or read plus failed plus queued is less than total, poll slowly while only queued repos remain, and reload the library when read changes."},"state":{"type":"string","enum":["waiting"]},"requestedAt":{"type":"string","description":"An ISO 8601 time in UTC."},"syncedAt":{"anyOf":[{"type":"string","description":"An ISO 8601 time in UTC."},{"type":"null"}]},"waiting":{"type":"object","properties":{"ahead":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many syncs waiting in line start before this one."},"startsAt":{"type":"string","description":"When this sync is due to start. An estimate that can move later."}},"required":["ahead","startsAt"],"additionalProperties":true}},"required":["login","starredTotal","accountType","enrichment","state","requestedAt","syncedAt","waiting"],"additionalProperties":true},{"type":"object","properties":{"login":{"type":"string"},"starredTotal":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"How many repos the login has starred on GitHub, as of Stargrep's latest look. Null until Stargrep has looked. 0 for an org."},"accountType":{"anyOf":[{"type":"string","enum":["user","org"]},{"type":"null"}],"description":"Whether the login is a user or an org, or null until Stargrep has looked. An org cannot star repos."},"enrichment":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many repos the login stars now."},"read":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of them Stargrep has summarized and embedded, so search by meaning can find them. Repos are shared, so this can start above zero."},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of them Stargrep gave up reading after repeated failures of their own, such as repos GitHub no longer serves."},"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of the unread ones wait for the daily summary cap. Stargrep reads them later on its own, possibly days later, and search finds them by name and description meanwhile."}},"required":["total","read","failed","queued"],"additionalProperties":true,"description":"How far reading the login's stars has got. Reading is settled for now when state is not queued and read plus failed plus queued equals total, and finished once queued is 0 too. Right after triggerSync the total is still 0, so poll while state is queued or read plus failed plus queued is less than total, poll slowly while only queued repos remain, and reload the library when read changes."},"state":{"type":"string","enum":["queued"]},"requestedAt":{"type":"string","description":"An ISO 8601 time in UTC."},"syncedAt":{"anyOf":[{"type":"string","description":"An ISO 8601 time in UTC."},{"type":"null"}]},"waiting":{"type":"null"}},"required":["login","starredTotal","accountType","enrichment","state","requestedAt","syncedAt","waiting"],"additionalProperties":true},{"type":"object","properties":{"login":{"type":"string"},"starredTotal":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"How many repos the login has starred on GitHub, as of Stargrep's latest look. Null until Stargrep has looked. 0 for an org."},"accountType":{"anyOf":[{"type":"string","enum":["user","org"]},{"type":"null"}],"description":"Whether the login is a user or an org, or null until Stargrep has looked. An org cannot star repos."},"enrichment":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many repos the login stars now."},"read":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of them Stargrep has summarized and embedded, so search by meaning can find them. Repos are shared, so this can start above zero."},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of them Stargrep gave up reading after repeated failures of their own, such as repos GitHub no longer serves."},"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of the unread ones wait for the daily summary cap. Stargrep reads them later on its own, possibly days later, and search finds them by name and description meanwhile."}},"required":["total","read","failed","queued"],"additionalProperties":true,"description":"How far reading the login's stars has got. Reading is settled for now when state is not queued and read plus failed plus queued equals total, and finished once queued is 0 too. Right after triggerSync the total is still 0, so poll while state is queued or read plus failed plus queued is less than total, poll slowly while only queued repos remain, and reload the library when read changes."},"state":{"type":"string","enum":["failed"]},"requestedAt":{"type":"string","description":"An ISO 8601 time in UTC."},"syncedAt":{"anyOf":[{"type":"string","description":"An ISO 8601 time in UTC."},{"type":"null"}]},"waiting":{"type":"null"}},"required":["login","starredTotal","accountType","enrichment","state","requestedAt","syncedAt","waiting"],"additionalProperties":true},{"type":"object","properties":{"login":{"type":"string"},"starredTotal":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"How many repos the login has starred on GitHub, as of Stargrep's latest look. Null until Stargrep has looked. 0 for an org."},"accountType":{"anyOf":[{"type":"string","enum":["user","org"]},{"type":"null"}],"description":"Whether the login is a user or an org, or null until Stargrep has looked. An org cannot star repos."},"enrichment":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many repos the login stars now."},"read":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of them Stargrep has summarized and embedded, so search by meaning can find them. Repos are shared, so this can start above zero."},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of them Stargrep gave up reading after repeated failures of their own, such as repos GitHub no longer serves."},"queued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many of the unread ones wait for the daily summary cap. Stargrep reads them later on its own, possibly days later, and search finds them by name and description meanwhile."}},"required":["total","read","failed","queued"],"additionalProperties":true,"description":"How far reading the login's stars has got. Reading is settled for now when state is not queued and read plus failed plus queued equals total, and finished once queued is 0 too. Right after triggerSync the total is still 0, so poll while state is queued or read plus failed plus queued is less than total, poll slowly while only queued repos remain, and reload the library when read changes."},"state":{"type":"string","enum":["done"]},"requestedAt":{"type":"null"},"syncedAt":{"type":"string","description":"An ISO 8601 time in UTC."},"waiting":{"type":"null"}},"required":["login","starredTotal","accountType","enrichment","state","requestedAt","syncedAt","waiting"],"additionalProperties":true}],"description":"unknown has never synced, waiting has a place in line, queued is about to run or running, failed could not finish, and done has a sync time."}}}},"400":{"description":"Malformed request. Ensure the request body is properly formatted and the 'Content-Type' header is set correctly.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/BadRequest"},{"$ref":"#/components/schemas/UndefinedError"}]}}}},"500":{"description":"Stargrep failed to answer.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/InternalServerError"},{"$ref":"#/components/schemas/UndefinedError"}]}}}},"503":{"description":"Stargrep could not reach a service it needs. Try again shortly.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ServiceUnavailable"},{"$ref":"#/components/schemas/UndefinedError"}]}}}}}}},"/repos/{id}":{"get":{"operationId":"getRepo","summary":"Read one repo","description":"Returns what Stargrep knows about a repo, including its summary, by GitHub repo ID.","parameters":[{"in":"path","required":true,"name":"id","schema":{"type":"integer","maximum":9007199254740991,"exclusiveMinimum":0,"description":"The GitHub repo ID."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","maximum":9007199254740991,"exclusiveMinimum":0},"owner":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"language":{"anyOf":[{"type":"string"},{"type":"null"}]},"topics":{"type":"array","items":{"type":"string"}},"license":{"anyOf":[{"type":"string"},{"type":"null"}]},"kind":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The repo's primary kind, such as library or cli, or null when Stargrep has not placed it."},"archived":{"type":"boolean"},"pushedAt":{"anyOf":[{"type":"string","description":"An ISO 8601 time in UTC."},{"type":"null"}]},"icon":{"anyOf":[{"type":"object","properties":{"url":{"type":"string","description":"A square WebP on this API's origin, served as immutable, so the URL never shows other bytes."},"plate":{"type":"string","enum":["light","dark","none"],"description":"The tile to draw behind the icon. dark for white ink on transparent, light for black ink on transparent."},"size":{"type":"integer","minimum":1,"maximum":128,"description":"The icon's width and height in pixels, at most 128. Smaller when the source was smaller."}},"required":["url","plate","size"],"additionalProperties":true},{"type":"null"}],"description":"The repo's own icon, or null when Stargrep found none or has not looked yet."},"ownerType":{"anyOf":[{"type":"string","enum":["user","org"]},{"type":"null"}],"description":"Whether a user or an org owns the repo, or null before Stargrep has read it."},"ownerAvatarUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The owner's GitHub avatar, or null before Stargrep has read it."},"facets":{"type":"array","items":{"type":"object","properties":{"atom":{"type":"string","description":"An atom's key, such as 'lang:rust', 'about:subject:4127', or 'alt:subject:77'. It works as a filter."},"label":{"type":"string"},"listed":{"type":"boolean","description":"False for a subject fewer than two repos hold. Library atoms and lookupFacets leave such a subject out, and a filter by it still works."},"repoId":{"anyOf":[{"type":"integer","maximum":9007199254740991,"exclusiveMinimum":0},{"type":"null"}],"description":"The repo a subject is the project of, or null."}},"required":["atom","label","listed","repoId"],"additionalProperties":true},"description":"Every atom the repo holds, grouped by role, with its primary kind first."},"keywords":{"type":"array","items":{"type":"string"}},"homepage":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"anyOf":[{"type":"string","description":"An ISO 8601 time in UTC."},{"type":"null"}]}},"required":["id","owner","name","url","description","summary","language","topics","license","kind","archived","pushedAt","icon","ownerType","ownerAvatarUrl","facets","keywords","homepage","createdAt"],"additionalProperties":true}}}},"400":{"description":"Malformed request. Ensure the request body is properly formatted and the 'Content-Type' header is set correctly.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/BadRequest"},{"$ref":"#/components/schemas/UndefinedError"}]}}}},"404":{"description":"Stargrep has no repo with this ID.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/RepoNotFound"},{"$ref":"#/components/schemas/UndefinedError"}]}}}},"500":{"description":"Stargrep failed to answer.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/InternalServerError"},{"$ref":"#/components/schemas/UndefinedError"}]}}}},"503":{"description":"Stargrep could not reach a service it needs. Try again shortly.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ServiceUnavailable"},{"$ref":"#/components/schemas/UndefinedError"}]}}}}}}},"/stars/{login}":{"get":{"operationId":"stars","summary":"List a login's synced stars","description":"Returns the repos a GitHub login starred that Stargrep has synced, newest star first, a page at a time.","parameters":[{"in":"path","required":true,"name":"login","schema":{"type":"string","pattern":"^[A-Za-z\\d][A-Za-z\\d-]{0,38}$","description":"A GitHub login, such as octocat."}},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":1000,"description":"How many repos to return, at most. 1000 when left out."},"allowEmptyValue":true,"allowReserved":true},{"in":"query","name":"cursor","schema":{"type":"string","description":"Where a page of stars continues, from nextCursor."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"login":{"type":"string"},"repos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","maximum":9007199254740991,"exclusiveMinimum":0},"owner":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"language":{"anyOf":[{"type":"string"},{"type":"null"}]},"topics":{"type":"array","items":{"type":"string"}},"license":{"anyOf":[{"type":"string"},{"type":"null"}]},"kind":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The repo's primary kind, such as library or cli, or null when Stargrep has not placed it."},"archived":{"type":"boolean"},"pushedAt":{"anyOf":[{"type":"string","description":"An ISO 8601 time in UTC."},{"type":"null"}]},"icon":{"anyOf":[{"type":"object","properties":{"url":{"type":"string","description":"A square WebP on this API's origin, served as immutable, so the URL never shows other bytes."},"plate":{"type":"string","enum":["light","dark","none"],"description":"The tile to draw behind the icon. dark for white ink on transparent, light for black ink on transparent."},"size":{"type":"integer","minimum":1,"maximum":128,"description":"The icon's width and height in pixels, at most 128. Smaller when the source was smaller."}},"required":["url","plate","size"],"additionalProperties":true},{"type":"null"}],"description":"The repo's own icon, or null when Stargrep found none or has not looked yet."},"ownerType":{"anyOf":[{"type":"string","enum":["user","org"]},{"type":"null"}],"description":"Whether a user or an org owns the repo, or null before Stargrep has read it."},"ownerAvatarUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The owner's GitHub avatar, or null before Stargrep has read it."},"atoms":{"type":"array","items":{"type":"string","description":"An atom's key, such as 'lang:rust', 'about:subject:4127', or 'alt:subject:77'. It works as a filter."},"description":"The keys whose filter matches the repo, such as lang:javascript on a TypeScript repo, so counting them gives the number of repos each filter returns. A subject appears once two repos hold it. labels names each key."},"keywords":{"type":"array","items":{"type":"string"}},"starredAt":{"type":"string","description":"An ISO 8601 time in UTC."},"stars":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The repo's star count, when Stargrep has read it."},"read":{"type":"boolean","description":"Whether Stargrep has summarized and embedded the repo, so search by meaning can find it."}},"required":["id","owner","name","url","description","summary","language","topics","license","kind","archived","pushedAt","icon","ownerType","ownerAvatarUrl","atoms","keywords","starredAt","stars","read"],"additionalProperties":true},"description":"The login's stars, newest first."},"nextCursor":{"anyOf":[{"type":"string","description":"Where a page of stars continues, from nextCursor."},{"type":"null"}],"description":"Pass as cursor to read the next page, or null when this page is the last."},"labels":{"type":"object","additionalProperties":{"type":"string"},"description":"The label of every atom key the repos list, such as 'lang:rust': 'Rust'."}},"required":["login","repos","nextCursor","labels"],"additionalProperties":true}}}},"400":{"description":"Malformed request. Ensure the request body is properly formatted and the 'Content-Type' header is set correctly.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/BadRequest"},{"$ref":"#/components/schemas/UndefinedError"}]}}}},"404":{"description":"Stargrep has not synced this login's stars yet. Trigger a sync first.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/AccountNotSynced"},{"$ref":"#/components/schemas/UndefinedError"}]}}}},"429":{"description":"Too many requests from your network. Try again in a minute.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/TooManyRequests"},{"$ref":"#/components/schemas/UndefinedError"}]}}}},"500":{"description":"Stargrep failed to answer.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/InternalServerError"},{"$ref":"#/components/schemas/UndefinedError"}]}}}},"503":{"description":"Stargrep could not reach a service it needs. Try again shortly.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ServiceUnavailable"},{"$ref":"#/components/schemas/UndefinedError"}]}}}}}}},"/facets":{"post":{"operationId":"lookupFacets","summary":"Find atoms by name","description":"Finds the atoms whose name starts with q, to pass as search's filter: kinds, languages, licenses, platforms, statuses, and subjects that at least two repos hold, most-held first.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"q":{"type":"string","maxLength":100,"description":"The start of a facet's name, such as 'postg'."},"limit":{"type":"integer","minimum":1,"maximum":50,"description":"How many facets to return, at most. 10 when left out."}},"required":["q"],"additionalProperties":true}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"facets":{"type":"array","items":{"type":"object","properties":{"atom":{"type":"string","description":"An atom's key, such as 'lang:rust', 'about:subject:4127', or 'alt:subject:77'. It works as a filter."},"label":{"type":"string"},"repos":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many repos the atom's filter matches across Stargrep, from the last nightly count."}},"required":["atom","label","repos"],"additionalProperties":true},"description":"Most-held first."}},"required":["facets"],"additionalProperties":true}}}},"400":{"description":"Malformed request. Ensure the request body is properly formatted and the 'Content-Type' header is set correctly.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/BadRequest"},{"$ref":"#/components/schemas/UndefinedError"}]}}}},"429":{"description":"Too many requests from your network. Try again in a minute.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/TooManyRequests"},{"$ref":"#/components/schemas/UndefinedError"}]}}}},"500":{"description":"Stargrep failed to answer.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/InternalServerError"},{"$ref":"#/components/schemas/UndefinedError"}]}}}},"503":{"description":"Stargrep could not reach a service it needs. Try again shortly.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ServiceUnavailable"},{"$ref":"#/components/schemas/UndefinedError"}]}}}}}}},"/config":{"get":{"operationId":"config","summary":"Read the public settings","description":"Returns the demo account and the queries the home page offers.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"demoLogin":{"type":"string","pattern":"^[A-Za-z\\d][A-Za-z\\d-]{0,38}$","description":"The account whose stars the home page searches before anyone picks one."},"demoQuery":{"type":"string","description":"The query the home page answers before anyone types one."},"examples":{"type":"array","items":{"type":"string"},"description":"More queries that suit the demo account's stars."},"featured":{"type":"array","items":{"type":"string","pattern":"^[A-Za-z\\d][A-Za-z\\d-]{0,38}$","description":"A GitHub login, such as octocat."},"description":"Accounts to offer when someone picks whose stars to search."}},"required":["demoLogin","demoQuery","examples","featured"],"additionalProperties":true}}}},"400":{"description":"Malformed request. Ensure the request body is properly formatted and the 'Content-Type' header is set correctly.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/BadRequest"},{"$ref":"#/components/schemas/UndefinedError"}]}}}},"500":{"description":"Stargrep failed to answer.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/InternalServerError"},{"$ref":"#/components/schemas/UndefinedError"}]}}}}}}}}}