Dashboard › cli › Distillation
916f168b-50cd-44fa-926f-6efb6e1272d2["lore_tm_v1_7XFDr33hfjNr6G0eowNQvjxAs9gHw-d75cl9SIf7sho","lore_tm_v1_M5XwNqZ0eT-mjo4iuRgP8bQewcENLy9QFCy9CcQl8Yo","lore_tm_v1_RevnlMpUqG7sALNXizub_2c8Y8Q40zgZHVSip4jB0Bs"]
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/api/infrastructure.ts, buildSearchParams(params) accepts Record<string, string | number | boolean | string[] | undefined>, skips undefined, appends array values as repeated keys, stringifies scalar values with String(value), and returns undefined when no valid parameters remain.src/lib/api/infrastructure.ts are MAX_PAGINATION_PAGES = Math.max(1, Number(getEnv().SENTRY_MAX_PAGINATION_PAGES) || 50), API_MAX_PER_PAGE = 100, and ORG_FANOUT_CONCURRENCY = 5; the documented default safety capacity is 5,000 items.autoPaginate<T>() in src/lib/api/infrastructure.ts directly performs one fetchPage(initialCursor) when limit <= API_MAX_PER_PAGE; otherwise it accumulates pages for at most MAX_PAGINATION_PAGES, stops when the requested limit is met or nextCursor is absent, trims overshoot and drops the cursor because it would skip items, and warns via logger.warn if the page safety limit is reached.paginate<T>() in src/lib/api/infrastructure.ts defaults defaultLimit to 10, computes limit = options.limit ?? defaultLimit, caps perPage with Math.min(limit, API_MAX_PER_PAGE), and passes options.cursor into autoPaginate().apiRequestToRegion<T>() in src/lib/api/infrastructure.ts normalizes a leading / from the endpoint, builds ${config.baseUrl}/api/0/${normalizedEndpoint}${queryString}, defaults the method to "GET", sets "Content-Type": "application/json", and optionally zstd-compresses a JSON body with zstdCompressAsync, setting "Content-Encoding": "zstd".apiRequestToRegion<T>() calls throwRawApiError(response, endpoint) for unsuccessful responses; HTTP 204 or 205 throws ApiError with message API returned ${response.status} ${response.statusText} (no body) and hint "The server returned no content — the request may have matched no records."; invalid JSON is logged with logger.debug("Failed to parse JSON response body", parseError) and converted to an ApiError whose hint identifies a possible proxy or CDN issue.test/lib/introspect.test.ts lines 250 and 274; test/lib/command.test.ts lines 200 and 222; test/script/generate-skill-markdown.test.ts line 43; test/commands/auth/default.test.ts lines 64–69, 92–93, 115–120, and 143–144; src/sdk.generated.ts line 6; src/lib/introspect.ts lines 57, 62, 64, 291–292, and 301, 304–305; src/lib/command.ts lines 466, 470, 896, and 903; src/lib/help.ts line 122; src/commands/auth/default.ts lines 74 and 77; and script/generate-sdk.ts lines 221, 265, 272–273, 669, and 727.__examples is tested in test/lib/introspect.test.ts and test/lib/command.test.ts, declared as readonly CommandExample[] and mapped during introspection in src/lib/introspect.ts, and assigned from docs.examples in src/lib/command.ts.src/commands/auth/default.ts accesses command.__rawFunc as RawCommandFunc and throws "Command is missing __rawFunc; expected buildCommand output" when absent; test/commands/auth/default.test.ts temporarily replaces and later restores loginCommand.__rawFunc and statusCommand.__rawFunc in two test flows.script/generate-sdk.ts derives generated TypeScript return types from command __jsonSchema; references include the section comment "// --- Return types (derived from __jsonSchema) ---" and a biome-ignore lint/suspicious/noExplicitAny annotation because __jsonSchema is a non-standard property./home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/help.ts, generateCommands() obtains routes.getAllEntries(), excludes hidden top-level entries, and emits one HelpCommand per visible entry.generateCommands() excludes hidden subcommands, joins visible subcommand names with " | ", and constructs usage as sentry ${routeName} ${subNames}; for a direct command, it prefers entry.target.__primaryUsage over getPositionalString(entry.target.parameters.positional) and only adds a separating space when the placeholder is nonempty.src/lib/help.ts defines EXAMPLE_LOGGED_OUT = "sentry auth", EXAMPLE_LOGGED_IN = "sentry issue list", and DOCS_URL = "https://cli.sentry.dev/getting-started/".formatCommands() in src/lib/help.ts calculates the longest usage width, uses padding 4, applies cyan() to the padded usage and muted() to the description, prefixes each row with " $ ", and joins rows with newline characters.